Skip to content
Skill

M05 type driven

Guides Rust code toward type-level designs that rule out invalid states at compile time

M05 type driven is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
21
Last commit
License
MIT
Listing updated

Similar skills

About M05 type driven

This skill steers an agent to answer design questions with the type system before reaching for runtime checks. It walks through patterns such as newtypes for semantic values, type state for state machines, PhantomData for phantom parameters, marker traits for capabilities, builders for gradual construction and sealed traits for closed sets of implementations. Each pattern comes with a short Rust example and a quick reference table.

The guidance is organised as a thinking routine: the agent checks whether a constraint can be encoded in types, whether validation can happen at construction or at a state transition, and who needs to know the invariant. It also lists anti-patterns such as boolean flags for states and public fields that carry invariants, with the preferred alternative for each.

The skill is a single instruction file with no scripts. It expects Rust code and points to related skills for domain modelling, trait design and error handling in constructors.

When your agent uses it

CRITICAL: Use for type-driven design. Triggers: type state, PhantomData, newtype, marker trait, builder pattern, make invalid states unrepresentable, compile-time validation, sealed trait, ZST, 类型状态, 新类型模式, 类型驱动设计

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (4 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Copy the skill folder to ~/.claude/skills/m05-type-driven to use it in all your projects:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/m05-type-driven &&
cp -R "$tmp/.claude/skills/m05-type-driven" ~/.claude/skills/m05-type-driven &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/m05-type-driven inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/m05-type-driven to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/m05-type-driven &&
cp -R "$tmp/.claude/skills/m05-type-driven" ~/.agents/skills/m05-type-driven &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/m05-type-driven inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/m05-type-driven to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/m05-type-driven &&
cp -R "$tmp/.claude/skills/m05-type-driven" ~/.cursor/skills/m05-type-driven &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/m05-type-driven inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/k1-c/linear-tui.git --path .claude/skills/m05-type-driven

Or copy the folder to ~/.gemini/skills/m05-type-driven yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/m05-type-driven:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/m05-type-driven &&
cp -R "$tmp/.claude/skills/m05-type-driven" ~/.copilot/skills/m05-type-driven &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/m05-type-driven inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/k1-c/linear-tui.git

Then copy linear-tui/.claude/skills/m05-type-driven into your agent's skills folder as m05-type-driven. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Newtype wrappers
Shows how to wrap primitives in named types so that semantic values cannot be mixed up.
Type state machines
Explains encoding valid states of an object as distinct types with transitions between them.
PhantomData usage
Covers using phantom type parameters for variance, lifetimes and state tracking.
Marker and sealed traits
Describes capability marker traits and sealing traits to restrict external implementations.
Builder pattern guidance
Advises when a builder helps construct values gradually instead of using uninitialized options.
Design anti-patterns
Lists common mistakes such as boolean state flags and public fields with invariants, with alternatives.

Good for

  • Refactor a connection API so it cannot send data before authenticating
  • Replace raw String identifiers with distinct newtype wrappers
  • Design a builder that forces required fields before building a struct
  • Seal a trait so that downstream crates cannot implement it
  • Review a Rust module for boolean flags that should become types

M05 type driven FAQ

What does M05 type driven need to run?

It is a single SKILL.md file with no scripts. It is written for Rust code and does not list other tools.

When does the skill trigger?

It triggers on terms such as type state, PhantomData, newtype, marker trait, builder pattern, sealed trait, ZST and compile-time validation, including Chinese keywords for type-state and newtype design.

How do I install M05 type driven in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/m05-type-driven to use it in all your projects, or to .claude/skills/m05-type-driven in one project.

Does M05 type driven run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use M05 type driven?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to M05 type driven?

The closest alternatives to M05 type driven are Principle type system discipline, M09 domain, TypeScript best practices, M04 zero cost and Principle model the domain.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from k1-c/linear-tui

  1. Gives the agent a quick reference of Rust-specific naming, error handling and async rules

    • Open source
    • 21 GitHub stars
    • Developer tools
  2. Guides the agent to write Conventional Commits, splitting mixed changes into several

    • Open source
    • 21 GitHub stars
    • Developer tools
  3. Guides an agent through building Rust command-line tools with clap, config layers

    • Open source
    • 21 GitHub stars
    • Developer tools
  4. Guides the agent through Rust ownership, borrow and lifetime compiler errors

    • Open source
    • 21 GitHub stars
    • Developer tools
  5. Guides an agent in choosing Rust smart pointers like Box, Rc, Arc, Weak and RefCell

    • Open source
    • 21 GitHub stars
    • Developer tools
  6. Guides a Rust agent through E0596/E0499/E0502 borrow errors and interior mutability

    • Open source
    • 21 GitHub stars
    • Developer tools