igmarin/rust-core-skills · Archived

tdd

Cargo TDD with HITL: failing test for the right reason, user approves, green, refactor, fmt/clippy. Trigger: tdd, red-green-refactor, test first, cargo test.

First seen Aug 21, 2026

Installation

$ npx skills add igmarin/rust-core-skills --skill tdd

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Also in this package

Other skills from igmarin/rust-core-skills.

npx skills add igmarin/rust-core-skills

Browse all from igmarin/rust-core-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

License LICENSE
Default branch main
Open issues 0
Status Archived

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0
LicenseMIT
More metadata
version
1.0.0
user-invocable
true
entry_point
1
phases
Phase 1: Context and RED, Phase 2: HITL approve and GREEN, Phase 3: Refactor, Phase 4: Quality
hard_gates
Test fails for missing behaviour, User approval, Quality gate green
dependencies
{"source":"self","skills":["load-context","rust-essentials"]}

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,438 B
  • docs SUMMARY.md 168 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 2 installs

SKILL.md

TDD playbook

HARD-GATE

  • No implementation until a test exists, was run, and failed because behaviour is missing (not because of compile noise you have not fixed in the test).
  • Implementation waits for explicit user approval.
  • Quality gate before you call it done — same commands as docs/skill-authoring.md: cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test.

When to use

New or changed behaviour in a Rust crate. Prefer unit tests next to the module; tests/ only for public-API contracts.

Loads

Skill Role
load-context existing crates
rust-essentials apply docs/fcis-rust.md

Phases

  1. Context + RED — load-context if the crate exists. Write the smallest failing test. Run cargo test <test_name> -- --exact.
  2. HITL + GREEN — show the test + failure. Wait. Implement only what was approved. Re-run until green.
  3. Refactor — behaviour unchanged; re-run after each step.
  4. Quality — fmt, clippy -D warnings, cargo test for the crate.

Validation

  • RED: failure is missing behaviour
  • User said to implement
  • GREEN on the target test
  • fmt/clippy/test exit 0

Error recovery

Problem Action
Test does not compile fix the test; stay in RED
Still red after impl smallest fix; re-approve if the approach changed
Refactor red revert last step
Clippy red fix; do not #[allow] to skip the gate

Output

## TDD Report
**Behaviour:** …
**Test:** `path` / `test_name`
**RED:** command + reason
**Approval:** yes/no
**GREEN:** command
**Quality:** fmt / clippy / test
**Skipped (ponytail):** …

Integration

Atomics during GREEN: type-driven-design, error-handling, ownership-borrowing as needed. Do not skip rust-essentials.