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:
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.
development
--- name: worktree description: Coordinate multiple agents on one repo via a worktree-lock pool, so two agents never clobber each other's working tree. Acquire the first free slot (main, then beta/gamma… worktrees, created on demand), work there on your own branch, release when you've pushed. Use before modifying any repo that might be in use by another agent (factory, dataforce, etc.), or whenever you're told a repo is being worked on. Backed by `ro worktree`. category: development argument-hin
testing
--- name: ship description: Ship a feature branch the local-CI-first way — run the full local gate, push, open a PR, squash-merge, then deploy, without waiting on GitHub Actions. Use when a branch is ready for main and you want it merged and deployed now. Reads CI policy from `ro ci` (default skips remote CI because GitHub Actions billing keeps hitting limits). Sibling to /ro:gh-ship (waits on GitHub checks) and /ro:cf-ship (the deploy half). Triggers on "ship it", "ship this", "merge and deploy
testing
--- name: setup-logging description: Set up (or audit) the observability stack in a TanStack Start + Cloudflare Workers app so it is "diagnosable by default" — structured logging (logtape) with a request context carrying trace_id + userId + tenant/orgId, a trace_id propagated FE→BE→logs→Sentry→PostHog, Cloudflare Workers observability enabled, and Sentry + PostHog wired. Two modes: `setup` (wire it into an app) and `audit` (check an existing app + report gaps). Use when scaffolding a new app, wh
development
Manage credentials INSIDE the active ~/.claude/.env file — read which token/account to use for a given app (Simplicity vs Dataforce vs Ronan-personal), add or update a secret WITHOUT it passing through the chat (an interactive Terminal window prompts for it), and track secrets that were exposed in a transcript so they get rotated. Sibling to /ro:context (which switches WHICH env file is active). Use when the user wants to add an API key/token/secret, asks "which credential do I use for X", needs the env organized/labelled, or a secret was pasted into the chat and should be rotated.