Skip to content

copyleftdev/rust-claude

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-claude

Production Rust starter for Claude Code. DST-first. Persona-driven. Self-evolving.


Encodes the engineering judgment of Joran Greef (TigerBeetle), Niko Matsakis (Rust lang), Jon Gjengset (Rust for Rustaceans), Mara Bos (Atomics and Locks), Carl Lerche (Tokio), David Tolnay (serde), and Casey Muratori (Handmade Hero) into Claude Code's operating instructions.

Every line Claude writes is informed by the best systems programmers alive.

What You Get

rust-claude/
  CLAUDE.md              -- Claude's operating instructions
  settings.json          -- Hooks, permissions, tool config
  hooks/
    pre-write.sh         -- Quality gate: blocks unwrap(), println!, unsafe without SAFETY
    post-write.sh        -- Auto-runs clippy on every edit
  skills/
    dst/SKILL.md         -- /dst: Generate deterministic simulation tests
    persona/SKILL.md     -- /persona: Activate an engineering persona
    audit/SKILL.md       -- /audit: Full project audit (fmt + clippy + test + deny)
    evolve/SKILL.md      -- /evolve: Self-update from latest Rust ecosystem research
  references/
    personas.md          -- 7 persona definitions with decision heuristics
    dst-guide.md         -- DST methodology deep-dive with code examples
    patterns.md          -- 12 production Rust patterns catalog

Quick Start

# Clone into your Claude Code config
git clone https://github.com/copyleftdev/rust-claude.git

# Start a new Rust project using it
cd your-rust-project
cp -r path/to/rust-claude/{CLAUDE.md,settings.json,hooks,skills,references} .

# Or symlink for shared config
ln -s path/to/rust-claude/CLAUDE.md .
ln -s path/to/rust-claude/settings.json .

Open the project in Claude Code. Claude now operates with DST-first methodology and persona-driven judgment.

Skills

/dst [module]

Generate a deterministic simulation test for a module. Identifies I/O dependencies, injects fault simulation, generates invariant assertions.

> /dst src/storage/wal.rs

/persona <name>

Activate a specific engineering persona for the current task.

> /persona greef      -- TigerBeetle: DST, io_uring, consensus
> /persona matsakis   -- Lifetimes, borrow checker, trait design
> /persona gjengset   -- Library API design, type-state, testing
> /persona bos        -- Atomics, memory model, lock-free
> /persona lerche     -- Async runtime, Tower, backpressure
> /persona tolnay     -- serde, proc macros, error handling
> /persona muratori   -- Performance, profiling, hardware reality

/audit

Full project audit: cargo fmt --check + cargo clippy + cargo test + cargo deny check.

/evolve [report.md]

Self-update the knowledge base from latest Rust ecosystem research. Fetches from Rust blog, This Week in Rust, TigerBeetle blog. Optionally ingests a research report. Proposes changes, asks for approval.

Hooks

pre-write.sh (Quality Gate)

Blocks writes to .rs files that violate standards:

  • .unwrap() in library code (use .expect() or ?)
  • println!() in library code (use tracing)
  • unsafe {} without // SAFETY: comment
  • std::thread::sleep() (breaks DST)

post-write.sh (Feedback)

Auto-runs cargo clippy on every Rust file edit. Non-blocking feedback.

Philosophy

DST is the floor, not the ceiling. TigerBeetle's VOPR runs years of simulated operations in minutes. If your I/O-touching code isn't testable under deterministic replay, it's not production-ready.

Personas are judgment, not role-play. When Claude hits a concurrency problem, it applies Mara Bos's decision heuristics. When it designs an API, it thinks like Jon Gjengset. This isn't cosplay — it's distilled expertise.

Self-evolution. The /evolve skill updates itself from the latest Rust ecosystem developments. The knowledge base grows with the ecosystem.

License

MIT

Releases

No releases published

Packages

 
 
 

Contributors

Languages