Rtk Tdd
Enforces Red-Green-Refactor TDD for Rust, with idiomatic test patterns and a strict pre-commit gate.
- CCM score
- 67 of 100
- skills.sh installs
- 2.4K
- GitHub stars
- 88.2K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers the cycle of writing a failing test, implementing the minimum to pass, then refactoring while staying green
- Includes test patterns by code type (pure functions, parsing, validation, error handling, roundtrips) and a
test_{function}_{scenario}naming convention - Enforces a failing-test check before any production code and a
cargo fmt --check,cargo clippy --all-targets, andcargo testgate - Designed for Rust implementation, testing, refactoring, and bug-fixing tasks, with guidance on when pure TDD does not apply
Install
$ npx -y skills add rtk-ai/rtk --skill rtk-tdd -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Rust TDD Workflow
Three Laws of TDD
- Do NOT write production code without a failing test
- Write only enough test to fail (including compilation failure)
- Write only enough production code to pass the failing test
Cycle: RED (test fails) -> GREEN (minimum to pass) -> REFACTOR (cleanup, cargo test)
Red-Green-Refactor Steps
1. Write test in #[cfg(test)] mod tests of the SAME file
2. cargo test MODULE::tests::test_name -- must FAIL (red)
3. Implement the minimum in the function
4. cargo test MODULE::tests::test_name -- must PASS (green)
5. Refactor if needed, re-run cargo test (still green)
6. cargo fmt && cargo clippy --all-targets && cargo test (final gate)
Never skip step 2. If the test passes immediately, it tests nothing.
Idiomatic Rust Test Patterns
Details
- Repository
- github.com/rtk-ai/rtk
- Categories
- Testing & QA, Rust
- First seen
- Jun 3, 2026
Questions
What does the rtk-tdd skill do?
The rtk-tdd skill enforces Red-Green-Refactor test-driven development for Rust work. It auto-triggers on implementation, testing, refactoring and bug fixing tasks, and guides the agent with Rust-idiomatic patterns using anyhow and thiserror, cfg(test) modules and an Arrange-Act-Assert workflow.
Where does rtk-tdd stand in the Testing & QA category?
The rtk-tdd skill sits in the Testing & QA category on Claude Marketplaces, alongside tdd, migrate-to-shoehorn, test-driven-development, webapp-testing and break-ui. It differs from those by focusing on Rust code, with cargo test, cargo fmt and cargo clippy as its pre-commit gate.
How do I install the rtk-tdd skill?
Run npx -y skills add rtk-ai/rtk --skill rtk-tdd -y in your project to install it. After that, the agent follows the Three Laws of TDD on Rust tasks, writing a failing test before any production code.
Who is rtk-tdd for?
The rtk-tdd skill is for developers writing Rust who want tests written first. It covers pure functions, parsing, validation, error handling and struct roundtrips, and says when pure TDD does not fit, such as code that calls Command::new or performs direct I/O.
More from rtk-ai/rtk
All 7Similar to Rtk Tdd
More Testing & QAtdd-rustrtk-ai/rtk1.6K installsTest-driven workflow for building RTK output filters in Rust, with real fixtures and enforced token-savings checks.
tddglebis/claude-skills263 installsEnforces RED-GREEN-REFACTOR test-driven development with isolated subagents for test writing and implementation.
test-driven-developmentobra/superpowers298.4K installsTest-first development skill that enforces red-green-refactor and forbids production code without a failing test.
rust-testingaffaan-m/ecc15.3K installsRust testing patterns covering unit, integration, async, property-based, and mocked tests under a TDD workflow.
tdd-workflows-tdd-redsickn33/agentic-awesome-skills238 installsGenerate failing TDD red-phase tests that define expected behavior, edge cases, and error handling before implementation.