tdd-rust

TDD workflow for RTK filter development. Red-Green-Refactor with Rust idioms. Real fixtures, token savings assertions, snapshot tests with insta. Auto-triggers on new filter implementation.

By rtk-ai · 981 installs

npx skills add rtk-ai/rtk --skill tdd-rust

Source repository · Upstream listing

RTK TDD Workflow Enforce Red Green Refactor for all RTK filter development. The Loop Step 1: Real Fixture First Never write synthetic test data. Capture real command output: Fixture naming: tests/fixtures/<command raw.txt Step 2: Write the Test (Red) Run: cargo test → should fail (function doesn't exist yet). Step 3: Minimum Implementation (Green) Run: cargo test → green. Step 4: Accept Snapshot Step 5: Wire to main.rs (Integration) Step 6: Quality Gate All 3 must pass. Zero clippy warnings. Arrange Act Assert Pattern RTK Specific Test Patterns Test ANSI stripping Test fallback behavior Test savings at multiple sizes What "Done" Looks Like Checklist before moving on: [ ] tests/fixtures/<cmd raw.txt — real command output [ ] filter <cmd () function returns Result<String [ ] Snapshot test passes and accepted via cargo insta review [ ] Token savings test: ≥60% verified [ ] Empty input test: no panic [ ] Malformed input test: no panic [ ] run() function with fallback pattern [ ] Registered in main.rs Commands enum [ ] cargo fmt all && cargo clippy all targets && cargo test — all green Never Do This