Rust Type Driven

Type-driven design expert covering newtype pattern, type state, PhantomData, marker traits, builder pattern, compile-time validation, sealed traits, and zero-sized types (ZST).

49 stars 7 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add huiali/rust-skills --skill rust-type-driven
Manual install
git clone --depth 1 https://github.com/huiali/rust-skills.git /tmp/rust-skills
mkdir -p ~/.claude/skills
cp -r /tmp/rust-skills/.codex/skills/rust-type-driven ~/.claude/skills/rust-type-driven

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

## Solution Patterns

### Pattern 1: Newtype Pattern

```rust
// ❌ Primitive types can be confused
fn process_user(id: u64) { ... }
fn process_order(id: u64) { ... }

// Easy to mix up:
process_order(user_id);  // Compiles but wrong!

// ✅ Type-safe newtypes
struct UserId(u64);
struct OrderId(u64);

fn process_user(id: UserId) { ... }
fn process_order(id: OrderId) { ... }

// Compiler prevents:
// process_order(user_id);  // Compile error!
```

**When to use:**
- Domain-specific identifiers
- Values with different semantics but same representation
- Adding type-level validation

### Pattern 2: Type State Pattern
Read the full skill on GitHub

Details

Skill name
rust-type-driven
Path
.codex/skills/rust-type-driven/SKILL.md
License
MIT
Repo updated
9 February 2026

FAQ

What does the Rust Type Driven skill do?

Type-driven design expert covering newtype pattern, type state, PhantomData, marker traits, builder pattern, compile-time validation, sealed traits, and zero-sized types (ZST).

How do I install the Rust Type Driven skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add huiali/rust-skills --skill rust-type-driven. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Rust Type Driven popular?

It lives in huiali/rust-skills, which has 49 GitHub stars and 7 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.