.claude/skills/test-driven-development/SKILL.md
Unified TDD skill with three input modes — from spec, from task, or from description. Enforces test-first development using repository patterns, with proptest guidance and backpressure integration.
npx skillsauth add mikeyobrien/ralph-orchestrator test-driven-developmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
One skill for all TDD workflows. Enforces test-first development using existing repository patterns. Three input modes handle different entry points — specs, task files, or ad-hoc descriptions — but the core cycle is always RED → GREEN → REFACTOR.
Detect the input type and follow the corresponding mode:
.spec.md)Use when the input references a .spec.md file with Given/When/Then acceptance criteria.
todo!() bodies:
/// Spec: <spec-file> — Criterion #<N>
/// Given <given text>
/// When <when text>
/// Then <then text>
#[test]
fn <spec_name>_criterion_<N>_<slug>() {
todo!("Implement: <then text>");
}
cargo test --no-run -p <crate>Programmatic support: ralph_core::preflight::{extract_acceptance_criteria, extract_criteria_from_file, extract_all_criteria} can parse criteria from spec files.
.code-task.md)Use when the input references a .code-task.md file or a specific implementation task.
Use for ad-hoc tasks without a spec or task file.
Before writing tests, discover existing conventions:
rg --files -g "crates/*/tests/*.rs"
rg -n "#\[cfg\(test\)\]" crates/
Read 2-3 relevant test files near the target code. Mirror:
tempfile, scenarios, or harnessesUse proptest only when ALL of:
proptest! {
#[test]
fn round_trip(input in "[a-z0-9]{0,32}") {
let encoded = encode(input.as_str());
let decoded = decode(&encoded).expect("should decode");
prop_assert_eq!(decoded, input);
}
}
Don't introduce proptest as a new dependency without strong justification.
Include coverage evidence in completion events:
ralph emit "build.done" "tests: pass, lint: pass, typecheck: pass, audit: pass, coverage: pass (82%)"
Run cargo tarpaulin --out Html --output-dir coverage --skip-clean when feasible. If coverage cannot be run, state why and include targeted test evidence instead.
#[cfg(test)] testscrates/<crate>/tests/crates/ralph-cli/tests/development
Introspect, explain, and improve Ralph Orchestrator using its published llms.txt doc map. Use this skill whenever the user asks questions about Ralph's behavior, wants to understand how a Ralph internal works (event loop, hats, memories, tasks, backends, presets), debug an unfamiliar failure mode, or propose a code change to the ralph-orchestrator repo. The skill teaches the agent to discover authoritative answers from the live docs via llms.txt before guessing, and to scope improvements through the published architecture rather than the local checkout alone.
development
Run, monitor, resume, merge, and debug Ralph loops. Use this skill whenever the user asks to operate `ralph run` or `ralph loops`, inspect loop state, recover suspended loops, analyze diagnostics, or unblock merge queue issues.
development
Create, inspect, validate, explain, and improve Ralph hat collections. Use this skill whenever the user asks to make or refine a `.ralph/hats/*.yml` workflow, debug hat routing, explain event topology, or tune a multi-hat Ralph run.
testing
A directory-style test skill for smoke testing