skills/tdd/SKILL.md
Test-driven development with red-green-refactor cycles and vertical slices. Use when implementing features test-first, doing TDD, or working through a story.
npx skillsauth add RonanCodes/ronan-skills tddInstall 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.
Implement features using strict red-green-refactor cycles. Write the test first. Always.
/tdd "add search endpoint with fuzzy matching"
/tdd --story US-003
If --story is passed, read the story from .ralph/prd.json for requirements and acceptance criteria.
Before writing anything, detect:
If no test setup exists, ask the user which framework to use and set it up.
Repeat for each vertical slice:
When the trigger is a bug or user feedback (not a new feature), the cycle is the same red-green-refactor, but RED means reproduce the reported scenario, not invent a spec. A production bug is a gap your tests did not cover; the report is the cheapest spec you will ever get. (Canon: canon/sentry-user-issues-tdd.md.)
Translate the report into the smallest test that fails for the user's reason. Do whatever it takes to actually SEE the issue first — pick the cheapest level that genuinely reproduces it:
Run it. Confirm it fails, and fails for the RIGHT reason (read the failure — a test that fails for an unrelated reason proves nothing). "It's obvious, I'll just fix it" is exactly when this step gets skipped and the wrong thing gets fixed. The failing test is the proof you understood the bug.
Make the MINIMUM change that turns the test green. Resist making it elegant or fast yet — get it correct and working first. No drive-by refactors, no premature optimisation. Run the test: it must pass and the rest of the suite must stay green.
Only once it's green: improve the code — naming, duplication, clarity, and now any optimisation that's actually warranted. Tests stay green after every change; add no new behaviour. The separation is the point: correctness first (green), quality second (refactor). Optimising before it works is how you ship a fast wrong answer.
Ship the regression test in the same change as the fix — never as a follow-up (the follow-up that never comes is the default outcome). For Sentry-tracked bugs, pair it with the resolvedInNextRelease reopen-on-recurrence backstop (/ro:sentry).
Each cycle implements a thin end-to-end slice, not a horizontal layer.
Good slices (thin, vertical, testable):
Bad slices (thick, horizontal):
Report:
## Cycle N: [slice description]
- RED: [test written, confirmed failing]
- GREEN: [code written, test passing]
- REFACTOR: [what was cleaned up]
- Status: N of ~M slices complete
If working on a story from .ralph/prd.json, update the story's passes field and append progress to .ralph/progress.txt after all slices are complete.
The quality of an agent's feedback loop sets the ceiling on its output quality. TDD instruments the code before the implementation lands, which makes it much harder for the agent to "cheat" the test (write the implementation first, then write a test that conveniently matches). Without good feedback loops the agent codes blind, no matter how good the prompt is.
This is also why deep modules work so well with TDD: one test boundary around a deep module covers a lot of behaviour, so each red-green cycle exercises a meaningful slice rather than a thin shell. Background: llm-wiki-ai-research:deep-modules-for-ai.
testing
--- name: linear-pipeline description: The Fable orchestrator for a single dispatched Linear ticket. Holds almost no context itself; it receives `--issue <ID> --detached`, decides the stage sequence, and fans out a sub-agent per stage, passing forward only each stage's artifact (never re-derived, never inlined into its own context). Step zero, before any planning or stage routing, is a boundary triage against `canon/security-boundary.md` (#199): a match tags Ronan Connolly and stops the run, no
development
--- name: in-your-face description: Capture a chat-only answer into a durable artifact (markdown + HTML, PDF when cheap) and launch it automatically so the user cannot miss it. Use when user says "in your face", "don't let me lose this", "save that answer", "make that durable", or right after answering a substantive side question (a recipe, comparison, how-to, or generated prompt) that would otherwise die with the context. category: workflow argument-hint: [--no-open] [--vault <short>] [hint of
tools
One-shot headless OpenAI Codex CLI calls for background/admin AI tasks — summaries, classification, extraction, admin glue. The default engine for anything that runs AI constantly in the background (daemon-driven, per-event), because it bills the flat ChatGPT subscription instead of Claude usage or per-token API spend, and it keeps working while Claude is rate-limited. NEVER for coding — coding stays Claude. Use when a skill or daemon needs a cheap always-on AI call, when the user says "use codex", "ask codex", "codex as backup", or when building a background summarizer/classifier into a listener or loop. Reads auth from ~/.codex/auth.json (ChatGPT account, no API key).
research
Turn a warranty rejection, repair quote, or RMA email into a cited decision brief — legal read (NL/EU consumer law), is the part user-serviceable, live part and new-unit prices, repair-vs-DIY-vs-new economics, before-you-send-it checklist, deadlines. Use when the user pastes or screenshots a repair quote, warranty rejection, "not covered" email, onderzoekskosten fee, or asks "should I repair or replace this".