feat(tdd): add executable-spec-first entry skill + tdd-author agent

A new opt-in alternative to the brainstorm -> planner design entry,
for work whose desired behaviour is test-specifiable. Instead of a
prose spec the user approves, `tdd` produces one minimal RED
executable-spec ("how it should work") and treats it like a bug to
be fixed: the GREEN side hands off to `implement` mini-mode, the
same two-stage RED-first handoff `debug` uses.

Skill + agent split mirrors debug/debugger: a thin SKILL.md owns
trigger, dispatch, the orchestrator-side loop, and handoff; the
agent (tdd-author) carries the authoring discipline. The agent
guards two failure modes specifically — guessing a design into a
test (a genuine design fork bounces back to `brainstorm` rather
than ratifying an un-chosen design), and pushing harder on a
headline test that won't go green (one iteration that can't reach
GREEN triggers a reactive decompose into a ladder of BLOCKER
sub-tests; two failed rounds bounce to `brainstorm`).

The boundary is the design line: `tdd` owns the work iff one honest
minimal assertion pins it; otherwise `brainstorm` reclaims it. This
is distinct from the per-task TDD the implementer already practices
inside `implement` — `tdd` authors the one headline spec above it.

Wires the phase into the docs it references:
- docs/profile-schema.md: opt-in `tdd` pipeline slot
- README.md: skill table row
- docs/pipeline.md: entry-path in the graph, phase description, skip rule
- templates/project-profile.yml: commented-out slot

install.sh picks up tdd/ automatically (top-level dir with SKILL.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-01 15:52:39 +02:00
parent e90c1cbf2a
commit 779efa4249
6 changed files with 528 additions and 5 deletions
+25 -4
View File
@@ -1,10 +1,13 @@
# Pipeline
```
[new cycle] [bug observed]
| |
v v
brainstorm -> plan -> implement debug -> implement (mini)
[new cycle] [test-specifiable feature] [bug observed]
| | |
v v v
brainstorm -> plan -> implement debug -> implement (mini)
^ |
| tdd -> implement (mini)
+----(design fork)----------/ (RED executable-spec -> GREEN, like a bug fix)
(per iteration loop)
|
[cycle close — a loop step, not a milestone close]
@@ -114,6 +117,21 @@ Runs whenever a bug is observed. RED-first: produces a failing
test in the working tree before any fix is attempted. Hands off
the GREEN side to the implement skill in mini mode.
### tdd
Opt-in alternative to the `brainstorm → planner` design entry,
for work whose desired behaviour is test-specifiable — expressible
as one failing test. RED-first: the `tdd-author` agent turns a
description or issue into a single minimal, autonomous RED
executable-spec ("how it should work"), then hands the GREEN side
to `implement` in mini mode, exactly as a bug fix. When the
behaviour is not test-specifiable (a genuine design fork surfaces),
or two decomposition rounds fail, it bounces back to `brainstorm`.
When one iteration cannot reach GREEN, the headline test is carved
into a ladder of BLOCKER sub-tests, each its own RED→GREEN
mini-cycle. Distinct from the per-task TDD the implementer already
practices inside `implement`.
### fieldtest
Optional. Orchestrator-dispatched after the audit closes clean
@@ -160,6 +178,9 @@ documents what the skill skips and under what conditions:
- `implement` is the iteration body; not skippable.
- `audit` is mandatory at cycle close.
- `debug` is mandatory RED-first for any observable bug.
- `tdd` is an opt-in alternative entry to `brainstorm` for
test-specifiable work; it bounces back to `brainstorm` on a
design fork. A profile that omits the `tdd` phase disables it.
- `fieldtest` and `docwriter` are optional and orchestrator-
dispatched.
+7 -1
View File
@@ -207,12 +207,18 @@ pipeline:
debug:
trigger: bug # observable misbehaviour
red_first: true # RED test before any fix
tdd: # opt-in: omit the key to disable the entry path
trigger: test_specifiable_feature # behaviour expressible as one failing test
red_first: true # RED executable-spec before any implementation
alt_to: brainstorm # alternative design entry; bounces back on a design fork
boss:
user_invoked: true # autonomous-orchestrator mode, /boss
```
Phases not listed are disabled for the project. A project that
does not want a `fieldtest` phase simply omits the key.
does not want a `fieldtest` phase simply omits the key. `tdd` is
opt-in the same way: a profile that omits it keeps
`brainstorm → planner` as the only design entry path.
## Example: minimal profile