bigpowers 2.1.3 → 2.3.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 (164) hide show
  1. package/.pi/package.json +16 -0
  2. package/.pi/prompts/assess-impact.md +76 -0
  3. package/.pi/prompts/audit-code.md +156 -0
  4. package/.pi/prompts/build-epic.md +44 -0
  5. package/.pi/prompts/change-request.md +105 -0
  6. package/.pi/prompts/commit-message.md +135 -0
  7. package/.pi/prompts/compose-workflow.md +40 -0
  8. package/.pi/prompts/craft-skill.md +150 -0
  9. package/.pi/prompts/deepen-architecture.md +235 -0
  10. package/.pi/prompts/define-language.md +79 -0
  11. package/.pi/prompts/define-success.md +62 -0
  12. package/.pi/prompts/delegate-task.md +76 -0
  13. package/.pi/prompts/design-interface.md +96 -0
  14. package/.pi/prompts/develop-tdd.md +375 -0
  15. package/.pi/prompts/diagnose-root.md +23 -0
  16. package/.pi/prompts/dispatch-agents.md +83 -0
  17. package/.pi/prompts/edit-document.md +22 -0
  18. package/.pi/prompts/elaborate-spec.md +81 -0
  19. package/.pi/prompts/enforce-first.md +77 -0
  20. package/.pi/prompts/evolve-skill.md +38 -0
  21. package/.pi/prompts/execute-plan.md +54 -0
  22. package/.pi/prompts/fix-bug.md +36 -0
  23. package/.pi/prompts/grill-me.md +95 -0
  24. package/.pi/prompts/grill-with-docs.md +37 -0
  25. package/.pi/prompts/guard-git.md +212 -0
  26. package/.pi/prompts/hook-commits.md +93 -0
  27. package/.pi/prompts/inspect-quality.md +105 -0
  28. package/.pi/prompts/investigate-bug.md +117 -0
  29. package/.pi/prompts/kickoff-branch.md +99 -0
  30. package/.pi/prompts/map-codebase.md +70 -0
  31. package/.pi/prompts/migrate-spec.md +482 -0
  32. package/.pi/prompts/model-domain.md +227 -0
  33. package/.pi/prompts/orchestrate-project.md +161 -0
  34. package/.pi/prompts/organize-workspace.md +159 -0
  35. package/.pi/prompts/plan-refactor.md +77 -0
  36. package/.pi/prompts/plan-release.md +145 -0
  37. package/.pi/prompts/plan-work.md +161 -0
  38. package/.pi/prompts/release-branch.md +158 -0
  39. package/.pi/prompts/request-review.md +70 -0
  40. package/.pi/prompts/research-first.md +62 -0
  41. package/.pi/prompts/reset-baseline.md +20 -0
  42. package/.pi/prompts/respond-review.md +70 -0
  43. package/.pi/prompts/run-evals.md +56 -0
  44. package/.pi/prompts/run-planning.md +26 -0
  45. package/.pi/prompts/scope-work.md +23 -0
  46. package/.pi/prompts/search-skills.md +21 -0
  47. package/.pi/prompts/seed-conventions.md +132 -0
  48. package/.pi/prompts/session-state.md +146 -0
  49. package/.pi/prompts/setup-environment.md +23 -0
  50. package/.pi/prompts/simulate-agents.md +25 -0
  51. package/.pi/prompts/slice-tasks.md +23 -0
  52. package/.pi/prompts/spike-prototype.md +94 -0
  53. package/.pi/prompts/stocktake-skills.md +40 -0
  54. package/.pi/prompts/survey-context.md +129 -0
  55. package/.pi/prompts/terse-mode.md +37 -0
  56. package/.pi/prompts/trace-requirement.md +68 -0
  57. package/.pi/prompts/using-bigpowers.md +105 -0
  58. package/.pi/prompts/validate-fix.md +98 -0
  59. package/.pi/prompts/verify-work.md +125 -0
  60. package/.pi/prompts/visual-dashboard.md +51 -0
  61. package/.pi/prompts/wire-observability.md +92 -0
  62. package/.pi/prompts/write-document.md +244 -0
  63. package/.pi/skills/assess-impact/SKILL.md +77 -0
  64. package/.pi/skills/audit-code/SKILL.md +157 -0
  65. package/.pi/skills/build-epic/SKILL.md +45 -0
  66. package/.pi/skills/change-request/SKILL.md +106 -0
  67. package/.pi/skills/commit-message/SKILL.md +136 -0
  68. package/.pi/skills/compose-workflow/SKILL.md +41 -0
  69. package/.pi/skills/craft-skill/SKILL.md +151 -0
  70. package/.pi/skills/deepen-architecture/SKILL.md +236 -0
  71. package/.pi/skills/define-language/SKILL.md +80 -0
  72. package/.pi/skills/define-success/SKILL.md +63 -0
  73. package/.pi/skills/delegate-task/SKILL.md +77 -0
  74. package/.pi/skills/design-interface/SKILL.md +97 -0
  75. package/.pi/skills/develop-tdd/SKILL.md +376 -0
  76. package/.pi/skills/diagnose-root/SKILL.md +24 -0
  77. package/.pi/skills/dispatch-agents/SKILL.md +84 -0
  78. package/.pi/skills/edit-document/SKILL.md +23 -0
  79. package/.pi/skills/elaborate-spec/SKILL.md +82 -0
  80. package/.pi/skills/enforce-first/SKILL.md +78 -0
  81. package/.pi/skills/evolve-skill/SKILL.md +39 -0
  82. package/.pi/skills/execute-plan/SKILL.md +55 -0
  83. package/.pi/skills/fix-bug/SKILL.md +37 -0
  84. package/.pi/skills/grill-me/SKILL.md +96 -0
  85. package/.pi/skills/grill-with-docs/SKILL.md +38 -0
  86. package/.pi/skills/guard-git/SKILL.md +213 -0
  87. package/.pi/skills/hook-commits/SKILL.md +94 -0
  88. package/.pi/skills/inspect-quality/SKILL.md +106 -0
  89. package/.pi/skills/investigate-bug/SKILL.md +118 -0
  90. package/.pi/skills/kickoff-branch/SKILL.md +100 -0
  91. package/.pi/skills/map-codebase/SKILL.md +71 -0
  92. package/.pi/skills/migrate-spec/SKILL.md +483 -0
  93. package/.pi/skills/model-domain/SKILL.md +228 -0
  94. package/.pi/skills/orchestrate-project/SKILL.md +162 -0
  95. package/.pi/skills/organize-workspace/SKILL.md +160 -0
  96. package/.pi/skills/plan-refactor/SKILL.md +78 -0
  97. package/.pi/skills/plan-release/SKILL.md +146 -0
  98. package/.pi/skills/plan-work/SKILL.md +162 -0
  99. package/.pi/skills/release-branch/SKILL.md +159 -0
  100. package/.pi/skills/request-review/SKILL.md +71 -0
  101. package/.pi/skills/research-first/SKILL.md +63 -0
  102. package/.pi/skills/reset-baseline/SKILL.md +21 -0
  103. package/.pi/skills/respond-review/SKILL.md +71 -0
  104. package/.pi/skills/run-evals/SKILL.md +57 -0
  105. package/.pi/skills/run-planning/SKILL.md +27 -0
  106. package/.pi/skills/scope-work/SKILL.md +24 -0
  107. package/.pi/skills/search-skills/SKILL.md +22 -0
  108. package/.pi/skills/seed-conventions/SKILL.md +133 -0
  109. package/.pi/skills/session-state/SKILL.md +147 -0
  110. package/.pi/skills/setup-environment/SKILL.md +24 -0
  111. package/.pi/skills/simulate-agents/SKILL.md +26 -0
  112. package/.pi/skills/slice-tasks/SKILL.md +24 -0
  113. package/.pi/skills/spike-prototype/SKILL.md +95 -0
  114. package/.pi/skills/stocktake-skills/SKILL.md +41 -0
  115. package/.pi/skills/survey-context/SKILL.md +130 -0
  116. package/.pi/skills/terse-mode/SKILL.md +38 -0
  117. package/.pi/skills/trace-requirement/SKILL.md +69 -0
  118. package/.pi/skills/using-bigpowers/SKILL.md +106 -0
  119. package/.pi/skills/validate-fix/SKILL.md +99 -0
  120. package/.pi/skills/verify-work/SKILL.md +126 -0
  121. package/.pi/skills/visual-dashboard/SKILL.md +52 -0
  122. package/.pi/skills/wire-observability/SKILL.md +93 -0
  123. package/.pi/skills/write-document/SKILL.md +245 -0
  124. package/CHANGELOG.md +14 -0
  125. package/CLAUDE.md +1 -1
  126. package/CONVENTIONS.md +16 -10
  127. package/README.md +30 -4
  128. package/build-epic/SKILL.md +1 -1
  129. package/deepen-architecture/SKILL.md +2 -0
  130. package/define-language/SKILL.md +2 -0
  131. package/develop-tdd/REFERENCE.md +61 -0
  132. package/develop-tdd/SKILL.md +19 -119
  133. package/diagnose-root/SKILL.md +2 -0
  134. package/edit-document/SKILL.md +2 -0
  135. package/fix-bug/SKILL.md +3 -1
  136. package/grill-me/SKILL.md +3 -1
  137. package/grill-with-docs/SKILL.md +3 -1
  138. package/investigate-bug/SKILL.md +5 -11
  139. package/map-codebase/SKILL.md +3 -1
  140. package/migrate-spec/REFERENCE-GSD.md +4 -4
  141. package/migrate-spec/REFERENCE.md +33 -6
  142. package/migrate-spec/SKILL.md +1 -14
  143. package/model-domain/SKILL.md +2 -0
  144. package/orchestrate-project/REFERENCE.md +1 -1
  145. package/package.json +3 -2
  146. package/plan-release/SKILL.md +1 -1
  147. package/plan-work/REFERENCE.md +104 -0
  148. package/plan-work/SKILL.md +17 -151
  149. package/release-branch/REFERENCE.md +55 -0
  150. package/release-branch/SKILL.md +19 -117
  151. package/request-review/SKILL.md +1 -1
  152. package/run-planning/SKILL.md +3 -2
  153. package/scope-work/SKILL.md +3 -1
  154. package/scripts/audit-compliance.sh +15 -3
  155. package/scripts/check-skill-size.sh +79 -0
  156. package/scripts/generate-reference-tables.sh +64 -0
  157. package/scripts/project-survey.sh +2 -2
  158. package/scripts/sync-skills.sh +51 -3
  159. package/scripts/validate-doctrine.sh +143 -0
  160. package/seed-conventions/REFERENCE.md +63 -0
  161. package/seed-conventions/SKILL.md +23 -177
  162. package/slice-tasks/SKILL.md +3 -1
  163. package/survey-context/SKILL.md +3 -1
  164. package/write-document/SKILL.md +4 -2
@@ -1,188 +1,54 @@
1
1
  ---
2
2
  name: plan-work
3
3
  model: opus
4
- description: Write detailed implementation tasks into the active epic capsule directory (specs/epics/eNN-slug/). Produces decoupled story .md specs (countable-story-format) and runnable -tasks.yaml files. Every task must include a runnable verify command. Use when user needs step-by-step plan with evidence, or after plan-release.
4
+ description: "PLANNING SPINE STEP 3 of 3 — Plan the work: write detailed implementation tasks into the active epic capsule (specs/epics/eNN-slug/). Produces countable-story-format .md specs and runnable -tasks.yaml files. Use after slice-tasks (step 2). Not a substitute for scope-work (step 1) or slice-tasks (step 2)."
5
5
  ---
6
6
 
7
7
  # Plan Work
8
8
 
9
+ > **Spine position:** Step 3 — scope-work → slice-tasks → plan-work.
10
+
9
11
  Produce a detailed, verifiable implementation plan in the **active epic capsule directory** (`specs/epics/eNN-slug/`). Output: a story spec `.md` file (countable-story-format) and a decoupled `eNNsYY-tasks.yaml` with runnable verify commands. "I think it works" is not a step.
10
12
 
11
13
  > **HARD GATE** — Do NOT proceed with a plan until the task's success criteria are clear. If success is ambiguous, run `define-success` first to convert the task into "step → verify: <cmd>" pairs.
12
14
  >
13
- > **RECURSIVE DISCIPLINE** — This lifecycle apply to EVERY task, including updating these skills. Never skip planning because a task is "meta" or "just documentation."
15
+ > **RECURSIVE DISCIPLINE** — This lifecycle applies to EVERY task, including updating these skills. Never skip planning because a task is "meta" or "just documentation."
14
16
 
15
17
  ## Pre-flight
16
18
 
17
- Before writing the plan, check if `define-success` has been run. If the task's success criteria are unclear, run `define-success` first to convert the task into "step → verify: <cmd>" pairs.
18
-
19
- Read any existing `specs/` files: `release-plan.yaml`, `product/SCOPE_LATEST.yaml`, active epic capsule `epics/<capsule_dir>/epic.yaml`, `tech-architecture/tech-stack.md`, `product/GLOSSARY_LATEST.yaml`.
19
+ Read: `release-plan.yaml`, `product/SCOPE_LATEST.yaml`, active `epics/<capsule>/epic.yaml`, `tech-architecture/tech-stack.md`, `product/GLOSSARY_LATEST.yaml`.
20
20
 
21
- > **ZOOM-OUT MANDATE** (v1.17.0 Guardrails) — If this plan modifies an existing module, function, or behavior:
22
- > 1. State the module's **purpose** — what is it responsible for?
23
- > 2. Name the **callers** — who depends on it?
24
- > 3. List the **contracts** — what invariants or interfaces must be preserved?
25
- >
26
- > If you cannot answer all three without deep code archaeology, the scope is misunderstood. Stop and clarify with the user before writing steps.
21
+ > **ZOOM-OUT MANDATE** (v1.17.0) — If modifying an existing module: (1) State the module's **purpose**. (2) Name its **callers**. (3) List its **contracts**. Cannot answer all three? Stop — scope is misunderstood.
27
22
 
28
- If this plan touches an existing module or symbol, run `assess-impact` first to understand the blast radius before writing steps.
23
+ If this plan touches an existing module, run `assess-impact` first to understand blast radius.
29
24
 
30
- > **DISCOVERY MANDATE** (v1.18.0 Guardrails) — For any step involving external API integration (e.g., macOS CGEventTap, AWS SDK, Third-party libraries):
31
- > 1. You MUST perform a `google_web_search` or `grep_search` of local documentation to verify the API signature and constraints.
32
- > 2. You MUST quote at least one technical detail (method name, parameter, or error case) from your discovery in the step's context.
33
- >
34
- > Plans that skip discovery for complex integrations are [SUS] and should be rejected.
25
+ > **DISCOVERY MANDATE** (v1.18.0) — For external API integration, verify the API signature via local docs or search and quote at least one technical detail in the step's context.
35
26
 
36
- > **MULTIPLE INTERPRETATIONS (HARD GATE)** — If the task statement admits ≥2 valid interpretations, you must list them and get a decision from the user before drafting any steps. Do not assume intent.
27
+ > **MULTIPLE INTERPRETATIONS (HARD GATE)** — If the task admits ≥2 valid interpretations, list them and get a user decision before drafting any steps.
37
28
 
38
- > **COMPLEXITY PUSHBACK (HARD GATE)** — Every step introducing a new abstraction (class, interface, helper, layer) MUST include a one-sentence "Reason for Depth": _"This abstraction is needed because [forcing function]..."_. If the sentence cannot be filled with a non-trivial reason, the abstraction is premature. Delete it and use inline code instead.
29
+ > **COMPLEXITY PUSHBACK (HARD GATE)** — Every new abstraction MUST include a one-sentence "Reason for Depth." If it can't be filled non-trivially, the abstraction is premature use inline code instead.
39
30
 
40
- > **SLOPCHECK (HARD GATE)** — For every external package proposed in the plan, run slopcheck (or manual registry check) and tag: `[OK]`, `[SUS]`, or `[SLOP]`. `[SUS]` and `[SLOP]` require explicit human approval before the step may execute. Document tags inline next to the package name.
31
+ > **SLOPCHECK (HARD GATE)** — For every external package, tag it `[OK]`, `[SUS]`, or `[SLOP]`. `[SUS]`/`[SLOP]` require human approval before execution.
41
32
 
42
33
  ## Invocation modes
43
34
 
44
35
  - Default: full plan with zoom-out mandate, impact assessment, slopcheck
45
- - --fast (formerly plan-work-fast): Skip zoom-out and impact assessment. Use for tasks under 3 BCPs with no module interface changes.
36
+ - `--fast`: Skip zoom-out and impact assessment. Use for tasks under 3 BCPs with no module interface changes.
46
37
 
47
38
  ## Process
48
39
 
49
- ### 1. Explore the codebase
50
-
51
- Use the Agent tool with subagent_type=Explore to understand:
52
- - Affected modules and their current interfaces
53
- - Existing test patterns to follow
54
- - Any similar features already implemented (prior art)
55
- - Dependencies that will be needed
56
-
57
- ### 2. Draft steps
58
-
59
- Break the implementation into the smallest possible steps where each step:
60
- - Leaves the codebase in a working state (tests pass)
61
- - Has exactly one observable outcome
62
- - Can be verified with a single runnable command
63
-
64
- **Red-flag check**: before moving to Step 3, name any rationalization you caught yourself making — skipping a gate, adding out-of-scope steps, omitting a verify command. Write them out; do not suppress them.
65
-
66
- ### 3. Write capsule story spec + tasks
67
-
68
- Output two files inside the active epic capsule directory:
69
-
70
- **Story spec:** `specs/epics/<capsule>/eNNsYY-<slug>.md` — populated [countable-story-format](file:///Users/danielvm/Developer/bigpowers/countable-story-format.md) with all 20 sections. Minimum maturity: 3 (Countable). Acceptance criteria in §17.
71
-
72
- **Task checklist:** `specs/epics/<capsule>/eNNsYY-tasks.yaml` — decoupled execution steps:
73
-
74
- ```yaml
75
- story_id: e01s01
76
- title: Login
77
- status: todo
78
- bcps: 3
79
- tasks:
80
- - id: 1
81
- description: "Add login form component tests"
82
- verify: "npm test -- login-form.test.tsx"
83
- status: todo
84
- ```
85
-
86
- Update `specs/epics/<capsule>/epic.yaml` manifest to list the story and its BCPs. Run `bash scripts/sync-status-from-epics.sh` after structural changes.
87
-
88
- <plan-template>
89
-
90
- ### Story [X.Y]: [title] — Implementation Steps
91
-
92
- **type:** feat | fix | refactor
93
- **context:** domain | infra
94
- **Context**: [One paragraph: what this story implements and why]
95
-
96
- ## Steps
97
-
98
- 1. [Step description] (ref: ADR-NNNN or commit SHA) → verify: `<runnable command>`
99
-
100
- 2. [Step description] (ref: ADR-NNNN or commit SHA) → verify: `<runnable command>`
101
-
102
- 3. [Step description] (ref: ADR-NNNN or commit SHA) → verify: `<runnable command>`
103
-
104
- ...
105
-
106
- ## Verification Script (Step-by-Step)
40
+ 1. **Explore** Use `Explore` subagent to understand affected modules, existing test patterns, similar prior art, and dependencies.
107
41
 
108
- [A human-readable, step-by-step script for the user to verify the story's outcome. Focus on user-observable behavior.]
42
+ 2. **Draft steps** Break implementation into the smallest possible steps where each step leaves the codebase working, has one observable outcome, and can be verified with a single command. Red-flag check: name any rationalization you caught before moving to step 3.
109
43
 
110
- 1. [Action 1: e.g. Start the server]
111
- 2. [Action 2: e.g. Open browser to http://localhost:3000]
112
- 3. [Action 3: e.g. Click 'Login']
113
- 4. [Observation: e.g. Verify that the login modal appears]
44
+ 3. **Write capsule story spec + tasks** — Output two files inside the active epic capsule. See [REFERENCE.md](REFERENCE.md) for file formats and the plan-template.
114
45
 
115
- ## Out of scope
46
+ 4. **Verify step format** — Every step MUST follow: `N. <What to do> → verify: <runnable command>`. See [REFERENCE.md](REFERENCE.md) for good/bad examples.
116
47
 
117
- - [Explicit exclusions]
118
-
119
- ## Risks
120
-
121
- - [Anything that could go wrong and how to detect it early]
122
-
123
- </plan-template>
124
-
125
- ### 4. Verify step format rules
126
-
127
- Every step MUST follow this exact format:
128
- ```
129
- N. <What to do> → verify: <runnable command that proves it worked>
130
- ```
131
-
132
- Good examples:
133
- ```
134
- 1. Add User model with email and name fields → verify: npm test -- user.test.ts
135
- 2. Add POST /users endpoint → verify: curl -s -X POST http://localhost:3000/users -d '{"email":"a@b.com"}' | jq .id
136
- 3. Add email uniqueness constraint → verify: npm test -- user-uniqueness.test.ts
137
- ```
138
-
139
- Bad examples (no verify command):
140
- ```
141
- 1. Implement the user creation flow
142
- 2. Write tests for the API
143
- ```
144
-
145
- ### 5. Review with user
146
-
147
- Before finalizing, confirm:
148
- - Does the step order make sense?
149
- - Is the granularity right (not too coarse, not too fine)?
150
- - Are the verify commands actually runnable in this project?
48
+ 5. **Review with user** — Confirm step order, granularity, and that verify commands are runnable in this project.
151
49
 
152
50
  After writing capsule tasks, suggest `kickoff-branch` (if not already on a feature branch) then `build-epic`, `execute-plan`, or `develop-tdd`.
153
51
 
154
- ## Sub-operations
155
-
156
- ### Define Success (absorbed)
157
-
158
- Before planning, convert task statements into observable "step → verify: <cmd>" pairs:
159
-
160
- - Break the task into observable outcomes (behaviors) rather than implementation steps
161
- - Write pairs in the format: [What must be true] → verify: <runnable command>
162
- - Challenge completeness: are there any required behaviors not covered?
163
- - Get user confirmation: "Does this capture everything the task requires?"
164
- - Once confirmed, these pairs become the skeleton for plan-work steps
165
-
166
- ### Zoom-Out Check (absorbed)
167
-
168
- When modifying an existing module, confirm scope is understood:
169
-
170
- - State the module's **purpose** — what is it responsible for?
171
- - Name the **callers** — who depends on it?
172
- - List the **contracts** — what invariants or interfaces must be preserved?
173
-
174
- If you cannot answer all three without deep code archaeology, scope is misunderstood. Clarify with the user before writing steps.
175
-
176
- ### Slopcheck (absorbed)
177
-
178
- For every external package proposed in the plan, tag each with one of:
179
-
180
- - `[OK]` — package is mature, actively maintained, appropriate scope
181
- - `[SUS]` — package is suspiciously broad, has maintenance concerns, or unclear fit
182
- - `[SLOP]` — package is unmaintained, has known security issues, or out of scope
183
-
184
- `[SUS]` and `[SLOP]` require explicit human approval before the step may execute. Document tags inline next to the package name.
185
-
186
52
  ## Handoff
187
53
 
188
54
  Gate: READY -> next: kickoff-branch
@@ -0,0 +1,55 @@
1
+ # Release Branch — Reference
2
+
3
+ ## PR body template (team-pr mode)
4
+
5
+ ```bash
6
+ PR_TITLE="<type>(<scope>): <description>"
7
+ echo "$PR_TITLE" | grep -vE "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+$" && echo "❌ ERROR: PR Title must follow Conventional Commits"
8
+
9
+ gh pr create \
10
+ --title "$PR_TITLE" \
11
+ --body "$(cat <<'EOF'
12
+ ## Summary
13
+ - [What this PR does]
14
+ - [Key decisions made]
15
+
16
+ ## Verify
17
+ - [ ] All tests pass
18
+ - [ ] Coverage gates met (≥80% overall, ≥95% business logic)
19
+ - [ ] CONVENTIONS.md compliance verified
20
+ - [ ] PR Title follows Conventional Commits (for automated release)
21
+
22
+ ## specs/ artifacts
23
+ - [List any specs/ files produced or updated]
24
+ EOF
25
+ )"
26
+ ```
27
+
28
+ ## Worktree cleanup details
29
+
30
+ ```bash
31
+ # From the main repo root
32
+ git worktree prune
33
+ git worktree remove ../<branch-name> 2>/dev/null || true
34
+ git branch -d <branch-name>
35
+ ```
36
+
37
+ If `git worktree remove` fails due to uncommitted changes, ask: "There are uncommitted changes in the worktree. Force remove? (y/n)". If yes: `git worktree remove -f ../<branch-name>`.
38
+
39
+ ## Cycle-time recording
40
+
41
+ After landing the branch, record delivery metrics for this story:
42
+
43
+ 1. Write `metrics.story_end` (ISO 8601) to `specs/state.yaml`
44
+ 2. Compute `cycle_minutes`: `story_end` minus `story_start` in minutes
45
+ 3. Compute `bcp_per_hour`: `epic_cycle.story_bcps / (cycle_minutes / 60)`
46
+ 4. Append a row to `specs/metrics/cycle-times.yaml`:
47
+
48
+ ```yaml
49
+ - id: e01s01
50
+ bcps: 3
51
+ start: "2026-06-10T09:45:00Z"
52
+ end: "2026-06-10T11:15:00Z"
53
+ cycle_minutes: 90
54
+ bcp_per_hour: 2.0
55
+ ```
@@ -12,16 +12,16 @@ Finalize a completed feature branch: verify coverage gates, integrate onto `main
12
12
 
13
13
  ## Additional modes
14
14
 
15
- - --hotfix: Emergency fix. Cherry-pick to main plus immediate tag. Skip PR in solo profile.
15
+ - `--hotfix`: Emergency fix. Cherry-pick to main plus immediate tag. Skip PR in solo profile.
16
16
 
17
17
  ## Integrate mode
18
18
 
19
- Choose mode from project profile or explicit user request:
19
+ Read `specs/state.yaml` key `workflow_mode` first (`team-pr` | `solo-git`). Fall back to sniffing `profiles/solo-git.md` only when the key is absent.
20
20
 
21
21
  | Mode | When | Ship path |
22
22
  |------|------|-----------|
23
- | **solo-local** | `profiles/solo-git.md` or `specs/WORKFLOW-solo-git.md` active | `bash scripts/land-branch.sh <branch> "<conventional message>"` — no PR |
24
- | **team-pr** | Default, or collaboration / remote CI required | `gh pr create` → `gh pr merge --squash` (§6–7) |
23
+ | **solo-local** | `workflow_mode: solo-git` (or `profiles/solo-git.md` present as fallback) | `bash scripts/land-branch.sh <branch> "<conventional message>"` |
24
+ | **team-pr** | `workflow_mode: team-pr` (default) | `gh pr create` → `gh pr merge --squash` |
25
25
 
26
26
  If unsure and working alone, prefer **solo-local**.
27
27
 
@@ -29,168 +29,70 @@ If unsure and working alone, prefer **solo-local**.
29
29
 
30
30
  ### 1. Final verification
31
31
 
32
- Run the full suite one last time on the feature branch:
33
-
34
32
  ```bash
35
- <full test command>
36
- <typecheck command>
37
- <lint command>
38
- # Verify Conventional Commits history
39
- git log main...HEAD --oneline | grep -vE "^[a-f0-9]+ (feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+$" && echo "❌ ERROR: Non-conventional commits found" || echo "✅ Commits verified"
33
+ <full test command> && <typecheck command> && <lint command>
34
+ git log main...HEAD --oneline | grep -vE "^[a-f0-9]+ (feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+$" && echo "❌ Non-conventional commits found" || echo "✅ Commits verified"
40
35
  ```
41
36
 
42
- - [ ] All tests pass
43
- - [ ] No type errors
44
- - [ ] No lint violations
45
- - [ ] All commits in branch history follow Conventional Commits 1.0.0
37
+ - [ ] All tests pass, no type errors, no lint violations, all commits follow Conventional Commits
46
38
 
47
39
  ### 2. Coverage check
48
40
 
49
- Verify coverage meets the project gates:
50
-
51
- - [ ] Overall coverage ≥ 80%
52
- - [ ] Business logic / domain layer coverage ≥ 95%
53
-
54
- If coverage is below the gate, stop and return to `develop-tdd` to add missing tests.
41
+ - [ ] Overall coverage 80%; business logic coverage ≥ 95%
55
42
 
56
43
  ### 3. Diff review
57
44
 
58
- ```bash
59
- git diff main...HEAD --stat
60
- git log main...HEAD --oneline
61
- ```
62
-
63
- Confirm:
64
- - [ ] All commits are intentional — no debug commits, no "WIP" commits
65
- - [ ] No secrets, credentials, or personal data in the diff
66
- - [ ] CONVENTIONS.md compliance across all changes
45
+ - [ ] All commits intentional, no secrets, CONVENTIONS.md compliance
67
46
 
68
47
  ### 4. Decision
69
48
 
70
- Present the user with the options:
71
-
72
- | Option | When to choose |
73
- |--------|---------------|
74
- | **Release (solo-local)** | Feature complete; solo profile active — land via script |
75
- | **Open PR for Release** | Feature complete; team-pr mode or remote CI gate needed |
76
- | **Keep branch** | More work needed; preserve for later |
77
- | **Discard** | Approach was wrong; start over |
49
+ Options: **Release (solo-local)** / **Open PR** / **Keep branch** / **Discard**
78
50
 
79
51
  ### 5. Solo-local integrate
80
52
 
81
- From the **primary** repository root (not the feature worktree):
82
-
83
- 1. Run `commit-message` to produce the squash commit subject.
84
- 2. Land:
85
-
53
+ Run `commit-message` to produce the squash commit subject, then:
86
54
  ```bash
87
55
  bash scripts/land-branch.sh <task-slug> "feat(scope): description"
88
56
  ```
89
57
 
90
- The script will: update `main`, squash-merge, commit, push, remove worktree, delete branch, and leave you on `main`.
91
-
92
- Skip duplicate cleanup in §8 if the script succeeded.
93
-
94
58
  ### 6. Create PR (team-pr only)
95
59
 
96
- The PR title is the **single source of truth** for the version bump. It MUST follow Conventional Commits.
97
-
98
- ```bash
99
- PR_TITLE="<type>(<scope>): <description>"
100
- echo "$PR_TITLE" | grep -vE "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+$" && echo "❌ ERROR: PR Title must follow Conventional Commits"
101
-
102
- gh pr create \
103
- --title "$PR_TITLE" \
104
- --body "$(cat <<'EOF'
105
- ## Summary
106
- - [What this PR does]
107
- - [Key decisions made]
108
-
109
- ## Verify
110
- - [ ] All tests pass
111
- - [ ] Coverage gates met (≥80% overall, ≥95% business logic)
112
- - [ ] CONVENTIONS.md compliance verified
113
- - [ ] PR Title follows Conventional Commits (for automated release)
114
-
115
- ## specs/ artifacts
116
- - [List any specs/ files produced or updated]
117
- EOF
118
- )"
119
- ```
60
+ See [REFERENCE.md](REFERENCE.md) for the full PR body template and gh commands.
120
61
 
121
62
  ### 7. Merge (team-pr only)
122
63
 
123
- Wait for CI to pass. Merge using **Squash and Merge** so the PR title becomes the commit message on `main`.
124
-
125
64
  ```bash
126
65
  gh pr merge --squash --delete-branch
127
66
  ```
128
67
 
129
- `semantic-release` will automatically:
130
- 1. Detect the commit on `main`.
131
- 2. Determine the SemVer bump from the commit type.
132
- 3. Tag the repo (e.g., `v2.1.0`).
133
- 4. Generate release notes.
68
+ `semantic-release` auto-detects the commit, bumps SemVer, tags the repo, generates release notes.
134
69
 
135
70
  ### 7a. Archive completed epic capsule
136
71
 
137
- > **HARD GATE** — When an epic's stories are all complete (all marked `done` in `execution-status.yaml`), move the epic capsule directory to the archive.
72
+ > **HARD GATE** — When all epic stories are done (all `done` in `execution-status.yaml`), archive the capsule:
138
73
 
139
74
  ```bash
140
- EPIC_CAPSULE="specs/epics/eNN-slug"
141
- if [ -d "$EPIC_CAPSULE" ]; then
142
- mkdir -p specs/epics/archive
143
- mv "$EPIC_CAPSULE" "specs/epics/archive/"
144
- echo "Archived: $EPIC_CAPSULE → specs/epics/archive/"
145
- fi
75
+ mv specs/epics/eNN-slug specs/epics/archive/
146
76
  ```
147
77
 
148
- **Rationale:** Archiving completed epics removes inactive context from the agent workspace, preserving token budget (C2/C6). The capsule directory (epic.yaml + stories + tasks + epic-local ADRs) moves as a unit — nothing is orphaned.
149
-
150
- ### 8. Clean up worktree (if not done by land-branch.sh)
78
+ ### 8. Clean up worktree
151
79
 
152
80
  ```bash
153
- # From the main repo root
154
81
  git worktree prune
155
82
  git worktree remove ../<branch-name> 2>/dev/null || true
156
83
  git branch -d <branch-name>
157
84
  ```
158
85
 
159
- - If `git worktree remove` fails due to uncommitted changes, ask the user: "There are uncommitted changes in the worktree. Force remove? (y/n)". If yes: `git worktree remove -f ../<branch-name>`.
160
- - If the directory `../<branch-name>` is already missing, `git worktree remove` might fail; the `|| true` ensures the process continues to branch deletion.
161
-
162
86
  ### 8a. Cycle-time recording
163
87
 
164
- After landing the branch, record delivery metrics for this story:
165
-
166
- 1. Write `metrics.story_end` with the current ISO 8601 timestamp to `specs/state.yaml`
167
- 2. Compute `cycle_minutes`: `story_end` minus `story_start` in minutes
168
- 3. Compute `bcp_per_hour`: `epic_cycle.story_bcps` divided by `(cycle_minutes / 60)`
169
- 4. Append a row to `specs/metrics/cycle-times.yaml` with fields: `id`, `bcps`, `start`, `end`, `cycle_minutes`, `bcp_per_hour`
170
-
171
- Example row:
172
- ```yaml
173
- - id: e01s01
174
- bcps: 3
175
- start: "2026-06-10T09:45:00Z"
176
- end: "2026-06-10T11:15:00Z"
177
- cycle_minutes: 90
178
- bcp_per_hour: 2.0
179
- ```
88
+ After landing, record delivery metrics. See [REFERENCE.md](REFERENCE.md) for fields and example row.
180
89
 
181
- ### 9. Return to main (primary worktree)
90
+ ### 9. Return to main
182
91
 
183
92
  ```bash
184
- cd <primary-repo-root>
185
- git checkout main # or master
186
- git status
187
- pwd
93
+ git checkout main && git status && pwd
188
94
  ```
189
95
 
190
- Confirm:
191
- - [ ] Current branch is `main` (or project default)
192
- - [ ] cwd is the primary repository root, not `../<task-slug>`
193
-
194
96
  Report: "Branch released. Integrate mode: <solo-local|team-pr>. cwd: $(pwd) on $(git branch --show-current)."
195
97
 
196
98
  ## Handoff
@@ -62,7 +62,7 @@ When the reviewer returns:
62
62
  - Compute the quality score: `100 × (total_items − must_fix − should_fix) / total_items`
63
63
  - Report the score to the user
64
64
 
65
- > **HARD GATE** — If score < 94%, do NOT merge. Run `respond-review` to resolve must-fix and should-fix findings first.
65
+ > **HARD GATE** — If score < 94%, do NOT merge. Run `respond-review` to resolve must-fix and should-fix findings first. The 94% threshold also applies to the compliance SCORE computed by `npm run compliance` (scripts/audit-compliance.sh): SCORE = passing Gherkin scenarios / total × 100.
66
66
 
67
67
  ### 4. Hand off to respond-review
68
68
 
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  name: run-planning
3
3
  model: sonnet
4
- description: Advance discover-phase workflows and update specs/planning-status.yaml. Use for survey, scope, research, plan-release chain without touching build epics.
4
+ description: "DISCOVER-PHASE ADVANCER — Drive the discover-phase checklist (specs/planning-status.yaml) through survey-context scope-work research-first → elaborate-spec → plan-release slice-tasks. NOT a duplicate of plan-work or the planning spine; it orchestrates the pre-coding discover phase only."
5
5
  ---
6
6
 
7
7
  # Run Planning
8
- > **HARD GATE** — **HARD GATE** — Before running planning skills, confirm the epic capsule exists and the active story is clear. Planning without a target is noise.
8
+ > **HARD GATE** — Before running planning skills, confirm the epic capsule exists and the active story is clear. Planning without a target is noise.
9
9
 
10
+ > **Role:** DISCOVER-PHASE ADVANCER — orchestrates the discover-phase sequence; hands off to the scope-work → slice-tasks → plan-work spine for implementation planning.
10
11
 
11
12
  Updates `specs/planning-status.yaml` as discover-phase skills complete.
12
13
 
@@ -1,11 +1,13 @@
1
1
  ---
2
2
  name: scope-work
3
- description: Define what is in and out of scope for the current effort and save as specs/product/SCOPE_LATEST.yaml. Use when user wants a PRD, scope definition, or before plan-release on a new initiative.
3
+ description: "PLANNING SPINE STEP 1 of 3 — Scope the work: define what is in and out of scope and save as specs/product/SCOPE_LATEST.yaml. Use before slice-tasks or plan-release on any new initiative. Not a substitute for slice-tasks (step 2) or plan-work (step 3)."
4
4
  model: sonnet
5
5
  ---
6
6
 
7
7
  # Scope Work
8
8
 
9
+ > **Spine position:** Step 1 — scope-work → slice-tasks → plan-work.
10
+
9
11
  Turn the current conversation into a bounded PRD at `specs/product/SCOPE_LATEST.yaml`.
10
12
 
11
13
  ## Process
@@ -157,7 +157,7 @@ process_step() {
157
157
 
158
158
  local sanitized_step
159
159
  sanitized_step=$(echo "$step" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
160
- local step_script="specs/audit/steps/${sanitized_step}.sh"
160
+ local step_script="specs/verifications/steps/${sanitized_step}.sh"
161
161
 
162
162
  if [[ -f "$step_script" ]]; then
163
163
  echo " [EXEC] Gathering evidence: $step_script"
@@ -182,8 +182,8 @@ run_audit_file() {
182
182
  echo "------------------------------------------------------------"
183
183
  echo "FEATURE: $FEATURE_FILE"
184
184
 
185
- local REPORT_FILE="specs/audit/reports/audit-$(basename "$FEATURE_FILE" .feature)-$(date +%Y%m%d-%H%M%S).md"
186
- mkdir -p specs/audit/reports
185
+ local REPORT_FILE="specs/verifications/reports/audit-$(basename "$FEATURE_FILE" .feature)-$(date +%Y%m%d-%H%M%S).md"
186
+ mkdir -p specs/verifications/reports
187
187
 
188
188
  echo "# Audit Report: $FEATURE_FILE" > "$REPORT_FILE"
189
189
  echo "Date: $(date)" >> "$REPORT_FILE"
@@ -249,6 +249,18 @@ echo "============================================================"
249
249
  echo "Global Audit Summary:"
250
250
  echo " TOTAL PASS: $TOTAL_GLOBAL_PASS"
251
251
  echo " TOTAL FAIL: $TOTAL_GLOBAL_FAIL"
252
+ TOTAL_GLOBAL_ALL=$((TOTAL_GLOBAL_PASS + TOTAL_GLOBAL_FAIL))
253
+ if [[ $TOTAL_GLOBAL_ALL -gt 0 ]]; then
254
+ SCORE=$(awk "BEGIN { printf \"%d\", $TOTAL_GLOBAL_PASS * 100 / $TOTAL_GLOBAL_ALL }")
255
+ else
256
+ SCORE=0
257
+ fi
258
+ echo " SCORE: ${SCORE}% (threshold 94%)"
259
+ if [[ $SCORE -ge 94 ]]; then
260
+ echo " GATE: PASS"
261
+ else
262
+ echo " GATE: FAIL (below 94%)"
263
+ fi
252
264
  echo "============================================================"
253
265
 
254
266
  if [[ $TOTAL_GLOBAL_FAIL -gt 0 ]]; then
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env bash
2
+ # Skill size guard — enforces tiered line caps on every */SKILL.md file.
3
+ # Run after any SKILL.md edits to validate size compliance.
4
+ # Critical-path skills: 150 lines max. All others: 120 lines max.
5
+ set -euo pipefail
6
+
7
+ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
8
+ cd "$REPO_ROOT"
9
+
10
+ ERRORS=0
11
+
12
+ report_oversize() {
13
+ echo "FAIL: $*" >&2
14
+ ERRORS=$((ERRORS + 1))
15
+ }
16
+
17
+ # Critical-path skills with 150-line cap
18
+ CRITICAL_PATH=(
19
+ "survey-context"
20
+ "run-planning"
21
+ "scope-work"
22
+ "slice-tasks"
23
+ "plan-work"
24
+ "plan-release"
25
+ "define-success"
26
+ "kickoff-branch"
27
+ "develop-tdd"
28
+ "execute-plan"
29
+ "build-epic"
30
+ "verify-work"
31
+ "audit-code"
32
+ "request-review"
33
+ "release-branch"
34
+ "orchestrate-project"
35
+ "investigate-bug"
36
+ "diagnose-root"
37
+ "fix-bug"
38
+ "session-state"
39
+ "seed-conventions"
40
+ "migrate-spec"
41
+ "elaborate-spec"
42
+ "grill-me"
43
+ "grill-with-docs"
44
+ )
45
+
46
+ # Check all */SKILL.md files
47
+ for skill_file in */SKILL.md; do
48
+ skill_name="${skill_file%/SKILL.md}"
49
+ line_count=$(wc -l < "$skill_file")
50
+
51
+ # Determine cap based on critical-path membership
52
+ is_critical=0
53
+ for critical in "${CRITICAL_PATH[@]}"; do
54
+ if [[ "$skill_name" == "$critical" ]]; then
55
+ is_critical=1
56
+ break
57
+ fi
58
+ done
59
+
60
+ if [[ $is_critical -eq 1 ]]; then
61
+ CAP=150
62
+ else
63
+ CAP=120
64
+ fi
65
+
66
+ if [[ $line_count -gt $CAP ]]; then
67
+ report_oversize "$skill_name/SKILL.md is $line_count lines (cap $CAP)"
68
+ fi
69
+ done
70
+
71
+ # Summary
72
+ echo "---"
73
+ if [[ "$ERRORS" -eq 0 ]]; then
74
+ echo "check-skill-size: ALL within cap"
75
+ exit 0
76
+ else
77
+ echo "check-skill-size: $ERRORS file(s) over cap" >&2
78
+ exit 1
79
+ fi