bigpowers 2.1.3 → 2.2.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.
@@ -10,179 +10,43 @@ Produce a detailed, verifiable implementation plan in the **active epic capsule
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
  >
13
- > **RECURSIVE DISCIPLINE** — This lifecycle apply to EVERY task, including updating these skills. Never skip planning because a task is "meta" or "just documentation."
13
+ > **RECURSIVE DISCIPLINE** — This lifecycle applies to EVERY task, including updating these skills. Never skip planning because a task is "meta" or "just documentation."
14
14
 
15
15
  ## Pre-flight
16
16
 
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.
17
+ Read: `release-plan.yaml`, `product/SCOPE_LATEST.yaml`, active `epics/<capsule>/epic.yaml`, `tech-architecture/tech-stack.md`, `product/GLOSSARY_LATEST.yaml`.
18
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
+ > **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.
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
+ If this plan touches an existing module, run `assess-impact` first to understand blast radius.
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
+ > **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.
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
+ > **MULTIPLE INTERPRETATIONS (HARD GATE)**If the task admits ≥2 valid interpretations, list them and get a user decision before drafting any steps.
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
+ > **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.
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.
39
-
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.
29
+ > **SLOPCHECK (HARD GATE)** — For every external package, tag it `[OK]`, `[SUS]`, or `[SLOP]`. `[SUS]`/`[SLOP]` require human approval before execution.
41
30
 
42
31
  ## Invocation modes
43
32
 
44
33
  - 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.
34
+ - `--fast`: Skip zoom-out and impact assessment. Use for tasks under 3 BCPs with no module interface changes.
46
35
 
47
36
  ## Process
48
37
 
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)
107
-
108
- [A human-readable, step-by-step script for the user to verify the story's outcome. Focus on user-observable behavior.]
38
+ 1. **Explore** Use `Explore` subagent to understand affected modules, existing test patterns, similar prior art, and dependencies.
109
39
 
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]
40
+ 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.
114
41
 
115
- ## Out of scope
42
+ 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.
116
43
 
117
- - [Explicit exclusions]
44
+ 4. **Verify step format** — Every step MUST follow: `N. <What to do> → verify: <runnable command>`. See [REFERENCE.md](REFERENCE.md) for good/bad examples.
118
45
 
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?
46
+ 5. **Review with user** — Confirm step order, granularity, and that verify commands are runnable in this project.
151
47
 
152
48
  After writing capsule tasks, suggest `kickoff-branch` (if not already on a feature branch) then `build-epic`, `execute-plan`, or `develop-tdd`.
153
49
 
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
50
  ## Handoff
187
51
 
188
52
  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,14 @@ 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:
20
-
21
19
  | Mode | When | Ship path |
22
20
  |------|------|-----------|
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) |
21
+ | **solo-local** | `profiles/solo-git.md` active | `bash scripts/land-branch.sh <branch> "<conventional message>"` |
22
+ | **team-pr** | Default / remote CI required | `gh pr create` → `gh pr merge --squash` |
25
23
 
26
24
  If unsure and working alone, prefer **solo-local**.
27
25
 
@@ -29,168 +27,70 @@ If unsure and working alone, prefer **solo-local**.
29
27
 
30
28
  ### 1. Final verification
31
29
 
32
- Run the full suite one last time on the feature branch:
33
-
34
30
  ```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"
31
+ <full test command> && <typecheck command> && <lint command>
32
+ 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
33
  ```
41
34
 
42
- - [ ] All tests pass
43
- - [ ] No type errors
44
- - [ ] No lint violations
45
- - [ ] All commits in branch history follow Conventional Commits 1.0.0
35
+ - [ ] All tests pass, no type errors, no lint violations, all commits follow Conventional Commits
46
36
 
47
37
  ### 2. Coverage check
48
38
 
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.
39
+ - [ ] Overall coverage 80%; business logic coverage ≥ 95%
55
40
 
56
41
  ### 3. Diff review
57
42
 
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
43
+ - [ ] All commits intentional, no secrets, CONVENTIONS.md compliance
67
44
 
68
45
  ### 4. Decision
69
46
 
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 |
47
+ Options: **Release (solo-local)** / **Open PR** / **Keep branch** / **Discard**
78
48
 
79
49
  ### 5. Solo-local integrate
80
50
 
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
-
51
+ Run `commit-message` to produce the squash commit subject, then:
86
52
  ```bash
87
53
  bash scripts/land-branch.sh <task-slug> "feat(scope): description"
88
54
  ```
89
55
 
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
56
  ### 6. Create PR (team-pr only)
95
57
 
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
- ```
58
+ See [REFERENCE.md](REFERENCE.md) for the full PR body template and gh commands.
120
59
 
121
60
  ### 7. Merge (team-pr only)
122
61
 
123
- Wait for CI to pass. Merge using **Squash and Merge** so the PR title becomes the commit message on `main`.
124
-
125
62
  ```bash
126
63
  gh pr merge --squash --delete-branch
127
64
  ```
128
65
 
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.
66
+ `semantic-release` auto-detects the commit, bumps SemVer, tags the repo, generates release notes.
134
67
 
135
68
  ### 7a. Archive completed epic capsule
136
69
 
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.
70
+ > **HARD GATE** — When all epic stories are done (all `done` in `execution-status.yaml`), archive the capsule:
138
71
 
139
72
  ```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
73
+ mv specs/epics/eNN-slug specs/epics/archive/
146
74
  ```
147
75
 
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)
76
+ ### 8. Clean up worktree
151
77
 
152
78
  ```bash
153
- # From the main repo root
154
79
  git worktree prune
155
80
  git worktree remove ../<branch-name> 2>/dev/null || true
156
81
  git branch -d <branch-name>
157
82
  ```
158
83
 
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
84
  ### 8a. Cycle-time recording
163
85
 
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
- ```
86
+ After landing, record delivery metrics. See [REFERENCE.md](REFERENCE.md) for fields and example row.
180
87
 
181
- ### 9. Return to main (primary worktree)
88
+ ### 9. Return to main
182
89
 
183
90
  ```bash
184
- cd <primary-repo-root>
185
- git checkout main # or master
186
- git status
187
- pwd
91
+ git checkout main && git status && pwd
188
92
  ```
189
93
 
190
- Confirm:
191
- - [ ] Current branch is `main` (or project default)
192
- - [ ] cwd is the primary repository root, not `../<task-slug>`
193
-
194
94
  Report: "Branch released. Integrate mode: <solo-local|team-pr>. cwd: $(pwd) on $(git branch --show-current)."
195
95
 
196
96
  ## 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
 
@@ -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
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env bash
2
+ # Regenerates the auto-generated catalog section in docs/references/model-profiles.md
3
+ # from live */SKILL.md frontmatter. Run after any SKILL.md addition/rename.
4
+ # Called by sync-skills.sh and npm version hooks.
5
+ set -euo pipefail
6
+
7
+ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
8
+ TARGET="$REPO_ROOT/docs/references/model-profiles.md"
9
+
10
+ cd "$REPO_ROOT"
11
+
12
+ # --- 1. Collect live skill→model pairs ---
13
+ declare -a ROWS=()
14
+ while IFS= read -r line; do
15
+ skill_dir="${line%%/SKILL.md*}"
16
+ model_raw="${line##*model: }"
17
+ model="${model_raw// /}"
18
+ ROWS+=("$skill_dir $model")
19
+ done < <(grep -r "^model:" */SKILL.md | sed 's|/SKILL.md:model:||' | sort)
20
+
21
+ TOTAL=${#ROWS[@]}
22
+
23
+ # --- 2. Build replacement block ---
24
+ BLOCK="<!-- AUTO-GENERATED-CATALOG: begin — do not edit manually; run scripts/generate-reference-tables.sh -->
25
+ | Skill | Model |
26
+ |-------|-------|"
27
+ for row in "${ROWS[@]}"; do
28
+ skill="${row%% *}"
29
+ model="${row##* }"
30
+ # capitalise first letter for display
31
+ model_cap="$(echo "${model:0:1}" | tr '[:lower:]' '[:upper:]')${model:1}"
32
+ BLOCK+="
33
+ | \`$skill\` | **$model_cap** |"
34
+ done
35
+ BLOCK+="
36
+
37
+ Total: **$TOTAL** skills — verify with \`ls -d \*/SKILL.md | wc -l\`
38
+ <!-- AUTO-GENERATED-CATALOG: end -->"
39
+
40
+ # --- 3. Splice block into target file ---
41
+ # Replace between marker comments if they exist; otherwise append.
42
+ if grep -q "AUTO-GENERATED-CATALOG: begin" "$TARGET"; then
43
+ python3 - "$TARGET" "$BLOCK" <<'PYEOF'
44
+ import sys, re
45
+ path = sys.argv[1]
46
+ block = sys.argv[2]
47
+ text = open(path).read()
48
+ new_text = re.sub(
49
+ r'<!-- AUTO-GENERATED-CATALOG: begin.*?<!-- AUTO-GENERATED-CATALOG: end -->',
50
+ block,
51
+ text,
52
+ flags=re.DOTALL
53
+ )
54
+ open(path, 'w').write(new_text)
55
+ PYEOF
56
+ else
57
+ printf '\n\n## Full Skill Catalog (auto-generated)\n\n%s\n' "$BLOCK" >> "$TARGET"
58
+ fi
59
+
60
+ # --- 4. Update the "expect N" count assertion (legacy line) ---
61
+ # Replaces "expect NN" with the live count so the prose stays accurate.
62
+ sed -i.bak "s/expect [0-9]*/expect $TOTAL/" "$TARGET" && rm -f "${TARGET}.bak"
63
+
64
+ echo "generate-reference-tables: updated $TARGET ($TOTAL skills)"
@@ -13,7 +13,7 @@ specs_files=""
13
13
  if [[ "$has_specs" == "true" ]]; then
14
14
  specs_files=$( {
15
15
  ls specs/*.yaml 2>/dev/null || true
16
- ls specs/requirements/*.yaml 2>/dev/null || true
16
+ ls specs/product/*.yaml 2>/dev/null || true
17
17
  ls specs/*.md 2>/dev/null || true
18
18
  } | xargs -n1 basename 2>/dev/null | sort -u | tr '\n' ',' | sed 's/,$//')
19
19
  fi
@@ -34,7 +34,7 @@ if [[ -f "specs/state.yaml" ]]; then
34
34
  esac
35
35
  elif [[ -f "specs/release-plan.yaml" ]]; then
36
36
  phase="Plan"
37
- elif [[ -f "specs/requirements/SCOPE_LATEST.yaml" ]] || [[ -f "specs/SCOPE.md" ]]; then
37
+ elif [[ -f "specs/product/SCOPE_LATEST.yaml" ]] || [[ -f "specs/SCOPE.md" ]]; then
38
38
  phase="Design"
39
39
  elif [[ "$current_branch" != "main" && "$current_branch" != "master" ]]; then
40
40
  phase="Initiate"