task-pipeline-skill 0.12.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +477 -0
  2. package/LICENSE +47 -0
  3. package/README.md +369 -171
  4. package/cursor/rules/task-pipeline.mdc +125 -20
  5. package/package.json +8 -4
  6. package/plugins/task-pipeline/.claude-plugin/plugin.json +15 -4
  7. package/plugins/task-pipeline/commands/task-pipeline.md +20 -8
  8. package/plugins/task-pipeline/skills/task-pipeline/SKILL.md +112 -39
  9. package/plugins/task-pipeline/skills/task-pipeline/pipeline.example.json +35 -16
  10. package/plugins/task-pipeline/skills/task-pipeline/references/acceptance.md +119 -0
  11. package/plugins/task-pipeline/skills/task-pipeline/references/artifacts.md +47 -14
  12. package/plugins/task-pipeline/skills/task-pipeline/references/brainstorm.md +108 -0
  13. package/plugins/task-pipeline/skills/task-pipeline/references/build.md +365 -0
  14. package/plugins/task-pipeline/skills/task-pipeline/references/companion-skills.md +72 -31
  15. package/plugins/task-pipeline/skills/task-pipeline/references/conventions.md +27 -3
  16. package/plugins/task-pipeline/skills/task-pipeline/references/decomposition.md +139 -0
  17. package/plugins/task-pipeline/skills/task-pipeline/references/grill.md +78 -7
  18. package/plugins/task-pipeline/skills/task-pipeline/references/knowledge-sources.md +159 -0
  19. package/plugins/task-pipeline/skills/task-pipeline/references/loop-guard.md +100 -0
  20. package/plugins/task-pipeline/skills/task-pipeline/references/planning.md +195 -0
  21. package/plugins/task-pipeline/skills/task-pipeline/references/review.md +174 -0
  22. package/plugins/task-pipeline/skills/task-pipeline/references/spec.md +144 -0
  23. package/plugins/task-pipeline/skills/task-pipeline/references/stages.md +190 -35
  24. package/plugins/task-pipeline/skills/task-pipeline/references/tdd.md +110 -0
  25. package/plugins/task-pipeline/skills/task-pipeline/templates/README.md +5 -3
  26. package/plugins/task-pipeline/skills/task-pipeline/templates/brief.md +50 -2
  27. package/plugins/task-pipeline/skills/task-pipeline/templates/carryover.md +36 -0
@@ -3,7 +3,7 @@
3
3
  For each stage: what it does, what to invoke, artifacts, and the **GATE** that
4
4
  must pass before advancing. Each gate is tagged with its **type** — `auto` (the
5
5
  orchestrator verifies the check itself, pass/fail) or `manual` (wait for the
6
- operator's explicit go). These stages (0 intake + 1→9) are the plugin's
6
+ operator's explicit go). These stages (0 intake + 1→10) are the plugin's
7
7
  **example** flow, encoded in `pipeline.example.json` against the universal contract
8
8
  `pipeline.schema.json`; a host project replaces it with its own
9
9
  stages/agents/types (see SKILL.md → *Bring your own skills*).
@@ -32,16 +32,30 @@ stages/agents/types (see SKILL.md → *Bring your own skills*).
32
32
  - **What (normal entry):** the operator's one-line task is almost never enough to
33
33
  run autonomously. Before anything else, **grill the operator** to expand that
34
34
  one line into a complete, unambiguous brief — resolve every decision branch
35
- up front so stages 1→9 need no further human input beyond the manual gates.
35
+ up front so stages 1→10 need no further human input beyond the manual gates.
36
36
  This is input expansion, not design: turn "make me feature X" into locked
37
37
  answers for scope, users, constraints, data, edge cases, done-criteria.
38
+ - **Phase 1 — harvest the knowledge sources FIRST**
39
+ ([`knowledge-sources.md`](knowledge-sources.md)). Before the first question:
40
+ query what the project already knows about this task — code, `CLAUDE.md`,
41
+ `CONTEXT.md`/ADRs, `docs/` + `docs/ux/`, past pipeline briefs and carry-over
42
+ ledgers, the **knowledge wiki** if one is installed
43
+ ([obsidian-wiki](https://github.com/ar9av/obsidian-wiki) — recommended,
44
+ never required), and any **other repo or hosted doc system the project names as
45
+ its docs**. Write the **source ledger** into the brief (a row per source, or an
46
+ explicit "none found"). It is retrieval scoped by the task's own nouns, not a
47
+ read of everything — and it is what makes phase 2's answers checkable instead of
48
+ merely confident.
38
49
  - **How it runs: [`grill.md`](grill.md)** — the full doctrine, built into this
39
50
  skill (nothing to install). In short: one question per turn, a recommended
40
51
  answer with each, explore the codebase before asking, depth-first through the
41
- decision tree, contradictions reconciled on the spot; plus **domain awareness**
52
+ decision tree, contradictions reconciled on the spot; **every answer that touches
53
+ a harvested source is checked against it** — the operator outranks any document,
54
+ but only out loud, and the losing side is logged for the stage-9 doc update; plus
55
+ **domain awareness**
42
56
  (challenge terms against `CONTEXT.md`, sharpen fuzzy language, stress-test with
43
57
  concrete scenarios, cross-reference the code, record ADRs for hard-to-reverse
44
- calls) and the **autonomy sweep** that pre-resolves every stage-1→9 blocker.
58
+ calls) and the **autonomy sweep** that pre-resolves every stage-1→10 blocker.
45
59
  Deploy authorization has a hard floor there: a standing go counts only when it
46
60
  names the target and the preconditions.
47
61
  - **UI early-detect:** one branch of the grill is always "does this touch a
@@ -53,14 +67,18 @@ stages/agents/types (see SKILL.md → *Bring your own skills*).
53
67
  constraints, assumptions, explicitly-deferred items, done-criteria) **plus the
54
68
  autonomy sweep's per-stage answers and the model decision**. Seed it from
55
69
  the skill's `templates/brief.md` skeleton — but only when absent, never
56
- overwrite an existing brief. Stages 2–4 build on this brief; stages 5–9 read
70
+ overwrite an existing brief. Stages 2–4 build on this brief; stages 5–10 read
57
71
  its autonomy section instead of asking. Where the session produced them, also:
58
72
  an updated `CONTEXT.md` (terms written as they resolved) and any ADRs under
59
73
  `docs/adr/` — see `grill.md` → *Domain awareness*.
60
- - **GATE (manual):** shared understanding reached — every detected branch has a
61
- recorded answer or an explicit deferral, no open contradictions, **every
74
+ - **GATE (manual):** shared understanding reached — **the source ledger is written
75
+ (every source consulted, or an explicit "none found")**, every detected branch has
76
+ a recorded answer or an explicit deferral, **every answer that contradicted a
77
+ harvested source has a recorded resolution** (which governs, and whether the doc
78
+ is now stale), no open contradictions, **every
62
79
  autonomy-sweep row is answered or explicitly marked "stop and ask here"**, the
63
- model decision is recorded, and the operator confirms the brief. Stop when a
80
+ **REQ table is written and every row names its check**, the carry-over ledger is
81
+ seeded, the model decision is recorded, and the operator confirms the brief. Stop when a
64
82
  re-scan surfaces no new branches (don't grill past diminishing returns;
65
83
  reversible calls can be deferred with a note). Only then start stage 1.
66
84
 
@@ -73,16 +91,40 @@ stages/agents/types (see SKILL.md → *Bring your own skills*).
73
91
  - **GATE (auto):** every contract the design will lock is grounded in fetched docs,
74
92
  not recall. Unresolvable libraries are flagged in the spec.
75
93
 
76
- ## 2 — Brainstorm
77
- - **Invoke:** `superpowers:brainstorming`. One question at a time; 2–3 approaches +
78
- a recommendation; design presented in sections.
94
+ ## 2 — Brainstorm + decompose
95
+ - **How it runs: [`brainstorm.md`](brainstorm.md)** built into this skill. Read
96
+ the brief first (stage 0 already answered scope/constraints/done-criteria), then
97
+ explore the codebase, scope-check for decomposition, one question at a time, 2–3
98
+ approaches with a recommendation, design presented in sections and approved
99
+ section by section. **Hard gate:** no code, no scaffolding, no implementation
100
+ skill before the operator approves the design — including on "obviously simple"
101
+ tasks.
79
102
  - **UI detection (mandatory check):** decide whether the task touches any
80
103
  user-facing surface (web, mobile, CLI, TUI — new feature, new screen/command,
81
104
  or a change to user-visible behavior). Record the verdict; it arms the UX
82
105
  track in stage 3.
83
- - **GATE (manual):** the user approves the design **and** the UI verdict is recorded.
106
+ - **Decomposition (platforms only): [`decomposition.md`](decomposition.md).** If
107
+ the brief describes a platform rather than a change — several independent
108
+ capabilities, several surfaces that could ship separately, REQs no single
109
+ deliverable satisfies — cut it into **modules** before any spec is written, and
110
+ commit the module map (`specs/<topic>-modules.md`): what each module delivers,
111
+ the entities it owns, what it depends on, the contracts it exposes, its REQs and
112
+ its status, in build order with the walking skeleton first. Single-module work
113
+ records `single module: <name>` in the design and moves on — a skipped
114
+ decomposition is a decision, never an omission.
115
+ - **GATE (manual):** the user approves the design, the UI verdict is recorded,
116
+ **every REQ is answered by the design** — a requirement the design doesn't
117
+ address is either covered now or explicitly dropped by the operator, with the
118
+ drop recorded in the carry-over ledger — **and, for a platform, the module map is
119
+ approved**: brick criteria met or excepted in writing, dependency graph acyclic,
120
+ build order topological, every REQ mapped to exactly one module, cross-module
121
+ contracts named with their owner.
84
122
 
85
123
  ## 3 — Spec — with UX track for user-facing tasks
124
+ - **How it runs: [`spec.md`](spec.md)** — built into this skill: the UX-track order,
125
+ what the spec must lock (types, schemas, signatures, file layout, the **Global
126
+ Constraints** block stages 4–5 depend on), the self-review pass and the operator
127
+ review gate.
86
128
  - **UX track (runs FIRST when stage 2 flagged UI; skip entirely otherwise).**
87
129
  Requires the **super-ux** skills. If missing on a UI task → give the install
88
130
  line and stop (see SKILL.md *Prerequisites*: `/plugin marketplace add
@@ -98,8 +140,9 @@ stages/agents/types (see SKILL.md → *Bring your own skills*).
98
140
  map**: task analysis, user-flow diagrams (branches, error paths), every
99
141
  screen + state with wireframe and (Figma on) a Figma frame link.
100
142
  4. `ux-scenarios` → `docs/ux/scenarios.md` — the **WHAT** (source of truth for
101
- behavior): scenarios validated per the format contract (`scenario-format.md`,
102
- ux-contract v4) IDs, statuses, `Traces:` to stories/journey stages/flows,
143
+ behavior): scenarios validated against the scenario-format contract super-ux
144
+ itself ships (`scenario-format.md`read its current version there, never
145
+ pin one here) — IDs, statuses, `Traces:` to stories/journey stages/flows,
103
146
  edge/error states enumerated.
104
147
  5. **Run the super-ux linter** (`/ux-lint` or `python3 docs/ux/lint.py`) — it
105
148
  must pass: no drift, no orphans, no broken traces or stale Figma links.
@@ -107,14 +150,15 @@ stages/agents/types (see SKILL.md → *Bring your own skills*).
107
150
  never rebuild from scratch. If the chain already exists and is validated (e.g.
108
151
  the task entered from super-ux), just verify (linter green) and embed it into
109
152
  the spec; only build the parts that are missing.
110
- - **Spec:** brainstorming writes the design to
111
- `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` and commits it. Lock all
153
+ - **Spec:** write the approved design to
154
+ `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` and commit it. Lock all
112
155
  shared contracts (types, schemas, signatures, file layout). For UI tasks the
113
156
  spec **embeds the UX layer**: links the validated scenario IDs, the flows and
114
157
  `SCR-` screens, the CJM stages the feature serves, and the UX
115
158
  patterns/principles from super-ux that apply (`best-practices.md`,
116
159
  `ux-design-principles.md`, `component-guidelines.md`).
117
- - **GATE (manual):** spec committed **and** user-reviewed; for UI tasks
160
+ - **GATE (manual):** spec committed **and** user-reviewed; **every section carries
161
+ `covers: REQ-…` and every REQ appears in at least one section**; for UI tasks
118
162
  additionally: the super-ux chain (foundation → flows → screens → scenarios) is
119
163
  designed, validated and approved; scenarios validated in `docs/ux/scenarios.md`;
120
164
  the linter passes; every user-facing spec requirement traces to a scenario ID
@@ -122,30 +166,51 @@ stages/agents/types (see SKILL.md → *Bring your own skills*).
122
166
  starts before this — the chain comes BEFORE interface.
123
167
 
124
168
  ## 4 — Plan
125
- - **Invoke:** `superpowers:writing-plans` →
126
- `docs/superpowers/plans/YYYY-MM-DD-<feature>.md`. Zero-context tasks, exact
127
- paths, TDD steps, DoD each, dependency graph + parallel groups, non-overlapping
128
- file ownership.
129
- - **GATE (auto):** every spec requirement maps to a task; no placeholders; parallel-group
169
+ - **How it runs: [`planning.md`](planning.md)** — built into this skill
170
+ `docs/superpowers/plans/YYYY-MM-DD-<topic>.md` (same slug as the brief and the
171
+ spec). Zero-context tasks, exact
172
+ paths, complete code in every step, TDD steps with expected output, DoD each,
173
+ dependency graph + parallel groups, non-overlapping file ownership, and the
174
+ Global Constraints block copied verbatim from the spec.
175
+ - **GATE (auto):** **set equality — the REQ ids in the brief equal the union of
176
+ `Implements:` across plan tasks.** A non-empty difference fails the gate and is
177
+ reported as the explicit list of dropped requirements; this is the seam where
178
+ scope leaks silently, so the check is mechanical, not a judgement call. Plus:
179
+ every spec requirement maps to a task; no placeholders; names and
180
+ types consistent across tasks; every task carries a verifiable DoD; parallel-group
130
181
  tasks share no files. For UI tasks: every task building user-facing behavior
131
182
  names the scenario ID(s) and `SCR-` screen(s) it implements, and its DoD
132
183
  includes satisfying them **and** updating the affected super-ux layers in the
133
184
  same change (super-ux *same-change* rule).
134
185
 
135
186
  ## 5 — Dev
136
- - **Invoke:** `superpowers:using-git-worktrees` (isolate)
137
- `superpowers:subagent-driven-development` (or `superpowers:executing-plans`).
138
- TDD per task (failing test minimal impl → green → commit). Pin subagents to the
139
- run's confirmed model (`model-tiering.md`).
140
- - **GATE (auto):** all plan tasks DONE (two-stage review: spec compliance, then code
141
- quality); full test suite green.
187
+ - **How it runs: [`build.md`](build.md)** — built into this skill: isolate the
188
+ workspace (native worktree tool first, git fallback, baseline tests), keep a
189
+ ledger under `.task-pipeline/build/<plan>/` so a compacted context can resume,
190
+ then one fresh implementer subagent per task with a file-based brief and report,
191
+ a review after every task ([`review.md`](review.md)), and a five-round fix loop
192
+ with an explicit breaker. TDD per task ([`tdd.md`](tdd.md)): failing test
193
+ watch it fail → minimal impl → watch it pass → commit. Pin subagents to the
194
+ run's confirmed model (`model-tiering.md`). The plan's parallel groups fan out
195
+ **only** when each implementer gets its own worktree; otherwise sequential.
196
+ - **Integration closes the stage:** sync with the base branch, re-run the full suite
197
+ on the result, land it the project's way (merge, or a PR — outward, so it needs a
198
+ go), remove the worktree. Stages 7–9 act on the integrated result, so a branch the
199
+ operator chose to leave unmerged is recorded as such.
200
+ - **GATE (auto):** all plan tasks DONE (three review verdicts per task: spec
201
+ compliance, **REQ satisfied**, code quality); every finding fixed or parked with a
202
+ ruling; **every parked finding and implementer concern harvested into the
203
+ carry-over ledger** — nothing stays only in the scratch workspace, which is
204
+ deleted; no task left BLOCKED; full test suite green; branch integrated per the brief's policy (or the operator's
205
+ "leave it" recorded).
142
206
 
143
207
  ## 6 — Tests
144
208
  - **What:** consolidate test coverage for the change: confirm new functionality
145
209
  has tests (written test-first in stage 5), update/repair existing tests the
146
210
  change touched, and add edge-case + failure-path tests per DoD.
147
- - **Invoke:** the host test runner (see `conventions.md` → *Lint + test*);
148
- `superpowers:test-driven-development` for any uncovered gap.
211
+ - **Invoke:** the host test runner (see `conventions.md` → *Lint + test*); the
212
+ built-in [`tdd.md`](tdd.md) cycle for any uncovered gap — failing test first,
213
+ same as stage 5.
149
214
  - **GATE (auto):** the **full** suite is green (not just the new tests); new/changed code
150
215
  is covered; no `skip`/`xfail` smuggling a red suite past the gate. Never advance
151
216
  to deploy on a red or partial run.
@@ -158,7 +223,9 @@ stages/agents/types (see SKILL.md → *Bring your own skills*).
158
223
  if the project defines release automation (`pipeline.json` → `release`, toggle
159
224
  on), that is what "deploy" runs here.
160
225
  - **GATE (manual):** lint clean (host linter **and**, for UI projects, the super-ux
161
- linter) **and** suite green **before** deploy. Deploy is outward explicit
226
+ linter) **and** suite green **before** deploy, **and no REQ is still `open`** — a
227
+ `partial` ships only with the operator's explicit acceptance. A gap is cheapest to
228
+ close before it ships, and the operator is already present at this gate. Deploy is outward → explicit
162
229
  operator go. Respect deploy-from-main rules if the project mandates them.
163
230
 
164
231
  ## 8 — Post-deploy
@@ -168,9 +235,97 @@ stages/agents/types (see SKILL.md → *Bring your own skills*).
168
235
  steps — never silent success.
169
236
 
170
237
  ## 9 — Docs + wiki
238
+ - **The stage-0 source ledger is the work list** ([`knowledge-sources.md`](knowledge-sources.md)
239
+ → *Close the loop*): every source the harvest read gets updated if this run
240
+ changed or disproved it. What was worth reading at stage 0 and is wrong now is
241
+ the next run's false premise.
171
242
  - Update host module docs / runbooks per the project's self-update rules, in the
172
243
  **same change**. For UI tasks, confirm the super-ux layers were updated in this
173
- change and the linter is green (super-ux *same-change* + *no-drift* rules). Then
174
- sync knowledge to the wiki (`wiki-update` skill).
175
- - **GATE (auto):** docs in sync with code; UI: super-ux layers current + linter
176
- green; wiki synced; dangling links fixed.
244
+ change and the linter is green (super-ux *same-change* + *no-drift* rules).
245
+ - **Sync the knowledge wiki** `wiki-update` when
246
+ [obsidian-wiki](https://github.com/ar9av/obsidian-wiki) is installed (detect:
247
+ `~/.obsidian-wiki/config`, or the skill resolves). Not installed → recommend it
248
+ once with its install line and continue; a missing wiki never blocks the gate.
249
+ Distil the knowledge (decisions, seams, why), not a diff summary.
250
+ - **Docs living in another repository** are outward: propose the edit, get an
251
+ explicit go, then open a PR there. No go → the exact edit goes in the carry-over
252
+ ledger.
253
+ - **GATE (auto):** docs in sync with code; every stale row in the source ledger
254
+ either updated or carried over with its edit; UI: super-ux layers current +
255
+ linter green; wiki synced (or absent and recommended once); dangling links fixed.
256
+
257
+ ## 10 — Acceptance
258
+ - **What:** the closing stage — go back to the brief and account for **every**
259
+ requirement. Doctrine: [`acceptance.md`](acceptance.md). Every earlier gate asks
260
+ "is this artifact good?"; none asks "does this still contain everything that was
261
+ asked for?" The loss happens on the seams between stages, and this is where it
262
+ surfaces.
263
+ - **Runs last**, after docs and wiki — those are deliverables too, and a REQ may
264
+ name them.
265
+ - **How it runs:** built in. Read the brief's REQ table, the carry-over ledger in
266
+ full, the plan's task statuses, git log, the final suite output, stage-8 notes and
267
+ stage-9 doc changes (plus `docs/ux/scenarios.md` + `/ux-lint` for UI tasks). Write
268
+ `docs/superpowers/specs/YYYY-MM-DD-<topic>-acceptance.md` — one row per REQ,
269
+ status `verified` / `partial` / `deferred` / `dropped`, each with **evidence** (a
270
+ passing test name, `file:line`, a command and its output, or a scenario ID).
271
+ "Done" without evidence is not done: downgrade to `partial` and say so rather
272
+ than upgrading the claim.
273
+ - Then ask the operator the closing question out loud, list in hand: *here's what
274
+ you asked for, here's what shipped, here's what's deferred and where it lives —
275
+ what's missing?* Ask it even when the table is green; the operator holds context
276
+ the brief never captured, and this is the cheapest moment in the run to hear it.
277
+ - **GATE (manual):** every REQ has a status (none `unknown`); every `verified`
278
+ carries evidence; every `partial` names what's missing and where it's tracked;
279
+ every `deferred`/`dropped` has the operator's agreement and, for `deferred`, a
280
+ tracker entry; no carry-over row left `unresolved`; the operator answers the
281
+ closing question and signs off. Manual by design — an automated check can prove
282
+ the table is well-formed, only the person who asked can confirm it is what they
283
+ asked for.
284
+
285
+ ## The program loop — a platform, one brick at a time
286
+
287
+ When stage 2 produced a **module map** ([`decomposition.md`](decomposition.md)),
288
+ stages 0–2 have run once for the whole platform and the rest of the pipeline runs
289
+ **per module**, in build order:
290
+
291
+ ```
292
+ module N → 3 spec (dossier) → 4 plan → 5 build → 6 tests → 7 lint+deploy
293
+ → 8 post-deploy → 9 docs+wiki → 10 acceptance → map status: done
294
+ → module N+1 (back to 3)
295
+ ```
296
+
297
+ - **No re-grilling, no re-decomposing per module.** New information that changes the
298
+ map goes back to stage 2 as an explicit, operator-approved map revision — never a
299
+ quiet edit mid-module.
300
+ - **Each module's spec is a full dossier** (`spec.md`): architecture, entities,
301
+ contracts in and out, business rules, edge and failure cases, UI/Figma chain when
302
+ it has a surface.
303
+ - **Deploy cadence is the brief's call** (autonomy sweep): per module, or once after
304
+ several. Decide it up front, not per module.
305
+ - **Update the module map's status in the same commit as that module's acceptance.**
306
+ The map is the resume point after a lost context.
307
+ - **Program done** when every row is `done` or `deferred` with an agreed home, the
308
+ cross-module contracts are covered by tests that cross the seam, and a final
309
+ acceptance covers the platform's whole REQ table — not module by module.
310
+
311
+ ## Cross-cutting — the loop guard
312
+
313
+ Any stage can be re-entered and any loop can churn: a pass undoing what an earlier
314
+ pass decided, two shapes alternating, the same file rewritten with no new
315
+ information. [`loop-guard.md`](loop-guard.md) is the detector and the break
316
+ protocol, and it binds every repeating loop here — the stage-5 fix loop, a stage
317
+ re-entered after a failed gate, the program loop above, any audit → fix → audit
318
+ cycle.
319
+
320
+ - **Every repeating pass logs one line per touched file** (`touch: <file> — pass N —
321
+ reason: <finding id / gate item>`) to the run ledger. Detection is mechanical, not
322
+ a feeling, and the ledger is what survives compaction.
323
+ - **Trips on:** revert-oscillation (A→B→A); the same file edited twice for the same
324
+ reason; a finding already ADDRESSED or parked coming back; a stage entered a third
325
+ time for one artifact; two loops editing one file. Hard caps: 5 fix rounds per
326
+ task, 2 re-entries per stage per artifact, 3 passes per module.
327
+ - **On a trip: stop editing.** Name shapes A and B with their evidence, escalate to
328
+ the layer that owns the conflict (rubric → operator → plan → spec → module map),
329
+ re-plan the check as an ordered one-item-per-line checklist, then go through it in
330
+ order, one commit per item. Never settle a higher-layer conflict inside a lower
331
+ loop, and never adjudicate before the cap.
@@ -0,0 +1,110 @@
1
+ # TDD — stages 5 and 6, built in
2
+
3
+ How every task in the build is implemented, and what stage 6 consolidates. Built
4
+ into this skill; nothing to install.
5
+
6
+ > Ported from the `test-driven-development` skill in
7
+ > [obra/superpowers](https://github.com/obra/superpowers) (MIT — see `LICENSE` →
8
+ > *Third-party*), with the stage-6 suite gate added.
9
+
10
+ ## The iron law
11
+
12
+ ```
13
+ NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
14
+ ```
15
+
16
+ **If you didn't watch the test fail, you don't know it tests the right thing.**
17
+
18
+ Wrote code before the test? Delete it and start from the test. Not "keep it as
19
+ reference", not "adapt it while writing tests", not "look at it once more". Delete
20
+ means delete — code you kept is code the test was written to fit.
21
+
22
+ **Always:** new features, bug fixes, refactors, behavior changes.
23
+ **Exceptions, and only with the operator's say-so:** throwaway prototypes,
24
+ generated code, pure configuration.
25
+
26
+ Thinking "skip TDD just this once"? That thought is the rationalization, not the
27
+ exception.
28
+
29
+ ## Red → green → refactor
30
+
31
+ **RED — write one failing test.** One behavior, a name that describes that
32
+ behavior, real code rather than mocks wherever mocks are avoidable.
33
+
34
+ **Verify RED — run it and watch it fail. Mandatory.** Confirm it *fails* rather
35
+ than *errors*, that the message is the one you expected, and that it fails because
36
+ the feature is missing — not because of a typo or a bad import. A test that passes
37
+ immediately is testing behavior that already exists: fix the test.
38
+
39
+ **GREEN — the simplest code that passes.** No extra options, no "while I'm here"
40
+ refactor of the neighbors, no configuration surface nobody asked for. YAGNI.
41
+
42
+ **Verify GREEN — run it and watch it pass. Mandatory.** The new test passes, the
43
+ other tests still pass, and the output is pristine — no stray warnings or errors.
44
+ Test still fails → fix the code, never the test. Another test broke → fix it now.
45
+
46
+ **REFACTOR — only once green.** Remove duplication, improve names, extract helpers.
47
+ Tests stay green. No new behavior enters here.
48
+
49
+ Then the next failing test.
50
+
51
+ ## Tests that stay honest
52
+
53
+ - **Before writing a test, name the production change that would make it fail.**
54
+ Can't name one? The test asserts nothing useful.
55
+ - **Assert on real behavior, never on mock behavior.** `expect(mock).toHaveBeenCalled()`
56
+ proves the mock works. Understand a dependency's side effects before mocking it —
57
+ a mock that lies is worse than no test.
58
+ - **One thing per test.** An "and" in the name means two tests.
59
+ - **Test-only helpers live in test utilities**, never as extra branches or flags in
60
+ production classes.
61
+ - **Edge cases and failure paths are part of the task**, not a follow-up ticket:
62
+ empty input, boundary values, the network call that fails, the timeout.
63
+
64
+ ## Stage 6 — consolidation and the suite gate
65
+
66
+ Stage 5 wrote the tests task by task. Stage 6 makes the whole thing true:
67
+
68
+ - New functionality has tests (written test-first in stage 5) — fill any gap now,
69
+ the same way: failing test first.
70
+ - Tests the change touched are updated or repaired, not deleted around.
71
+ - Edge-case and failure-path coverage matches each task's DoD.
72
+ - The test command is the one recorded in the brief's autonomy sweep; "green" means
73
+ what the brief says it means (including a known-red baseline, if one was
74
+ recorded).
75
+
76
+ **GATE (auto):** the **full** suite is green — not just the new tests. New and
77
+ changed code is covered. No `skip` / `xfail` / commented-out assertion smuggles a
78
+ red suite past the gate. A partial or red run never advances to deploy; report it
79
+ honestly instead.
80
+
81
+ ## When stuck
82
+
83
+ | Problem | What it means |
84
+ |---|---|
85
+ | Don't know how to test it | Write the API you wish existed, then the assertion. Still stuck → ask the operator. |
86
+ | The test is too complicated | The design is too complicated. Simplify the interface. |
87
+ | Everything has to be mocked | The code is too coupled. Inject dependencies. |
88
+ | Setup is enormous | Extract helpers; if it's still huge, the design is the problem. |
89
+ | Fixing a bug | Write the failing test that reproduces it first. The test proves the fix and prevents the regression. |
90
+
91
+ ## Rationalizations
92
+
93
+ | Excuse | Reality |
94
+ |---|---|
95
+ | "Too simple to test" | Simple code breaks. The test costs 30 seconds. |
96
+ | "I'll test after" | Tests written after pass immediately, which proves nothing. You never watched it fail, so you never proved it can catch the bug. |
97
+ | "Tests after achieve the same thing — spirit, not ritual" | Tests-after answer "what does this do?"; tests-first answer "what should this do?" After-the-fact tests are biased by the code that already exists. |
98
+ | "I already tested it manually" | Ad-hoc, unrepeatable, no record of what was covered. "Worked when I tried it" is not coverage. |
99
+ | "Deleting X hours of code is wasteful" | Sunk cost. The real choice is rewriting with TDD versus keeping code you can't trust. |
100
+ | "Just exploring first" | Fine — throw the exploration away and start with TDD. |
101
+ | "The existing code has no tests either" | You're improving it. Add tests for what you touch. |
102
+ | "TDD will slow me down" | TDD is the fast path: bugs caught before commit, refactors without fear. The shortcut ends in production debugging. |
103
+
104
+ ## Red flags — stop and start over
105
+
106
+ Code before test · test written after implementation · test passed on the first run
107
+ · can't explain why it failed · "tests later" · "just this once" · "keep it as
108
+ reference" · "it's about spirit not ritual" · "this case is different because…"
109
+
110
+ All of them mean the same thing: delete the code, start from the failing test.
@@ -1,12 +1,14 @@
1
1
  # templates
2
2
 
3
- Skeletons task-pipeline seeds into a host project. Only the **brief** is owned by
4
- this plugin (it is the stage-0 intake artifact); the spec and plan skeletons come
5
- from the `superpowers` skills, and the `docs/ux/*` skeletons from `super-ux`.
3
+ Skeletons task-pipeline seeds into a host project. Only the **brief** is a seeded
4
+ file (it is the stage-0 intake artifact). The spec and plan have no skeleton here —
5
+ their required structure is prescribed inline by `references/spec.md` and
6
+ `references/planning.md`; the `docs/ux/*` skeletons come from `super-ux`.
6
7
 
7
8
  | Template | Seeded to | Stage |
8
9
  |---|---|---|
9
10
  | `brief.md` | `docs/superpowers/specs/YYYY-MM-DD-<topic>-brief.md` | 0 — intake grill |
11
+ | `carryover.md` | `docs/superpowers/specs/YYYY-MM-DD-<topic>-carryover.md` | 0 seeds, all stages append, 10 reads |
10
12
  | `context.md` | `CONTEXT.md` at the repo root (or per context) | 0 — grill, domain awareness |
11
13
  | `adr.md` | `docs/adr/NNNN-<slug>.md` | 0 — grill, hard-to-reverse decisions |
12
14
 
@@ -9,12 +9,56 @@
9
9
  - **UI verdict:** yes / no — does this touch a user-facing surface (web/mobile/CLI/TUI)?
10
10
  If yes, the stage-3 super-ux UX track is armed.
11
11
 
12
+ ## Knowledge sources (the phase-1 harvest — written BEFORE the first question)
13
+
14
+ What the project already knew about this task, and where it said so. One row per
15
+ source actually consulted; `none found` is a valid, useful row. Stage 9 updates
16
+ this same list — a source worth reading at the start is the next run's false
17
+ premise if the run leaves it wrong.
18
+
19
+ | Source | What it says about this task | Fresh? | Authority | Stale after this run? |
20
+ |---|---|---|---|---|
21
+ | `docs/adr/NNNN-….md` | … | YYYY-MM | decision | no |
22
+ | wiki: `projects/…/concepts/…` | … | YYYY-MM | context | **yes — update at stage 9** |
23
+ | `CLAUDE.md` | test/lint/deploy commands, house rules | current | convention | no |
24
+
25
+ Precedence when two disagree: **code > host docs and ADRs > wiki > memory.** The
26
+ operator outranks every document — but only **out loud**: an override quoted
27
+ against its source is a recorded decision, an unquoted one is an undetected
28
+ divergence.
29
+
30
+ - **Doc repos / hosted doc systems this project names:** … (or `none`)
31
+ - **Knowledge wiki:** installed / not installed
32
+ ([obsidian-wiki](https://github.com/ar9av/obsidian-wiki); recommended, never a gate)
33
+
12
34
  ## Scope
13
35
 
14
36
  - **In scope:** …
15
37
  - **Out of scope / explicitly deferred:** … (with the reason and, for deferrals,
16
38
  the latest moment the decision can still be made)
17
39
 
40
+ ## Requirements (the REQ spine — every later stage traces to these IDs)
41
+
42
+ Scope above is prose; this is the **addressable** form of it. One row per
43
+ independently verifiable deliverable — not one per sentence. Every row needs a
44
+ named check: **a requirement you can't say how to verify is a badly-stated
45
+ requirement** — split it here, on the grill, not at acceptance.
46
+
47
+ | ID | Requirement | How it's verified | Status |
48
+ |---|---|---|---|
49
+ | REQ-001 | … | test name / `file:line` / command + expected output / `SCN-…` | open |
50
+ | REQ-002 | … | … | open |
51
+
52
+ Status lifecycle, written at three checkpoints only (stage 4, stage 5, stage 10 —
53
+ not continuously): `open` → `planned` → `built` → `verified` \| `partial` \|
54
+ `deferred` \| `dropped`.
55
+
56
+ > **The list is frozen once confirmed.** Adding a requirement mid-run is fine —
57
+ > append it with its source. **Removing or narrowing one needs the operator's
58
+ > explicit agreement**, recorded in the carry-over ledger. Silently restating the
59
+ > task in smaller terms is the failure this table exists to prevent: every gate
60
+ > after it goes green on the shrunken task and nothing reports the loss.
61
+
18
62
  ## Users & context
19
63
 
20
64
  - **Who / for what:** … (personas, the job being done)
@@ -26,7 +70,7 @@
26
70
  |---|---|---|---|
27
71
  | 1 | … | … | … |
28
72
 
29
- ## Autonomy (the sweep — stages 1→9 read this instead of asking)
73
+ ## Autonomy (the sweep — stages 1→10 read this instead of asking)
30
74
 
31
75
  Every row is either a resolved answer or an explicit **STOP AND ASK**. A blank row
32
76
  is not neutral — it is a scheduled interruption.
@@ -35,15 +79,19 @@ is not neutral — it is a scheduled interruption.
35
79
  |---|---|---|
36
80
  | run-wide | Model for this run | … (most capable available unless overridden; per-stage overrides here) |
37
81
  | run-wide | Decide autonomously vs escalate to me | … |
82
+ | 0 Harvest | Doc sources beyond this repo — other repos, hosted docs, the knowledge wiki; and may stage 9 write to them? | … (another repo is outward: propose + PR, never a direct push) |
38
83
  | 1 Docs | External libs/APIs/SDKs in play; any context7 can't resolve → where their docs live | … |
84
+ | 2 Decompose | Platform (several capabilities/surfaces) or one module? If platform — deploy cadence: per module, or once at the end | … |
39
85
  | 2–3 Spec | UI verdict (arms super-ux); scenario-tracing waiver, if any | … |
40
86
  | 4–5 Dev | Base branch; worktree/branch policy; is `main` off-limits; commit convention; task tracker | … |
87
+ | 5 Integration | How the branch lands — direct merge, PR (who approves), or "leave it, I'll merge"; is parallel fan-out (one worktree per implementer) wanted? | … |
41
88
  | 6 Tests | Test command; what "green" means; known-red baseline; coverage expectation | … |
42
89
  | 7 Lint | Lint command (incl. `docs/ux/lint.py` for UI projects) | … |
43
90
  | 7 Deploy | Target + path; release automation on/off; deploy-from-main rule | … |
44
91
  | 7 Deploy | **Authorization** — standing go, or ask every time? | … |
45
92
  | 8 Post-deploy | Where logs / health live (app name, endpoint, workflow) | … |
46
- | 9 Docs+wiki | Which module docs / runbooks this change updates; wiki sync yes/no | … |
93
+ | 9 Docs+wiki | Which module docs / runbooks this change updates; wiki sync yes/no; which stale ledger rows get fixed | … |
94
+ | 10 Acceptance | Who signs off; where deferred REQs get tracked (issue tracker / backlog) | … |
47
95
 
48
96
  > **Deploy authorization has a hard floor.** A standing go counts only if it is
49
97
  > **specific** — named target and named preconditions ("staging, once lint and the
@@ -0,0 +1,36 @@
1
+ # Carry-over ledger — <topic>
2
+
3
+ > **Append-only.** Any stage may add a row; nobody edits or deletes one. Committed
4
+ > to `docs/superpowers/specs/YYYY-MM-DD-<topic>-carryover.md` beside the brief, and
5
+ > read in full by stage 10 (acceptance).
6
+ >
7
+ > **The rule: deferred out loud is forgotten.** If it isn't written here, it wasn't
8
+ > deferred — it was lost. That covers everything said in passing: "we'll do that
9
+ > later", "good enough for now", a `DONE_WITH_CONCERNS` from an implementer, a
10
+ > reviewer's non-blocking finding, a requirement the operator agreed to drop.
11
+
12
+ | # | Stage | What | Why it isn't done | REQ | Where it lives now |
13
+ |---|---|---|---|---|---|
14
+ | 1 | 5 Dev | XLSX export path | scope call — CSV first | REQ-004 | LIN-483 |
15
+ | 2 | 5 Review | `export.ts` lacks a size guard | minor, non-blocking | — | backlog |
16
+ | 3 | 2 Brainstorm | REQ-007 dropped: bulk export | operator agreed 2026-07-28 | REQ-007 | dropped |
17
+
18
+ ## Columns
19
+
20
+ - **Stage** — where it surfaced, so acceptance knows how far it travelled.
21
+ - **What** — the concrete thing not done. "Error handling" is not an entry;
22
+ "`export.ts` swallows a failed write instead of surfacing it" is.
23
+ - **Why it isn't done** — scope call, blocked, deliberate deferral, out of budget.
24
+ "Forgot" is a legitimate and useful answer here.
25
+ - **REQ** — the requirement it belongs to, or `—` if it's outside the REQ spine.
26
+ - **Where it lives now** — issue id, backlog, `dropped` (with the operator's
27
+ agreement), or `unresolved`. **`unresolved` blocks the stage-10 gate**: an item
28
+ with no home is exactly the thing that gets forgotten, so acceptance refuses to
29
+ close on it.
30
+
31
+ ## Notes
32
+
33
+ - Adding a row costs one line and never blocks a stage — that is the point. The
34
+ ledger is cheap precisely so nobody is tempted to keep it in their head.
35
+ - Rows referencing a REQ feed that REQ's final status: an open carry-over row
36
+ means the requirement is at best `partial`, never `verified`.