@sienklogic/plan-build-run 2.37.0 → 2.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/package.json +1 -1
  3. package/plugins/copilot-pbr/agents/audit.agent.md +1 -0
  4. package/plugins/copilot-pbr/agents/codebase-mapper.agent.md +1 -0
  5. package/plugins/copilot-pbr/agents/debugger.agent.md +3 -0
  6. package/plugins/copilot-pbr/agents/dev-sync.agent.md +23 -0
  7. package/plugins/copilot-pbr/agents/executor.agent.md +1 -0
  8. package/plugins/copilot-pbr/agents/integration-checker.agent.md +7 -4
  9. package/plugins/copilot-pbr/agents/planner.agent.md +27 -1
  10. package/plugins/copilot-pbr/agents/researcher.agent.md +4 -1
  11. package/plugins/copilot-pbr/agents/verifier.agent.md +29 -12
  12. package/plugins/copilot-pbr/commands/test.md +5 -0
  13. package/plugins/copilot-pbr/plugin.json +1 -1
  14. package/plugins/copilot-pbr/references/verification-patterns.md +44 -17
  15. package/plugins/copilot-pbr/skills/config/SKILL.md +12 -2
  16. package/plugins/copilot-pbr/skills/health/SKILL.md +13 -5
  17. package/plugins/copilot-pbr/skills/setup/SKILL.md +9 -1
  18. package/plugins/copilot-pbr/skills/shared/context-budget.md +10 -0
  19. package/plugins/copilot-pbr/skills/shared/universal-anti-patterns.md +6 -0
  20. package/plugins/copilot-pbr/skills/test/SKILL.md +210 -0
  21. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  22. package/plugins/cursor-pbr/agents/audit.md +1 -0
  23. package/plugins/cursor-pbr/agents/codebase-mapper.md +1 -0
  24. package/plugins/cursor-pbr/agents/debugger.md +3 -0
  25. package/plugins/cursor-pbr/agents/dev-sync.md +23 -0
  26. package/plugins/cursor-pbr/agents/executor.md +1 -0
  27. package/plugins/cursor-pbr/agents/integration-checker.md +7 -4
  28. package/plugins/cursor-pbr/agents/planner.md +27 -1
  29. package/plugins/cursor-pbr/agents/researcher.md +4 -1
  30. package/plugins/cursor-pbr/agents/verifier.md +29 -12
  31. package/plugins/cursor-pbr/commands/test.md +5 -0
  32. package/plugins/cursor-pbr/references/verification-patterns.md +44 -17
  33. package/plugins/cursor-pbr/skills/config/SKILL.md +12 -2
  34. package/plugins/cursor-pbr/skills/health/SKILL.md +14 -5
  35. package/plugins/cursor-pbr/skills/setup/SKILL.md +9 -1
  36. package/plugins/cursor-pbr/skills/shared/context-budget.md +10 -0
  37. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +6 -0
  38. package/plugins/cursor-pbr/skills/test/SKILL.md +211 -0
  39. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  40. package/plugins/pbr/agents/audit.md +1 -0
  41. package/plugins/pbr/agents/codebase-mapper.md +1 -0
  42. package/plugins/pbr/agents/debugger.md +3 -0
  43. package/plugins/pbr/agents/dev-sync.md +23 -0
  44. package/plugins/pbr/agents/executor.md +1 -0
  45. package/plugins/pbr/agents/integration-checker.md +7 -4
  46. package/plugins/pbr/agents/planner.md +27 -1
  47. package/plugins/pbr/agents/researcher.md +4 -1
  48. package/plugins/pbr/agents/verifier.md +29 -12
  49. package/plugins/pbr/commands/test.md +5 -0
  50. package/plugins/pbr/references/verification-patterns.md +44 -17
  51. package/plugins/pbr/scripts/context-bridge.js +15 -9
  52. package/plugins/pbr/scripts/lib/config.js +96 -3
  53. package/plugins/pbr/scripts/lib/core.js +9 -0
  54. package/plugins/pbr/scripts/lib/migrate.js +169 -0
  55. package/plugins/pbr/scripts/lib/todo.js +300 -0
  56. package/plugins/pbr/scripts/pbr-tools.js +82 -3
  57. package/plugins/pbr/skills/config/SKILL.md +12 -2
  58. package/plugins/pbr/skills/health/SKILL.md +14 -3
  59. package/plugins/pbr/skills/help/SKILL.md +2 -0
  60. package/plugins/pbr/skills/setup/SKILL.md +9 -1
  61. package/plugins/pbr/skills/shared/context-budget.md +10 -0
  62. package/plugins/pbr/skills/shared/universal-anti-patterns.md +6 -0
  63. package/plugins/pbr/skills/test/SKILL.md +212 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ All notable changes to Plan-Build-Run will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.38.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.37.0...plan-build-run-v2.38.0) (2026-02-27)
9
+
10
+
11
+ ### Features
12
+
13
+ * **quick-016:** add L4 verification, failure markers, roadmap dual format, requirement coverage ([1260623](https://github.com/SienkLogic/plan-build-run/commit/1260623f483ae0e62a22b7637bfd3400da7883df))
14
+ * **quick-016:** enhance agent success criteria and behavioral anchors from GSD gap analysis ([a3ac95a](https://github.com/SienkLogic/plan-build-run/commit/a3ac95a7cb0cfc6a44905bdbba1b2e354aabb7ea))
15
+ * **quick-017:** add migrate subcommand to pbr-tools.js dispatcher ([8b4737a](https://github.com/SienkLogic/plan-build-run/commit/8b4737aa11eca1eea46a259805bd128ff3bee2e4))
16
+ * **quick-017:** GREEN - implement migrate.js and wire CURRENT_SCHEMA_VERSION into config.js ([84beb51](https://github.com/SienkLogic/plan-build-run/commit/84beb51b77af7e4ee6db59e868df291f114e621e))
17
+ * **scripts:** add CRITICAL tier to context-bridge ([4f46411](https://github.com/SienkLogic/plan-build-run/commit/4f464114b1401de3c6bb22c3fb2baff56ce3502f))
18
+ * **skills:** add /pbr:test skill with command across all plugins ([a38d6e3](https://github.com/SienkLogic/plan-build-run/commit/a38d6e3f8fc3eda17a5810b38bd17fddaccb730a))
19
+ * **skills:** add save-defaults, load-defaults, and --repair flag ([a56d1c9](https://github.com/SienkLogic/plan-build-run/commit/a56d1c9468c7212b802b18d71b7fe951b924d1c0))
20
+ * **tools:** add todo.js library with tests ([2ba058b](https://github.com/SienkLogic/plan-build-run/commit/2ba058bb2f143333a920ef8dd14b09021d7abe11))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **tests:** force-add fixture todo files ignored by .gitignore ([1b89f11](https://github.com/SienkLogic/plan-build-run/commit/1b89f1178b3980b9e167d8d137e300b0f2aa9e7d))
26
+ * **tools:** clean up .bak files in atomicWrite + add agent body sync tests ([af1aba2](https://github.com/SienkLogic/plan-build-run/commit/af1aba29ed80e46ec0e901974f6c851151274579))
27
+
8
28
  ## [2.37.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.36.0...plan-build-run-v2.37.0) (2026-02-27)
9
29
 
10
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sienklogic/plan-build-run",
3
- "version": "2.37.0",
3
+ "version": "2.38.0",
4
4
  "description": "Plan it, Build it, Run it — structured development workflow for Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -223,3 +223,4 @@ CRITICAL: Your final output MUST end with exactly one completion marker.
223
223
  Orchestrators pattern-match on these markers to route results. Omitting causes silent failures.
224
224
 
225
225
  - `## AUDIT COMPLETE` - audit report written to .planning/audits/
226
+ - `## AUDIT FAILED` - could not complete audit (no session logs found, unreadable JSONL)
@@ -126,6 +126,7 @@ CRITICAL: Your final output MUST end with exactly one completion marker.
126
126
  Orchestrators pattern-match on these markers to route results. Omitting causes silent failures.
127
127
 
128
128
  - `## MAPPING COMPLETE` - analysis document written to output path
129
+ - `## MAPPING FAILED` - could not complete analysis (empty project, inaccessible files)
129
130
 
130
131
  ---
131
132
 
@@ -28,6 +28,9 @@ You are **debugger**, the systematic debugging agent. Investigate bugs using the
28
28
  - [ ] Evidence log maintained (append-only)
29
29
  - [ ] Scientific method followed (hypothesis, test, observe)
30
30
  - [ ] Fix committed with root cause in body (if fix mode)
31
+ - [ ] Fix verification: original issue no longer reproduces
32
+ - [ ] Fix verification: regression tests pass (existing tests still green)
33
+ - [ ] Fix verification: no environment-specific assumptions introduced
31
34
  - [ ] Debug file updated with current status
32
35
  - [ ] Completion marker returned
33
36
  </success_criteria>
@@ -112,3 +112,26 @@ Copied verbatim (no transformations needed).
112
112
  6. DO NOT leave `argument-hint` in Copilot skills
113
113
  7. DO NOT consume more than 50% context before producing output
114
114
  8. DO NOT spawn sub-agents — this agent performs only file read/write operations
115
+
116
+ ---
117
+
118
+ <success_criteria>
119
+ - [ ] Source file(s) read from plugins/pbr/
120
+ - [ ] File type determined (skill, agent, reference, shared, template)
121
+ - [ ] Transformations applied per rules table
122
+ - [ ] Cursor derivative written with correct format (no allowed-tools, ${PLUGIN_ROOT})
123
+ - [ ] Copilot derivative written with correct format (.agent.md extension, no model/memory)
124
+ - [ ] Derivative-specific content preserved (not overwritten)
125
+ - [ ] Sync report returned with files modified and transformations applied
126
+ - [ ] Completion marker returned
127
+ </success_criteria>
128
+
129
+ ---
130
+
131
+ ## Completion Protocol
132
+
133
+ CRITICAL: Your final output MUST end with exactly one completion marker.
134
+ Orchestrators pattern-match on these markers to route results. Omitting causes silent failures.
135
+
136
+ - `## SYNC COMPLETE` - all derivatives updated
137
+ - `## SYNC FAILED` - could not complete sync, reason provided
@@ -368,6 +368,7 @@ Record timestamps at start and end using `node -e "console.log(new Date().toISOS
368
368
  - [ ] All tasks executed (or checkpoint state returned)
369
369
  - [ ] Each task committed individually with proper format
370
370
  - [ ] All deviations documented in SUMMARY.md
371
+ - [ ] All requirement_ids from PLAN frontmatter copied to SUMMARY requirements-completed
371
372
  - [ ] SUMMARY.md created with substantive content (not placeholder)
372
373
  - [ ] Self-check performed: all key_files exist on disk
373
374
  - [ ] Self-check performed: all commits present in git log
@@ -148,6 +148,7 @@ See `references/integration-patterns.md` for grep/search patterns by framework.
148
148
 
149
149
  ### Agent-Specific
150
150
  - Never attempt to fix issues — you REPORT them
151
+ - ALWAYS include specific file paths and line numbers in every finding — never say "the config module" without a path
151
152
  - Imports are not usage — verify symbols are actually called
152
153
  - "File exists" is not "component is integrated"
153
154
  - Auth middleware existing somewhere does not mean routes are protected
@@ -159,11 +160,12 @@ See `references/integration-patterns.md` for grep/search patterns by framework.
159
160
  ---
160
161
 
161
162
  <success_criteria>
162
- - [ ] All 5 check categories evaluated
163
- - [ ] Cross-phase dependencies verified
164
- - [ ] E2E flows traced end-to-end
163
+ - [ ] All check categories evaluated (export/import, API routes, auth, E2E flows, cross-phase deps, data-flow)
164
+ - [ ] Cross-phase dependencies verified (provides/consumes chains satisfied)
165
+ - [ ] E2E flows traced end-to-end with specific file paths as evidence
165
166
  - [ ] Export/import wiring confirmed
166
- - [ ] Critical issues documented with evidence
167
+ - [ ] Requirements integration map: every requirement traced to implementation with wiring status
168
+ - [ ] Critical issues documented with evidence (file paths, line numbers)
167
169
  - [ ] INTEGRATION-REPORT.md written
168
170
  - [ ] Completion marker returned
169
171
  </success_criteria>
@@ -176,3 +178,4 @@ CRITICAL: Your final output MUST end with exactly one completion marker.
176
178
  Orchestrators pattern-match on these markers to route results. Omitting causes silent failures.
177
179
 
178
180
  - `## INTEGRATION CHECK COMPLETE` - report written with pass/fail status
181
+ - `## INTEGRATION CHECK FAILED` - could not complete checks (missing artifacts, no phases to check)
@@ -42,6 +42,17 @@ Invoked with plan-checker feedback containing issues. Revise flagged plan(s) to
42
42
  ### Mode 4: Roadmap Mode
43
43
  Invoked with a request to create/update the project roadmap. Produce `.planning/ROADMAP.md` using the template at `${PLUGIN_ROOT}/templates/ROADMAP.md.tmpl`.
44
44
 
45
+ #### Requirement Coverage Validation
46
+
47
+ Before writing ROADMAP.md, cross-reference REQUIREMENTS.md (or the goals from the begin output) against the planned phases. Every requirement MUST appear in at least one phase's goal or provides list. If any requirement is unassigned, either add it to an existing phase or create a new phase. Report coverage: `{covered}/{total} requirements mapped to phases`.
48
+
49
+ #### Dual Format: Checklist + Detail
50
+
51
+ ROADMAP.md MUST contain TWO representations of the phase structure:
52
+
53
+ 1. **Quick-scan checklist** (at the top, after milestone header) — one line per phase with status
54
+ 2. **Detailed phase descriptions** — full goal, discovery, provides, depends-on per phase
55
+
45
56
  #### Fallback Format: ROADMAP.md (if template unreadable)
46
57
 
47
58
  ```markdown
@@ -50,6 +61,12 @@ Invoked with a request to create/update the project roadmap. Produce `.planning/
50
61
  ## Milestone: {project} v1.0
51
62
  **Goal:** {one-line milestone goal}
52
63
  **Phases:** 1 - {N}
64
+ **Requirement coverage:** {covered}/{total} requirements mapped
65
+
66
+ ### Phase Checklist
67
+ - [ ] Phase 01: {name} — {one-line goal summary}
68
+ - [ ] Phase 02: {name} — {one-line goal summary}
69
+ - [ ] Phase 03: {name} — {one-line goal summary}
53
70
 
54
71
  ### Phase 01: {name}
55
72
  **Goal:** {goal}
@@ -58,7 +75,7 @@ Invoked with a request to create/update the project roadmap. Produce `.planning/
58
75
  **Depends on:** {list}
59
76
  ```
60
77
 
61
- **Milestone grouping:** All phases in the initial roadmap MUST be wrapped in a `## Milestone: {project name} v1.0` section. This section includes `**Goal:**` and `**Phases:** 1 - {N}`, followed by the `### Phase NN:` details. For comprehensive-depth projects (8+ phases), consider splitting into multiple milestones if there are natural delivery boundaries (e.g., "Core Platform" phases 1-5, "Advanced Features" phases 6-10). Each milestone section follows the format defined in the roadmap template.
78
+ **Milestone grouping:** All phases in the initial roadmap MUST be wrapped in a `## Milestone: {project name} v1.0` section. This section includes `**Goal:**`, `**Phases:** 1 - {N}`, and `**Requirement coverage:**`, followed by the Phase Checklist and `### Phase NN:` details. For comprehensive-depth projects (8+ phases), consider splitting into multiple milestones if there are natural delivery boundaries (e.g., "Core Platform" phases 1-5, "Advanced Features" phases 6-10). Each milestone section follows the format defined in the roadmap template.
62
79
 
63
80
  ---
64
81
 
@@ -234,8 +251,14 @@ When receiving checker feedback:
234
251
  - [ ] Tasks grouped into plans by wave
235
252
  - [ ] PLAN files exist with XML task structure
236
253
  - [ ] Each plan: frontmatter complete (depends_on, files_modified, must_haves)
254
+ - [ ] Each plan: requirement_ids field populated (MUST NOT be empty)
237
255
  - [ ] Each task: all 5 elements (name, files, action, verify, done)
238
256
  - [ ] Wave structure maximizes parallelism
257
+ - [ ] Every REQ-ID from ROADMAP/REQUIREMENTS appears in at least one plan
258
+ - [ ] Gap closure mode (if VERIFICATION.md exists): gaps clustered, tasks derived from gap.missing
259
+ - [ ] Revision mode (if re-planning): flagged issues addressed, no new issues introduced, waves still valid
260
+ - [ ] Context fidelity: locked decisions from CONTEXT.md all have corresponding tasks
261
+ - [ ] PLAN files written via Write tool (NEVER Bash heredoc)
239
262
  - [ ] PLAN files committed to git
240
263
  </success_criteria>
241
264
 
@@ -249,6 +272,7 @@ Orchestrators pattern-match on these markers to route results. Omitting causes s
249
272
  - `## PLANNING COMPLETE` - all plan files written and self-checked
250
273
  - `## PLANNING FAILED` - cannot produce valid plans from available context
251
274
  - `## PLANNING INCONCLUSIVE` - need more research or user decisions
275
+ - `## CHECKPOINT REACHED` - blocked on human decision, checkpoint details provided
252
276
 
253
277
  ---
254
278
 
@@ -306,6 +330,8 @@ One-line task descriptions in `<name>`. File paths in `<files>`, not explanation
306
330
  10. DO NOT assume research is done — check discovery level
307
331
  11. DO NOT leave done conditions vague — they must be observable
308
332
  12. DO NOT specify literal `undefined` for parameters that have a known source in the calling context — use data contracts to map sources
333
+ 13. DO NOT use Bash heredoc for file creation — ALWAYS use the Write tool
334
+ 14. DO NOT leave requirement_ids empty in PLAN frontmatter — every plan must trace to requirements
309
335
 
310
336
  </anti_patterns>
311
337
 
@@ -237,7 +237,10 @@ Additionally for this agent:
237
237
  - [ ] Source hierarchy followed (S1-S6 ordering)
238
238
  - [ ] All findings tagged with source level and confidence
239
239
  - [ ] Version-sensitive info sourced from S1-S3 only
240
- - [ ] Gaps documented with reasons
240
+ - [ ] Negative claims verified (absence of feature confirmed, not just unmentioned)
241
+ - [ ] Multiple sources cross-referenced for key decisions
242
+ - [ ] Publication dates checked — no stale guidance presented as current
243
+ - [ ] Gaps documented with reasons and "What might I have missed?" reflection
241
244
  - [ ] Research output file written with required sections
242
245
  - [ ] Completion marker returned
243
246
  </success_criteria>
@@ -98,16 +98,30 @@ Check for stub indicators: TODO/FIXME comments, empty function bodies, trivial r
98
98
  #### Level 3: Wired (Connected to the System)
99
99
  Verify the artifact is imported AND used by other parts of the system (functions called, components rendered, middleware applied, routes registered). Result: `WIRED`, `IMPORTED-UNUSED`, or `ORPHANED`.
100
100
 
101
+ #### Level 4: Functional (Actually Works)
102
+ Run the artifact and verify it produces correct results. This goes beyond structural checks (L1-L3) to behavioral verification. Result: `FUNCTIONAL`, `RUNTIME_ERROR`, or `LOGIC_ERROR`.
103
+
104
+ **When to apply L4:** Only for must-haves that have automated verification commands (test suites, build scripts, API endpoints). Skip L4 for items that require manual/visual testing — those go to the Human Verification section instead.
105
+
106
+ **L4 checks:**
107
+ - Tests pass: `npm test`, `pytest`, or the project's test command
108
+ - Build succeeds: `npm run build`, `tsc --noEmit`, or equivalent
109
+ - API responds correctly: endpoint returns expected shape and status codes
110
+ - CLI produces expected output: command-line tools return correct exit codes and output
111
+
101
112
  #### Artifact Outcome Decision Table
102
113
 
103
- | Exists | Substantive | Wired | Status |
104
- |--------|-------------|-------|--------|
105
- | No | -- | -- | MISSING |
106
- | Yes | No | -- | STUB |
107
- | Yes | Yes | No | UNWIRED |
108
- | Yes | Yes | Yes | PASSED |
114
+ | Exists | Substantive | Wired | Functional | Status |
115
+ |--------|-------------|-------|------------|--------|
116
+ | No | -- | -- | -- | MISSING |
117
+ | Yes | No | -- | -- | STUB |
118
+ | Yes | Yes | No | -- | UNWIRED |
119
+ | Yes | Yes | Yes | No | BROKEN |
120
+ | Yes | Yes | Yes | Yes | PASSED |
109
121
 
110
122
  > **Note:** WIRED status (Level 3) requires correct arguments, not just correct function names. A call that passes `undefined` for a parameter available in scope is `ARGS_WRONG`, not `WIRED`.
123
+ >
124
+ > **Note:** FUNCTIONAL status (Level 4) is optional — only applied when automated verification is available. Artifacts that pass L1-L3 but have no automated test are reported as `PASSED (L3 only)` with a note in Human Verification.
111
125
 
112
126
  ### Step 6: Verify Key Links (Always)
113
127
 
@@ -135,13 +149,15 @@ Beyond verifying that calls exist, spot-check that **arguments passed to cross-b
135
149
  Cross-reference all must-haves against verification results in a table:
136
150
 
137
151
  ```markdown
138
- | # | Must-Have | Type | L1 (Exists) | L2 (Substantive) | L3 (Wired) | Status |
139
- |---|----------|------|-------------|-------------------|------------|--------|
140
- | 1 | {description} | truth | - | - | - | VERIFIED/FAILED |
141
- | 2 | {description} | artifact | YES/NO | YES/STUB/PARTIAL | WIRED/ORPHANED/ARGS_WRONG | PASS/FAIL |
142
- | 3 | {description} | key_link | - | - | YES/NO/ARGS_WRONG | PASS/FAIL |
152
+ | # | Must-Have | Type | L1 (Exists) | L2 (Substantive) | L3 (Wired) | L4 (Functional) | Status |
153
+ |---|----------|------|-------------|-------------------|------------|-----------------|--------|
154
+ | 1 | {description} | truth | - | - | - | - | VERIFIED/FAILED |
155
+ | 2 | {description} | artifact | YES/NO | YES/STUB/PARTIAL | WIRED/ORPHANED | FUNCTIONAL/BROKEN/- | PASS/FAIL |
156
+ | 3 | {description} | key_link | - | - | YES/NO/ARGS_WRONG | - | PASS/FAIL |
143
157
  ```
144
158
 
159
+ L4 column shows `-` when no automated verification is available. Only artifacts with test commands or build verification get L4 checks.
160
+
145
161
  ### Step 8: Scan for Anti-Patterns (Full Verification Only)
146
162
 
147
163
  Scan for: dead code/unused imports, console.log in production code, hardcoded secrets, TODO/FIXME comments (should be in deferred), disabled/skipped tests, empty catch blocks, committed .env files. Report blockers only.
@@ -258,7 +274,7 @@ Mark any file containing 2+ stub patterns as "STUB — not substantive".
258
274
  - [ ] Previous VERIFICATION.md checked
259
275
  - [ ] Must-haves established from plan frontmatter
260
276
  - [ ] All truths verified with status and evidence
261
- - [ ] All artifacts checked at 3 levels (exists, substantive, wired)
277
+ - [ ] All artifacts checked at 3-4 levels (exists, substantive, wired, functional when testable)
262
278
  - [ ] All key links verified including argument values
263
279
  - [ ] Anti-patterns scanned and categorized
264
280
  - [ ] Overall status determined
@@ -273,6 +289,7 @@ CRITICAL: Your final output MUST end with exactly one completion marker.
273
289
  Orchestrators pattern-match on these markers to route results. Omitting causes silent failures.
274
290
 
275
291
  - `## VERIFICATION COMPLETE` - VERIFICATION.md written (status in frontmatter)
292
+ - `## VERIFICATION FAILED` - could not complete verification (missing phase dir, no must-haves to check)
276
293
 
277
294
  ---
278
295
 
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: "Generate tests for completed phase code. Detects test framework and targets key files."
3
+ ---
4
+
5
+ This command is provided by the `pbr:test` skill.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbr",
3
3
  "displayName": "Plan-Build-Run",
4
- "version": "2.37.0",
4
+ "version": "2.38.0",
5
5
  "description": "Plan-Build-Run — Structured development workflow for GitHub Copilot CLI. Solves context rot through disciplined agent delegation, structured planning, atomic execution, and goal-backward verification.",
6
6
  "author": {
7
7
  "name": "SienkLogic",
@@ -4,9 +4,9 @@ Reference patterns for deriving verification criteria from goals. Used by the pl
4
4
 
5
5
  ---
6
6
 
7
- ## The Three-Layer Check
7
+ ## The Four-Layer Check
8
8
 
9
- Every must-have is verified through three layers, checked in order:
9
+ Every must-have is verified through up to four layers, checked in order:
10
10
 
11
11
  ### Layer 1: Existence
12
12
 
@@ -62,6 +62,28 @@ grep -q "prisma" src/app.ts
62
62
  grep -q "DISCORD_CLIENT_ID" src/auth/discord.ts
63
63
  ```
64
64
 
65
+ ### Layer 4: Functional
66
+
67
+ Does the artifact actually work when executed?
68
+
69
+ ```bash
70
+ # Tests pass
71
+ npm test -- --testPathPattern auth
72
+ pytest tests/test_auth.py -v
73
+
74
+ # Build succeeds
75
+ npm run build
76
+ npx tsc --noEmit
77
+
78
+ # API returns correct data
79
+ curl -s http://localhost:3000/api/auth/login -X POST -d '{"code":"test"}' | jq '.token'
80
+
81
+ # CLI produces expected output
82
+ node src/cli.js --help | grep -q "Usage:"
83
+ ```
84
+
85
+ **When to apply L4:** Only when automated verification commands exist (test suites, build scripts, API endpoints with test data). Skip for items requiring manual/visual testing. L4 is optional — artifacts passing L1-L3 without available automated tests are reported as `PASSED (L3 only)`.
86
+
65
87
  ---
66
88
 
67
89
  ## Verification by Feature Type
@@ -69,41 +91,46 @@ grep -q "DISCORD_CLIENT_ID" src/auth/discord.ts
69
91
  ### API Endpoint
70
92
 
71
93
  ```
72
- Existence: curl returns non-404 status
73
- Substance: curl returns expected response shape (correct fields)
74
- Wiring: endpoint calls the right service, middleware is applied
94
+ Existence: curl returns non-404 status
95
+ Substance: curl returns expected response shape (correct fields)
96
+ Wiring: endpoint calls the right service, middleware is applied
97
+ Functional: POST/GET with test data returns correct response, error cases handled
75
98
  ```
76
99
 
77
100
  ### Database Schema
78
101
 
79
102
  ```
80
- Existence: table/collection exists, can query without error
81
- Substance: columns/fields match specification, constraints are applied
82
- Wiring: application code references the schema, migrations run cleanly
103
+ Existence: table/collection exists, can query without error
104
+ Substance: columns/fields match specification, constraints are applied
105
+ Wiring: application code references the schema, migrations run cleanly
106
+ Functional: CRUD operations work end-to-end, constraints reject invalid data
83
107
  ```
84
108
 
85
109
  ### Authentication
86
110
 
87
111
  ```
88
- Existence: auth routes exist, auth module exports functions
89
- Substance: login flow returns token, invalid creds return error
90
- Wiring: protected routes use auth middleware, tokens are validated
112
+ Existence: auth routes exist, auth module exports functions
113
+ Substance: login flow returns token, invalid creds return error
114
+ Wiring: protected routes use auth middleware, tokens are validated
115
+ Functional: auth tests pass (valid token, expired token, missing token, malformed token)
91
116
  ```
92
117
 
93
118
  ### UI Component
94
119
 
95
120
  ```
96
- Existence: component file exists, exports default component
97
- Substance: component renders expected elements (test or visual check)
98
- Wiring: component is imported in parent, receives correct props, routes to it
121
+ Existence: component file exists, exports default component
122
+ Substance: component renders expected elements (test or visual check)
123
+ Wiring: component is imported in parent, receives correct props, routes to it
124
+ Functional: component tests pass, build succeeds with component included
99
125
  ```
100
126
 
101
127
  ### Configuration
102
128
 
103
129
  ```
104
- Existence: config file exists, environment variables documented
105
- Substance: config values are used (not dead code), defaults are sensible
106
- Wiring: application reads config at startup, config changes take effect
130
+ Existence: config file exists, environment variables documented
131
+ Substance: config values are used (not dead code), defaults are sensible
132
+ Wiring: application reads config at startup, config changes take effect
133
+ Functional: app starts with config, missing config produces clear error message
107
134
  ```
108
135
 
109
136
  ---
@@ -112,10 +112,11 @@ Use AskUserQuestion:
112
112
  - label: "Depth" description: "quick/standard/comprehensive"
113
113
  - label: "Model profile" description: "quality/balanced/budget/adaptive"
114
114
  - label: "Features" description: "Toggle workflow features, gates, status line"
115
- - label: "Git settings" description: "branching strategy, commit mode"
115
+ - label: "Git settings" description: "branching strategy, commit mode"
116
+ - label: "Save as defaults" description: "Save current config as user-level defaults for new projects"
116
117
  multiSelect: false
117
118
 
118
- Note: The original 7 categories are condensed to 4. "Models" (per-agent) is accessible through "Model profile" with a follow-up option. "Gates", "Parallelization", and "Status Line" are grouped under "Features".
119
+ Note: The original 7 categories are condensed to 5. "Models" (per-agent) is accessible through "Model profile" with a follow-up option. "Gates", "Parallelization", and "Status Line" are grouped under "Features". "Save as defaults" exports to ~/.claude/pbr-defaults.json.
119
120
 
120
121
  **Follow-up based on selection:**
121
122
 
@@ -178,6 +179,15 @@ Use AskUserQuestion:
178
179
  - label: "Disabled" description: "No git integration"
179
180
  multiSelect: false
180
181
 
182
+ If user selects "Save as defaults":
183
+ Save current project config as user-level defaults for future projects:
184
+
185
+ ```bash
186
+ node "${PLUGIN_ROOT}/scripts/pbr-tools.js" config save-defaults
187
+ ```
188
+
189
+ Display: "Saved your preferences to ~/.claude/pbr-defaults.json. New projects created with /pbr:setup will use these as starting values."
190
+
181
191
  If user types something else (freeform): interpret as a direct setting command and handle via Step 2 argument parsing logic.
182
192
 
183
193
  ### 4. Apply Changes
@@ -17,10 +17,16 @@ Then proceed to Step 1.
17
17
 
18
18
  # /pbr:health — Planning Directory Diagnostics
19
19
 
20
- You are running the **health** skill. Your job is to validate the integrity of the `.planning/` directory, report problems, and suggest targeted fixes. You never auto-repair anything.
20
+ You are running the **health** skill. Your job is to validate the integrity of the `.planning/` directory, report problems, and suggest targeted fixes.
21
21
 
22
22
  This skill runs **inline**. It is read-only by default, but offers an optional **auto-fix** flow for common corruption patterns (see the Auto-Fix section below).
23
23
 
24
+ ## Argument Parsing
25
+
26
+ Check if the user passed `--repair`:
27
+ - `--repair`: Skip the AskUserQuestion prompt in the Auto-Fix section and automatically apply ALL fixes (equivalent to selecting "Fix all"). Still create backups before any destructive operations.
28
+ - No flag: Use the interactive AskUserQuestion flow as described below (default behavior).
29
+
24
30
  ---
25
31
 
26
32
  ## How Checks Work
@@ -184,7 +190,11 @@ cp .planning/STATE.md .planning/backups/STATE-$(date +%Y%m%dT%H%M%S).md
184
190
 
185
191
  This ensures the user can recover the original STATE.md if the fix produces incorrect results.
186
192
 
187
- 1. Count the auto-fixable issues and present:
193
+ 1. Count the auto-fixable issues.
194
+
195
+ **If `--repair` flag was passed**: Skip the question and go directly to "Fix all" (step 2). Display: "Auto-repair mode: applying {N} fixes..."
196
+
197
+ **Otherwise**: Present the choice:
188
198
 
189
199
  Use AskUserQuestion:
190
200
  question: "Found {N} auto-fixable issues. How should we handle them?"
@@ -194,7 +204,7 @@ This ensures the user can recover the original STATE.md if the fix produces inco
194
204
  - label: "Review each" description: "Show each fix and confirm individually"
195
205
  - label: "Skip" description: "Do nothing — just report"
196
206
 
197
- 2. If "Fix all": Apply all fixes in order, then display a summary:
207
+ 2. If "Fix all" (or `--repair`): Apply all fixes in order, then display a summary:
198
208
  ```
199
209
  Auto-fix results:
200
210
  - Fixed: {description of fix 1}
@@ -213,8 +223,6 @@ This ensures the user can recover the original STATE.md if the fix produces inco
213
223
 
214
224
  4. If "Skip": Do nothing, continue to the rest of the output.
215
225
 
216
- **Note:** When auto-fix is active, the health skill is no longer strictly read-only. The `allowed-tools` frontmatter must include `Write` and `AskUserQuestion` for auto-fix to work. Update the frontmatter accordingly.
217
-
218
226
  ---
219
227
 
220
228
  ## Bonus: Recent Decisions
@@ -71,7 +71,15 @@ mkdir -p .planning/phases .planning/todos/pending .planning/todos/done .planning
71
71
 
72
72
  **CRITICAL: Write .planning/config.json NOW. Do NOT skip this step.**
73
73
 
74
- Create `.planning/config.json` with defaults:
74
+ Before writing config.json, check for user-level defaults:
75
+
76
+ ```bash
77
+ node "${PLUGIN_ROOT}/scripts/pbr-tools.js" config load-defaults
78
+ ```
79
+
80
+ If user defaults exist (the output has keys like `mode`, `features`, etc.), inform the user: "Found your saved preferences from ~/.claude/pbr-defaults.json. These will be merged into your project config (project-specific settings take precedence)." Then deep-merge user defaults into the config below before writing.
81
+
82
+ Create `.planning/config.json` with defaults (merged with user defaults if they exist):
75
83
  ```json
76
84
  {
77
85
  "version": 2,
@@ -17,6 +17,16 @@ Every skill that spawns agents or reads significant content must follow these ru
17
17
  4. **Delegate** heavy work to agents — the orchestrator routes, it doesn't execute
18
18
  5. **Before spawning agents**: If you've already consumed significant context (large file reads, multiple subagent results), warn the user: "Context budget is getting heavy. Consider running `/pbr:pause` to checkpoint progress." Suggest pause proactively rather than waiting for compaction.
19
19
 
20
+ ## Context Degradation Awareness
21
+
22
+ Quality degrades gradually before panic thresholds fire. Watch for these early warning signs:
23
+
24
+ - **Silent partial completion** — agent claims task is done but implementation is incomplete. Self-check catches file existence but not semantic completeness. Always verify agent output meets the plan's must_haves, not just that files exist.
25
+ - **Increasing vagueness** — agent starts using phrases like "appropriate handling" or "standard patterns" instead of specific code. This indicates context pressure even before budget warnings fire.
26
+ - **Skipped steps** — agent omits protocol steps it would normally follow. If an agent's success criteria has 8 items but it only reports 5, suspect context pressure.
27
+
28
+ When delegating to agents, the orchestrator cannot verify semantic correctness of agent output — only structural completeness. This is a fundamental limitation. Mitigate with must_haves.truths and spot-check verification.
29
+
20
30
  ## Customization
21
31
 
22
32
  Skills should add skill-specific rules below the reference line. Common skill-specific additions:
@@ -36,3 +36,9 @@ These rules prevent context rot -- quality degradation as the context window fil
36
36
  14. **Do not** suggest multiple next actions without clear priority -- one primary suggestion, alternatives listed secondary.
37
37
  15. **Do not** use `git add .` or `git add -A` -- stage specific files only.
38
38
  16. **Do not** include sensitive information (API keys, passwords, tokens) in planning documents or commits.
39
+
40
+ ## Error Recovery Rules (apply to every skill)
41
+
42
+ 17. **Git lock detection**: Before any git operation, if it fails with "Unable to create lock file", check for stale `.git/index.lock` and advise the user to remove it (do not remove automatically — another process may hold it legitimately).
43
+ 18. **Config fallback awareness**: `configLoad()` returns `null` silently on invalid JSON. If your skill depends on config values, check for null and warn the user: "config.json is invalid or missing — running with defaults. Run `/pbr:health` to diagnose."
44
+ 19. **Partial state recovery**: If STATE.md references a phase directory that doesn't exist, do not proceed silently. Warn the user and suggest `/pbr:health` to diagnose the mismatch.