gsd-headless
Orchestrate GSD (Git Ship Done) projects programmatically via headless CLI. Use when an agent…
Test-driven development with red-green-refactor loops around vertical slices (tracer bullets), not horizontal layers. Use when asked to "use TDD", "write test-first", "red-green-refactor", "build this with tests", or when a feature has a clear observable contract. The discipline
$ npx -y skills add open-gsd/gsd-pi --skill tdd --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/tddContext preview
The summary Claude sees to decide when to auto-load this skill.
Test-driven development with red-green-refactor loops around vertical slices (tracer bullets), not horizontal layers. Use when asked to "use TDD", "write test-first", "red-green-refactor", "build this with tests", or when a feature has a clear observable contract. The discipline
name: tdd description: Test-driven development with red-green-refactor loops around vertical slices (tracer bullets), not horizontal layers. Use when asked to "use TDD", "write test-first", "red-green-refactor", "build this with tests", or when a feature has a clear observable contract. The discipline complement to the test/add-tests skills (the mechanics).
<objective> Drive feature implementation through one red-green-refactor cycle per vertical slice. Each cycle produces a single failing test that pins one observable behavior, then the minimal code that makes it pass, then refactoring while GREEN. Never refactor while RED. Never write all tests up front. </objective>
<context> GSD already organizes work into slices (S##) and tasks (T##). This skill operates at the task level — inside a single T##-PLAN.md, it structures the execution as a sequence of tiny red-green-refactor cycles rather than write-all-then-test or write-all-without-tests.
Invocation points:
Do not use this skill for:
</context>
<core_principle> **TESTS VERIFY BEHAVIOR THROUGH PUBLIC INTERFACES, NOT IMPLEMENTATION DETAILS.** A good test reads like a specification and survives refactors. A test that mocks internals or asserts private state fails every time you clean up the code — that is a bad test pretending to be a good one.
**VERTICAL SLICES, NOT HORIZONTAL LAYERS.** Writing all tests upfront ("horizontal slicing") produces tests for behavior you imagined, not behavior the code actually exhibits. One tracer bullet at a time: write one test, make it pass, learn, write the next.
**NEVER REFACTOR WHILE RED.** Refactoring without a passing test means you are guessing whether you broke something. Get to green first. Then clean up. Then go red again for the next slice. </core_principle>
<process>
Before writing anything:
1. What is the public interface? (function signature, HTTP route, module exports) 2. Which behaviors matter most? List them in order of how badly you'd want to know if they broke. 3. What does a "caller" look like? Write one example call in prose.
If the user has not supplied these, ask — one round, 1–3 questions.
Pick the first behavior — usually the happy path for the most common input. Write one test that exercises it end-to-end through the public interface. Run it. It must fail (RED). If it passes, the test is not testing what you think it is — fix the test before writing any code.
Then write the minimum code to make it pass. "Minimum" means: if hard-coding `return 42` makes the test pass, hard-code `return 42`. You will generalize on the next cycle. Run the test. It must pass (GREEN).
This proves the end-to-end path works — test harness, imports, wiring, build. Everything from Step 3 onward is incremental.
Pick the next behavior. Write one test that pins it. Run — RED. Write the minimum code that makes it pass without breaking prior tests. Run — GREEN.
Guidelines for picking the next behavior:
Guidelines for writing the test:
Guidelines for writing the code:
Now that the behavior is pinned, clean up. Extract duplicated logic. Rename unclear variables. Deepen the module — move responsibilities behind the interface until the internals stop leaking into the test.
Rules:
When the behavior the task plan specified is fully under test and the code is clean:
1. Run the full test suite — not just the tests you wrote. Verify no regressions. 2. Record a one-line summary of what is now pinned with `capture_thought` if the behavior is non-obvious or the test surfaced a trap future agents should know about. 3. Use `gsd_*` tools to mark the task complete — do not edit checkboxes by hand.
</process>
<anti_patterns>
GSD Pi is a local-first coding agent for planning, implementing, verifying, and tracking project work from the command line.
Repo: open-gsd/gsd-pi
Orchestrate GSD (Git Ship Done) projects programmatically via headless CLI. Use when an agent…
Audit and improve web accessibility following WCAG 2.1 guidelines. Use when asked to "improve…
Browser automation CLI for AI agents. Use when interacting with websites — navigating pages,…
Design or review an HTTP/REST/GraphQL API for versioning, pagination, error shapes,…
Apply modern web development best practices for security, compatibility, and code quality.…
Ask a quick side question about your current work without derailing the main task. Answers…