bigpowers 2.73.8 → 2.74.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/.continue/rules/context7-mcp.md +0 -0
- package/.continue/rules/diagnose-stall.md +0 -0
- package/.kilocode/rules/context7-mcp.md +0 -0
- package/.kilocode/rules/diagnose-stall.md +0 -0
- package/.pi/package.json +2 -2
- package/.pi/prompts/audit-code.md +17 -13
- package/.pi/prompts/change-request.md +3 -1
- package/.pi/prompts/compose-workflow.md +15 -0
- package/.pi/prompts/context7-mcp.md +54 -0
- package/.pi/prompts/craft-skill.md +28 -0
- package/.pi/prompts/deepen-architecture.md +20 -0
- package/.pi/prompts/delegate-task.md +14 -0
- package/.pi/prompts/deploy.md +8 -0
- package/.pi/prompts/develop-tdd.md +15 -4
- package/.pi/prompts/diagnose-stall.md +53 -0
- package/.pi/prompts/dispatch-agents.md +49 -19
- package/.pi/prompts/gate-trace.md +9 -1
- package/.pi/prompts/guard-git.md +14 -0
- package/.pi/prompts/migrate-spec.md +12 -0
- package/.pi/prompts/plan-work.md +62 -2
- package/.pi/prompts/publish-package.md +11 -0
- package/.pi/prompts/release-branch.md +39 -43
- package/.pi/prompts/request-review.md +57 -17
- package/.pi/prompts/run-benchmark.md +3 -3
- package/.pi/prompts/run-evals.md +26 -6
- package/.pi/prompts/security-review.md +56 -8
- package/.pi/prompts/seed-conventions.md +61 -0
- package/.pi/prompts/session-state.md +5 -10
- package/.pi/prompts/slice-tasks.md +3 -0
- package/.pi/prompts/smoke-test.md +11 -0
- package/.pi/prompts/stocktake-skills.md +2 -1
- package/.pi/prompts/validate-contracts.md +12 -0
- package/.pi/prompts/validate-fix.md +2 -0
- package/.pi/prompts/verify-work.md +31 -20
- package/.pi/prompts/wire-ci.md +11 -0
- package/.pi/prompts/write-document.md +10 -0
- package/.pi/skills/audit-code/SKILL.md +17 -13
- package/.pi/skills/change-request/SKILL.md +3 -1
- package/.pi/skills/compose-workflow/SKILL.md +15 -0
- package/.pi/skills/context7-mcp/SKILL.md +56 -0
- package/.pi/skills/craft-skill/SKILL.md +28 -0
- package/.pi/skills/deepen-architecture/SKILL.md +20 -0
- package/.pi/skills/delegate-task/SKILL.md +14 -0
- package/.pi/skills/deploy/SKILL.md +8 -0
- package/.pi/skills/develop-tdd/SKILL.md +15 -4
- package/.pi/skills/diagnose-stall/SKILL.md +55 -0
- package/.pi/skills/dispatch-agents/SKILL.md +49 -19
- package/.pi/skills/gate-trace/SKILL.md +9 -1
- package/.pi/skills/guard-git/SKILL.md +14 -0
- package/.pi/skills/migrate-spec/SKILL.md +12 -0
- package/.pi/skills/plan-work/SKILL.md +62 -2
- package/.pi/skills/publish-package/SKILL.md +11 -0
- package/.pi/skills/release-branch/SKILL.md +39 -43
- package/.pi/skills/request-review/SKILL.md +57 -17
- package/.pi/skills/run-benchmark/SKILL.md +3 -3
- package/.pi/skills/run-evals/SKILL.md +26 -6
- package/.pi/skills/security-review/SKILL.md +56 -8
- package/.pi/skills/seed-conventions/SKILL.md +61 -0
- package/.pi/skills/session-state/SKILL.md +5 -10
- package/.pi/skills/slice-tasks/SKILL.md +3 -0
- package/.pi/skills/smoke-test/SKILL.md +11 -0
- package/.pi/skills/stocktake-skills/SKILL.md +2 -1
- package/.pi/skills/validate-contracts/SKILL.md +12 -0
- package/.pi/skills/validate-fix/SKILL.md +2 -0
- package/.pi/skills/verify-work/SKILL.md +31 -20
- package/.pi/skills/wire-ci/SKILL.md +11 -0
- package/.pi/skills/write-document/SKILL.md +10 -0
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +59 -1
- package/CONVENTIONS.md +80 -5
- package/README.md +1 -1
- package/SKILL-INDEX.md +1 -1
- package/package.json +1 -1
- package/scripts/bp-churn-rank.sh +49 -0
- package/scripts/check-import-boundaries.sh +64 -0
- package/scripts/compile-rule-matrix.sh +114 -0
- package/scripts/hooks/rtk-rewrite.sh +11 -0
- package/scripts/hooks/token-mgmt-pre-tool-use.sh +53 -0
- package/scripts/install.sh +6 -0
- package/scripts/lib/completeness-critic.sh +62 -0
- package/scripts/lib/doc-fetch-cache.sh +71 -0
- package/scripts/lib/golden-suite-gates.sh +3 -1
- package/scripts/lib/parallel-review-worktrees.sh +34 -0
- package/scripts/lib/plan-consistency-check.sh +88 -0
- package/scripts/lib/run-benchmark.py +210 -0
- package/scripts/lib/simple_yaml.py +130 -0
- package/scripts/lib/sync-context-engineering-ref.sh +19 -0
- package/scripts/lib/trace-matrix.py +10 -281
- package/scripts/lib/trace_renderer.py +147 -0
- package/scripts/references-manifest.yaml +19 -0
- package/scripts/run-benchmark.sh +6 -0
- package/scripts/sync-references.sh +25 -0
- package/scripts/test-trace-matrix-size.sh +46 -0
- package/scripts/validate-skill-catalog.sh +147 -0
- package/scripts/validate-skill-description.sh +70 -0
- package/skills/audit-code/SKILL.md +19 -13
- package/skills/change-request/SKILL.md +3 -1
- package/skills/compose-workflow/SKILL.md +15 -0
- package/skills/context7-mcp/SKILL.md +57 -0
- package/skills/craft-skill/SKILL.md +29 -0
- package/skills/deepen-architecture/SKILL.md +22 -0
- package/skills/delegate-task/SKILL.md +14 -0
- package/skills/deploy/SKILL.md +9 -0
- package/skills/develop-tdd/SKILL.md +18 -4
- package/skills/diagnose-stall/SKILL.md +56 -0
- package/skills/dispatch-agents/SKILL.md +51 -19
- package/skills/gate-trace/SKILL.md +11 -1
- package/skills/guard-git/REFERENCE.md +14 -0
- package/skills/migrate-spec/REFERENCE.md +12 -0
- package/skills/plan-work/REFERENCE.md +29 -2
- package/skills/plan-work/SKILL.md +38 -0
- package/skills/publish-package/REFERENCE.md +11 -0
- package/skills/release-branch/REFERENCE.md +14 -0
- package/skills/release-branch/SKILL.md +28 -43
- package/skills/request-review/SKILL.md +59 -17
- package/skills/run-benchmark/SKILL.md +4 -4
- package/skills/run-evals/REFERENCE.md +14 -4
- package/skills/run-evals/SKILL.md +13 -2
- package/skills/security-review/REFERENCE-false-positives.md +9 -8
- package/skills/security-review/REFERENCE-vuln-categories.md +4 -0
- package/skills/security-review/SKILL.md +45 -0
- package/skills/security-review/fixtures/CWE-79-xss-negative.js +6 -0
- package/skills/security-review/fixtures/CWE-79-xss-positive.js +6 -0
- package/skills/security-review/fixtures/CWE-89-sqli-negative.py +8 -0
- package/skills/security-review/fixtures/CWE-89-sqli-positive.py +9 -0
- package/skills/seed-conventions/REFERENCE.md +40 -0
- package/skills/seed-conventions/SKILL.md +22 -0
- package/skills/session-state/SKILL.md +5 -10
- package/skills/slice-tasks/SKILL.md +3 -0
- package/skills/smoke-test/REFERENCE.md +11 -0
- package/skills/stocktake-skills/SKILL.md +3 -1
- package/skills/validate-contracts/REFERENCE.md +12 -0
- package/skills/validate-fix/SKILL.md +3 -0
- package/skills/verify-work/REFERENCE.md +17 -0
- package/skills/verify-work/SKILL.md +18 -20
- package/skills/wire-ci/REFERENCE.md +11 -0
- package/skills/write-document/REFERENCE.md +10 -0
- package/skills-lock.json +32 -22
|
@@ -5,12 +5,24 @@ model: sonnet
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
# story: e45s26
|
|
9
|
+
|
|
8
10
|
# Security Review
|
|
9
11
|
|
|
10
12
|
> **HARD GATE** — Requires git context (branch with merge-base or diff). Never
|
|
11
13
|
> writes files outside `specs/security/`. Findings below confidence 8/10 are
|
|
12
14
|
> suppressed. **→ verify:** `git rev-parse HEAD >/dev/null 2>&1 && echo "ok" || echo "BLOCKED"`
|
|
13
15
|
|
|
16
|
+
## Parallel worktree mode (e45s18)
|
|
17
|
+
|
|
18
|
+
When running alongside `audit-code`, use isolated worktrees so scans do not race on the same index:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
bash scripts/lib/parallel-review-worktrees.sh security-review
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Each check gets a detached worktree at `.bigpowers/worktrees/review-<name>/`; reports still write only under `specs/security/`.
|
|
25
|
+
|
|
14
26
|
## 5-phase scan
|
|
15
27
|
|
|
16
28
|
| # | Phase | What |
|
|
@@ -25,6 +37,37 @@ model: sonnet
|
|
|
25
37
|
|
|
26
38
|
Covered: SQLi, XSS, SSRF, command injection, auth bypass, unsafe deserialization, path traversal, IDOR, crypto flaws, secrets exposure, template injection, NoSQLi
|
|
27
39
|
|
|
40
|
+
## CWE mapping mandate (e45s26)
|
|
41
|
+
|
|
42
|
+
Every **new detection rule** added to this skill MUST:
|
|
43
|
+
|
|
44
|
+
1. Map to a [CWE](https://cwe.mitre.org/) ID in `REFERENCE-vuln-categories.md` (e.g. SQLi → CWE-89, XSS → CWE-79).
|
|
45
|
+
2. Ship **two fixture pairs** under `skills/security-review/fixtures/`:
|
|
46
|
+
- **Positive** — minimal code the rule MUST flag (vulnerable pattern present).
|
|
47
|
+
- **Negative** — structurally similar code the rule MUST NOT flag (safe pattern / false-positive guard).
|
|
48
|
+
|
|
49
|
+
| Rule | CWE | Positive fixture | Negative fixture |
|
|
50
|
+
|------|-----|------------------|------------------|
|
|
51
|
+
| SQL injection | CWE-89 | `fixtures/CWE-89-sqli-positive.py` | `fixtures/CWE-89-sqli-negative.py` |
|
|
52
|
+
| XSS (DOM) | CWE-79 | `fixtures/CWE-79-xss-positive.js` | `fixtures/CWE-79-xss-negative.js` |
|
|
53
|
+
|
|
54
|
+
Before merging a new category, run both fixtures through the detection guidance and confirm positive flags / negative passes.
|
|
55
|
+
|
|
56
|
+
## SQL-safety doctrine (e45s41 — proven authorship)
|
|
57
|
+
|
|
58
|
+
Formal rule for SQL injection classification:
|
|
59
|
+
|
|
60
|
+
| SQL source | Attacker-reachable input? | Verdict |
|
|
61
|
+
|------------|---------------------------|---------|
|
|
62
|
+
| Hardcoded / compile-time constant string | N/A | **Safe** — proven authorship |
|
|
63
|
+
| Developer-authored query with bound parameters only | No dynamic fragments from user input | **Safe** |
|
|
64
|
+
| String concatenation / template with user-controlled values | Yes | **Unsafe** — report as SQLi |
|
|
65
|
+
| ORM query builder with user input in WHERE/JOIN | Yes | **Unsafe** unless parameterized |
|
|
66
|
+
| Stored procedure call with bound args | Args from trusted constants only | **Safe** |
|
|
67
|
+
| Stored procedure with dynamic SQL inside | User input reaches EXEC | **Unsafe** |
|
|
68
|
+
|
|
69
|
+
**Provenance test:** If the agent cannot prove the query string was authored entirely by the developer (no attacker-reachable interpolation), treat as vulnerable. Hardcoded SQL in migrations, seeds, and admin scripts is safe; anything reachable from HTTP/CLI/user input is not.
|
|
70
|
+
|
|
28
71
|
## BCP Plus Integration
|
|
29
72
|
|
|
30
73
|
This skill maps to **BCP Plus dimension 12 (Security & Compliance)**. When BCP Plus sizing is active, the threat model categories above correspond to sub-elements within dimension 12. The NFR Gate rule applies: standard-expectation items (e.g., "use HTTPS", "hash passwords") score 0 with a one-line rationale; only above-standard security requirements contribute to the dimension 12 count. See `docs/references/bcp-plus.md` for the full 13-dimension framework and NFR Gate pattern.
|
|
@@ -176,14 +219,15 @@ Automatically exclude findings matching these patterns:
|
|
|
176
219
|
| 8 | **Race conditions / timing attacks** that are theoretical | Only report if concretely problematic |
|
|
177
220
|
| 9 | **Outdated third-party libraries** | Managed separately by dependency scanners |
|
|
178
221
|
| 10 | **Memory safety** in Rust or other memory-safe languages | Impossible by language guarantees |
|
|
179
|
-
| 11 | **
|
|
180
|
-
| 12 | **
|
|
181
|
-
| 13 | **
|
|
182
|
-
| 14 | **
|
|
183
|
-
| 15 | **
|
|
184
|
-
| 16 | **Regex
|
|
185
|
-
| 17 | **
|
|
186
|
-
| 18 | **
|
|
222
|
+
| 11 | **Hardcoded SQL with proven authorship** — migrations, seeds, static admin queries with no user interpolation | Developer-authored SQL is safe per SQL-safety doctrine (e45s41) |
|
|
223
|
+
| 12 | **Unit test files only** | Not production risk |
|
|
224
|
+
| 13 | **Log spoofing** | Outputting unsanitized input to logs is not a vuln |
|
|
225
|
+
| 14 | **SSRF that only controls path** | Only host/protocol control is exploitable |
|
|
226
|
+
| 15 | **User-controlled content in AI system prompts** | Not a security vulnerability |
|
|
227
|
+
| 16 | **Regex injection** | Injecting untrusted content into regex is not a vuln |
|
|
228
|
+
| 17 | **Regex DOS** | Excluded alongside general DOS |
|
|
229
|
+
| 18 | **Documentation files** (.md, .txt) | Insecure docs are not code vulnerabilities |
|
|
230
|
+
| 19 | **Lack of audit logs** | Not a vulnerability |
|
|
187
231
|
|
|
188
232
|
## Precedent Rules
|
|
189
233
|
|
|
@@ -235,6 +279,8 @@ Each category: vulnerable pattern → safe pattern → code example.
|
|
|
235
279
|
| Aspect | Detail |
|
|
236
280
|
|--------|--------|
|
|
237
281
|
| **Vulnerable** | String interpolation in SQL queries: `f"SELECT * FROM users WHERE id = {uid}"` |
|
|
282
|
+
| **CWE** | CWE-89 (SQL Injection) |
|
|
283
|
+
| **Fixtures** | `fixtures/CWE-89-sqli-positive.py` (flag) · `fixtures/CWE-89-sqli-negative.py` (pass) |
|
|
238
284
|
| **Safe** | Parameterized queries / ORM: `cursor.execute("SELECT * FROM users WHERE id = %s", (uid,))` |
|
|
239
285
|
| **Look for** | f-strings, `+` concatenation, `format()` in query builders; raw SQL in ORM `.raw()` / `.execute()` |
|
|
240
286
|
| **False-positive guard** | Not a FP if the input is user-controlled (HTTP param, file, env var, CLI arg). Env vars are trusted (see exclusion rules). |
|
|
@@ -244,6 +290,8 @@ Each category: vulnerable pattern → safe pattern → code example.
|
|
|
244
290
|
| Aspect | Detail |
|
|
245
291
|
|--------|--------|
|
|
246
292
|
| **Vulnerable** | `element.innerHTML = userInput`, `dangerouslySetInnerHTML={{__html: userInput}}` |
|
|
293
|
+
| **CWE** | CWE-79 (Cross-site Scripting) |
|
|
294
|
+
| **Fixtures** | `fixtures/CWE-79-xss-positive.js` (flag) · `fixtures/CWE-79-xss-negative.js` (pass) |
|
|
247
295
|
| **Safe** | `element.textContent = userInput`, React JSX (auto-escaped), template engines with auto-escaping |
|
|
248
296
|
| **Look for** | `.innerHTML`, `document.write()`, `dangerouslySetInnerHTML`, `v-html` (Vue), `bypassSecurityTrustHtml` (Angular) |
|
|
249
297
|
| **False-positive guard** | React/Angular components without unsafe methods are NOT vulnerable (see exclusion rules). |
|
|
@@ -63,7 +63,28 @@ echo "# Specs\n\nAll planning documents for this project." > specs/README.md
|
|
|
63
63
|
|
|
64
64
|
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`).
|
|
65
65
|
|
|
66
|
+
### Self-installing fenced markers (e45s21)
|
|
66
67
|
|
|
68
|
+
Skills that write into `CLAUDE.md` or `AGENTS.md` MUST use **fenced HTML comment markers** so handwritten content outside the fence is never clobbered:
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
<!-- BEGIN bigpowers:section-id -->
|
|
72
|
+
…agent-managed content only…
|
|
73
|
+
<!-- END bigpowers:section-id -->
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Merge rule:** On update, replace only the content *between* matching `BEGIN`/`END` pairs. If a marker pair is missing, append a new fenced block at the end of the file — never rewrite the whole file.
|
|
77
|
+
|
|
78
|
+
**Standard marker IDs** for seeded projects (see [REFERENCE.md](REFERENCE.md) § Fenced markers):
|
|
79
|
+
|
|
80
|
+
| Marker ID | Owner skill | Purpose |
|
|
81
|
+
|-----------|-------------|---------|
|
|
82
|
+
| `project` | seed-conventions | Project, Commands, Architecture |
|
|
83
|
+
| `context-routing` | seed-conventions | Glob → sub-AGENTS.md routing table |
|
|
84
|
+
| `learned-preferences` | session-state | Learned User Preferences + Workspace Facts |
|
|
85
|
+
| `tooling` | setup-environment, guard-git | sqz/rtk/hook blocks installed by tooling skills |
|
|
86
|
+
|
|
87
|
+
Emit these fences in `AGENTS.md` (and therefore `CLAUDE.md` symlink) from `docs/templates/AGENTS.md`. User prose outside fences is sacred.
|
|
67
88
|
|
|
68
89
|
- [ ] CLAUDE.md exists and is populated
|
|
69
90
|
- [ ] CONVENTIONS.md exists and includes specs/ output convention
|
|
@@ -77,8 +98,48 @@ When generating `CLAUDE.md`, if the user did not name a Preflight command, chain
|
|
|
77
98
|
---
|
|
78
99
|
|
|
79
100
|
# story: e51s02 e37s01 e37s03 e37s14
|
|
101
|
+
# story: e45s21
|
|
80
102
|
# Seed Conventions — Reference Templates
|
|
81
103
|
|
|
104
|
+
## Navigation
|
|
105
|
+
|
|
106
|
+
| Lines | Section |
|
|
107
|
+
|-------|---------|
|
|
108
|
+
| 1–4 | Title + story tags |
|
|
109
|
+
| 6–22 | Navigation (this table) |
|
|
110
|
+
| 24–35 | AGENTS.md spine |
|
|
111
|
+
| 37–76 | Agent config template |
|
|
112
|
+
| 78–85 | opencode.json template |
|
|
113
|
+
| 87–96 | Aider bridge |
|
|
114
|
+
| 98–108 | Codex CLI wiring |
|
|
115
|
+
| 110–118 | CONVENTIONS.md |
|
|
116
|
+
| 120–122 | Stack profile fragments |
|
|
117
|
+
| 124–153 | Local tool wiring |
|
|
118
|
+
|
|
119
|
+
## Fenced markers (e45s21)
|
|
120
|
+
|
|
121
|
+
Self-installing blocks prevent skills from overwriting user-authored prose. Pattern:
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
<!-- BEGIN bigpowers:section-id -->
|
|
125
|
+
…managed content…
|
|
126
|
+
<!-- END bigpowers:section-id -->
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Merge algorithm:**
|
|
130
|
+
|
|
131
|
+
1. If `BEGIN bigpowers:<id>` exists → replace inner content only.
|
|
132
|
+
2. If missing → append new fenced block at EOF.
|
|
133
|
+
3. Never delete content outside fences.
|
|
134
|
+
|
|
135
|
+
Seed these marker IDs in generated `AGENTS.md`:
|
|
136
|
+
|
|
137
|
+
| ID | Initial content |
|
|
138
|
+
|----|-----------------|
|
|
139
|
+
| `project` | Project, Commands, Architecture, Conventions, Never, Agent Rules |
|
|
140
|
+
| `context-routing` | Glob → sub-AGENTS.md table (see CLAUDE.md e45s22) |
|
|
141
|
+
| `learned-preferences` | Empty Learned User Preferences + Workspace Facts lists |
|
|
142
|
+
|
|
82
143
|
## AGENTS.md spine (Reach Template — e37s01)
|
|
83
144
|
|
|
84
145
|
Canonical source: copy from `docs/templates/AGENTS.md` in the bigpowers repo (Reach Template).
|
|
@@ -5,6 +5,8 @@ model: haiku
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
# story: e45s23
|
|
9
|
+
|
|
8
10
|
# Session State
|
|
9
11
|
> **HARD GATE** — **HARD GATE** — Session state must be synchronized with git state. If state.yaml conflicts with the working tree, halt and ask for clarification. Do NOT assume state is correct.
|
|
10
12
|
|
|
@@ -19,6 +21,8 @@ Maintain a single source of truth for the *current* session in `specs/state.yaml
|
|
|
19
21
|
|
|
20
22
|
Legacy markdown (`specs/archive/STATE.md`, `RELEASE-PLAN.md`) is **not** SoT when YAML exists — use `specs/state.yaml` only.
|
|
21
23
|
|
|
24
|
+
When a story modifies existing behavior, patch only between matching marker pairs in `CLAUDE.md` / `AGENTS.md` `learned-preferences` fence — see e45s21.
|
|
25
|
+
|
|
22
26
|
## Handoff block (cold start)
|
|
23
27
|
|
|
24
28
|
When ending a session or before a context-heavy spawn, update `handoff` in `state.yaml`:
|
|
@@ -65,6 +69,7 @@ When starting a new session or after a significant context flush:
|
|
|
65
69
|
Whenever a significant decision is made or a milestone is reached:
|
|
66
70
|
|
|
67
71
|
- [ ] Patch via `bash scripts/bp-yaml-set.sh specs/state.yaml git.hash <hash>` (or edit directly).
|
|
72
|
+
- [ ] Patch `handoff` and `learned_preferences` / `workspace_facts` in `CLAUDE.md` fenced block when durable user preferences or repo facts crystallize (e45s23).
|
|
68
73
|
- [ ] Update `handoff.open_decisions` with rationale.
|
|
69
74
|
- [ ] Update `epic_cycle` when advancing `ship-epic` steps.
|
|
70
75
|
- [ ] Record open questions under `handoff.open_decisions` or an ADR.
|
|
@@ -131,16 +136,6 @@ handoff:
|
|
|
131
136
|
next_skill: survey-context
|
|
132
137
|
```
|
|
133
138
|
|
|
134
|
-
## Tracking commit ratio
|
|
135
|
-
|
|
136
|
-
After `release-branch` lands, compute fix-to-feature ratio via:
|
|
137
|
-
```bash
|
|
138
|
-
FEAT_COUNT=$(git log main --oneline --grep="^feat" | wc -l | tr -d ' ')
|
|
139
|
-
FIX_COUNT=$(git log main --oneline --grep="^fix" | wc -l | tr -d ' ')
|
|
140
|
-
FIX_PCT=$((FIX_COUNT * 100 / (FEAT_COUNT + FIX_COUNT)))
|
|
141
|
-
```
|
|
142
|
-
Update `specs/state.yaml` `metrics.commit_ratio` with counts. If `fix_pct > 30%`, emit: `"High fix rate (N%) — deploy + smoke-test recommended"`.
|
|
143
|
-
|
|
144
139
|
## Anti-Patterns
|
|
145
140
|
|
|
146
141
|
- **Duplicate Plan**: Don't copy `release-plan.yaml` or epic shards into `state.yaml`.
|
|
@@ -5,6 +5,8 @@ model: sonnet
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
# story: e45s29
|
|
9
|
+
|
|
8
10
|
# Slice Tasks
|
|
9
11
|
|
|
10
12
|
> **Spine position:** Step 2 — scope-work → slice-tasks → plan-work.
|
|
@@ -37,6 +39,7 @@ Produce **epic capsule story tasks** in `specs/epics/eNN-slug/` — vertical sli
|
|
|
37
39
|
- `eNNsYY-tasks.yaml` with `story_id`, `title`, `status`, `bcps`, `tasks[]` (each with `id`, `description`, `verify`, `status`)
|
|
38
40
|
- Story spec `.md` files are written by `plan-work` and follow countable-story-format.md
|
|
39
41
|
- The epic capsule manifest (`epic.yaml`) is updated to list the story ID and BCPs
|
|
42
|
+
- **Requirement deltas (e45s29):** Stories that alter existing behavior MUST carry `delta:` in `epic.yaml` (`ADDED` | `MODIFIED` | `REMOVED` | `RENAMED`). `plan-work` expands deltas into full before/after requirement text.
|
|
40
43
|
|
|
41
44
|
5. **Order by WSJF** in `release-plan.yaml` epic list — highest WSJF first. Weight-shortest-job-first ensures the highest value arrives earliest.
|
|
42
45
|
|
|
@@ -70,6 +70,17 @@ DEPLOY_URL="$DEPLOY_URL" bash scripts/run-smoke.sh
|
|
|
70
70
|
|
|
71
71
|
# Smoke Test — Reference
|
|
72
72
|
|
|
73
|
+
## Navigation
|
|
74
|
+
|
|
75
|
+
| Lines | Section |
|
|
76
|
+
|-------|---------|
|
|
77
|
+
| 1 | Title |
|
|
78
|
+
| 3–12 | Navigation |
|
|
79
|
+
| 14–31 | Runner script |
|
|
80
|
+
| 33–42 | Configuration reference |
|
|
81
|
+
| 44–53 | Verification |
|
|
82
|
+
| 55–160 | Reference blocks 1–5 |
|
|
83
|
+
|
|
73
84
|
## Runner script
|
|
74
85
|
|
|
75
86
|
A ready-to-use runner is provided for standalone operation:
|
|
@@ -21,6 +21,7 @@ Audit SKILL.md catalog for drift, stale triggers, missing HARD GATEs, and INDEX
|
|
|
21
21
|
|
|
22
22
|
## Process
|
|
23
23
|
|
|
24
|
+
0. **Catalog validator (code-enforced)** — run `bash scripts/validate-skill-catalog.sh`. Any FAIL is a critical finding before manual review. Add `--archive` to list zero-usage skills from `metrics.skill_timings` for auto-archiving candidates (move to `specs/epics/archive/` or delete after user confirms).
|
|
24
25
|
1. Run `bash scripts/audit-catalog.sh` to verify pi/skills ↔ source SKILL.md sync. Mismatch is a critical finding.
|
|
25
26
|
2. Run mode; for each skill check: exists, verb-noun, <300 lines total, HARD GATE present, INDEX row matches.
|
|
26
27
|
3. Write `specs/STOCKTAKE-<date>.md` with findings table (skill, issue, severity).
|
|
@@ -52,7 +53,7 @@ Timing data is populated by `scripts/bp-timing.sh start|end <skill>` calls withi
|
|
|
52
53
|
|
|
53
54
|
## Verify
|
|
54
55
|
|
|
55
|
-
→ verify: `test -f specs/STOCKTAKE-*.md && echo OK || echo MISSING`
|
|
56
|
+
→ verify: `test -f specs/STOCKTAKE-*.md && bash scripts/validate-skill-catalog.sh && echo OK || echo MISSING`
|
|
56
57
|
|
|
57
58
|
See [REFERENCE.md](REFERENCE.md) for checklist.
|
|
58
59
|
|
|
@@ -115,6 +115,18 @@ bash scripts/validate-contracts.sh <contract-file>
|
|
|
115
115
|
|
|
116
116
|
# Validate Contracts — Reference
|
|
117
117
|
|
|
118
|
+
## Navigation
|
|
119
|
+
|
|
120
|
+
| Lines | Section |
|
|
121
|
+
|-------|---------|
|
|
122
|
+
| 1 | Title |
|
|
123
|
+
| 3–14 | Navigation |
|
|
124
|
+
| 16–24 | Integration |
|
|
125
|
+
| 26–35 | Configuration |
|
|
126
|
+
| 37–46 | Verification |
|
|
127
|
+
| 48–170 | Reference blocks + Examples 1–6 |
|
|
128
|
+
| 172–190 | Integration (duplicate) + Configuration + Verification |
|
|
129
|
+
|
|
118
130
|
## Integration
|
|
119
131
|
|
|
120
132
|
- **Pre-deploy gate:** The `deploy` skill runs `validate-contracts` before smoke-test.
|
|
@@ -11,6 +11,8 @@ model: haiku
|
|
|
11
11
|
|
|
12
12
|
Prove the fix works. "I think it works" is not evidence. Run the suite, show the output, then harden against recurrence.
|
|
13
13
|
|
|
14
|
+
> **Two-commit red/green policy (e45s08)** — Bug fixes follow the same two-commit discipline as `develop-tdd`: first commit adds/adjusts the failing test (`test(<scope>): …`), second commit applies the fix (`fix(<scope>): …`). Do not squash RED and GREEN before review.
|
|
15
|
+
|
|
14
16
|
## Checklist
|
|
15
17
|
|
|
16
18
|
### 1. Re-run the originally failing test
|
|
@@ -45,12 +45,20 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
|
|
|
45
45
|
2. **Cold-start smoke** (if app; skip if P3): stop server, clear caches, boot from scratch.
|
|
46
46
|
3. **AGENTS.md preflight** — if 0a skipped BP_PREFLIGHT, run `bash scripts/bp-read-agents.sh` and use detected command.
|
|
47
47
|
4. Mechanical gates: build → typecheck → lint → tests (from `CLAUDE.md` or AGENTS.md). Skip tests if P2/P3.
|
|
48
|
+
|
|
49
|
+
> **HARD GATE — One-test-minimum terminal verdict (e45s13):** At least one mechanical gate MUST be a **real terminal-verdict command** (shell exits 0 or non-zero — not prose, not combined log excerpts). Record that command's stdout/stderr from a **single contiguous run** in `specs/verifications/eNNsYY-verify.yaml` under `terminal_verdict`. Bug reports and gap logs MUST NOT merge evidence from multiple runs into one verdict — each failing run gets its own evidence block.
|
|
50
|
+
|
|
48
51
|
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.
|
|
49
52
|
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
|
+
5a2. **Completeness critic (e45s05)** — `bash scripts/lib/completeness-critic.sh`. **BLOCKER** aborts merge gate; WARNING → gaps loop; FILLED = evidence only.
|
|
54
|
+
|
|
50
55
|
5b. **NFR Evidence Gate** (P0 only) — Produces go/no-go output on three dimensions: Performance (response time, throughput), Reliability (error rate, recovery), and Operability (logging, health checks). Reads thresholds from `specs/tech-architecture/eNN-TEST_PLAN_LATEST.md` and writes evidence as OKF verification-report bundles to `specs/verifications/NFR-eNNsYY.json`. FAIL on any dimension blocks the gate.
|
|
51
56
|
6. **Step-by-step UAT** (skip if P2/P3) — one user-observable action at a time.
|
|
52
57
|
7. **Gaps loop** — failures → log → `plan-work` → re-verify. Unaddressed HIGH findings from step 5 feed into this loop alongside other quality gaps.
|
|
53
58
|
|
|
59
|
+
7a. **Validation gate (e45s09)** — All tasks `status: passing`; evidence in `specs/verifications/`; update `execution-status.yaml`.
|
|
60
|
+
7b. **Reopen-don't-refile (e45s09)** — Regressions reopen existing story/bug — no duplicate capsule entries.
|
|
61
|
+
|
|
54
62
|
## Verify sub-operations
|
|
55
63
|
|
|
56
64
|
### Cold-Start Smoke (absorbed)
|
|
@@ -93,6 +101,11 @@ phases:
|
|
|
93
101
|
tests:
|
|
94
102
|
passed: true
|
|
95
103
|
coverage: "94.2%"
|
|
104
|
+
terminal_verdict:
|
|
105
|
+
command: "npm test"
|
|
106
|
+
exit_code: 0
|
|
107
|
+
captured_at: "2026-06-11T14:25:00Z"
|
|
108
|
+
note: "Single run — do not merge output from other attempts"
|
|
96
109
|
manual:
|
|
97
110
|
steps:
|
|
98
111
|
- step: "Open /login"
|
|
@@ -114,26 +127,7 @@ for p in specs/conventions-wiki/*.md; do [ "$(basename "$p")" = "index.md" ]&&co
|
|
|
114
127
|
|
|
115
128
|
## --cli mode
|
|
116
129
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
**Auto-detect binary name:**
|
|
120
|
-
```bash
|
|
121
|
-
# Cargo.toml
|
|
122
|
-
BINARY=$(grep '^name' Cargo.toml | head -1 | awk -F'"' '{print $2}')
|
|
123
|
-
# package.json
|
|
124
|
-
BINARY=$(node -e "console.log(require('./package.json').bin && Object.keys(require('./package.json').bin)[0] || '')" 2>/dev/null)
|
|
125
|
-
# Makefile
|
|
126
|
-
BINARY=$(grep '^BIN\s*=' Makefile 2>/dev/null | awk '{print $3}')
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**CLI verification checklist (replaces cold-start smoke):**
|
|
130
|
-
|
|
131
|
-
1. `--help` smoke: `$BINARY --help` → assert output contains "Usage"
|
|
132
|
-
2. `--version` check: `$BINARY --version` → assert version matches manifest (Cargo.toml / package.json)
|
|
133
|
-
3. Happy-path: run documented example command from README.md → assert non-empty output
|
|
134
|
-
4. Edge case: `$BINARY --invalid-flag` → assert exit code ≠ 0 and error message printed
|
|
135
|
-
|
|
136
|
-
No "stop server" / "clear caches" in `--cli` mode. Steps 3–6 still run unchanged.
|
|
130
|
+
CLI tools: use `--cli` when no server process. Binary detect + checklist: [REFERENCE.md](REFERENCE.md#cli-mode).
|
|
137
131
|
|
|
138
132
|
## Verify
|
|
139
133
|
|
|
@@ -168,3 +162,20 @@ sleep 3 && curl -sf http://localhost:<port>/health || echo "BOOT FAIL"
|
|
|
168
162
|
```
|
|
169
163
|
|
|
170
164
|
Feed gaps to `plan-work` as new steps with verify commands, then re-run verify-work.
|
|
165
|
+
|
|
166
|
+
## CLI mode
|
|
167
|
+
|
|
168
|
+
For CLI tools where cold-start smoke does not apply. Auto-detected when no server process; or use `--cli`.
|
|
169
|
+
|
|
170
|
+
**Auto-detect binary name:**
|
|
171
|
+
```bash
|
|
172
|
+
BINARY=$(grep '^name' Cargo.toml | head -1 | awk -F'"' '{print $2}') # Cargo
|
|
173
|
+
BINARY=$(node -e "console.log(require('./package.json').bin && Object.keys(require('./package.json').bin)[0] || '')" 2>/dev/null)
|
|
174
|
+
BINARY=$(grep '^BIN\s*=' Makefile 2>/dev/null | awk '{print $3}')
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Checklist (replaces cold-start smoke):**
|
|
178
|
+
1. `$BINARY --help` → output contains "Usage"
|
|
179
|
+
2. `$BINARY --version` → matches manifest
|
|
180
|
+
3. README example command → non-empty output
|
|
181
|
+
4. `$BINARY --invalid-flag` → exit ≠ 0 with error message
|
|
@@ -108,6 +108,17 @@ Add the following to the project's documentation or CLAUDE.md after setup:
|
|
|
108
108
|
|
|
109
109
|
# Wire Ci — Reference
|
|
110
110
|
|
|
111
|
+
## Navigation
|
|
112
|
+
|
|
113
|
+
| Lines | Section |
|
|
114
|
+
|-------|---------|
|
|
115
|
+
| 1 | Title |
|
|
116
|
+
| 3–14 | Navigation |
|
|
117
|
+
| 16–38 | Examples |
|
|
118
|
+
| 40–52 | Options |
|
|
119
|
+
| 54–62 | Integration with build-epic |
|
|
120
|
+
| 64–270 | Reference blocks 1–8 |
|
|
121
|
+
|
|
111
122
|
## Examples
|
|
112
123
|
|
|
113
124
|
### Create CI for a Rust project
|
|
@@ -82,6 +82,16 @@ Suggest next skill: `audit-code` or `sync-skills.sh`.
|
|
|
82
82
|
|
|
83
83
|
Combined from dbader/readme-template and jehna/readme-best-practices. No TOC.
|
|
84
84
|
|
|
85
|
+
## Navigation
|
|
86
|
+
|
|
87
|
+
| Lines | Section |
|
|
88
|
+
|-------|---------|
|
|
89
|
+
| 1 | Title |
|
|
90
|
+
| 5–16 | Navigation |
|
|
91
|
+
| 18–24 | Sections intro |
|
|
92
|
+
| 26–178 | README section templates (1–15) |
|
|
93
|
+
| 180–183 | Verify |
|
|
94
|
+
|
|
85
95
|
## Sections
|
|
86
96
|
|
|
87
97
|
### 1. Title + Badges
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [2.74.0](https://github.com/danielvm-git/bigpowers/compare/v2.73.9...v2.74.0) (2026-07-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **e45:** skill hardening & verification patterns (s01–s41) ([9253dc0](https://github.com/danielvm-git/bigpowers/commit/9253dc04d4304256cdc07263a24eaf0ec7d757df))
|
|
7
|
+
|
|
8
|
+
## [2.73.9](https://github.com/danielvm-git/bigpowers/compare/v2.73.8...v2.73.9) (2026-07-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **gate-trace:** split trace-matrix.py under 300-line cap ([ece8389](https://github.com/danielvm-git/bigpowers/commit/ece8389c815614d116d91b57dda9c67f6133caaf))
|
|
14
|
+
|
|
1
15
|
## [2.73.8](https://github.com/danielvm-git/bigpowers/compare/v2.73.7...v2.73.8) (2026-07-07)
|
|
2
16
|
|
|
3
17
|
|
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,50 @@
|
|
|
1
1
|
# story: e38s08
|
|
2
2
|
# story: e51s05
|
|
3
|
+
# story: e45s22
|
|
4
|
+
# story: e45s23
|
|
3
5
|
|
|
4
6
|
# bigpowers — Claude Code
|
|
5
7
|
|
|
6
8
|
Read CONVENTIONS.md before any GitHub or git operation.
|
|
7
9
|
|
|
10
|
+
<!-- BEGIN bigpowers:context-routing -->
|
|
11
|
+
## Context Routing
|
|
12
|
+
|
|
13
|
+
Load subdirectory context **by file glob** — do not read the full doc tree up front.
|
|
14
|
+
|
|
15
|
+
| Glob / trigger | Load first | Fallback |
|
|
16
|
+
|----------------|------------|----------|
|
|
17
|
+
| `skills/**` | Active skill's `SKILL.md` + sibling `REFERENCE.md` if linked | `SKILL-INDEX.md` |
|
|
18
|
+
| `specs/epics/**` | Capsule `epic.yaml` + active story `-tasks.yaml` | `specs/release-plan.yaml` |
|
|
19
|
+
| `specs/product/**` | `SCOPE_LATEST.yaml`, `VISION_LATEST.yaml` | `specs/README.md` |
|
|
20
|
+
| `specs/tech-architecture/**` | `tech-stack.md` + epic `eNN-TEST_PLAN_LATEST.md` if present | `CONVENTIONS.md` |
|
|
21
|
+
| `scripts/**` | `CONVENTIONS.md` § Generated artifact targets | This file § Commands |
|
|
22
|
+
| `website/**` | `website/README.md` if present | Never edit `website/src/content/docs/` (generated) |
|
|
23
|
+
| `docs/**` | Matching doc under `docs/` | `docs/references/` |
|
|
24
|
+
| Default / session start | This file → `CONVENTIONS.md` → `specs/state.yaml` | `survey-context` |
|
|
25
|
+
|
|
26
|
+
Sub-AGENTS.md files (when present in consumer projects) override this table for their directory only.
|
|
27
|
+
<!-- END bigpowers:context-routing -->
|
|
28
|
+
|
|
29
|
+
<!-- BEGIN bigpowers:learned-preferences -->
|
|
30
|
+
## Learned User Preferences
|
|
31
|
+
|
|
32
|
+
_Durable preferences discovered across sessions. Update via `session-state` — do not infer from chat alone._
|
|
33
|
+
|
|
34
|
+
- Prefer `rtk`-prefixed shell commands for git, test, and build output (token savings).
|
|
35
|
+
- Run Preflight before forward work; never dismiss red gates as pre-existing.
|
|
36
|
+
- Edit `skills/*/SKILL.md` sources only — never `.cursor/rules/` or `.gemini/` artifacts.
|
|
37
|
+
|
|
38
|
+
## Workspace Facts
|
|
39
|
+
|
|
40
|
+
_Stable repo facts — prefer these over re-discovery._
|
|
41
|
+
|
|
42
|
+
- Stack: Markdown / Bash documentation project; skills sync via `bash scripts/sync-skills.sh`.
|
|
43
|
+
- Planning SoT: `specs/state.yaml`, `specs/release-plan.yaml`, `specs/execution-status.yaml`.
|
|
44
|
+
- Story traceability: `# story: eNNsNN` tags in implementing files; `bash scripts/trace-stories.sh --strict` in CI.
|
|
45
|
+
- Rule matrix: `bash scripts/compile-rule-matrix.sh` → `specs/rule-matrix.json` (P0–P3 tiers from CONVENTIONS.md).
|
|
46
|
+
<!-- END bigpowers:learned-preferences -->
|
|
47
|
+
|
|
8
48
|
## Project
|
|
9
49
|
|
|
10
50
|
bigpowers — agent skills for spec-driven, test-first software development by solo developers (skill count and catalog are auto-generated in `SKILL-INDEX.md`; never hardcode the count in docs).
|
|
@@ -62,6 +102,18 @@ Collection of verb-noun skills under `skills/`, each with a SKILL.md source file
|
|
|
62
102
|
|
|
63
103
|
## Token Management
|
|
64
104
|
|
|
105
|
+
**Mechanical backstop (e45s03):** `scripts/hooks/token-mgmt-pre-tool-use.sh` blocks oversized tool calls when prose rules are ignored. Wire as a `PreToolUse` hook for `Read`, `Grep`, and `Bash` (alongside `hooks/pre-tool-use.sh` for git safety). Thresholds: Read >100KB, Grep >200 matches without `head_limit`, Bash commands likely to exceed 500 output lines without `rtk`/`sqz compress`. Install snippet:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"hooks": {
|
|
110
|
+
"PreToolUse": [
|
|
111
|
+
{ "matcher": "Read|Grep|Bash", "hooks": [{ "type": "command", "command": "bash scripts/hooks/token-mgmt-pre-tool-use.sh" }] }
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
65
117
|
Context engineering (write/select/compress/isolate — see `docs/references/context-engineering.md`):
|
|
66
118
|
|
|
67
119
|
- **Write (token-efficient content):** Short functions (4-20 lines), unique symbol names, headless tests. Don't restate code in comments.
|
|
@@ -113,9 +165,15 @@ Before any task, run this sequence — not optional:
|
|
|
113
165
|
- Search with `bts find` before opening files to locate a symbol or pattern.
|
|
114
166
|
- Pipe anything > 200 lines through `bts compress` before adding to context.
|
|
115
167
|
- Run `bts map` when asked for a repo overview.
|
|
116
|
-
- Use `bts docs <lib>` before answering questions about library APIs.
|
|
168
|
+
- Use `bts docs <lib>` before answering questions about library APIs. Doc fetches use `scripts/lib/doc-fetch-cache.sh` (ETag-revalidated, 300s TTL — see `context7-mcp` skill, e45s20).
|
|
117
169
|
- If a tool is missing, say so and run `bts doctor` — do not silently substitute.
|
|
118
170
|
|
|
171
|
+
<!-- BEGIN rtk-pretooluse-hook (e45s16 — mechanical PreToolUse backstop; remove block to disable) -->
|
|
172
|
+
|
|
173
|
+
**RTK hook (installed):** `scripts/hooks/rtk-rewrite.sh` is symlinked into `~/.claude/hooks/` by `bash scripts/install.sh` and registered as a Bash `PreToolUse` hook. It delegates to `rtk hook claude` — prose rules below are a fallback only when the hook is absent.
|
|
174
|
+
|
|
175
|
+
<!-- END rtk-pretooluse-hook -->
|
|
176
|
+
|
|
119
177
|
<!-- BEGIN sqz-claude-guidance (auto-installed by sqz init; remove this block to disable) -->
|
|
120
178
|
|
|
121
179
|
## sqz — Context Compression (READ FIRST)
|
package/CONVENTIONS.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
# story: e30s02
|
|
2
2
|
# story: e30s03
|
|
3
3
|
# story: e38s08
|
|
4
|
+
# story: e45s10
|
|
4
5
|
# story: e51s01
|
|
6
|
+
# story: e45s25
|
|
7
|
+
# story: e45s36
|
|
5
8
|
|
|
6
9
|
# Conventions
|
|
7
10
|
|
|
@@ -86,6 +89,43 @@ Discovered fixes ship in the **same PR** as the original work but in **separate
|
|
|
86
89
|
|
|
87
90
|
**Hard block:** Red Preflight or red CI blocks kickoff-branch, develop-tdd, and verify-work forward progress until fix-or-log produces green.
|
|
88
91
|
|
|
92
|
+
## Risk Tiers (Effective Rule Matrix)
|
|
93
|
+
|
|
94
|
+
Human-readable source of truth for verification depth. Machine-readable compile:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
bash scripts/compile-rule-matrix.sh # → specs/rule-matrix.json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Diff `specs/rule-matrix.json` across git tags to audit rule drift. Schema version in JSON `matrix_version` field.
|
|
101
|
+
|
|
102
|
+
### P0 — Critical (never violate)
|
|
103
|
+
|
|
104
|
+
- **[always-green]**: Preflight and CI must be green before forward work. (`verify-work`, `kickoff-branch`, `develop-tdd`)
|
|
105
|
+
- **[no-direct-coding]**: Route feature work through bigpowers skills — no ad-hoc implementation without a plan in `specs/`. (`plan-work`, `orchestrate-project`)
|
|
106
|
+
- **[traceability]**: Every story has ≥1 `story: eNNsNN` tag in implementing code or tests. (`trace-stories.sh --strict`)
|
|
107
|
+
- **[no-generated-edits]**: Never edit `.cursor/rules/`, `.gemini/`, or `website/src/content/docs/` directly. (`sync-skills.sh`)
|
|
108
|
+
|
|
109
|
+
### P1 — High (fix before merge)
|
|
110
|
+
|
|
111
|
+
- **[conventional-commits]**: All commits follow Conventional Commits; semantic-release owns version bumps. (`commit-message`, `release-branch`)
|
|
112
|
+
- **[verify-per-story]**: Every story/task has runnable `verify:` commands; `verify-work` confirms before done. (`plan-work`, `verify-work`)
|
|
113
|
+
- **[test-on-change]**: New functions and bug fixes include tests; regressions get regression tests. (`develop-tdd`, `validate-fix`)
|
|
114
|
+
- **[branch-protection]**: No direct work on `main`/`master`; feature branches via `kickoff-branch`. (`guard-git`)
|
|
115
|
+
|
|
116
|
+
### P2 — Medium (address in same epic or next)
|
|
117
|
+
|
|
118
|
+
- **[plan-tests-waiver]**: P2/P3-dominant epics may set `test_plan: waived` in `state.yaml`. (`plan-tests`)
|
|
119
|
+
- **[file-size-cap]**: Source files under 300 lines unless listed in § File-Size Exceptions. (`audit-code`)
|
|
120
|
+
- **[handoff-signaling]**: Critical-path skills write `handoff.next_skill` to `state.yaml`. (`session-state`)
|
|
121
|
+
- **[delta-requirements]**: Behavior changes require `ADDED`/`MODIFIED`/`REMOVED`/`RENAMED` tags in requirement specs. (`plan-work`, `change-request`)
|
|
122
|
+
|
|
123
|
+
### P3 — Low (best effort)
|
|
124
|
+
|
|
125
|
+
- **[boy-scout]**: Leave touched files at least as clean as found. (`audit-code`)
|
|
126
|
+
- **[terse-when-heavy]**: Switch to `terse-mode` when context exceeds ~20 turns. (`terse-mode`)
|
|
127
|
+
- **[skill-naming]**: Verb-noun kebab-case under `skills/`; documented exceptions only. (`craft-skill`)
|
|
128
|
+
|
|
89
129
|
### Banned dismissive phrases
|
|
90
130
|
|
|
91
131
|
Agents MUST NOT use these phrases (or close paraphrases) to ignore reproducible failures:
|
|
@@ -178,6 +218,30 @@ When planning closes, copy to `specs/product/snapshots/release-<version>/` (`rel
|
|
|
178
218
|
|
|
179
219
|
Validate YAML layout: `bash scripts/validate-specs-yaml.sh`. Patch runtime keys: `bash scripts/bp-yaml-set.sh specs/state.yaml git.branch feat/foo`.
|
|
180
220
|
|
|
221
|
+
### Documentation Responsibilities (e45s36)
|
|
222
|
+
|
|
223
|
+
Each specs/ artifact owns specific facts. Update the owning file when the fact changes — do not duplicate across files.
|
|
224
|
+
|
|
225
|
+
| File / directory | Owns | Update when |
|
|
226
|
+
|------------------|------|-------------|
|
|
227
|
+
| `specs/state.yaml` | Active session, handoff, story timing, workflow mode | Every skill handoff; branch switch; story start/end |
|
|
228
|
+
| `specs/release-plan.yaml` | Epic ordering, WSJF, BCP baselines, release codename | New epic scoped; WSJF re-prioritized; BCP re-estimated |
|
|
229
|
+
| `specs/execution-status.yaml` | Story/epic done/todo status (sole SoT) | Story completes; gate-trace runs; manual status change |
|
|
230
|
+
| `specs/product/SCOPE_LATEST.yaml` | In/out of scope, initiative boundaries | scope-work; change-request Add mode |
|
|
231
|
+
| `specs/product/VISION_LATEST.yaml` | North star, strategic intent | Major product pivot; scope-work |
|
|
232
|
+
| `specs/product/GLOSSARY_LATEST.yaml` | Canonical domain terms | define-language; model-domain term crystallizes |
|
|
233
|
+
| `specs/epics/eNN-*/epic.yaml` | Epic manifest, story list, BCPs | slice-tasks; plan-work adds stories |
|
|
234
|
+
| `specs/epics/eNN-*/eNNsYY-*.md` | Story requirements (countable-story-format) | plan-work; section approval state changes |
|
|
235
|
+
| `specs/epics/eNN-*/eNNsYY-tasks.yaml` | Runnable implementation tasks + verify | plan-work; develop-tdd task completion |
|
|
236
|
+
| `specs/tech-architecture/tech-stack.md` | Stack, modules, gray areas | map-codebase; deepen-architecture; model-domain |
|
|
237
|
+
| `specs/tech-architecture/eNN-TEST_PLAN_LATEST.md` | P0/P1 test scenarios per epic | plan-tests |
|
|
238
|
+
| `specs/adr/ADR-*.md` | Architectural decisions | model-domain; deepen-architecture ADR offer accepted |
|
|
239
|
+
| `specs/bugs/BUG-*.md` | Bug RCA + fix plan | investigate-bug |
|
|
240
|
+
| `specs/bugs/registry.yaml` | Bug index (generated) | inspect-quality; sync-bugs-registry.sh |
|
|
241
|
+
| `specs/verifications/*` | Verify evidence, audit reports, eval reports | verify-work; audit-code; run-evals |
|
|
242
|
+
| `specs/security/REVIEW.md` | Latest security scan findings | security-review |
|
|
243
|
+
| `specs/metrics/cycle-times.yaml` | Delivery velocity ledger | release-branch lands story |
|
|
244
|
+
|
|
181
245
|
### Generated artifact targets
|
|
182
246
|
|
|
183
247
|
Skill content is edited in `skills/*/SKILL.md` and auto-propagated to these targets by `bash scripts/sync-skills.sh`:
|
|
@@ -291,13 +355,24 @@ window. The following files are documented exceptions:
|
|
|
291
355
|
|
|
292
356
|
| File | Lines | Rationale | Review date |
|
|
293
357
|
|------|-------|-----------|-------------|
|
|
294
|
-
| `scripts/lib/trace-matrix.py` | 523 | Traceability matrix engine: tag scanning, oracle-confidence scoring, and JSON/markdown emission share tightly-coupled dataclasses and a single pass over the story index. Splitting would fragment the matrix model across modules. Split candidate for a future plan-refactor (BUG-2026-07-04-filesize-gate-python-blindspot); documented meanwhile. Also exceeds the 500-line cap. | 2026-10-01 |
|
|
295
|
-
| `scripts/lib/trace-stories.py` | 301 | Story-tag discovery + file-to-story mapping; the phases share regex state and a common file walk. One line over cap; monitor for split alongside trace-matrix.py. | 2026-10-01 |
|
|
296
358
|
| `scripts/audit-compliance.sh` | 300 | Gherkin harness with embedded judge logic and waiver subsystem; splitting the judge loop from the reporting layer would require fragile state-passing. At the 300-line cap; monitor. | 2026-10-01 |
|
|
297
359
|
|
|
298
360
|
**Note:** `scripts/trace-stories.sh` was refactored from a 613-line monolith into a
|
|
299
|
-
69-line orchestrator delegating to
|
|
300
|
-
|
|
301
|
-
|
|
361
|
+
69-line orchestrator delegating to `scripts/lib/trace-stories.py`. `scripts/lib/trace-matrix.py`
|
|
362
|
+
was split into `simple_yaml.py` + `trace_renderer.py` (252 lines); see
|
|
363
|
+
BUG-2026-07-06-gate-trace-matrix-oversized. Prior exception rows for trace-matrix.py
|
|
364
|
+
and trace-stories.py are removed — both are now under the 300-line cap.
|
|
302
365
|
|
|
303
366
|
Any new exception requires an entry in this table with rationale and a review date.
|
|
367
|
+
|
|
368
|
+
## docs/references SSOT Sync (e45s10)
|
|
369
|
+
|
|
370
|
+
Agent-guidance files under `docs/references/` are **distilled from upstream sources**, not hand-edited ad hoc. Canonical inputs live in `CLAUDE.md`, `docs/PRINCIPLES.md`, and `skills/*/SKILL.md`.
|
|
371
|
+
|
|
372
|
+
| Action | Command |
|
|
373
|
+
|--------|---------|
|
|
374
|
+
| Regenerate locally | `bash scripts/sync-references.sh` |
|
|
375
|
+
| Manifest | `scripts/references-manifest.yaml` |
|
|
376
|
+
| Scheduled CI | `.github/workflows/sync-references.yml` (weekly) |
|
|
377
|
+
|
|
378
|
+
After changing SKILL.md `model:` frontmatter or token-management prose in CLAUDE.md, run `sync-references.sh` to refresh reference docs and `.sync-stamp`.
|