tdd
stevesolun/ctx/.agents/skills/tdd/SKILL.md
Apply test-driven development with small, behavior-focused feedback loops. Use when the user asks to build or fix something test-first, mentions red-green-refactor, or wants integration tests.
Skill583 starsChanged 56 days ago
What's in it
- Test-Driven Development
- Loop
- Judgment
--- name: tdd description: Apply test-driven development with small, behavior-focused feedback loops. Use when the user asks to build or fix something test-first, mentions red-green-refactor, or wants integration tests. --- # Test-Driven Development Use small red → green → refactor cycles when a test-first feedback loop is practical. Treat repository conventions, existing tests, and the requested behavior as authoritative. ## Loop 1. Identify one observable behavior and the seam through which callers see it. 2. Write the smallest meaningful test and confirm that it fails for the expected reason. 3. Add only enough implementation to make the test pass. 4. Refactor when doing so improves clarity or design; keep the suite green. 5. Repeat with the next vertical slice. Infer seams from public interfaces and nearby tests. Ask the user only when choosing a seam would materially change the product contract, cost, or scope. ## Judgment - Prefer behavior-focused tests that survive internal refactors. - Derive expected results from a specification, worked example, or other independent source rather than duplicating the implementation. - Mock external or nondeterministic boundaries when useful; follow established repository patterns where they provide an adequate feedback loop. - Prefer vertical slices over a speculative batch of tests. Batch closely related mechanical cases when that is clearer and faster. - If a failing-first cycle is impractical—for example in legacy code with no usable seam—state the limitation and establish the nearest reliable characterization or integration test. Read [tests.md](tests.md) for examples and [mocking.md](mocking.md) when deciding whether and where to use test doubles.
More agent context in stevesolun/ctx
26 other files this repository gives its agents.
AGENTS.md
CLAUDE.md
Skill
- ask-matt.agents/skills/ask-matt/SKILL.md
- codebase-design.agents/skills/codebase-design/SKILL.md
- code-review.agents/skills/code-review/SKILL.md
- diagnosing-bugs.agents/skills/diagnosing-bugs/SKILL.md
- domain-modeling.agents/skills/domain-modeling/SKILL.md
- grilling.agents/skills/grilling/SKILL.md
- grill-me.agents/skills/grill-me/SKILL.md
- grill-with-docs.agents/skills/grill-with-docs/SKILL.md
- handoff.agents/skills/handoff/SKILL.md
- implement.agents/skills/implement/SKILL.md
- improve-codebase-architecture.agents/skills/improve-codebase-architecture/SKILL.md
- prototype.agents/skills/prototype/SKILL.md
- research.agents/skills/research/SKILL.md
- resolving-merge-conflicts.agents/skills/resolving-merge-conflicts/SKILL.md
- setup-matt-pocock-skills.agents/skills/setup-matt-pocock-skills/SKILL.md
- teach.agents/skills/teach/SKILL.md
- to-spec.agents/skills/to-spec/SKILL.md
- to-tickets.agents/skills/to-tickets/SKILL.md
- triage.agents/skills/triage/SKILL.md
- wayfinder.agents/skills/wayfinder/SKILL.md
- writing-great-skills.agents/skills/writing-great-skills/SKILL.md
- ctx-dispatch.claude/skills/ctx-dispatch/SKILL.md
- ctx-verify.claude/skills/ctx-verify/SKILL.md
- skill-routerdocs/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

