@punks/cli 2.1.7 → 2.1.10

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 (48) hide show
  1. package/README.md +2 -2
  2. package/dist/data/AGENTS.md +3 -1
  3. package/dist/data/catalog/hooks.ts +8 -0
  4. package/dist/data/catalog/lint.ts +28 -82
  5. package/dist/data/catalog/packs.ts +8 -6
  6. package/dist/data/catalog/skills.ts +48 -0
  7. package/dist/data/catalog/tools.ts +9 -1
  8. package/dist/data/hooks/format-edited-file.mjs +1 -1
  9. package/dist/data/hooks/scaffold-update-check.mjs +181 -0
  10. package/dist/data/hooks.test.ts +19 -2
  11. package/dist/data/scripts/sync-subagents.mjs +70 -37
  12. package/dist/data/subagents/manifest.mjs +120 -0
  13. package/dist/index.js +1916 -767
  14. package/dist/skills/agnostic/cli/dp-cli/SKILL.md +3 -3
  15. package/dist/skills/agnostic/cli/dp-cli/references/commands.md +1 -1
  16. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +46 -0
  17. package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +4 -0
  18. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +67 -0
  19. package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +41 -0
  20. package/dist/skills/agnostic/docs/writing-beats/SKILL.md +69 -0
  21. package/dist/skills/agnostic/docs/writing-fragments/SKILL.md +76 -0
  22. package/dist/skills/agnostic/docs/writing-shape/SKILL.md +75 -0
  23. package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -2
  24. package/dist/skills/agnostic/planning/create-plan/references/planner-phase.md +1 -1
  25. package/dist/skills/agnostic/planning/create-spec/SKILL.md +57 -12
  26. package/dist/skills/agnostic/planning/create-spec/references/backlog-sync.md +5 -2
  27. package/dist/skills/agnostic/planning/create-spec/references/discovery.md +24 -16
  28. package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -2
  29. package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +29 -5
  30. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +34 -7
  31. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +32 -9
  32. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +4 -2
  33. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +3 -3
  34. package/dist/skills/agnostic/planning/implement-spec/references/sequential.md +16 -6
  35. package/dist/skills/agnostic/planning/stack/SKILL.md +89 -0
  36. package/dist/skills/agnostic/quality/autoreview/SKILL.md +191 -0
  37. package/dist/skills/agnostic/quality/autoreview/scripts/autoreview +1176 -0
  38. package/dist/skills/agnostic/quality/autoreview/scripts/test-review-harness +176 -0
  39. package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +7 -5
  40. package/dist/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +621 -830
  41. package/dist/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +250 -0
  42. package/dist/skills/phases/delivery-phase/SKILL.md +6 -1
  43. package/dist/skills/phases/docs-ingest-phase/SKILL.md +28 -20
  44. package/dist/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +8 -5
  45. package/dist/skills/phases/docs-ingest-phase/references/public-docs.md +82 -0
  46. package/dist/skills/phases/requirements-phase/SKILL.md +2 -0
  47. package/dist/skills/phases/review-phase/SKILL.md +26 -9
  48. package/package.json +1 -1
@@ -4,35 +4,43 @@ Use this reference before asking clarifying questions.
4
4
 
5
5
  ## Required order
6
6
 
7
- 1. Read `apps/wiki/AGENTS.md`.
8
- - Stop if it does not exist. The wiki is not bootstrapped yet.
9
- 2. Read `apps/wiki/index.md`.
10
- - Use it as the master map for source specs, routed project docs, and recent wiki activity.
11
- 3. Identify the primary spec domain or project area.
12
- - Prefer an existing `apps/wiki/specs/<domain>/` directory when one clearly owns the request.
7
+ 1. Resolve the planning surface. Prefer the first existing layout:
8
+ - routed project wiki: `apps/wiki/content/docs/project/specs`
9
+ - legacy source wiki: `apps/wiki/specs`
10
+ - docs fallback: `docs/specs`
11
+ 2. Read local guidance for the resolved surface when present:
12
+ - routed project wiki: `apps/wiki/AGENTS.md`, `apps/wiki/content/docs/project/index.mdx`, `apps/wiki/content/docs/project/meta.json`
13
+ - legacy source wiki: `apps/wiki/AGENTS.md`, `apps/wiki/index.md`
14
+ - docs fallback: `docs/README.md`, `docs/specs/index.md`
15
+ 3. If none of those roots exists, create `docs/specs/<domain>/<folder>/SPEC.md` rather than blocking on scaffold setup.
16
+ - Mention that the repo lacks a routed wiki planning surface in the handoff.
17
+ - Do not create or scaffold `apps/wiki` from this skill.
18
+ 4. Identify the primary spec domain or project area.
19
+ - Prefer an existing `<resolved-specs-root>/<domain>/` directory when one clearly owns the request.
13
20
  - Otherwise infer a concise domain slug from backlog context or the user's request.
14
21
  - If multiple domains are involved, pick the primary owner and note cross-domain scope in the spec.
15
22
  - Do not create `apps/wiki/domains/` just to make discovery work.
16
- 4. Read existing context for that area when present:
17
- - `apps/wiki/specs/<domain>/<domain>-specs.md`
18
- - `apps/wiki/content/docs/project/**` pages that match the area
19
- 5. Optionally read related routed project pages when they are obviously relevant.
20
- 6. Check for existing overlapping specs in:
21
- - `apps/wiki/specs/<domain>/<domain>-specs.md`
22
- 7. If backlog context exists, inspect the parent epic/capability and every child story beneath it.
23
+ 5. Read existing context for that area when present:
24
+ - `<resolved-specs-root>/<domain>/<domain>-specs.md`
25
+ - routed project pages under `apps/wiki/content/docs/project/**` that match the area
26
+ - docs pages under `docs/**` that match the area
27
+ 6. Optionally read related routed project pages when they are obviously relevant.
28
+ 7. Check for existing overlapping specs in:
29
+ - `<resolved-specs-root>/<domain>/<domain>-specs.md`
30
+ 8. If backlog context exists, inspect the parent epic/capability and every child story beneath it.
23
31
  Use [../../write-backlog/assets/concepts/backlog-model.md](../../write-backlog/assets/concepts/backlog-model.md) as the source of truth for how to interpret module -> epic -> story shape.
24
32
  Harvest:
25
33
  - epic outcome and constraints
26
34
  - each child story title
27
35
  - each child story body and acceptance signals
28
36
  - cross-story blockers or sequencing assumptions that affect the problem statement
29
- 8. Check existing DB schema when a matching domain schema file exists:
37
+ 9. Check existing DB schema when a matching domain schema file exists:
30
38
  - `packages/db/src/schema/<domain>.ts`
31
39
  Use it to:
32
40
  - avoid speccing duplicates
33
41
  - catch contradictions with the implemented model
34
42
  - surface open questions when a required field is absent
35
- 9. Glance at the top-level repo structure only if needed for terminology or context.
43
+ 10. Glance at the top-level repo structure only if needed for terminology or context.
36
44
 
37
45
  ## Exploration rule
38
46
 
@@ -43,4 +51,4 @@ This is orientation, not deep implementation research.
43
51
  - Prefer enough context to ask better questions
44
52
  - Do not drift into solution design
45
53
 
46
- If the Agent tool is available, use a subagent for this pass so the main thread stays clean.
54
+ If the Agent tool is available, use the `planning-discovery` subagent for this pass so the main thread stays clean. Its output should be evidence, contradictions, overlapping work, and open questions only; keep synthesis and spec decisions in the parent thread.
@@ -4,8 +4,12 @@ Use this reference after questioning and before writing the file.
4
4
 
5
5
  ## Domain resolution
6
6
 
7
- - The spec path is `apps/wiki/specs/<domain>/<folder-name>/SPEC.md`.
8
- - Use the exact existing domain directory name from `apps/wiki/specs/` when one clearly applies.
7
+ - The spec path is `<resolved-specs-root>/<domain>/<folder-name>/SPEC.md`.
8
+ - Resolve `<resolved-specs-root>` during discovery:
9
+ - `apps/wiki/content/docs/project/specs` for routed project wiki repos
10
+ - `apps/wiki/specs` for legacy source-wiki repos
11
+ - `docs/specs` when no wiki planning surface exists
12
+ - Use the exact existing domain directory name from `<resolved-specs-root>/` when one clearly applies.
9
13
  - If no existing spec domain applies, create a concise kebab-case domain from the request or backlog area.
10
14
  - If multiple domains are touched, choose the primary owner and describe the cross-domain aspect in the spec body.
11
15
  - Do not create `apps/wiki/domains/` as part of spec authoring.
@@ -1,8 +1,22 @@
1
- # Wiki Bookkeeping
1
+ # Planning Surface Bookkeeping
2
2
 
3
3
  Use this reference after writing `SPEC.md`.
4
4
 
5
- ## Required updates
5
+ ## Required updates by surface
6
+
7
+ ### Routed project wiki
8
+
9
+ When using `apps/wiki/content/docs/project/specs`:
10
+
11
+ 1. Create or update `<resolved-specs-root>/<domain>/<domain>-specs.md` with:
12
+ - the spec name
13
+ - a one-line summary
14
+ 2. Update `meta.json` files only when needed for the new spec to appear in the routed tree.
15
+ 3. Update any existing project specs index page that already tracks specs.
16
+
17
+ ### Legacy source wiki
18
+
19
+ When using `apps/wiki/specs`:
6
20
 
7
21
  1. Add a row to the **Specs** table in `apps/wiki/index.md`:
8
22
 
@@ -13,8 +27,7 @@ Use this reference after writing `SPEC.md`.
13
27
  2. Create or update `apps/wiki/specs/<domain>/<domain>-specs.md` with:
14
28
  - the spec name
15
29
  - a one-line summary
16
-
17
- 3. Append to `apps/wiki/log.md`:
30
+ 3. Append to `apps/wiki/log.md` when it exists:
18
31
 
19
32
  ```md
20
33
  ## [YYYY-MM-DD] spec | <spec title>
@@ -23,4 +36,15 @@ Use this reference after writing `SPEC.md`.
23
36
  - Status: Draft
24
37
  ```
25
38
 
26
- Do not skip this step.
39
+ ### Docs fallback
40
+
41
+ When using `docs/specs`:
42
+
43
+ 1. Create or update `docs/specs/index.md` with:
44
+ - the domain
45
+ - the spec path
46
+ - status `Draft`
47
+ 2. Create or update `docs/specs/<domain>/<domain>-specs.md` with:
48
+ - the spec name
49
+ - a one-line summary
50
+ 3. Do not invent wiki logs or routed metadata for a repo that has not bootstrapped them.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: implement-spec
3
- description: Implement an approved spec folder while keeping `IMPLEMENTATION-NOTES.md`, `PLAN.md`, and spec-linked tech debt in sync. Use when a reviewed spec already has a `PLAN.md` and execution should proceed either sequentially in one thread or in parallel with explicit worker orchestration.
3
+ description: Implement an approved spec folder while keeping `IMPLEMENTATION-NOTES.md`, `PLAN.md`, and spec-linked tech debt in sync. Use when a reviewed spec already has a `PLAN.md` and execution should proceed through the default single-worker sequential path or explicit parallel worker waves.
4
4
  ---
5
5
 
6
6
  # Implement Spec
@@ -10,7 +10,7 @@ description: Implement an approved spec folder while keeping `IMPLEMENTATION-NOT
10
10
  - **Role:** higher-order execution orchestrator
11
11
  - **Entrypoint type:** public entrypoint
12
12
  - **Upstream:** reviewed spec folder with `SPEC.md` and `PLAN.md`
13
- - **Delegates to:** `$tdd`, `$simplify`, and internal worker orchestration in parallel mode
13
+ - **Delegates to:** `$tdd`, `$simplify`, tiny `$requirements-phase` sessions for debt ambiguity, and internal worker orchestration in sequential and parallel modes
14
14
  - **Downstream:** `docs-ingest-phase` when the resulting spec folder should be ingested into domain knowledge
15
15
  - **Entry conditions:** existing reviewed spec folder; stop and use `create-plan` if `PLAN.md` is missing
16
16
  - **Stop conditions:** shared acceptance audit complete, final manual review checklist written, spec folder finalized, blocked work reported honestly
@@ -21,6 +21,12 @@ description: Implement an approved spec folder while keeping `IMPLEMENTATION-NOT
21
21
  - MUST use `$simplify`
22
22
  Use `$agent-browser` when any task `review_mode` is `browser` or `mixed`.
23
23
 
24
+ ## Sequential responsibilities
25
+
26
+ When `implement-spec` runs in `sequential` mode, it must follow [references/sequential.md](references/sequential.md).
27
+
28
+ That means `implement-spec` itself owns orchestration and validation, while exactly one implementation worker owns the sequential coding loop. This keeps the parent context small and adds a parent review gate after worker handoff.
29
+
24
30
  ## Parallel responsibilities
25
31
 
26
32
  When `implement-spec` runs in `parallel` mode, it must follow [references/parallel.md](references/parallel.md) as the full orchestration contract.
@@ -39,13 +45,33 @@ That means `implement-spec` itself owns all of the following in parallel mode:
39
45
  1. Resolve the target spec folder under `apps/wiki/specs/<domain>/<spec>/`.
40
46
  2. Read `references/lifecycle.md` and follow the shared execution contract exactly.
41
47
  3. Choose the execution mode explicitly:
42
- - Read `references/sequential.md` for one-thread execution.
48
+ - Read `references/sequential.md` for default single-worker sequential execution.
43
49
  - Read `references/parallel.md` for wave-based worker execution.
44
50
  4. Record the chosen mode under **Execution mode** in `IMPLEMENTATION-NOTES.md` before coding.
45
51
  5. Execute only the chosen mode. Do not mix modes inside one run.
46
52
  6. After each completed task or wave, update `PLAN.md`, `IMPLEMENTATION-NOTES.md`, and spec-linked tech debt before advancing.
47
- 7. If backlog sync is in scope, keep epic/story bodies product-facing and use native metadata or comments instead of execution handoff rewrites.
48
- 8. Finish with the shared acceptance audit, manual review checklist, and spec finalization contract.
53
+ 7. Resolve implementation debt as soon as it appears. Do not leave "later" work, TODOs, temporary compromises, or vague follow-up debt.
54
+ 8. If a debt item needs a product/scope decision outside the active goal, stop and run a very small `$requirements-phase` clarification before continuing.
55
+ 9. If backlog sync is in scope, keep epic/story bodies product-facing and use native metadata or comments instead of execution handoff rewrites.
56
+ 10. Finish with the shared acceptance audit, manual review checklist, and spec finalization contract.
57
+
58
+ ## Stack-aware branch gate
59
+
60
+ Before coding, inspect `PLAN.md` for `Branch/Base Intent`.
61
+
62
+ - If no `Branch/Base Intent` exists, continue with the normal execution flow.
63
+ - If it exists, verify the current branch is the intended child branch based on
64
+ the intended parent branch, or create/switch to the intended child branch from
65
+ the intended parent branch before implementation starts.
66
+ - Do not reinterpret intra-epic task dependencies as separate PRs.
67
+ - Default to PR-after-implementation: implement, commit, push, create or update
68
+ the PR with the recorded base, then run `stack sync --dry-run`.
69
+ - If the dry-run preview is correct and reports pending stack changes, run
70
+ `stack sync`.
71
+ - Early draft PRs are opt-in only when the user explicitly asks for them.
72
+ - If `stack` is unavailable and `Branch/Base Intent` exists, block the
73
+ stack-dependent workflow. Missing `stack` does not block independent
74
+ trunk-based work.
49
75
 
50
76
  ## Mode selection
51
77
 
@@ -53,7 +79,8 @@ Choose `sequential` when:
53
79
 
54
80
  - the user wants single-threaded execution
55
81
  - tasks are tightly coupled
56
- - worker handoff cost would outweigh parallelism
82
+ - parallel worker handoff cost would outweigh parallelism
83
+ - the user did not choose a mode
57
84
 
58
85
  Choose `parallel` when:
59
86
 
@@ -61,7 +88,7 @@ Choose `parallel` when:
61
88
  - the plan contains independent waves
62
89
  - disjoint write scopes make worker fan-out safe
63
90
 
64
- If the user already chose a mode, honor it. If not, make the smallest safe choice and state it.
91
+ If the user already chose a mode, honor it. If not, choose `sequential` and state that it uses one implementation worker plus parent validation.
65
92
 
66
93
  ## Advanced features
67
94
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  It routes to one of two approaches:
8
8
 
9
- - `sequential` — one thread, no workers
9
+ - `sequential` — one implementation worker, parent orchestration, parent validation
10
10
  - `parallel` — wave-based execution with explicit worker orchestration
11
11
 
12
12
  Do not recreate wrapper skills for these modes. Keep the routing here and load only the needed mode reference.
@@ -62,12 +62,28 @@ Persistent implementation drift belongs in:
62
62
 
63
63
  `docs/reference/tech-debt/<domain>/<spec>.md`
64
64
 
65
- Use it only for durable drift that should inform later work on the same spec:
65
+ This file is not a dumping ground for avoidable "later" work.
66
66
 
67
- - scoped compromises
68
- - unresolved gaps
69
- - pre-existing debt discovered during execution
70
- - cleanup intentionally deferred by the current spec
67
+ Default rule: resolve debt immediately when it appears.
68
+
69
+ Forbidden debt language:
70
+
71
+ - "do this later"
72
+ - "temporary workaround"
73
+ - "future implementation"
74
+ - "follow-up cleanup"
75
+ - vague TODOs without an owner, decision, and blocker
76
+
77
+ Use the ledger only for debt that cannot be resolved inside the current run because it is outside the active goal, requires a human product/scope decision, or is blocked by an external dependency.
78
+
79
+ For every ledger entry, record:
80
+
81
+ - exact debt
82
+ - why it cannot be resolved now
83
+ - decision needed or external blocker
84
+ - owner or next action
85
+
86
+ If the debt is inside the active goal, fix it before advancing. If the debt is outside the active goal but affects the implementation decision, stop and run a tiny `$requirements-phase` clarification with one narrow question and a recommended answer. Continue only after the branch is closed, parked explicitly, or converted into an accepted scope change.
71
87
 
72
88
  Do not create the file when nothing durable must survive the run.
73
89
 
@@ -75,10 +91,14 @@ Do not create the file when nothing durable must survive the run.
75
91
 
76
92
  - Mode is manual. The chosen approach decides the execution path.
77
93
  - Do not switch modes mid-run unless the user explicitly redirects.
94
+ - Default to `sequential` when the user does not choose a mode.
95
+ - In `sequential`, keep implementation work inside one worker; the parent coordinates, reviews, validates, and finalizes.
78
96
  - Treat every `tdd_target` as required RED-first behavior, never optional guidance.
79
97
  - Treat every `review_mode` as required validation routing, never optional metadata.
80
98
  - Keep an operator-visible execution board in the conversation so progress is obvious.
81
- - Keep scope discipline. Out-of-scope findings go to `IMPLEMENTATION-NOTES.md`, not silent scope creep.
99
+ - Keep scope discipline. Out-of-scope findings that do not affect the current implementation go to `IMPLEMENTATION-NOTES.md`, not silent scope creep.
100
+ - Never leave sloppy debt, TODO placeholders, temporary compromises, or "later" implementation notes for in-goal work.
101
+ - When unclear debt affects the current implementation and the answer is not already in the spec/plan/backlog, pause for a tiny `$requirements-phase` clarification instead of guessing.
82
102
  - If backlog sync is part of the run, keep epic and story bodies product-facing.
83
103
  - Execution-time backlog sync may use comments, links, native status, and native relations.
84
104
  - Never rewrite epic or story bodies with task ids, TDD targets, validation commands, or file lists.
@@ -91,7 +111,8 @@ After each completed task or wave:
91
111
  - append a concise execution log in `PLAN.md`
92
112
  - record touched files in `PLAN.md`
93
113
  - update `IMPLEMENTATION-NOTES.md` with non-obvious decisions, surprises, or deviations
94
- - update the spec-linked tech-debt file when durable drift appears
114
+ - resolve any in-goal debt before advancing
115
+ - update the spec-linked tech-debt file only for blocked or explicitly parked debt with exact owner/next action
95
116
  - if backlog sync is in scope, prefer native metadata changes or concise comments over body rewrites
96
117
 
97
118
  ## 8. Handle blockers honestly
@@ -99,7 +120,7 @@ After each completed task or wave:
99
120
  If a task is blocked:
100
121
 
101
122
  1. record it in `IMPLEMENTATION-NOTES.md`
102
- 2. update the spec-linked tech-debt file when the blocker is durable
123
+ 2. update the spec-linked tech-debt file only when the blocker creates durable unresolved debt
103
124
  3. skip only tasks truly blocked by it
104
125
  4. finish all remaining reachable work
105
126
  5. report blocked tasks clearly at the end
@@ -154,6 +175,8 @@ Before reporting back:
154
175
  - ensure **Sanity checks** lists only commands actually run
155
176
  - ensure **Manual Review Checklist** has at least one concrete row, or one explicit non-applicability row
156
177
  - ensure **Remaining work** matches any unmet or blocked criteria
178
+ - ensure no in-goal debt remains as TODO, follow-up cleanup, or vague later-work text
179
+ - ensure every tech-debt ledger entry has exact blocker/decision/owner/next action
157
180
  - set `SPEC.md` frontmatter `status: implemented`
158
181
  - set `PLAN.md` `**Status:** Complete` when that line exists
159
182
 
@@ -32,7 +32,9 @@ Each worker brief should require:
32
32
  7. not weakening or removing tests unless requirements changed
33
33
  8. implementing only the assigned task scope and satisfying all acceptance criteria
34
34
  9. running the exact task validation evidence before returning, plus extra plan validation when feasible
35
- 10. updating the plan entry with status, log, touched files, and gotchas before handoff closes
35
+ 10. resolving any in-goal debt immediately instead of leaving TODOs, temporary workarounds, or "later" notes
36
+ 11. stopping for parent clarification when a debt item requires a product/scope decision outside the assigned task
37
+ 12. updating the plan entry with status, log, touched files, and gotchas before handoff closes
36
38
 
37
39
  ## Worker output contract
38
40
 
@@ -44,7 +46,7 @@ Require the worker to return:
44
46
  - verification evidence: RED -> GREEN for testable tasks, or the exact non-testable alternative that was run
45
47
  - validation evidence performed
46
48
  - validation intentionally deferred
47
- - anything deferred, blocked, or risky
49
+ - anything blocked or risky, with exact reason and required decision
48
50
 
49
51
  ## Scope rule
50
52
 
@@ -1,13 +1,13 @@
1
1
  # Parallel Execution
2
2
 
3
- Use this approach when execution should fan out across independent tasks or waves.
3
+ Use this approach only when execution should fan out across independent tasks or waves.
4
4
 
5
5
  When `implement-spec` chooses `parallel` mode, this reference is the full contract for parallel execution.
6
6
 
7
7
  ## Parallel contract
8
8
 
9
9
  - **Mode:** `parallel`
10
- - **Worker policy:** spawn workers only for currently unblocked work
10
+ - **Worker policy:** spawn multiple workers only for currently unblocked independent work
11
11
  - **Execution board:** completed, in progress, unblocked next, blocked, current wave
12
12
 
13
13
  ## Adoption rule
@@ -24,7 +24,7 @@ That includes:
24
24
  6. updating plan logs and execution notes
25
25
  7. repeating until all reachable tasks are complete or a real blocker remains
26
26
 
27
- Do not treat worker spawning as the whole job. The orchestration loop is part of this mode.
27
+ Do not treat worker spawning as the whole job. Parallel mode adds multi-worker wave orchestration on top of the default parent validation responsibilities.
28
28
 
29
29
  ## Quick start
30
30
 
@@ -1,28 +1,38 @@
1
1
  # Sequential Execution
2
2
 
3
- Use this approach when execution should stay in one thread without worker fan-out.
3
+ Use this approach when execution should stay serial while avoiding main-context implementation churn.
4
4
 
5
5
  ## Sequential contract
6
6
 
7
7
  - **Mode:** `sequential`
8
- - **Worker policy:** do not spawn workers
8
+ - **Worker policy:** spawn exactly one implementation worker
9
9
  - **Execution board:** completed, in progress, next, blocked
10
10
 
11
11
  ## Quick start
12
12
 
13
13
  1. Load the shared lifecycle from `lifecycle.md`.
14
14
  2. Record `sequential` under **Execution mode** in `IMPLEMENTATION-NOTES.md`.
15
- 3. Execute one task at a time in dependency order.
16
- 4. After every task, run the task-level validation gate before marking it done.
17
- 5. Update plan status, logs, touched files, notes, and tech debt immediately.
15
+ 3. Read `.agents/subagents/manifest.mjs` when present and choose the best specialist for the whole sequential implementation.
16
+ 4. Spawn one worker with the full spec folder, plan, lifecycle rules, required skills, task order, and update obligations.
17
+ 5. Require the worker to execute one task at a time in dependency order.
18
+ 6. After worker handoff, review the diff, plan updates, notes, and validation evidence before finalization.
19
+ 7. Run any parent-level acceptance or smoke checks needed to trust the worker output.
18
20
 
19
21
  ## Task loop
20
22
 
21
- For every task:
23
+ The worker owns this loop for every task:
22
24
 
23
25
  1. start from `tdd_target`
24
26
  2. validate through the task's public interface
25
27
  3. run the task-level validation gate before marking it done
26
28
  4. update the execution board before advancing
27
29
 
30
+ The parent owns:
31
+
32
+ - worker brief quality
33
+ - post-handoff review
34
+ - acceptance-criteria audit
35
+ - manual review checklist
36
+ - final spec-folder status
37
+
28
38
  Stop only when all reachable tasks are complete or a real blocker remains.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: stack
3
+ description: Use the local squash-safe `stack` CLI for stacked PR inspection, sync, merge, and undo workflows when backlog-dependent work is represented by open parent PRs.
4
+ ---
5
+
6
+ # Stack
7
+
8
+ Use the local `stack` CLI for squash-safe stacked PR workflows. It is for repos
9
+ where dependent PRs may be open at the same time and GitHub squash-merges parent
10
+ PRs.
11
+
12
+ Keep ordinary editing and commits on plain `git`. Use `stack` only for stack
13
+ intent, stack inspection, sync, merge, and undo workflows.
14
+
15
+ ## Mental Model
16
+
17
+ ```text
18
+ main
19
+ └─ parent-branch #101
20
+ └─ child-branch #102
21
+ ```
22
+
23
+ The GitHub PR base is the source of truth for ordinary stack inference. A child
24
+ PR should use its parent PR branch as its base. Independent PRs stay based on
25
+ trunk and do not need fake stack tracking.
26
+
27
+ ## Core Commands
28
+
29
+ - `stack status`: inspect the current tracked or inferred stack.
30
+ - `stack sync --dry-run`: required inspection gate before stack mutation.
31
+ - `stack sync`: approved mutation gate after the dry-run preview is correct.
32
+ - `stack merge --auto`: merge the current stack root with GitHub auto-merge,
33
+ wait for it to land, and repair descendants.
34
+ - `stack undo --apply`: restore the previous applied stack mutation when a
35
+ repair or merge needs to be rolled back.
36
+
37
+ ## Harness Workflow Rules
38
+
39
+ - Missing `stack` blocks stack-dependent workflows only. It does not block
40
+ independent trunk-based work.
41
+ - `create-spec` records stack intent through `Dependency Readiness` and
42
+ `Branch/Base Intent`; it does not mutate git state.
43
+ - `create-plan` preserves and validates those sections; it does not decide stack
44
+ topology.
45
+ - `implement-spec` executes recorded branch/base intent before coding and runs
46
+ stack sync only after PR base metadata exists.
47
+ - `delivery-phase` owns stack mutation and cleanliness.
48
+ - `review-phase` stays readonly and reports stack evidence.
49
+
50
+ ## Normal Stacked PR Flow
51
+
52
+ ```bash
53
+ git checkout -b team/name/child team/name/parent
54
+ # implement, commit, push
55
+ gh pr create --base team/name/parent --head team/name/child
56
+ stack sync --dry-run
57
+ stack sync
58
+ ```
59
+
60
+ Use `stack track <branch> --onto <parent>` only when GitHub PR bases cannot
61
+ encode the stack clearly. Prefer PR bases over hand-maintained metadata.
62
+
63
+ ## Delivery Closeout
64
+
65
+ When a PR exists, run:
66
+
67
+ ```bash
68
+ stack status
69
+ stack sync --dry-run
70
+ ```
71
+
72
+ If the PR is stack-dependent and the dry-run reports pending changes, run:
73
+
74
+ ```bash
75
+ stack sync
76
+ ```
77
+
78
+ Then rerun `stack status` if the final report needs evidence.
79
+
80
+ ## Recovery
81
+
82
+ For the most recent applied stack mutation:
83
+
84
+ ```bash
85
+ stack undo
86
+ stack undo --apply
87
+ ```
88
+
89
+ Run the dry-run form first unless the user explicitly asks for immediate restore.