bigpowers 1.5.1 → 2.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 (42) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/SKILL-INDEX.md +2 -2
  3. package/assess-impact/SKILL.md +2 -2
  4. package/build-epic/SKILL.md +5 -5
  5. package/change-request/SKILL.md +4 -4
  6. package/dashboard/src/loaders/reader.js +2 -1
  7. package/dashboard/src/tui/filesystem.js +4 -5
  8. package/dashboard/src/tui/index.js +2 -2
  9. package/dashboard/src/tui/ledger.js +3 -5
  10. package/dashboard/src/tui/state-yaml.js +5 -7
  11. package/deepen-architecture/SKILL.md +6 -6
  12. package/define-success/SKILL.md +1 -1
  13. package/develop-tdd/SKILL.md +3 -3
  14. package/elaborate-spec/SKILL.md +7 -7
  15. package/execute-plan/SKILL.md +4 -4
  16. package/investigate-bug/SKILL.md +1 -1
  17. package/kickoff-branch/SKILL.md +1 -1
  18. package/map-codebase/SKILL.md +4 -4
  19. package/migrate-spec/SKILL.md +8 -8
  20. package/model-domain/SKILL.md +8 -8
  21. package/orchestrate-project/SKILL.md +2 -2
  22. package/package.json +1 -1
  23. package/plan-release/SKILL.md +73 -27
  24. package/plan-work/SKILL.md +23 -7
  25. package/release-branch/SKILL.md +15 -0
  26. package/research-first/SKILL.md +2 -2
  27. package/run-evals/SKILL.md +2 -2
  28. package/run-planning/SKILL.md +1 -1
  29. package/scope-work/SKILL.md +4 -4
  30. package/scripts/land-branch.sh +28 -0
  31. package/seed-conventions/SKILL.md +37 -6
  32. package/session-state/SKILL.md +34 -3
  33. package/slice-tasks/SKILL.md +4 -4
  34. package/survey-context/SKILL.md +2 -2
  35. package/trace-requirement/SKILL.md +6 -6
  36. package/verify-work/SKILL.md +35 -2
  37. package/write-document/SKILL.md +1 -1
  38. package/dashboard/src/data/gate-status.js +0 -32
  39. package/dashboard/src/data/metrics.js +0 -89
  40. package/dashboard/src/data/pipeline-map.js +0 -32
  41. package/dashboard/src/data/reader.js +0 -122
  42. package/dashboard/src/data/watcher.js +0 -108
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  name: plan-release
3
3
  model: sonnet
4
- description: Convert elaborated specs into a structured release plan with Gherkin acceptance criteria and WSJF-sorted epics. Produces specs/release-plan.yaml and specs/epics/eNN-*.yaml. Use when a spec is clear and ready to plan, after elaborate-spec, or when the user wants a release plan broken into epics and stories.
4
+ description: Convert elaborated specs into a structured release plan with Gherkin acceptance criteria and WSJF-sorted epics. Produces specs/release-plan.yaml and epic capsule directories (specs/epics/eNN-slug/) with epic.yaml manifests, countable-story-format .md specs, and decoupled -tasks.yaml files. Use when a spec is clear and ready to plan, after elaborate-spec, or when the user wants a release plan broken into epics and stories.
5
5
  ---
6
6
 
7
7
  # Plan Release
8
8
 
9
9
  > **HARD GATE** — Do NOT run this skill unless `elaborate-spec` has produced a clear spec or the user has already defined the feature in detail. If the problem is still fuzzy, run `elaborate-spec` first.
10
10
 
11
- > **HARD GATE** — `specs/requirements/SCOPE_LATEST.yaml` (or legacy `specs/requirements/SCOPE_LATEST.yaml`) must exist. If missing, run `scope-work` first.
11
+ > **HARD GATE** — `specs/product/SCOPE_LATEST.yaml` (or legacy `specs/product/SCOPE_LATEST.yaml`) must exist. If missing, run `scope-work` first.
12
12
 
13
13
  Synthesize the conversation context into `specs/release-plan.yaml` (index) and shard detail under `specs/epics/`. No new interview — only clarify if something is genuinely ambiguous.
14
14
 
@@ -16,9 +16,27 @@ Synthesize the conversation context into `specs/release-plan.yaml` (index) and s
16
16
 
17
17
  | File | Content |
18
18
  |------|---------|
19
- | `specs/release-plan.yaml` | `release.version`, semver bump hint, WSJF-ordered epic list (`id: e01`, `file:`, `mode:`) — **no story status** |
20
- | `specs/epics/eNN-<slug>.yaml` | Epic metadata, `covers: [fr-x]`, stories with tasks and `verify:` |
21
- | `specs/execution-status.yaml` | Regenerate keys via `bash scripts/sync-status-from-epics.sh` after epics exist |
19
+ | `specs/release-plan.yaml` | `release.version`, semver bump hint, WSJF-ordered epic list with `id`, `capsule_dir`, `wsjf`, `bcps` — **no story status** |
20
+ | `specs/epics/eNN-<slug>/epic.yaml` | Epic manifest: `id`, `title`, `wsjf`, `total_bcps`, `status`, `stories[]` list |
21
+ | `specs/epics/eNN-<slug>/eNNsYY-<slug>.md` | Story spec in [countable-story-format.md](file:///Users/danielvm/Developer/bigpowers/countable-story-format.md) with 20 sections and Gherkin acceptance criteria |
22
+ | `specs/epics/eNN-<slug>/eNNsYY-tasks.yaml` | Decoupled task checklist with `verify:` commands per task |
23
+ | `specs/execution-status.yaml` | Flat key-value store for story status (`eNNsYY: todo`) |
24
+
25
+ ## Epic Capsule Structure
26
+
27
+ All epics use capsule directories (no flat/folder distinction):
28
+
29
+ ```
30
+ specs/epics/e01-auth-system/
31
+ ├── epic.yaml # Epic manifest
32
+ ├── adr/ # Epic-local ADRs (created lazily)
33
+ ├── e01s01-login.md # Story spec (countable-story-format)
34
+ ├── e01s01-tasks.yaml # Decoupled task checklist
35
+ ├── e01s02-jwt.md # Story spec
36
+ └── e01s02-tasks.yaml # Decoupled task checklist
37
+ ```
38
+
39
+ **Rationale:** Capsule dirs achieve change isolation (C9), enable archive pruning (C2/C6), and enforce SRP by decoupling spec `.md` from execution `-tasks.yaml` (C1). See `sdd-adequacy-ranking.md` for the full 10-criteria scoring.
22
40
 
23
41
  ## Process
24
42
 
@@ -49,51 +67,79 @@ release:
49
67
  bump_hint: minor # patch | minor | major — CI decides at merge
50
68
  epics:
51
69
  - id: e01
52
- title: Security
70
+ title: Auth System
53
71
  wsjf: 4.5
54
- file: epics/e01-security.yaml
55
- mode: flat # flat | folder (folder if >5 stories)
72
+ capsule_dir: epics/e01-auth-system
56
73
  - id: e02
57
- title: Verification
58
- wsjf: 4.3
59
- file: epics/e02-verification/epic.yaml
60
- mode: folder
74
+ title: User Profile
75
+ wsjf: 3.8
76
+ capsule_dir: epics/e02-user-profile
61
77
  ```
62
78
 
63
- ### 5. Save epic shards
79
+ ### 5. Save epic manifest (`epic.yaml`)
64
80
 
65
- **Flat** (`mode: flat`, ~5 stories):
81
+ Each epic capsule directory contains an `epic.yaml` manifest:
66
82
 
67
83
  ```yaml
68
84
  id: e01
69
- title: Security
85
+ title: Auth System
70
86
  wsjf: 4.5
71
- covers: [fr-08]
87
+ total_bcps: 8
88
+ status: in_progress
72
89
  stories:
73
90
  - id: e01s01
74
- title: Guard git hooks
75
- tasks:
76
- - desc: Block push on main
77
- verify: "grep -q guard-git .cursor/rules/guard-git.mdc"
91
+ title: Login
92
+ bcps: 3
93
+ status: todo
94
+ spec: e01s01-login.md
95
+ tasks: e01s01-tasks.yaml
96
+ - id: e01s02
97
+ title: JWT Token Management
98
+ bcps: 5
99
+ status: todo
100
+ spec: e01s02-jwt.md
101
+ tasks: e01s02-tasks.yaml
78
102
  ```
79
103
 
80
- **Folder GSD** (`mode: folder`): `epics/e02-verification/epic.yaml` + `stories/e02s01-*.md` with YAML frontmatter for tasks.
104
+ ### 6. Save story specs (countable-story-format .md)
81
105
 
82
- verify: `bash scripts/validate-specs-yaml.sh`
106
+ Each story becomes a standalone `.md` file following [countable-story-format.md](file:///Users/danielvm/Developer/bigpowers/countable-story-format.md). Minimum: maturity 3 (Countable) with all 20 sections present. Acceptance criteria in §17 use Gherkin scenarios.
83
107
 
84
- verify: `grep -c 'id: e' specs/release-plan.yaml`
108
+ ### 7. Save decoupled task files (`-tasks.yaml`)
109
+
110
+ Each story has a decoupled `-tasks.yaml` with implementation steps:
111
+
112
+ ```yaml
113
+ story_id: e01s01
114
+ title: Login
115
+ status: todo
116
+ bcps: 3
117
+ tasks:
118
+ - id: 1
119
+ description: "Add login form component tests"
120
+ verify: "npm test -- login-form.test.tsx"
121
+ status: todo
122
+ - id: 2
123
+ description: "Implement login form with validation"
124
+ verify: "npm test -- login-form.test.tsx"
125
+ status: todo
126
+ ```
127
+
128
+ > **HARD GATE** — Every task MUST have a runnable `verify:` command. No `verify:` = not a task.
129
+
130
+ → verify: `bash scripts/validate-specs-yaml.sh`
85
131
 
86
- ### 6. Sync execution status
132
+ ### 8. Sync execution status
87
133
 
88
134
  ```bash
89
135
  bash scripts/sync-status-from-epics.sh
90
136
  ```
91
137
 
92
- ### 7. Snapshot on planning close (optional)
138
+ ### 9. Snapshot on planning close (optional)
93
139
 
94
- Copy to `specs/requirements/snapshots/release-<version>/` when the user approves the plan.
140
+ Copy to `specs/product/snapshots/release-<version>/` when the user approves the plan.
95
141
 
96
- ### 8. Suggest next steps
142
+ ### 10. Suggest next steps
97
143
 
98
144
  - Run `assess-impact` before `plan-work` for any story touching existing modules.
99
145
  - Run `plan-work` per story for detailed steps inside the epic shard.
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: plan-work
3
3
  model: opus
4
- description: Write detailed implementation tasks into the active epic shard (specs/epics/eNN-*.yaml). Every task must include a runnable verify command. Use when user needs step-by-step plan with evidence, or after plan-release.
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.
5
5
  ---
6
6
 
7
7
  # Plan Work
8
8
 
9
- Produce a detailed, verifiable implementation plan in the **active epic shard** (`specs/epics/eNN-*.yaml` under the target story's `tasks[]`). Every step must be paired with a runnable verify command "I think it works" is not a step.
9
+ 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
10
 
11
11
  > **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
12
  >
@@ -16,7 +16,7 @@ Produce a detailed, verifiable implementation plan in the **active epic shard**
16
16
 
17
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
18
 
19
- Read any existing `specs/` files: `release-plan.yaml`, `requirements/SCOPE_LATEST.yaml`, active `epics/*.yaml`, `plans/TECH_STACK_LATEST.md`, `requirements/GLOSSARY_LATEST.yaml`.
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`.
20
20
 
21
21
  > **ZOOM-OUT MANDATE** (v1.17.0 Guardrails) — If this plan modifies an existing module, function, or behavior:
22
22
  > 1. State the module's **purpose** — what is it responsible for?
@@ -63,11 +63,27 @@ Break the implementation into the smallest possible steps where each step:
63
63
 
64
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
65
 
66
- ### 3. Write epic shard tasks
66
+ ### 3. Write capsule story spec + tasks
67
67
 
68
- Append tasks under the relevant story in `specs/epics/{epic-id}-*.yaml` (`tasks[]` with `desc` + `verify`). Update `specs/release-plan.yaml` if a new story is needed. Run `bash scripts/sync-status-from-epics.sh` after structural changes.
68
+ Output two files inside the active epic capsule directory:
69
69
 
70
- **BCP Accounting:** Each task line MUST be prefixed `[BCP N]` where N is its sequence number. After all tasks, write `bcps: <total>` to the epic shard YAML under the story's metadata.
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.
71
87
 
72
88
  <plan-template>
73
89
 
@@ -133,7 +149,7 @@ Before finalizing, confirm:
133
149
  - Is the granularity right (not too coarse, not too fine)?
134
150
  - Are the verify commands actually runnable in this project?
135
151
 
136
- After writing epic tasks, suggest `kickoff-branch` (if not already on a feature branch) then `build-epic`, `execute-plan`, or `develop-tdd`.
152
+ After writing capsule tasks, suggest `kickoff-branch` (if not already on a feature branch) then `build-epic`, `execute-plan`, or `develop-tdd`.
137
153
 
138
154
  ## Sub-operations
139
155
 
@@ -132,6 +132,21 @@ gh pr merge --squash --delete-branch
132
132
  3. Tag the repo (e.g., `v2.1.0`).
133
133
  4. Generate release notes.
134
134
 
135
+ ### 7a. Archive completed epic capsule
136
+
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.
138
+
139
+ ```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
146
+ ```
147
+
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
+
135
150
  ### 8. Clean up worktree (if not done by land-branch.sh)
136
151
 
137
152
  ```bash
@@ -10,7 +10,7 @@ model: sonnet
10
10
 
11
11
  ## Process
12
12
 
13
- 1. Read `specs/requirements/SCOPE_LATEST.yaml`, `specs/release-plan.yaml + epic shards`, and the current task statement.
13
+ 1. Read `specs/product/SCOPE_LATEST.yaml`, `specs/release-plan.yaml + epic shards`, and the current task statement.
14
14
  2. Search in order: this repo → bigpowers skills (`search-skills`) → package registries → web docs.
15
15
  3. For each candidate: note name, URL/path, fit (adopt | extend | compose | build).
16
16
  4. Append `## Prior Art` to `requirements/SCOPE_LATEST.yaml` notes or the active epic story.
@@ -26,6 +26,6 @@ model: sonnet
26
26
 
27
27
  ## Verify
28
28
 
29
- → verify: `grep -c "Prior Art" specs/requirements/SCOPE_LATEST.yaml specs/release-plan.yaml + epic shards 2>/dev/null | awk '{s+=$1} END {if(s>0) print "OK"; else print "MISSING"}'`
29
+ → verify: `grep -c "Prior Art" specs/product/SCOPE_LATEST.yaml specs/release-plan.yaml + epic shards 2>/dev/null | awk '{s+=$1} END {if(s>0) print "OK"; else print "MISSING"}'`
30
30
 
31
31
  See [REFERENCE.md](REFERENCE.md) for search commands and registry checklist.
@@ -20,8 +20,8 @@ model: sonnet
20
20
 
21
21
  ## Artefact
22
22
 
23
- `specs/EVALS-<feature>.md` — see [REFERENCE.md](REFERENCE.md) for template.
23
+ `specs/verifications/eNNsYY-eval-report.md` — see [REFERENCE.md](REFERENCE.md) for template. Eval reports are stored alongside verification evidence in `specs/verifications/`, keyed by story ID for traceability.
24
24
 
25
25
  ## Verify
26
26
 
27
- → verify: `ls specs/EVALS-*.md 2>/dev/null | head -1 | grep -q EVALS && echo OK || echo MISSING`
27
+ → verify: `find specs/verifications -name "*-eval-report.md" | wc -l | awk '{if($1>0) print "OK: "$1" eval reports"; else print "MISSING"}'`
@@ -5,7 +5,7 @@ description: Advance discover-phase workflows and update specs/planning-status.y
5
5
  ---
6
6
 
7
7
  # Run Planning
8
- > **HARD GATE** — **HARD GATE** — Before running planning skills, confirm the epic shard exists and the active story is clear. Planning without a target is noise.
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.
9
9
 
10
10
 
11
11
  Updates `specs/planning-status.yaml` as discover-phase skills complete.
@@ -1,22 +1,22 @@
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/requirements/SCOPE_LATEST.yaml. Use when user wants a PRD, scope definition, or before plan-release on a new initiative.
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.
4
4
  model: sonnet
5
5
  ---
6
6
 
7
7
  # Scope Work
8
8
 
9
- Turn the current conversation into a bounded PRD at `specs/requirements/SCOPE_LATEST.yaml`.
9
+ Turn the current conversation into a bounded PRD at `specs/product/SCOPE_LATEST.yaml`.
10
10
 
11
11
  ## Process
12
12
 
13
13
  1. Read existing `specs/` artifacts (`release-plan.yaml`, `plans/TECH_STACK_LATEST.md`, `requirements/VISION_LATEST.yaml` if any).
14
14
  2. Interview (if needed): goal, users, in-scope, out-of-scope, constraints, success metrics.
15
- 3. Write `specs/requirements/SCOPE_LATEST.yaml` with: `core_value`, `summary`, `in_scope[]`, `out_of_scope[]`, `constraints`, `success_criteria`, `references`.
15
+ 3. Write `specs/product/SCOPE_LATEST.yaml` with: `core_value`, `summary`, `in_scope[]`, `out_of_scope[]`, `constraints`, `success_criteria`, `references`.
16
16
  4. Run `research-first` if external dependencies are proposed.
17
17
 
18
18
  > **HARD GATE** — Every `in_scope` item must map to a future epic/story ID or explicit deferred note in `out_of_scope`.
19
19
 
20
20
  ## Verify
21
21
 
22
- → verify: `test -f specs/requirements/SCOPE_LATEST.yaml && grep -c 'out_of_scope' specs/requirements/SCOPE_LATEST.yaml | awk '{if($1>0) print "OK"; else print "MISSING"}'`
22
+ → verify: `test -f specs/product/SCOPE_LATEST.yaml && grep -c 'out_of_scope' specs/product/SCOPE_LATEST.yaml | awk '{if($1>0) print "OK"; else print "MISSING"}'`
@@ -143,6 +143,34 @@ if git remote get-url origin >/dev/null 2>&1; then
143
143
  git push origin "$DEFAULT_BRANCH"
144
144
  fi
145
145
 
146
+ # Epic capsule archival (evolved bigpowers v4.0.0+)
147
+ # Move completed epic capsules to archive when all stories are done
148
+ echo "==> Checking for completed epic capsules to archive..."
149
+ if [ -d specs/epics ] && [ -f specs/execution-status.yaml ]; then
150
+ for capsule in specs/epics/e[0-9]*-*/; do
151
+ [ -d "$capsule" ] || continue
152
+ capsule_name=$(basename "$capsule")
153
+ epic_id=$(echo "$capsule_name" | grep -o '^e[0-9]*' || true)
154
+ [ -n "$epic_id" ] || continue
155
+ # Check if all stories in this epic are done
156
+ ALL_DONE=true
157
+ if [ -f "$capsule/epic.yaml" ]; then
158
+ for story_id in $(grep -o 'e[0-9]*s[0-9]*' "$capsule/epic.yaml" 2>/dev/null || true); do
159
+ STATUS=$(grep "$story_id:" specs/execution-status.yaml 2>/dev/null | awk '{print $2}' || echo "todo")
160
+ if [ "$STATUS" != "done" ]; then
161
+ ALL_DONE=false
162
+ break
163
+ fi
164
+ done
165
+ fi
166
+ if [ "$ALL_DONE" = true ]; then
167
+ mkdir -p specs/epics/archive
168
+ echo " Archiving completed epic: $capsule_name → specs/epics/archive/"
169
+ mv "$capsule" "specs/epics/archive/"
170
+ fi
171
+ done
172
+ fi
173
+
146
174
  # Worktree cleanup
147
175
  WORKTREE_PATH="../$FEATURE_BRANCH"
148
176
  if git worktree list --porcelain 2>/dev/null | grep -q "^worktree $WORKTREE_PATH$"; then
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: seed-conventions
3
3
  model: sonnet
4
- description: Generate CLAUDE.md and CONVENTIONS.md for a brand-new project through a brief interview, and create the specs/ directory. Entry point for greenfield projects. Use when starting a new project from scratch, when user asks to set up AI agent conventions, or when there is no CLAUDE.md yet.
4
+ description: Generate CLAUDE.md and CONVENTIONS.md for a brand-new project through a brief interview, and create the specs/ directory with evolved bigpowers structure (product/, tech-architecture/, verifications/, epics/archive/). Entry point for greenfield projects. Use when starting a new project from scratch, when user asks to set up AI agent conventions, or when there is no CLAUDE.md yet.
5
5
  ---
6
6
 
7
7
  # Seed Conventions
@@ -75,7 +75,7 @@ Stack: [language, framework, runtime]
75
75
  ## Agent Rules
76
76
  - **Workflow Mandate:** You MUST use the bigpowers skills (e.g. `plan-work`, `develop-tdd`, `orchestrate-project`) to perform tasks. DO NOT write code directly in response to a user prompt like "build this feature".
77
77
  - Read specs/ before writing code.
78
- - All planning and specifications MUST be written to `specs/` (`requirements/SCOPE_LATEST.yaml`, `release-plan.yaml`, `epics/`) before any code is generated.
78
+ - All planning and specifications MUST be written to `specs/` (`product/SCOPE_LATEST.yaml`, `release-plan.yaml`, `epics/`) before any code is generated.
79
79
  - Write the minimum code that solves the stated problem. Nothing extra.
80
80
  - Never refactor, rename, or reorganize code outside the task scope.
81
81
  - Run tests after every change. Show evidence before declaring done.
@@ -115,7 +115,7 @@ Stack: [language, framework, runtime]
115
115
  ## Agent Rules
116
116
  - **Workflow Mandate:** You MUST use the bigpowers skills (e.g. `plan-work`, `develop-tdd`, `orchestrate-project`) to perform tasks. DO NOT write code directly in response to a user prompt like "build this feature".
117
117
  - Read specs/ before writing code.
118
- - All planning and specifications MUST be written to `specs/` (`requirements/SCOPE_LATEST.yaml`, `release-plan.yaml`, `epics/`) before any code is generated.
118
+ - All planning and specifications MUST be written to `specs/` (`product/SCOPE_LATEST.yaml`, `release-plan.yaml`, `epics/`) before any code is generated.
119
119
  - Write the minimum code that solves the stated problem. Nothing extra.
120
120
  - Never refactor, rename, or reorganize code outside the task scope.
121
121
  - Run tests after every change. Show evidence before declaring done.
@@ -155,7 +155,7 @@ Stack: [language, framework, runtime]
155
155
  ## Agent Rules
156
156
  - **Workflow Mandate:** You MUST use the bigpowers skills (e.g. `plan-work`, `develop-tdd`, `orchestrate-project`) to perform tasks. DO NOT write code directly in response to a user prompt like "build this feature".
157
157
  - Read specs/ before writing code.
158
- - All planning and specifications MUST be written to `specs/` (`requirements/SCOPE_LATEST.yaml`, `release-plan.yaml`, `epics/`) before any code is generated.
158
+ - All planning and specifications MUST be written to `specs/` (`product/SCOPE_LATEST.yaml`, `release-plan.yaml`, `epics/`) before any code is generated.
159
159
  - Write the minimum code that solves the stated problem. Nothing extra.
160
160
  - Never refactor, rename, or reorganize code outside the task scope.
161
161
  - Run tests after every change. Show evidence before declaring done.
@@ -177,14 +177,45 @@ Use the standard bigpowers CONVENTIONS.md template, filling in the project-speci
177
177
 
178
178
  ### `specs/` directory
179
179
 
180
+ Create the evolved bigpowers directory structure:
181
+
180
182
  ```bash
181
- mkdir -p specs
182
- echo "# Specs\n\nAll planning documents for this project." > specs/README.md
183
+ mkdir -p specs/product
184
+ mkdir -p specs/product/snapshots
185
+ mkdir -p specs/epics/archive
186
+ mkdir -p specs/tech-architecture
187
+ mkdir -p specs/adr
188
+ mkdir -p specs/verifications
189
+ mkdir -p specs/bugs
190
+
191
+ # Create empty placeholder files
192
+ touch specs/product/SCOPE_LATEST.yaml
193
+ touch specs/product/VISION_LATEST.yaml
194
+ touch specs/product/GLOSSARY_LATEST.yaml
195
+ touch specs/release-plan.yaml
196
+ touch specs/execution-status.yaml
197
+ touch specs/planning-status.yaml
198
+ touch specs/state.yaml
199
+ touch specs/tech-architecture/tech-stack.md
200
+ touch specs/tech-architecture/security.md
201
+ touch specs/tech-architecture/test.md
202
+ touch specs/tech-architecture/design.md
203
+ touch specs/tech-architecture/REFACTOR_LATEST.md
204
+ touch specs/tech-architecture/IMPACT_LATEST.md
205
+ touch specs/bugs/registry.yaml
206
+ echo "# Specs\n\nAll planning documents for this project. Evolved bigpowers structure (v4.0.0+)." > specs/README.md
183
207
  ```
184
208
 
209
+ **Note:** `specs/state.yaml.lock` is NOT pre-created — it is acquired and released dynamically during writes to prevent concurrency conflicts.
210
+
185
211
  ### Verify
186
212
 
187
213
  - [ ] CLAUDE.md exists and is populated
188
214
  - [ ] CONVENTIONS.md exists and includes specs/ output convention
189
215
  - [ ] specs/ directory exists
216
+ - [ ] specs/product/ exists with SCOPE_LATEST.yaml, VISION_LATEST.yaml, GLOSSARY_LATEST.yaml
217
+ - [ ] specs/tech-architecture/ exists with tech-stack.md, security.md, test.md, design.md
218
+ - [ ] specs/verifications/ exists
219
+ - [ ] specs/epics/archive/ exists
220
+ - [ ] specs/bugs/registry.yaml exists
190
221
  - [ ] Confirm with user: "Does CLAUDE.md accurately describe your project?"
@@ -12,7 +12,7 @@ Track the current state of implementation, including decisions made, pending tas
12
12
 
13
13
  ## Goal
14
14
 
15
- Maintain a single source of truth for the *current* session in `specs/state.yaml`. This complements long-term docs in `specs/plans/` and delivery detail in `specs/epics/` + `specs/release-plan.yaml`.
15
+ Maintain a single source of truth for the *current* session in `specs/state.yaml`. This complements long-term docs in `specs/tech-architecture/` and delivery detail in `specs/epics/` + `specs/release-plan.yaml`.
16
16
 
17
17
  Legacy markdown (`specs/archive/STATE.md`, `RELEASE-PLAN.md`) is **not** SoT when YAML exists — use `specs/state.yaml` only.
18
18
 
@@ -45,7 +45,7 @@ handoff:
45
45
 
46
46
  If `specs/state.yaml` does not exist, or if starting a new major phase:
47
47
 
48
- - [ ] Read `specs/release-plan.yaml` and `specs/requirements/SCOPE_LATEST.yaml`.
48
+ - [ ] Read `specs/release-plan.yaml` and `specs/product/SCOPE_LATEST.yaml`.
49
49
  - [ ] Get git metadata: `git branch --show-current` and `git rev-parse --short HEAD`.
50
50
  - [ ] Create `specs/state.yaml` with active flow, git, handoff, and epic cycle if in build.
51
51
 
@@ -68,6 +68,32 @@ Whenever a significant decision is made or a milestone is reached:
68
68
 
69
69
  → verify: `bash scripts/validate-specs-yaml.sh`
70
70
 
71
+ ## State Write-Lock Protocol
72
+
73
+ > **HARD GATE** — Before any write to `specs/state.yaml` or `specs/execution-status.yaml`, acquire `specs/state.yaml.lock`. Release it immediately after the write. A stale lock (>60s) may be force-released.
74
+
75
+ ### Acquire
76
+
77
+ 1. Check if `specs/state.yaml.lock` exists.
78
+ 2. If it exists, read the agent ID and timestamp inside.
79
+ 3. If the lock is stale (>60s old), remove it and proceed.
80
+ 4. If the lock is fresh (<60s), wait 2s and retry (max 15 attempts = 30s).
81
+ 5. Write `agent_id: <name>\nacquired_at: <ISO-8601>` to `specs/state.yaml.lock`.
82
+
83
+ ### Release
84
+
85
+ 1. After the write to `state.yaml` or `execution-status.yaml` completes:
86
+ 2. `rm specs/state.yaml.lock`
87
+
88
+ ### Lock format (`specs/state.yaml.lock`)
89
+
90
+ ```yaml
91
+ agent_id: session-state
92
+ acquired_at: "2026-06-11T14:30:00Z"
93
+ ```
94
+
95
+
96
+
71
97
  ## Operations
72
98
 
73
99
  ### show-state (absorbed)
@@ -80,7 +106,12 @@ Clear ephemeral session state. Set `active_epic_id`, `active_story_id`, and `epi
80
106
 
81
107
  ### compact-state (absorbed)
82
108
 
83
- Archive verbose decisions before a context transition. Move all entries from `handoff.open_decisions` to `specs/adr/` as individual ADR files, then reset `handoff.open_decisions` to an empty list.
109
+ Archive verbose decisions before a context transition. Move all entries from `handoff.open_decisions` to their appropriate location:
110
+
111
+ - **System-wide decisions** → `specs/adr/NNNN-slug.md` (global Architectural Decision Records)
112
+ - **Epic-scoped decisions** → `specs/epics/<active_epic_id>-<slug>/adr/NNNN-slug.md` (epic-local ADRs, archived with epic)
113
+
114
+ After archiving, reset `handoff.open_decisions` to an empty list.
84
115
 
85
116
  ## File Format: specs/state.yaml
86
117
 
@@ -6,17 +6,17 @@ model: sonnet
6
6
 
7
7
  # Slice Tasks
8
8
 
9
- Produce **epic shard stories** in `specs/epics/eNN-*.yaml` — vertical slices, each independently deliverable and testable. Legacy `specs/epics/ (see slice-tasks)` is deprecated; use epics + `execution-status.yaml`.
9
+ Produce **epic capsule story tasks** in `specs/epics/eNN-slug/` — vertical slices, each independently deliverable and testable. Output: decoupled `eNNsYY-tasks.yaml` files with runnable verify commands. Legacy `specs/epics/ (see slice-tasks)` is deprecated; use capsule dirs + `execution-status.yaml`.
10
10
 
11
11
  ## Process
12
12
 
13
- 1. Read `specs/requirements/SCOPE_LATEST.yaml` and/or `specs/release-plan.yaml`.
13
+ 1. Read `specs/product/SCOPE_LATEST.yaml` and/or `specs/release-plan.yaml`.
14
14
  2. Cut **tracer-bullet slices** (thin end-to-end paths first, then depth).
15
- 3. Each story: `id` (e.g. `e03s01`), `title`, optional `depends-on` in task desc, `tasks[]` with `desc` + `verify`.
15
+ 3. Each story: writes `eNNsYY-tasks.yaml` with `story_id`, `title`, `status`, `bcps`, `tasks[]` (each with `id`, `description`, `verify`, `status`). Story spec `.md` files are written by `plan-work` and follow [countable-story-format.md](file:///Users/danielvm/Developer/bigpowers/countable-story-format.md).
16
16
  4. Order by WSJF in `release-plan.yaml` epic list.
17
17
 
18
18
  > **HARD GATE** — No horizontal-only slices ("add all models") without a vertical path that proves integration.
19
19
 
20
20
  ## Verify
21
21
 
22
- → verify: `grep -c 'id: e' specs/epics/*.yaml | awk '{if($1>0) print "OK"; else print "MISSING"}'`
22
+ → verify: `find specs/epics -name "*-tasks.yaml" | wc -l | awk '{if($1>0) print "OK: "$1" task files"; else print "MISSING"}'`
@@ -67,7 +67,7 @@ Based on what you've found, identify which PMBOK phase this project is currently
67
67
  | **Design** | SCOPE exists but no `release-plan.yaml` |
68
68
  | **Plan** | `release-plan.yaml` exists; on `main`/`master` branch |
69
69
  | **Initiate** | On a feature branch; no code changes yet |
70
- | **Execute** | `state.yaml` `active_flow: build_epic`; epic shard in progress |
70
+ | **Execute** | `state.yaml` `active_flow: build_epic`; epic capsule in progress |
71
71
  | **Verify** | Implementation done; run `verify-work` or `run-evals` |
72
72
  | **Bug** | `state.yaml` `active_flow: fix_bug` or open `specs/bugs/BUG-*.md` |
73
73
  | **Review** | All code written; no PR yet |
@@ -116,7 +116,7 @@ At story start, write `metrics.story_start` with the current ISO 8601 timestamp
116
116
 
117
117
  ### list-epics (absorbed)
118
118
 
119
- Loop through all `specs/epics/*.yaml` files and print a summary of story counts per epic. Useful for understanding overall project scope and epic distribution.
119
+ Loop through all `specs/epics/*/epic.yaml` files and print a summary of story counts per epic. Useful for understanding overall project scope and epic distribution.
120
120
 
121
121
  ### check-gates (absorbed)
122
122
 
@@ -1,20 +1,20 @@
1
1
  ---
2
2
  name: trace-requirement
3
3
  model: haiku
4
- description: Link story IDs from specs/release-plan.yaml + epic shards to the implementing code and tests. Produces specs/TRACEABILITY.md. Use when you want to verify coverage of a release plan, audit which stories are implemented, or find "dark" stories with no code.
4
+ description: Link story IDs from specs/release-plan.yaml + epic capsule directories to the implementing code and tests. Produces specs/TRACEABILITY.md. Use when you want to verify coverage of a release plan, audit which stories are implemented, or find "dark" stories with no code.
5
5
  ---
6
6
 
7
7
  # Trace Requirement
8
8
 
9
- Build a traceability matrix from `specs/release-plan.yaml + epic shards` to implementing code and tests. Surfaces gaps in both directions: stories with no code, and code with no story.
9
+ Build a traceability matrix from `specs/release-plan.yaml + epic capsule directories` to implementing code and tests. Surfaces gaps in both directions: stories with no code, and code with no story.
10
10
 
11
11
  ## Pre-flight
12
12
 
13
- > **HARD GATE** — `specs/release-plan.yaml + epic shards` must exist. If it doesn't, run `plan-release` first.
13
+ > **HARD GATE** — `specs/release-plan.yaml + epic capsule directories` must exist. If it doesn't, run `plan-release` first.
14
14
 
15
- → verify: `[ -f specs/release-plan.yaml + epic shards ] && echo "ready" || echo "BLOCKED: run plan-release first"`
15
+ → verify: `[ -f specs/release-plan.yaml + epic capsule directories ] && echo "ready" || echo "BLOCKED: run plan-release first"`
16
16
 
17
- Read `specs/release-plan.yaml + epic shards` fully before proceeding.
17
+ Read `specs/release-plan.yaml + epic capsule directories` fully before proceeding.
18
18
 
19
19
  ## Process
20
20
 
@@ -22,7 +22,7 @@ Read `specs/release-plan.yaml + epic shards` fully before proceeding.
22
22
 
23
23
  From release-plan.yaml, collect all story IDs (e.g. `1.1`, `1.2`, `2.1`).
24
24
 
25
- → verify: `grep -o "Story [0-9]\+\.[0-9]\+" specs/release-plan.yaml + epic shards | sort -u`
25
+ → verify: `grep -o "Story [0-9]\+\.[0-9]\+" specs/release-plan.yaml + epic capsule directories | sort -u`
26
26
 
27
27
  ### 2. Search for story tags in code
28
28
 
@@ -21,7 +21,7 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
21
21
 
22
22
  0. **Branch check** — must not be `main`/`master`.
23
23
 
24
- 1. Read active story tasks and any **Verification Script** notes in `specs/epics/{active}.yaml` or story `.md` under `specs/epics/eNN/stories/`.
24
+ 1. Read active story tasks from `specs/epics/<capsule>/eNNsYY-tasks.yaml` and story spec from `specs/epics/<capsule>/eNNsYY-<slug>.md` (countable-story-format, Gherkin in §17).
25
25
  2. **Cold-start smoke** (if app): stop server, clear caches, boot from scratch.
26
26
  3. Mechanical gates: build → typecheck → lint → tests (from `CLAUDE.md`).
27
27
  4. **Step-by-step UAT** — one user-observable action at a time.
@@ -55,9 +55,42 @@ After UAT, identify and close any gaps between promised behavior and actual beha
55
55
  - Pass: user confirms per step.
56
56
  - Fail: capture expected vs actual; do not mark done in `execution-status.yaml`.
57
57
 
58
+ ## Persist verification evidence
59
+
60
+ After UAT passes, write structured evidence to `specs/verifications/eNNsYY-verify.yaml`:
61
+
62
+ ```yaml
63
+ story_id: e01s01
64
+ verified_at: "2026-06-11T14:30:00Z"
65
+ verifier: verify-work
66
+ phases:
67
+ smoke:
68
+ passed: true
69
+ build:
70
+ passed: true
71
+ command: "npm run build"
72
+ typecheck:
73
+ passed: true
74
+ lint:
75
+ passed: true
76
+ tests:
77
+ passed: true
78
+ coverage: "94.2%"
79
+ manual:
80
+ steps:
81
+ - step: "Open /login"
82
+ expected: "Login form renders"
83
+ actual: "Login form rendered correctly"
84
+ passed: true
85
+ gaps:
86
+ closed: true
87
+ ```
88
+
89
+ > **HARD GATE** — Verification evidence MUST be persisted before marking the story done. No evidence = not verified.
90
+
58
91
  ## Verify
59
92
 
60
- → verify: `grep -c 'verify:' specs/epics/*.yaml | awk '{if($1>0) print "OK"; else print "MISSING"}'`
93
+ → verify: `test -f specs/verifications/<story_id>-verify.yaml && echo "Evidence persisted"`
61
94
 
62
95
  See [REFERENCE.md](REFERENCE.md) for cold-start and gaps template.
63
96
 
@@ -25,7 +25,7 @@ Create high-signal technical documentation that serves as an expert collaborator
25
25
 
26
26
  Choose the correct BMAD-BigPowers artifact:
27
27
  - **Decision Record (ADR)**: For "Why" decisions (saved to `specs/adr/`).
28
- - **Context Map**: For system-wide architectural mapping (`specs/plans/TECH_STACK_LATEST.md`).
28
+ - **Context Map**: For system-wide architectural mapping (`specs/tech-architecture/tech-stack.md`).
29
29
  - **Technical Guide**: For "How-to" with verification (saved to `<module>/REFERENCE.md`).
30
30
  - **Behavioral Feature**: Gherkin-style compliance specs (saved to `specs/audit/features/`).
31
31
  - **Project README**: Project-facing documentation (saved to `README.md` at project root).