bigpowers 2.71.0 → 2.72.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.
package/.pi/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.71.0",
3
+ "version": "2.72.0",
4
4
  "description": "75 skills — 73 agent skills synthesizing 17 years of software engineering discipline into a prescriptive methodology for solo developers",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -49,7 +49,8 @@ Run this self-review before asking anyone else to look at the code. The goal is
49
49
  - [ ] Changes are limited to what was asked — nothing extra refactored or reorganized
50
50
  - [ ] No speculative features added
51
51
  - [ ] No files touched outside the stated scope
52
- - [ ] Changes are surgical: only code strictly required for the task; no refactoring, reorganization, or cleanup outside task scope (Boy Scout Rule applied surgically, not broadly)
52
+ - [ ] **Discovered defects:** Reproducible gate failures (Preflight, CI, golden suite) require fix-or-log — `quick-fix` or `fix-bug` — even when "outside" the story scope. Scope-minimization does not waive Always Green.
53
+ - [ ] Boy Scout Rule applies to files opened to fix a gate failure; it does not excuse skipping red Preflight
53
54
 
54
55
  ### Boy Scout Rule
55
56
 
@@ -27,6 +27,8 @@ If you catch yourself thinking these, stop and reconsider — you are likely dev
27
27
  | "I'm just fixing a small bug." | Small bugs often indicate deep interface flaws. Investigate root cause. |
28
28
  | "I need to mock this internal class." | Mocking internals couples tests to implementation. Mock only I/O. |
29
29
  | "This refactor is out of scope." | Leave the code cleaner than you found it (Boy Scout Rule). |
30
+ | "Preflight failed but it's unrelated." | **Always Green:** any reproducible gate failure routes **quick-fix → fix-bug** before forward work. Session boundaries do not waive Preflight. |
31
+ | "I'll note the red gate and continue." | Narrating a failure is banned. fix-or-log is mandatory per CONVENTIONS § Discovered Defects. |
30
32
 
31
33
  ## Workflow
32
34
 
@@ -9,7 +9,7 @@ description: Benchmark-gated skill evolution — consume bigpowers-benchmark rep
9
9
 
10
10
  ## Loop
11
11
 
12
- 1. **Regression gate** — Run `bash scripts/run-golden-suite.sh` to catch mechanical regressions (compliance, sync pipeline, size budget) before spending time on benchmark evals. If golden suite fails, fix regressions first — they are pre-requisites for any capability improvement.
12
+ 1. **Regression gate** — Run `bash scripts/run-verification-gates.sh` to catch mechanical regressions (compliance, sync pipeline, size budget) before spending time on benchmark evals. If golden suite fails, fix regressions first — they are pre-requisites for any capability improvement.
13
13
  2. **Establish baseline** — Run `run-benchmark <skill> --baseline`. If no definition exists at `specs/benchmarks/<skill>.yaml`, create one following `specs/benchmarks/SCHEMA.md` first. Save report path in `state.yaml`. If `specs/benchmarks/reports/BASELINE-<skill>.yaml` already exists, skip this step.
14
14
 
15
15
  3. **Identify gap** — Read the baseline report (`specs/benchmarks/reports/BASELINE-<skill>.yaml`). Find scenarios with `result: FAIL` or low `pass_at_k`. This is the measurable gap.
@@ -11,6 +11,16 @@ Orchestrates **fix_bug** flow without mixing epic build state.
11
11
 
12
12
  > **HARD GATE** — Set `specs/state.yaml` `active_flow: fix_bug` and `bug_cycle.current_step: 1` before starting.
13
13
 
14
+ ## Discovered gate failures (e51s04)
15
+
16
+ Valid entry **without a user-reported bug** when:
17
+
18
+ - **Preflight** or **CI** is red at kickoff or verify-work
19
+ - **Golden suite** or project baseline is red (`bash scripts/run-verification-gates.sh` or equivalent)
20
+ - A reproducible gate failure during unrelated epic work exceeds quick-fix guardrails
21
+
22
+ Create `specs/bugs/BUG-*.md` via `investigate-bug` (or inline in fix-bug step 1) describing the gate failure, then run the standard fix_bug chain.
23
+
14
24
  ## Five steps (`bug_cycle` in state.yaml)
15
25
 
16
26
  | Step | Skill / action |
@@ -7,9 +7,9 @@ description: Create a git worktree and feature branch, then verify a clean test
7
7
 
8
8
  > **HARD GATE** — Direct work on `main` or `master` is PROHIBITED. Every task MUST start with this skill to create a feature branch or worktree.
9
9
  >
10
- > **HARD GATE** — Do NOT proceed with development until a clean test baseline is verified. If the current base branch is failing tests, stop and fix the baseline before creating a new worktree.
10
+ > **HARD GATE** — Do NOT proceed with development until **Preflight** passes on the default branch. Red Preflight blocks branch creation and all forward work — invoke `quick-fix` or `fix-bug` per CONVENTIONS § Discovered Defects.
11
11
 
12
- Create an isolated working environment before touching any code. A clean baseline proves tests pass before you start — so any failure you see later was caused by your changes, not pre-existing issues.
12
+ Create an isolated working environment before touching any code. **Preflight must be green** before you write feature code — solo-default owns the whole tree, not just the current task diff.
13
13
 
14
14
  ## Process
15
15
 
@@ -112,32 +112,25 @@ fi
112
112
 
113
113
  If locked: abort. If unlocked: entry added, proceed.
114
114
 
115
- Run the full test suite and confirm it passes before writing any code:
115
+ Run **Preflight** (from `CLAUDE.md` Commands table, or `BP_PREFLIGHT` from `bash scripts/bp-read-agents.sh`) and confirm green before writing any code:
116
116
 
117
117
  ```bash
118
- # Use the project's test command from CLAUDE.md or package.json
119
- npm test # or: pytest, go test ./..., cargo test, etc.
118
+ # Preflight — project's full local verification stack
119
+ # bigpowers example:
120
+ npm run compliance && bash scripts/run-verification-gates.sh
121
+
122
+ # Or project-specific from CLAUDE.md / AGENTS.md
120
123
  ```
121
124
 
122
- - [ ] All tests pass
123
- - [ ] No type errors (`npm run typecheck` or equivalent)
124
- - [ ] No lint errors (`npm run lint` or equivalent)
125
+ - [ ] Preflight passes (all chained gates green)
126
+ - [ ] No type errors (`npm run typecheck` or equivalent, if not in Preflight)
127
+ - [ ] No lint errors (`npm run lint` or equivalent, if not in Preflight)
125
128
 
126
- If the baseline is broken, **stop and tell the user**. Do not proceed with development on a broken baseline.
129
+ If Preflight is red, **stop** — route to `quick-fix` or `fix-bug`. Fix before kickoff continues.
127
130
 
128
131
  ### 5. Confirm readiness
129
132
 
130
- Report the baseline result:
131
- ```
132
- ✓ Baseline clean: 42 tests passed, 0 failed
133
- Branch: <task-slug>
134
- Worktree: ../<task-slug>
135
- Ready to develop.
136
- ```
137
-
138
- Suggest next skill: `develop-tdd` to start the TDD loop, or `execute-plan` if `specs/release-plan.yaml + epic capsule directories` already exists.
139
-
140
-
133
+ Report: `✓ Preflight green` + branch + worktree. Suggest next: `develop-tdd` or `execute-plan`.
141
134
 
142
135
  ## Handoff
143
136
 
@@ -12,6 +12,10 @@ Fast-track for trivial data-only fixes that do not require the full bug-fix chai
12
12
 
13
13
  When a bug fix is purely data — an add-missing-key, a typo correction, a config value update — the standard 6-skill chain (investigate-bug → diagnose-root → develop-tdd → kickoff-branch → verify-work → release-branch) is wasteful overhead. Quick-fix collapses it to 2 skills: **quick-fix** then **release-branch**.
14
14
 
15
+ ## Discovered gate failures (e51s04)
16
+
17
+ A **Preflight**, **golden suite**, or **baseline red** failure discovered during unrelated work is valid quick-fix entry when the root cause is a data-only gap (missing key, typo, stale config) — **no user-reported bug required**. If guardrails abort (logic change, >1 file, >5 lines), fall back to `fix-bug` instead of narrating and continuing.
18
+
15
19
  ## Entry Criteria (ALL must be true)
16
20
 
17
21
  Before invoking quick-fix, evaluate every item in this checklist:
@@ -24,12 +24,12 @@ Ask the user these questions (one at a time, wait for each answer):
24
24
  2. **Stack** — "What language, framework, and runtime? (e.g. TypeScript / Next.js / Node 22)"
25
25
  2b. **Stack profile (optional)** — Offer: `swift`, `typescript-vue`, `node-service`, or none. If chosen, merge the matching fragment from `profiles/<name>.md` into generated `CONVENTIONS.md`.
26
26
  3. **Commands** — "What commands do you use for: run, test, build, lint?"
27
+ 3b. **Preflight (optional)** — "What single command runs your full local green stack (test + lint + build)? If you don't have one, we'll chain your Test + Lint + Build answers into a **Preflight** row in the Commands table."
27
28
  4. **Architecture** — "Key modules and relationships in 1–2 sentences."
28
29
  5. **Conventions** — "Any naming, file organization, or patterns all agents must follow?"
29
30
  6. **Never-do list** — "What are the hard stops? Things an agent must never touch?"
30
31
  7. **Defensive code categories** — "Which apply? (Rate limit / Retry / Circuit breaker / Timeout / Graceful degradation)"
31
32
  8. **Local tool wiring (optional)** — "Wire bigpowers skills for project-local tools that global install can't reach? (Cursor + OpenCode only)" If yes, generate the local wiring artifacts described in [REFERENCE.md](REFERENCE.md) §Local tool wiring. If no, skip — the standard seed output is unchanged.
32
- 8. **Local tool wiring (optional)** — "Wire bigpowers skills for project-local tools that global install can't reach? (Cursor + OpenCode only)" If yes, generate the local wiring artifacts described in [REFERENCE.md](REFERENCE.md) §Local tool wiring. If no, skip — the standard seed output is unchanged.
33
33
 
34
34
  ## Generate files
35
35
 
@@ -54,7 +54,9 @@ echo "# Specs\n\nAll planning documents for this project." > specs/README.md
54
54
 
55
55
  **Note:** `specs/state.yaml.lock` is NOT pre-created — acquired/released dynamically.
56
56
 
57
- `specs/state.yaml` carries a top-level `workflow_mode` key (`team-pr` | `solo-git`, default `team-pr`). This is the **canonical integrate-mode signal** for all skills — set it once here and skills such as `release-branch` read it from this file instead of sniffing profile files.
57
+ `specs/state.yaml` carries a top-level `workflow_mode` key (`team-pr` | `solo-git`, default `solo-git`). This is the **canonical integrate-mode signal** for all skills — set it once here and skills such as `release-branch` read it from this file instead of sniffing profile files.
58
+
59
+ When generating `CLAUDE.md`, if the user did not name a Preflight command, chain the Test + Lint + Build interview answers into one **Preflight** row (e.g. `npm test && npm run lint && npm run build`).
58
60
 
59
61
 
60
62
 
@@ -69,6 +71,7 @@ echo "# Specs\n\nAll planning documents for this project." > specs/README.md
69
71
 
70
72
  ---
71
73
 
74
+ # story: e51s02
72
75
  # Seed Conventions — Reference Templates
73
76
 
74
77
  ## Agent config template (CLAUDE.md / GEMINI.md / AGENTS.md)
@@ -94,6 +97,8 @@ Stack: [language, framework, runtime]
94
97
  | Test | `[cmd]` |
95
98
  | Build | `[cmd]` |
96
99
  | Lint | `[cmd]` |
100
+ | Preflight | `[test && lint && build chain — or user-named full-green cmd]` |
101
+ | CI | `gh pr checks` (when a PR is open) |
97
102
 
98
103
  ## Architecture
99
104
  [1–2 sentences. Key modules and their relationships.]
@@ -103,15 +108,17 @@ Stack: [language, framework, runtime]
103
108
  - [convention 2]
104
109
 
105
110
  ## Never
111
+ - Never dismiss reproducible gate failures as pre-existing or out of scope
112
+ - Never proceed on red Preflight or red CI — invoke quick-fix or fix-bug first
106
113
  - [hard stop 1]
107
114
  - [hard stop 2]
108
115
 
109
116
  ## Agent Rules
110
117
  - **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".
118
+ - **Always Green:** Preflight and CI must be green before forward work. Reproducible gate failures require **fix-or-log** (quick-fix → fix-bug) per CONVENTIONS § Discovered Defects.
111
119
  - Read specs/ before writing code.
112
120
  - All planning and specifications MUST be written to `specs/` (`product/SCOPE_LATEST.yaml`, `release-plan.yaml`, `epics/`) before any code is generated.
113
121
  - Write the minimum code that solves the stated problem. Nothing extra.
114
- - Never refactor, rename, or reorganize code outside the task scope.
115
122
  - Run tests after every change. Show evidence before declaring done.
116
123
  - One clarifying question beats a wrong assumption baked into 200 lines.
117
124
  ```
@@ -129,6 +136,12 @@ Stack: [language, framework, runtime]
129
136
 
130
137
  Use the standard bigpowers CONVENTIONS.md as the base. Fill in the project-specific defensive code categories from the interview answers.
131
138
 
139
+ **Always embed** these doctrine sections from bigpowers (adapt commands only):
140
+
141
+ - **§ Always Green / Shift Left** — 1-10-100 rationale, Preflight + CI green definitions
142
+ - **§ Discovered Defects** — fix-or-log ladder (quick-fix → fix-bug), separate commits for discovered fixes
143
+ - **Banned dismissive phrases** table — pre-existing, unrelated to session, not introduced by my changes, out of scope (ignoring a red gate)
144
+
132
145
  ## Stack profile fragments
133
146
 
134
147
  If the user selected a stack profile, merge the matching `profiles/<name>.md` fragment into the generated `CONVENTIONS.md` under a `## Stack Conventions` section. Profiles supply language-specific commands, architecture patterns, and never-do additions.
@@ -31,6 +31,8 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
31
31
 
32
32
  0. **Branch check** — must not be `main`/`master`.
33
33
 
34
+ 0a. **Preflight / CI green (HARD GATE — e51s03)** — Run Preflight from `CLAUDE.md` or `BP_PREFLIGHT` (`bp-read-agents.sh`). If PR open: `gh pr checks` (**CI green**). Failure blocks all phases → `quick-fix` or `fix-bug`.
35
+
34
36
  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). Note the `risk:` level (`P0`–`P3`).
35
37
  1a. **Pre-UAT verify validation** — for each task's `verify:` command, run it and detect pattern mismatches before UAT begins. If a grep/awk/jq command fails, check whether the pattern is wrong vs. a genuine failure:
36
38
  ```bash
@@ -39,7 +41,7 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
39
41
  ```
40
42
  Report: `"Pattern 'X' not found. Nearest match: 'Y' at line N"` and ask `"Update verify command? [Y/n]"`. Fix before proceeding — a mismatched verify command produces false failures during UAT.
41
43
  2. **Cold-start smoke** (if app; skip if P3): stop server, clear caches, boot from scratch.
42
- 3. **AGENTS.md preflight** — before running default checks, call `bash scripts/bp-read-agents.sh` to detect project-specific commands. If `BP_PREFLIGHT` is set, run it instead of the default mechanical gates (or in addition to them if the project requires both). Output: `"Using preflight from AGENTS.md: <cmd>"`. Fall back to `CLAUDE.md` commands if AGENTS.md is absent.
44
+ 3. **AGENTS.md preflight** — if 0a skipped BP_PREFLIGHT, run `bash scripts/bp-read-agents.sh` and use detected command.
43
45
  4. Mechanical gates: build → typecheck → lint → tests (from `CLAUDE.md` or AGENTS.md). Skip tests if P2/P3.
44
46
  5. **Security scan** (skip if P2/P3) — run `security-review` against the git diff (working tree vs merge-base). Parse findings report. If any HIGH findings with confidence ≥ 8 exist → **block the gate**. Write findings to `specs/security/REVIEW.md`. Allow documented exceptions via `specs/security/EXCEPTIONS.md`. MEDIUM/LOW findings warn but don't block.
45
47
  5a. **Blind-spot check** — run `bash scripts/check-blind-spots.sh`. This detects structural quality gaps (verify-gap, test-gap, stale-tag, etc.) beyond percentage coverage. If any HIGH-severity findings exist → **block the verify-work PASS gate**. Findings are written to `specs/blind-spots.json`. MEDIUM/LOW findings warn but don't block.
@@ -51,14 +53,7 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
51
53
 
52
54
  ### Cold-Start Smoke (absorbed)
53
55
 
54
- For applications, verify correctness from a clean state:
55
-
56
- - Stop the running server (if any)
57
- - Clear any caches (browser, application caches, compiled artifacts)
58
- - Boot the application from scratch
59
- - Verify that no stale artifacts or configuration are affecting the behavior
60
-
61
- This catches environment-specific bugs and ensures the build is reproducible.
56
+ Stop server, clear caches, boot from scratch; confirm no stale config affects behavior.
62
57
 
63
58
  ### Gaps Loop (absorbed)
64
59
 
@@ -51,7 +51,8 @@ Run this self-review before asking anyone else to look at the code. The goal is
51
51
  - [ ] Changes are limited to what was asked — nothing extra refactored or reorganized
52
52
  - [ ] No speculative features added
53
53
  - [ ] No files touched outside the stated scope
54
- - [ ] Changes are surgical: only code strictly required for the task; no refactoring, reorganization, or cleanup outside task scope (Boy Scout Rule applied surgically, not broadly)
54
+ - [ ] **Discovered defects:** Reproducible gate failures (Preflight, CI, golden suite) require fix-or-log — `quick-fix` or `fix-bug` — even when "outside" the story scope. Scope-minimization does not waive Always Green.
55
+ - [ ] Boy Scout Rule applies to files opened to fix a gate failure; it does not excuse skipping red Preflight
55
56
 
56
57
  ### Boy Scout Rule
57
58
 
@@ -29,6 +29,8 @@ If you catch yourself thinking these, stop and reconsider — you are likely dev
29
29
  | "I'm just fixing a small bug." | Small bugs often indicate deep interface flaws. Investigate root cause. |
30
30
  | "I need to mock this internal class." | Mocking internals couples tests to implementation. Mock only I/O. |
31
31
  | "This refactor is out of scope." | Leave the code cleaner than you found it (Boy Scout Rule). |
32
+ | "Preflight failed but it's unrelated." | **Always Green:** any reproducible gate failure routes **quick-fix → fix-bug** before forward work. Session boundaries do not waive Preflight. |
33
+ | "I'll note the red gate and continue." | Narrating a failure is banned. fix-or-log is mandatory per CONVENTIONS § Discovered Defects. |
32
34
 
33
35
  ## Workflow
34
36
 
@@ -11,7 +11,7 @@ model: opus
11
11
 
12
12
  ## Loop
13
13
 
14
- 1. **Regression gate** — Run `bash scripts/run-golden-suite.sh` to catch mechanical regressions (compliance, sync pipeline, size budget) before spending time on benchmark evals. If golden suite fails, fix regressions first — they are pre-requisites for any capability improvement.
14
+ 1. **Regression gate** — Run `bash scripts/run-verification-gates.sh` to catch mechanical regressions (compliance, sync pipeline, size budget) before spending time on benchmark evals. If golden suite fails, fix regressions first — they are pre-requisites for any capability improvement.
15
15
  2. **Establish baseline** — Run `run-benchmark <skill> --baseline`. If no definition exists at `specs/benchmarks/<skill>.yaml`, create one following `specs/benchmarks/SCHEMA.md` first. Save report path in `state.yaml`. If `specs/benchmarks/reports/BASELINE-<skill>.yaml` already exists, skip this step.
16
16
 
17
17
  3. **Identify gap** — Read the baseline report (`specs/benchmarks/reports/BASELINE-<skill>.yaml`). Find scenarios with `result: FAIL` or low `pass_at_k`. This is the measurable gap.
@@ -13,6 +13,16 @@ Orchestrates **fix_bug** flow without mixing epic build state.
13
13
 
14
14
  > **HARD GATE** — Set `specs/state.yaml` `active_flow: fix_bug` and `bug_cycle.current_step: 1` before starting.
15
15
 
16
+ ## Discovered gate failures (e51s04)
17
+
18
+ Valid entry **without a user-reported bug** when:
19
+
20
+ - **Preflight** or **CI** is red at kickoff or verify-work
21
+ - **Golden suite** or project baseline is red (`bash scripts/run-verification-gates.sh` or equivalent)
22
+ - A reproducible gate failure during unrelated epic work exceeds quick-fix guardrails
23
+
24
+ Create `specs/bugs/BUG-*.md` via `investigate-bug` (or inline in fix-bug step 1) describing the gate failure, then run the standard fix_bug chain.
25
+
16
26
  ## Five steps (`bug_cycle` in state.yaml)
17
27
 
18
28
  | Step | Skill / action |
@@ -9,9 +9,9 @@ model: haiku
9
9
 
10
10
  > **HARD GATE** — Direct work on `main` or `master` is PROHIBITED. Every task MUST start with this skill to create a feature branch or worktree.
11
11
  >
12
- > **HARD GATE** — Do NOT proceed with development until a clean test baseline is verified. If the current base branch is failing tests, stop and fix the baseline before creating a new worktree.
12
+ > **HARD GATE** — Do NOT proceed with development until **Preflight** passes on the default branch. Red Preflight blocks branch creation and all forward work — invoke `quick-fix` or `fix-bug` per CONVENTIONS § Discovered Defects.
13
13
 
14
- Create an isolated working environment before touching any code. A clean baseline proves tests pass before you start — so any failure you see later was caused by your changes, not pre-existing issues.
14
+ Create an isolated working environment before touching any code. **Preflight must be green** before you write feature code — solo-default owns the whole tree, not just the current task diff.
15
15
 
16
16
  ## Process
17
17
 
@@ -114,32 +114,25 @@ fi
114
114
 
115
115
  If locked: abort. If unlocked: entry added, proceed.
116
116
 
117
- Run the full test suite and confirm it passes before writing any code:
117
+ Run **Preflight** (from `CLAUDE.md` Commands table, or `BP_PREFLIGHT` from `bash scripts/bp-read-agents.sh`) and confirm green before writing any code:
118
118
 
119
119
  ```bash
120
- # Use the project's test command from CLAUDE.md or package.json
121
- npm test # or: pytest, go test ./..., cargo test, etc.
120
+ # Preflight — project's full local verification stack
121
+ # bigpowers example:
122
+ npm run compliance && bash scripts/run-verification-gates.sh
123
+
124
+ # Or project-specific from CLAUDE.md / AGENTS.md
122
125
  ```
123
126
 
124
- - [ ] All tests pass
125
- - [ ] No type errors (`npm run typecheck` or equivalent)
126
- - [ ] No lint errors (`npm run lint` or equivalent)
127
+ - [ ] Preflight passes (all chained gates green)
128
+ - [ ] No type errors (`npm run typecheck` or equivalent, if not in Preflight)
129
+ - [ ] No lint errors (`npm run lint` or equivalent, if not in Preflight)
127
130
 
128
- If the baseline is broken, **stop and tell the user**. Do not proceed with development on a broken baseline.
131
+ If Preflight is red, **stop** — route to `quick-fix` or `fix-bug`. Fix before kickoff continues.
129
132
 
130
133
  ### 5. Confirm readiness
131
134
 
132
- Report the baseline result:
133
- ```
134
- ✓ Baseline clean: 42 tests passed, 0 failed
135
- Branch: <task-slug>
136
- Worktree: ../<task-slug>
137
- Ready to develop.
138
- ```
139
-
140
- Suggest next skill: `develop-tdd` to start the TDD loop, or `execute-plan` if `specs/release-plan.yaml + epic capsule directories` already exists.
141
-
142
-
135
+ Report: `✓ Preflight green` + branch + worktree. Suggest next: `develop-tdd` or `execute-plan`.
143
136
 
144
137
  ## Handoff
145
138
 
@@ -14,6 +14,10 @@ Fast-track for trivial data-only fixes that do not require the full bug-fix chai
14
14
 
15
15
  When a bug fix is purely data — an add-missing-key, a typo correction, a config value update — the standard 6-skill chain (investigate-bug → diagnose-root → develop-tdd → kickoff-branch → verify-work → release-branch) is wasteful overhead. Quick-fix collapses it to 2 skills: **quick-fix** then **release-branch**.
16
16
 
17
+ ## Discovered gate failures (e51s04)
18
+
19
+ A **Preflight**, **golden suite**, or **baseline red** failure discovered during unrelated work is valid quick-fix entry when the root cause is a data-only gap (missing key, typo, stale config) — **no user-reported bug required**. If guardrails abort (logic change, >1 file, >5 lines), fall back to `fix-bug` instead of narrating and continuing.
20
+
17
21
  ## Entry Criteria (ALL must be true)
18
22
 
19
23
  Before invoking quick-fix, evaluate every item in this checklist:
@@ -26,12 +26,12 @@ Ask the user these questions (one at a time, wait for each answer):
26
26
  2. **Stack** — "What language, framework, and runtime? (e.g. TypeScript / Next.js / Node 22)"
27
27
  2b. **Stack profile (optional)** — Offer: `swift`, `typescript-vue`, `node-service`, or none. If chosen, merge the matching fragment from `profiles/<name>.md` into generated `CONVENTIONS.md`.
28
28
  3. **Commands** — "What commands do you use for: run, test, build, lint?"
29
+ 3b. **Preflight (optional)** — "What single command runs your full local green stack (test + lint + build)? If you don't have one, we'll chain your Test + Lint + Build answers into a **Preflight** row in the Commands table."
29
30
  4. **Architecture** — "Key modules and relationships in 1–2 sentences."
30
31
  5. **Conventions** — "Any naming, file organization, or patterns all agents must follow?"
31
32
  6. **Never-do list** — "What are the hard stops? Things an agent must never touch?"
32
33
  7. **Defensive code categories** — "Which apply? (Rate limit / Retry / Circuit breaker / Timeout / Graceful degradation)"
33
34
  8. **Local tool wiring (optional)** — "Wire bigpowers skills for project-local tools that global install can't reach? (Cursor + OpenCode only)" If yes, generate the local wiring artifacts described in [REFERENCE.md](REFERENCE.md) §Local tool wiring. If no, skip — the standard seed output is unchanged.
34
- 8. **Local tool wiring (optional)** — "Wire bigpowers skills for project-local tools that global install can't reach? (Cursor + OpenCode only)" If yes, generate the local wiring artifacts described in [REFERENCE.md](REFERENCE.md) §Local tool wiring. If no, skip — the standard seed output is unchanged.
35
35
 
36
36
  ## Generate files
37
37
 
@@ -56,7 +56,9 @@ echo "# Specs\n\nAll planning documents for this project." > specs/README.md
56
56
 
57
57
  **Note:** `specs/state.yaml.lock` is NOT pre-created — acquired/released dynamically.
58
58
 
59
- `specs/state.yaml` carries a top-level `workflow_mode` key (`team-pr` | `solo-git`, default `team-pr`). This is the **canonical integrate-mode signal** for all skills — set it once here and skills such as `release-branch` read it from this file instead of sniffing profile files.
59
+ `specs/state.yaml` carries a top-level `workflow_mode` key (`team-pr` | `solo-git`, default `solo-git`). This is the **canonical integrate-mode signal** for all skills — set it once here and skills such as `release-branch` read it from this file instead of sniffing profile files.
60
+
61
+ When generating `CLAUDE.md`, if the user did not name a Preflight command, chain the Test + Lint + Build interview answers into one **Preflight** row (e.g. `npm test && npm run lint && npm run build`).
60
62
 
61
63
 
62
64
 
@@ -71,6 +73,7 @@ echo "# Specs\n\nAll planning documents for this project." > specs/README.md
71
73
 
72
74
  ---
73
75
 
76
+ # story: e51s02
74
77
  # Seed Conventions — Reference Templates
75
78
 
76
79
  ## Agent config template (CLAUDE.md / GEMINI.md / AGENTS.md)
@@ -96,6 +99,8 @@ Stack: [language, framework, runtime]
96
99
  | Test | `[cmd]` |
97
100
  | Build | `[cmd]` |
98
101
  | Lint | `[cmd]` |
102
+ | Preflight | `[test && lint && build chain — or user-named full-green cmd]` |
103
+ | CI | `gh pr checks` (when a PR is open) |
99
104
 
100
105
  ## Architecture
101
106
  [1–2 sentences. Key modules and their relationships.]
@@ -105,15 +110,17 @@ Stack: [language, framework, runtime]
105
110
  - [convention 2]
106
111
 
107
112
  ## Never
113
+ - Never dismiss reproducible gate failures as pre-existing or out of scope
114
+ - Never proceed on red Preflight or red CI — invoke quick-fix or fix-bug first
108
115
  - [hard stop 1]
109
116
  - [hard stop 2]
110
117
 
111
118
  ## Agent Rules
112
119
  - **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".
120
+ - **Always Green:** Preflight and CI must be green before forward work. Reproducible gate failures require **fix-or-log** (quick-fix → fix-bug) per CONVENTIONS § Discovered Defects.
113
121
  - Read specs/ before writing code.
114
122
  - All planning and specifications MUST be written to `specs/` (`product/SCOPE_LATEST.yaml`, `release-plan.yaml`, `epics/`) before any code is generated.
115
123
  - Write the minimum code that solves the stated problem. Nothing extra.
116
- - Never refactor, rename, or reorganize code outside the task scope.
117
124
  - Run tests after every change. Show evidence before declaring done.
118
125
  - One clarifying question beats a wrong assumption baked into 200 lines.
119
126
  ```
@@ -131,6 +138,12 @@ Stack: [language, framework, runtime]
131
138
 
132
139
  Use the standard bigpowers CONVENTIONS.md as the base. Fill in the project-specific defensive code categories from the interview answers.
133
140
 
141
+ **Always embed** these doctrine sections from bigpowers (adapt commands only):
142
+
143
+ - **§ Always Green / Shift Left** — 1-10-100 rationale, Preflight + CI green definitions
144
+ - **§ Discovered Defects** — fix-or-log ladder (quick-fix → fix-bug), separate commits for discovered fixes
145
+ - **Banned dismissive phrases** table — pre-existing, unrelated to session, not introduced by my changes, out of scope (ignoring a red gate)
146
+
134
147
  ## Stack profile fragments
135
148
 
136
149
  If the user selected a stack profile, merge the matching `profiles/<name>.md` fragment into the generated `CONVENTIONS.md` under a `## Stack Conventions` section. Profiles supply language-specific commands, architecture patterns, and never-do additions.
@@ -33,6 +33,8 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
33
33
 
34
34
  0. **Branch check** — must not be `main`/`master`.
35
35
 
36
+ 0a. **Preflight / CI green (HARD GATE — e51s03)** — Run Preflight from `CLAUDE.md` or `BP_PREFLIGHT` (`bp-read-agents.sh`). If PR open: `gh pr checks` (**CI green**). Failure blocks all phases → `quick-fix` or `fix-bug`.
37
+
36
38
  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). Note the `risk:` level (`P0`–`P3`).
37
39
  1a. **Pre-UAT verify validation** — for each task's `verify:` command, run it and detect pattern mismatches before UAT begins. If a grep/awk/jq command fails, check whether the pattern is wrong vs. a genuine failure:
38
40
  ```bash
@@ -41,7 +43,7 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
41
43
  ```
42
44
  Report: `"Pattern 'X' not found. Nearest match: 'Y' at line N"` and ask `"Update verify command? [Y/n]"`. Fix before proceeding — a mismatched verify command produces false failures during UAT.
43
45
  2. **Cold-start smoke** (if app; skip if P3): stop server, clear caches, boot from scratch.
44
- 3. **AGENTS.md preflight** — before running default checks, call `bash scripts/bp-read-agents.sh` to detect project-specific commands. If `BP_PREFLIGHT` is set, run it instead of the default mechanical gates (or in addition to them if the project requires both). Output: `"Using preflight from AGENTS.md: <cmd>"`. Fall back to `CLAUDE.md` commands if AGENTS.md is absent.
46
+ 3. **AGENTS.md preflight** — if 0a skipped BP_PREFLIGHT, run `bash scripts/bp-read-agents.sh` and use detected command.
45
47
  4. Mechanical gates: build → typecheck → lint → tests (from `CLAUDE.md` or AGENTS.md). Skip tests if P2/P3.
46
48
  5. **Security scan** (skip if P2/P3) — run `security-review` against the git diff (working tree vs merge-base). Parse findings report. If any HIGH findings with confidence ≥ 8 exist → **block the gate**. Write findings to `specs/security/REVIEW.md`. Allow documented exceptions via `specs/security/EXCEPTIONS.md`. MEDIUM/LOW findings warn but don't block.
47
49
  5a. **Blind-spot check** — run `bash scripts/check-blind-spots.sh`. This detects structural quality gaps (verify-gap, test-gap, stale-tag, etc.) beyond percentage coverage. If any HIGH-severity findings exist → **block the verify-work PASS gate**. Findings are written to `specs/blind-spots.json`. MEDIUM/LOW findings warn but don't block.
@@ -53,14 +55,7 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
53
55
 
54
56
  ### Cold-Start Smoke (absorbed)
55
57
 
56
- For applications, verify correctness from a clean state:
57
-
58
- - Stop the running server (if any)
59
- - Clear any caches (browser, application caches, compiled artifacts)
60
- - Boot the application from scratch
61
- - Verify that no stale artifacts or configuration are affecting the behavior
62
-
63
- This catches environment-specific bugs and ensures the build is reproducible.
58
+ Stop server, clear caches, boot from scratch; confirm no stale config affects behavior.
64
59
 
65
60
  ### Gaps Loop (absorbed)
66
61
 
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.72.0](https://github.com/danielvm-git/bigpowers/compare/v2.71.0...v2.72.0) (2026-07-06)
2
+
3
+
4
+ ### Features
5
+
6
+ * **gates:** Always Green — preflight hard block & fix-or-log ([cfd572d](https://github.com/danielvm-git/bigpowers/commit/cfd572db09315895273466a72c55c0e7ab3d2b64))
7
+
1
8
  # [2.71.0](https://github.com/danielvm-git/bigpowers/compare/v2.70.1...v2.71.0) (2026-07-06)
2
9
 
3
10
 
package/CLAUDE.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # story: e38s08
2
+ # story: e51s05
2
3
 
3
4
  # bigpowers — Claude Code
4
5
 
@@ -22,15 +23,17 @@ Stack: Markdown / Bash (documentation-based; skills integrate with Claude Code,
22
23
  | Typecheck | N/A (Markdown / Bash project) |
23
24
  | CI platform | GitHub Actions (`.github/workflows/publish.yml`, `sync-skills.yml`) |
24
25
  | Compliance | `npm run compliance` |
25
- | Golden Suite | `bash scripts/run-golden-suite.sh` |
26
+ | Verification Gates | `bash scripts/run-verification-gates.sh` |
26
27
  | Traceability | `bash scripts/trace-stories.sh --strict` | grep for story tags (traceability check) |
28
+ | Preflight | `npm run compliance && bash scripts/run-verification-gates.sh && bash scripts/sync-skills.sh && bash scripts/trace-stories.sh --strict` | Full local green stack before forward work |
29
+ | CI | `gh pr checks` | Remote CI green when a PR is open |
27
30
 
28
31
  ### Pre-Merge Checklist
29
32
 
30
33
  Before opening a PR or landing a branch, run:
31
34
 
32
35
  ```bash
33
- npm run compliance && bash scripts/run-golden-suite.sh
36
+ npm run compliance && bash scripts/run-verification-gates.sh
34
37
  ```
35
38
 
36
39
  If any gate fails, fix before merging. Run `--baseline` after any intentional increase in skill count or structure.
@@ -85,9 +88,9 @@ Before any task, run this sequence — not optional:
85
88
  ## Agent Rules
86
89
 
87
90
  - **Workflow Mandate:** You MUST use the bigpowers skills (e.g., `plan-work`, `develop-tdd`, `craft-skill`) to perform tasks. DO NOT write code directly in response to a user prompt like "build this feature".
91
+ - **Always Green / fix-or-log:** Preflight and CI must be green before forward work. Any reproducible gate failure during unrelated work requires **quick-fix** or **fix-bug** — see CONVENTIONS § Discovered Defects. Never dismiss failures as pre-existing or out of scope.
88
92
  - Read specs/ and CONVENTIONS.md before writing code.
89
93
  - Write the minimum code that solves the stated problem. Nothing extra.
90
- - Never refactor, rename, or reorganize code outside the task scope.
91
94
  - Run tests after every change. Show evidence before declaring done.
92
95
  - One clarifying question beats a wrong assumption baked into 200 lines.
93
96
  - All written output (plans, specs, investigations) goes in specs/.
package/CONVENTIONS.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # story: e30s02
2
2
  # story: e30s03
3
3
  # story: e38s08
4
+ # story: e51s01
4
5
 
5
6
  # Conventions
6
7
 
@@ -32,12 +33,12 @@ All changes to this repository MUST follow the [Conventional Commits 1.0.0](http
32
33
  - Never call GitHub REST API directly (curl, fetch, etc.)
33
34
  - Never create GitHub issues from automated workflows — produce local .md files in specs/ instead
34
35
 
35
- ### Pre-Merge Golden Gate
36
+ ### Pre-Merge Verification Gates
36
37
 
37
- Before merging any branch, run the deterministic golden suite:
38
+ Before merging any branch, run the deterministic verification gates:
38
39
 
39
40
  ```bash
40
- bash scripts/run-golden-suite.sh
41
+ bash scripts/run-verification-gates.sh
41
42
  ```
42
43
 
43
44
  This runs compliance → G-04 self-test. If any gate fails, the merge is blocked.
@@ -59,6 +60,43 @@ You are operating within the `bigpowers` spec-driven development methodology.
59
60
  - **Scenario ID Format (e46s04+):** When a `specs/tech-architecture/eNN-TEST_PLAN_LATEST.md` exists for the epic, critical-path scenarios use the format `SC-eNNsYY-P{0|1|2|3}-NN` (e.g. `SC-e46s04-P0-01`). These IDs are referenced inside test files as `// scenario: SC-eNNsYY-P0-NN` comments alongside the existing `// story: eNNsNN` tag. SC gaps detected via check-blind-spots.sh; no separate SC tracing script required. gate-trace treats a P0 story with zero `SC-*-P0-*` references in test files as a CONCERNS finding (waivable via `state.yaml`). P2/P3 epics may set `test_plan: waived` in `state.yaml` to skip the `plan-tests` skill.
60
61
  - **Stream Continuity:** When writing large files or long documents, you MUST output continuously in chunks of ~200 lines. Do not pause between sections. Continue immediately until complete. If you need time to process, emit a placeholder comment or heading rather than going silent to prevent stream idle timeouts.
61
62
 
63
+ ## Always Green / Shift Left
64
+
65
+ Solo developers own the whole codebase. **Always Green** means Preflight and CI are green before any forward work — not "green enough for this task."
66
+
67
+ **Shift Left (1-10-100):** Defects cost roughly 1× to fix in development, 10× in integration, 100× in production (IBM Systems Sciences Institute; CloudQA benchmarks). Fixing a red gate now is cheaper than shipping and debugging later.
68
+
69
+ **Preflight** — the project's full local verification stack (chained from test, lint, typecheck, and build commands recorded in `CLAUDE.md`). Preflight MUST pass before kickoff, develop, or verify phases advance.
70
+
71
+ **CI green** — when a PR exists or remote CI applies, `gh pr checks` (or equivalent) MUST show passing before merge or land.
72
+
73
+ **Existing projects:** Projects seeded before e51 do not receive these sections automatically. Re-run `seed-conventions` and merge the Always Green blocks, or copy § Always Green and § Discovered Defects from bigpowers `CONVENTIONS.md` manually.
74
+
75
+ ## Discovered Defects
76
+
77
+ Any **reproducible gate failure** encountered during unrelated work is a discovered defect — not optional background noise.
78
+
79
+ **fix-or-log ladder (mandatory):**
80
+
81
+ 1. **quick-fix** — trivial, data-only, or single-file fixes within guardrails.
82
+ 2. **fix-bug** — when quick-fix guardrails abort, or the failure needs investigation (`specs/bugs/BUG-*.md` + TDD).
83
+ 3. **Log** — only when reproduction is blocked after good-faith attempt; write a BUG spec and stop forward work on the original task until triaged.
84
+
85
+ Discovered fixes ship in the **same PR** as the original work but in **separate commits** (Conventional Commits). Never narrate a failure and continue.
86
+
87
+ **Hard block:** Red Preflight or red CI blocks kickoff-branch, develop-tdd, and verify-work forward progress until fix-or-log produces green.
88
+
89
+ ### Banned dismissive phrases
90
+
91
+ Agents MUST NOT use these phrases (or close paraphrases) to ignore reproducible failures:
92
+
93
+ | Banned phrase | Required behavior instead |
94
+ |---------------|---------------------------|
95
+ | Pre-existing / pre-existing issues | Run fix-or-log; if truly unrelated, prove with a passing repro after revert |
96
+ | unrelated to this session | Same — session boundaries do not waive green gates |
97
+ | not introduced by my changes | Bisect or fix anyway; solo-default owns the whole tree |
98
+ | out of scope (ignoring a red gate) | Invoke quick-fix or fix-bug; scope-minimization never overrides Always Green |
99
+
62
100
  ## specs/ — All Planning Output Goes Here
63
101
 
64
102
  Every skill that produces written output writes to `specs/` at the project root.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.71.0",
3
+ "version": "2.72.0",
4
4
  "description": "73 agent skills synthesizing 17 years of software engineering discipline into a prescriptive methodology for solo developers",
5
5
  "main": "index.js",
6
6
  "scripts": {