Begin TDD implementation from task specification
Executes Test-Driven Development cycles for Rust tasks from specifications.
/plugin marketplace add jvishnefske/agent-plugins/plugin install swiss-cheese@jvishnefske-agent-pluginsYou are starting Test-Driven Development for tasks defined in .claude/tasks.yaml.
For each task, follow the Red-Green-Refactor cycle:
Before writing any implementation:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_req_001_acceptance_criterion() {
// Test the acceptance criteria from tasks.yaml
// This test MUST fail initially (no implementation exists)
}
}
test_req_NNN_* for traceabilitycargo test - confirm tests fail (red)Write the minimum code to make tests pass:
cargo test # Must pass
cargo build # Must pass
cargo clippy -- -D warnings # No warnings allowed
With tests covering all requirements, aggressively refactor:
cargo llvm-cov --html # Generate coverage report
All cargo commands must pass without warnings:
cargo build --all-targets 2>&1 | grep -E "^warning:" && exit 1
cargo test --all-features
cargo clippy --all-targets -- -D warnings
cargo fmt --check
The make verify target enforces these.
Tasks are ready when status: pending and all deps are complete.
- id: task-001
status: in_progress
If task has spec_file, read it for detailed requirements.
RED → Write failing test for acceptance criterion
GREEN → Write minimal code to pass
REFACTOR → Remove uncovered code, simplify
Repeat for each acceptance criterion.
make verify # Must pass: build, test, clippy, fmt
- id: task-001
status: complete
In the refactor step:
cargo llvm-covThis ensures:
The Stop hook blocks until make verify passes:
cargo build --all-targets (no warnings)cargo test --all-features (all pass)cargo clippy -- -D warnings (no warnings)cargo fmt --check (formatted)/swiss-cheese:design - Create task specification/swiss-cheese:implementation - Begin TDD implementation