tdd/SKILL.md
Build features or fix bugs using strict red-green-refactor TDD with vertical slices. Use when the user wants test-first development, mentions "red-green-refactor", wants integration-style tests, or asks to build something with TDD. Do NOT use for writing tests after implementation, adding tests to untested legacy code retroactively, or pure unit testing of isolated functions.
npx skillsauth add sanurb/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.
Strict red-green-refactor in vertical slices. One test, one implementation, repeat. Never all tests first.
Critical anti-pattern — horizontal slicing: Writing all tests first then all implementation produces tests that verify imagined behavior, not actual behavior. Tests become insensitive to real changes. Always vertical: one RED→GREEN cycle at a time, each informed by what the previous cycle revealed.
WRONG (horizontal): RED: test1,test2,test3 → GREEN: impl1,impl2,impl3
RIGHT (vertical): RED→GREEN: test1→impl1 → RED→GREEN: test2→impl2 → ...
Confirm with the user which behaviors to test. Ask ONE question:
"What should the public interface look like, and which behaviors are most important to test?"
From the answer, produce an ordered list of behaviors (not implementation steps). Prioritize critical paths and complex logic. Design interfaces for testability — see interface-design.md.
Do NOT proceed until the user approves the behavior list.
Execute one cycle at a time. For each behavior:
First cycle is the tracer bullet — proves the path works end-to-end. Each subsequent cycle adds one behavior.
Mock only at system boundaries (external APIs, databases, time/randomness). See mocking.md for guidelines. For good vs bad test examples, see tests.md.
After all tests pass, look for cleanup: extract duplication, deepen modules (move complexity behind simple interfaces), apply SOLID where natural. See refactoring.md.
Run tests after each refactor step. Never refactor while RED.
Per cycle:
RED: [test name] — [behavior it verifies] → FAIL
GREEN: [change made] → PASS
After all cycles:
REFACTOR: [what was cleaned up]
All tests passing: [N] tests
| File | When to read | |------|-------------| | tests.md | Step 2 (good vs bad test examples) | | mocking.md | Step 2 (when to mock, when not to) | | interface-design.md | Step 1 (designing testable interfaces) | | refactoring.md | Step 3 (refactor candidates after GREEN) |
development
Sets up an `## Agent skills` block in AGENTS.md/CLAUDE.md and `docs/agents/` so the engineering skills know this repo's issue tracker (GitHub, GitLab, fp, or local markdown), triage label vocabulary, and domain doc layout. Run before first use of `fp-plan`, `fp-implement`, `fp-review`, `to-issues`, `to-prd`, `triage`, `diagnose`, `tdd`, `improve-codebase-architecture`, or `zoom-out` — or if those skills appear to be missing context about the issue tracker, triage labels, or domain docs.
development
Build a throwaway prototype to flush out a design before committing to it. Routes between two branches — a runnable terminal app for state/business-logic questions, or several radically different UI variations toggleable from one route. Use when the user wants to prototype, sanity-check a data model or state machine, mock up a UI, explore design options, or says "prototype this", "let me play with it", "try a few designs".
tools
Control herdr (a terminal-native agent multiplexer) from inside it. Manage workspaces and tabs, split panes, spawn sibling agents, read pane output, and wait for state changes — all via CLI commands that talk to the running herdr instance over a local unix socket. Use when running inside herdr (HERDR_ENV=1). Do not use outside herdr.
documentation
Compact the current conversation into a handoff document for another agent to pick up.