@sienklogic/plan-build-run 2.59.0 → 2.60.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 (75) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/package.json +1 -1
  3. package/plugins/codex-pbr/agents/executor.md +8 -0
  4. package/plugins/codex-pbr/agents/plan-checker.md +5 -3
  5. package/plugins/codex-pbr/agents/planner.md +13 -7
  6. package/plugins/codex-pbr/agents/verifier.md +10 -1
  7. package/plugins/codex-pbr/references/plan-format.md +46 -8
  8. package/plugins/codex-pbr/skills/begin/SKILL.md +11 -27
  9. package/plugins/codex-pbr/skills/discuss/SKILL.md +52 -2
  10. package/plugins/codex-pbr/skills/health/SKILL.md +13 -0
  11. package/plugins/codex-pbr/skills/plan/SKILL.md +11 -1
  12. package/plugins/codex-pbr/skills/shared/context-loader-task.md +2 -0
  13. package/plugins/codex-pbr/skills/status/SKILL.md +17 -0
  14. package/plugins/codex-pbr/templates/PROJECT.md.tmpl +41 -0
  15. package/plugins/codex-pbr/templates/REQUIREMENTS.md.tmpl +52 -0
  16. package/plugins/codex-pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
  17. package/plugins/codex-pbr/templates/project-CONTEXT.md.tmpl +43 -0
  18. package/plugins/copilot-pbr/agents/executor.agent.md +8 -0
  19. package/plugins/copilot-pbr/agents/plan-checker.agent.md +5 -3
  20. package/plugins/copilot-pbr/agents/planner.agent.md +13 -7
  21. package/plugins/copilot-pbr/agents/verifier.agent.md +10 -1
  22. package/plugins/copilot-pbr/hooks/hooks.json +1 -0
  23. package/plugins/copilot-pbr/plugin.json +1 -1
  24. package/plugins/copilot-pbr/references/plan-format.md +46 -8
  25. package/plugins/copilot-pbr/skills/begin/SKILL.md +11 -27
  26. package/plugins/copilot-pbr/skills/discuss/SKILL.md +52 -2
  27. package/plugins/copilot-pbr/skills/health/SKILL.md +13 -0
  28. package/plugins/copilot-pbr/skills/plan/SKILL.md +11 -1
  29. package/plugins/copilot-pbr/skills/shared/context-loader-task.md +2 -0
  30. package/plugins/copilot-pbr/skills/status/SKILL.md +17 -0
  31. package/plugins/copilot-pbr/templates/PROJECT.md.tmpl +41 -0
  32. package/plugins/copilot-pbr/templates/REQUIREMENTS.md.tmpl +52 -0
  33. package/plugins/copilot-pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
  34. package/plugins/copilot-pbr/templates/project-CONTEXT.md.tmpl +43 -0
  35. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  36. package/plugins/cursor-pbr/agents/executor.md +8 -0
  37. package/plugins/cursor-pbr/agents/plan-checker.md +5 -3
  38. package/plugins/cursor-pbr/agents/planner.md +13 -7
  39. package/plugins/cursor-pbr/agents/verifier.md +10 -1
  40. package/plugins/cursor-pbr/hooks/hooks.json +1 -0
  41. package/plugins/cursor-pbr/references/plan-format.md +46 -8
  42. package/plugins/cursor-pbr/skills/begin/SKILL.md +11 -27
  43. package/plugins/cursor-pbr/skills/discuss/SKILL.md +53 -3
  44. package/plugins/cursor-pbr/skills/health/SKILL.md +13 -0
  45. package/plugins/cursor-pbr/skills/plan/SKILL.md +11 -1
  46. package/plugins/cursor-pbr/skills/shared/context-loader-task.md +2 -0
  47. package/plugins/cursor-pbr/skills/status/SKILL.md +17 -0
  48. package/plugins/cursor-pbr/templates/PROJECT.md.tmpl +41 -0
  49. package/plugins/cursor-pbr/templates/REQUIREMENTS.md.tmpl +52 -0
  50. package/plugins/cursor-pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
  51. package/plugins/cursor-pbr/templates/project-CONTEXT.md.tmpl +43 -0
  52. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  53. package/plugins/pbr/agents/executor.md +8 -0
  54. package/plugins/pbr/agents/plan-checker.md +5 -3
  55. package/plugins/pbr/agents/planner.md +13 -7
  56. package/plugins/pbr/agents/verifier.md +10 -1
  57. package/plugins/pbr/hooks/hooks.json +1 -0
  58. package/plugins/pbr/references/plan-format.md +46 -8
  59. package/plugins/pbr/scripts/check-plan-format.js +29 -0
  60. package/plugins/pbr/scripts/config-schema.json +2 -1
  61. package/plugins/pbr/scripts/context-bridge.js +1 -1
  62. package/plugins/pbr/scripts/lib/gates/doc-existence.js +46 -0
  63. package/plugins/pbr/scripts/post-write-dispatch.js +22 -2
  64. package/plugins/pbr/scripts/sync-context-to-claude.js +100 -0
  65. package/plugins/pbr/scripts/validate-task.js +14 -1
  66. package/plugins/pbr/skills/begin/SKILL.md +11 -27
  67. package/plugins/pbr/skills/discuss/SKILL.md +53 -3
  68. package/plugins/pbr/skills/health/SKILL.md +13 -0
  69. package/plugins/pbr/skills/plan/SKILL.md +11 -1
  70. package/plugins/pbr/skills/shared/context-loader-task.md +2 -0
  71. package/plugins/pbr/skills/status/SKILL.md +17 -0
  72. package/plugins/pbr/templates/PROJECT.md.tmpl +41 -0
  73. package/plugins/pbr/templates/REQUIREMENTS.md.tmpl +52 -0
  74. package/plugins/pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
  75. package/plugins/pbr/templates/project-CONTEXT.md.tmpl +43 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,36 @@ 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.60.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.59.0...plan-build-run-v2.60.0) (2026-03-06)
9
+
10
+
11
+ ### Features
12
+
13
+ * **65-01:** add project-CONTEXT.md.tmpl with planner-embeds pattern to all 4 plugins ([683f67c](https://github.com/SienkLogic/plan-build-run/commit/683f67c48197df79b17fb6199081914c663f458b))
14
+ * **65-01:** add PROJECT.md.tmpl to all 4 plugin template directories ([6416490](https://github.com/SienkLogic/plan-build-run/commit/6416490bdbd20867c2bc5f418c526d70b7f651e9))
15
+ * **65-01:** add REQUIREMENTS.md.tmpl with REQ-F/REQ-NF schema to all 4 plugins ([f293660](https://github.com/SienkLogic/plan-build-run/commit/f293660572dec225e7f3a25c137b199097af8d84))
16
+ * **65-02:** add --project flag and Step 1-project mode to discuss/SKILL.md across all 4 plugins ([35a40c4](https://github.com/SienkLogic/plan-build-run/commit/35a40c4a1ea24cf6b68fa076ca82e268cd208bb1))
17
+ * **65-02:** add PROJECT.md to context-loader-task.md briefing file lists across all 4 plugins ([12d4668](https://github.com/SienkLogic/plan-build-run/commit/12d46688632e6578e1e120ea123ff5de02bb781f))
18
+ * **65-02:** update begin/SKILL.md REQ-F/REQ-NF schema and project-CONTEXT template ref across 4 plugins; add 3 new keyTemplates to test ([b228120](https://github.com/SienkLogic/plan-build-run/commit/b228120d422cb3b8bd992cef1b4cada67cb11f3e))
19
+ * **65-03:** add doc-existence gate to validate-task; update test fixtures for implements advisory ([c5fc1e3](https://github.com/SienkLogic/plan-build-run/commit/c5fc1e3d6a360908d0652131173a784c5a7db427))
20
+ * **65-03:** GREEN - implement sync-context-to-claude.js ([65784a0](https://github.com/SienkLogic/plan-build-run/commit/65784a057622d600fc26891dc9ece84c8c53a2dd))
21
+ * **65-04:** add advisory warnings to health skill for missing PROJECT.md, REQUIREMENTS.md, CONTEXT.md across all 4 plugins ([182df09](https://github.com/SienkLogic/plan-build-run/commit/182df09681130b3927a09821f9d464b2546441ee))
22
+ * **65-04:** update planner agent for dual-source CONTEXT.md loading and plan/SKILL.md compliance check ([bd6cf41](https://github.com/SienkLogic/plan-build-run/commit/bd6cf4112b6f723459c5127be8bfc74efc98e370))
23
+ * **65-04:** update status skill to display PROJECT.md, REQUIREMENTS.md, CONTEXT.md presence across all 4 plugins ([60df410](https://github.com/SienkLogic/plan-build-run/commit/60df4104fa39d406b1833311a99df493922475d2))
24
+ * **xml-plan-format:** add auto_checkpoints to config-schema and satisfied/unsatisfied to VERIFICATION template ([72d08e8](https://github.com/SienkLogic/plan-build-run/commit/72d08e8dccf58e5011485bfb16a39db4e972ecef))
25
+ * **xml-plan-format:** add automated wrapper, feature type, and implements field to plan-format.md ([3ee897a](https://github.com/SienkLogic/plan-build-run/commit/3ee897a89016fe28b968266f33ff286f90de7671))
26
+ * **xml-plan-format:** enforce implements: blocking, add feature task validation, satisfied/unsatisfied advisory ([4d78e8e](https://github.com/SienkLogic/plan-build-run/commit/4d78e8eeccda91733b11f206c0d19ed075fd9fe7))
27
+ * **xml-plan-format:** sync cursor-pbr and copilot-pbr agents for implements:/automated/satisfied traceability ([753d4ed](https://github.com/SienkLogic/plan-build-run/commit/753d4ed0b3c4f486496781012d6dcef951d42076))
28
+ * **xml-plan-format:** update planner/executor/verifier/plan-checker for implements: traceability and must_haves locking ([98cc23f](https://github.com/SienkLogic/plan-build-run/commit/98cc23f7e5cfca60c188809b737c4156ceb49028))
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **cross-plugin-sync:** align status skill Step 1d heading order in cursor-pbr and copilot-pbr ([dc8419e](https://github.com/SienkLogic/plan-build-run/commit/dc8419e33c1184a2224cdb22d6383bf572d41d58))
34
+ * **cross-plugin-sync:** sync phase 66 references, templates, and agents to codex-pbr, copilot-pbr, cursor-pbr ([e143d9e](https://github.com/SienkLogic/plan-build-run/commit/e143d9ecfc4792fb8085f62ed9227738324ea69f))
35
+ * **doc-gates:** add 3-part format to doc-existence blocking reason ([ba2d732](https://github.com/SienkLogic/plan-build-run/commit/ba2d732e1fd89afce266a50057b2b1411152903e))
36
+ * **doc-gates:** upgrade doc-existence gate from advisory to blocking ([a4eeb3f](https://github.com/SienkLogic/plan-build-run/commit/a4eeb3fa015b0a81d4130dd7a9e4c220f124bf7d))
37
+
8
38
  ## [2.59.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.58.0...plan-build-run-v2.59.0) (2026-03-06)
9
39
 
10
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sienklogic/plan-build-run",
3
- "version": "2.59.0",
3
+ "version": "2.60.0",
4
4
  "description": "Plan it, Build it, Run it — structured development workflow for Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -35,6 +35,9 @@ You are **executor**, the code execution agent for Plan-Build-Run. You receive v
35
35
  a. Read task XML
36
36
  b. Execute <action> steps
37
37
  c. Run <verify> commands
38
+ - If <verify> contains an <automated> child element, extract and run the command inside it
39
+ - If <verify> is plain text (no <automated> child), run it as before (backward compat)
40
+ - Both forms produce the same result — <automated> is machine-parseable, plain text is human-readable
38
41
  d. If verify passes: commit
39
42
  e. If verify fails: apply deviation rules
40
43
  f. If checkpoint: STOP and return
@@ -196,6 +199,11 @@ When a task has a checkpoint type, **STOP execution** and return a structured re
196
199
  | `decision` | Before executing | Decision needed, options, context |
197
200
  | `human-action` | Before executing | What user must do, step-by-step |
198
201
 
202
+ **auto_checkpoints config**: After loading plan frontmatter, read `gates.auto_checkpoints` from config.json (default false):
203
+ - Load with: `node pbr-tools.js config-get gates.auto_checkpoints`
204
+ - When `auto_checkpoints` is true AND task type is `checkpoint:human-verify`: run the automated verify command. If it passes, auto-approve and continue. If it fails, still STOP and return the checkpoint response.
205
+ - `checkpoint:decision` and `checkpoint:human-action` always require human input regardless of `auto_checkpoints`.
206
+
199
207
  **Automation-first**: Complete all automatable pre-work before any checkpoint. Only checkpoint for genuinely human-required actions (API keys needing account login, architectural choices, destructive approvals).
200
208
 
201
209
  All responses use: `CHECKPOINT: {TYPE}` header, task info, type-specific fields, completed tasks table, remaining tasks list.
@@ -157,14 +157,16 @@ Plans declare `provides`/`consumes`; all consumed items must have providers.
157
157
  | Missing provides/consumes for exports | INFO |
158
158
 
159
159
  ### D9: Requirement Traceability
160
- Plans declare `requirement_ids` with bidirectional coverage. Forward: IDs trace to REQUIREMENTS.md (or ROADMAP.md goals). Backward: every requirement covered by at least one plan.
160
+ Plans declare `implements` with bidirectional coverage. Forward: IDs trace to REQUIREMENTS.md (or ROADMAP.md goals). Backward: every requirement covered by at least one plan.
161
+
162
+ > **Note:** `requirement_ids:` is a deprecated alias for `implements:` — treat as equivalent during transition.
161
163
 
162
164
  | Condition | Severity |
163
165
  |-----------|----------|
164
- | requirement_id references nonexistent requirement | BLOCKER |
166
+ | implements: ID references nonexistent requirement | BLOCKER |
165
167
  | Requirement not covered by any plan | WARNING |
166
168
  | ROADMAP goal not covered (no REQUIREMENTS.md) | WARNING |
167
- | Plan missing requirement_ids entirely | INFO |
169
+ | Plan missing implements: entirely | WARNING |
168
170
 
169
171
  ### D10: Test Plan Coverage
170
172
  Code-producing tasks should include test expectations. Check that tasks creating or modifying source code have corresponding test references in `<files>`, `<action>`, or `<verify>`. Test files should appear in `<files>`, test commands in `<verify>`, and test outcomes in `<done>`.
@@ -9,7 +9,7 @@ you MUST Read every listed file BEFORE any other action.
9
9
  Skipping this causes hallucinated context and broken output.
10
10
  </files_to_read>
11
11
 
12
- > Default files: CONTEXT.md, ROADMAP.md, research documents, existing plan files
12
+ > Default files: PROJECT.md (if exists), CONTEXT.md (project-level, if exists), phase CONTEXT.md (if exists), ROADMAP.md, research documents, existing plan files
13
13
 
14
14
  # Plan-Build-Run Planner
15
15
 
@@ -20,7 +20,7 @@ You are **planner**, the planning agent for the Plan-Build-Run development syste
20
20
 
21
21
  ## Core Principle: Context Fidelity
22
22
 
23
- **Locked decisions from CONTEXT.md are NON-NEGOTIABLE.** You never substitute, reinterpret, or work around locked decisions. If CONTEXT.md says "Use PostgreSQL", the plan uses PostgreSQL. Period.
23
+ **Locked decisions from BOTH `.planning/CONTEXT.md` (project-level) AND `.planning/phases/{NN}-{slug}/CONTEXT.md` (phase-level) are NON-NEGOTIABLE.** Phase-level overrides project-level for the same decision area. You never substitute, reinterpret, or work around locked decisions. If CONTEXT.md says "Use PostgreSQL", the plan uses PostgreSQL. Period.
24
24
 
25
25
  **Deferred ideas from CONTEXT.md MUST NOT appear in plans.** If something is marked as deferred, it does not exist for planning purposes. Do not plan for it, do not create hooks for it, do not "prepare" for it.
26
26
  </role>
@@ -192,7 +192,13 @@ Two plans CONFLICT if their `files_modified` lists overlap. Conflicting plans MU
192
192
  <execution_flow>
193
193
  ## Planning Process
194
194
 
195
- 1. **Load Context**: Read CONTEXT.md (locked decisions + deferred ideas), phase goal, and any research documents.
195
+ 1. **Load Context**: Read locked decisions, phase goal, and any research documents.
196
+ - Read `.planning/PROJECT.md` (if exists) — project scope/out-of-scope constraints
197
+ - Read `.planning/CONTEXT.md` (project-level, if exists) — cross-cutting locked decisions
198
+ - Read `.planning/phases/{NN}-{slug}/CONTEXT.md` (phase-level, if exists) — phase-specific decisions
199
+ - Phase-level CONTEXT.md overrides project-level for conflicting decision areas
200
+ - **For each locked decision found**: embed it directly into the relevant task's `<action>` block.
201
+ Executors NEVER read CONTEXT.md — PLAN.md task actions must be self-contained.
196
202
 
197
203
  ### Handling [NEEDS DECISION] Items
198
204
  When CONTEXT.md or RESEARCH-SUMMARY.md contains `[NEEDS DECISION]` flags from the synthesizer:
@@ -202,7 +208,7 @@ When CONTEXT.md or RESEARCH-SUMMARY.md contains `[NEEDS DECISION]` flags from th
202
208
  2. **Derive Must-Haves**: Apply goal-backward methodology — state the phase goal as a user-observable outcome, derive truths, artifacts, and key links.
203
209
  3. **Break Down Tasks**: For each must-have, determine code changes, files involved, verification method, and observable done condition. Group related work into tasks (2-3 per plan).
204
210
  4. **Assign Waves and Dependencies**: Identify independent tasks (Wave 1), map dependencies, assign wave numbers, check for circular deps and file conflicts within same wave.
205
- 5. **Write Plan Files**: Complete YAML frontmatter (include `requirement_ids` from REQUIREMENTS.md or ROADMAP.md goal IDs for traceability), XML tasks with all 5 elements, clear action instructions, executable verify commands, observable done conditions. Append a `## Summary` section per `references/plan-format.md` (under 500 tokens): plan ID, numbered task list, key files, must-haves, provides/consumes.
211
+ 5. **Write Plan Files**: Complete YAML frontmatter (include `implements` field with REQ-IDs from REQUIREMENTS.md or ROADMAP.md for traceability; `requirement_ids` is a deprecated alias — use `implements` as the primary field), XML tasks with all 5 elements, clear action instructions, executable verify commands, observable done conditions. Append a `## Summary` section per `references/plan-format.md` (under 500 tokens): plan ID, numbered task list, key files, must-haves, provides/consumes.
206
212
  6. **Self-Check** before writing:
207
213
 
208
214
  **CRITICAL — Run the self-check. Plans missing must-have coverage or incomplete tasks cause executor failures.**
@@ -240,7 +246,7 @@ When receiving checker feedback:
240
246
 
241
247
  ## Context Optimization
242
248
 
243
- **Context Fidelity Self-Check**: Before writing plans, verify: (1) every locked decision in CONTEXT.md has a corresponding task, (2) no task implements a deferred idea, (3) each "Claude's Discretion" item is addressed in at least one task. Report: "CONTEXT.md compliance: {M}/{N} locked decisions mapped."
249
+ **Context Fidelity Self-Check**: Before writing plans, verify: (1) every locked decision in BOTH `.planning/CONTEXT.md` (project-level) AND `.planning/phases/{NN}-{slug}/CONTEXT.md` (phase-level) has a corresponding task (deduplicate identical decisions across both files), (2) no task implements a deferred idea, (3) each "Claude's Discretion" item is addressed in at least one task. Report: "CONTEXT.md compliance: {M}/{N} locked decisions mapped."
244
250
 
245
251
  **Frontmatter-First Assembly**: When prior plans exist, read SUMMARY.md frontmatter only (not full body) — 10 frontmatters ~500 tokens vs 10 full SUMMARYs ~5000 tokens. Extract: `provides`, `requires`, `key_files`, `key_decisions`, `patterns`. Only read full body when a specific detail is needed.
246
252
 
@@ -256,7 +262,7 @@ When receiving checker feedback:
256
262
  - [ ] Tasks grouped into plans by wave
257
263
  - [ ] PLAN files exist with XML task structure
258
264
  - [ ] Each plan: frontmatter complete (depends_on, files_modified, must_haves)
259
- - [ ] Each plan: requirement_ids field populated (MUST NOT be empty)
265
+ - [ ] Each plan: implements: field populated (list REQ-IDs; use [] only if phase has no REQUIREMENTS.md)
260
266
  - [ ] Each task: all 5 elements (name, files, action, verify, done)
261
267
  - [ ] Wave structure maximizes parallelism
262
268
  - [ ] Every REQ-ID from ROADMAP/REQUIREMENTS appears in at least one plan
@@ -336,7 +342,7 @@ One-line task descriptions in `<name>`. File paths in `<files>`, not explanation
336
342
  11. DO NOT leave done conditions vague — they must be observable
337
343
  12. DO NOT specify literal `undefined` for parameters that have a known source in the calling context — use data contracts to map sources
338
344
  13. DO NOT use Bash heredoc for file creation — ALWAYS use the Write tool
339
- 14. DO NOT leave requirement_ids empty in PLAN frontmatter — every plan must trace to requirements
345
+ 14. DO NOT leave implements: empty in PLAN frontmatter — use implements: as the primary traceability field (requirement_ids: is deprecated)
340
346
 
341
347
  </anti_patterns>
342
348
 
@@ -74,7 +74,8 @@ Stop and report error if pbr-tools CLI is unavailable. Also read CONTEXT.md for
74
74
  - `artifacts`: Files/exports that must exist, be substantive, and not be stubs
75
75
  - `key_links`: Connections that must be wired between components
76
76
 
77
- If plans lack explicit must-haves, derive them goal-backward from ROADMAP.md: what must be TRUE → what must EXIST → what must be CONNECTED.
77
+ Must-haves in plan frontmatter are canonical use exactly what mustHavesCollect returns.
78
+ Only fall back to goal-backward derivation from ROADMAP.md if ALL plans in the phase have completely empty must_haves sections. Do NOT supplement or re-derive when must_haves are present.
78
79
 
79
80
  Output: A numbered list of every must-have to verify.
80
81
 
@@ -159,6 +160,14 @@ Cross-reference all must-haves against verification results in a table:
159
160
 
160
161
  L4 column shows `-` when no automated verification is available. Only artifacts with test commands or build verification get L4 checks.
161
162
 
163
+ ### Step 7b: Write REQ-ID Traceability (Always)
164
+
165
+ After verifying all must-haves, collect `implements:[]` from all plan frontmatters in the phase.
166
+
167
+ - For each REQ-ID: if all must-haves for that plan passed → add to `satisfied:[]`
168
+ - If any must-have for that plan failed → add to `unsatisfied:[]`
169
+ - Write `satisfied:[]` and `unsatisfied:[]` to the VERIFICATION.md frontmatter
170
+
162
171
  ### Step 8: Scan for Anti-Patterns (Full Verification Only)
163
172
 
164
173
  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.
@@ -43,9 +43,9 @@ provides:
43
43
  - "requireAuth() middleware"
44
44
  consumes:
45
45
  - "Database connection (from plan 01-01)"
46
- requirement_ids:
47
- - "P02-G1"
48
- - "P02-G2"
46
+ implements:
47
+ - "REQ-F-001"
48
+ - "REQ-F-002"
49
49
  closes_issues:
50
50
  - 42
51
51
  - 57
@@ -71,7 +71,8 @@ closes_issues:
71
71
  | `must_haves.key_links` | YES | array | Connections between components. Append `: grep command` for verification. |
72
72
  | `provides` | NO | array | What this plan exports for other plans to consume (classes, endpoints, modules) |
73
73
  | `consumes` | NO | array | What this plan needs from prior plans. Format: `"Thing (from plan XX-YY)"` |
74
- | `requirement_ids` | NO | array | Requirement IDs from REQUIREMENTS.md or ROADMAP.md goal IDs that this plan addresses. Enables bidirectional traceability between plans and requirements/goals. |
74
+ | `implements` | NO (WARNING if absent) | array | REQ-IDs from REQUIREMENTS.md this plan addresses. Primary traceability field. |
75
+ | `requirement_ids` | NO | array | DEPRECATED — use `implements:` instead. Kept for backward compat. |
75
76
  | `dependency_fingerprints` | NO | object | Hashes of dependency phase SUMMARY.md files at plan-creation time. Used to detect stale plans. |
76
77
  | `data_contracts` | NO | array | Cross-boundary parameter mappings for calls where arguments originate from external boundaries. Format: `"param: source (context) [fallback]"` |
77
78
  | `closes_issues` | NO | number[] | GitHub issue numbers to close when this plan's final commit lands. Default: `[]` |
@@ -162,14 +163,20 @@ The Summary section is generated by the planner agent at plan creation time. It
162
163
  DISCORD_REDIRECT_URI=http://localhost:3000/auth/callback
163
164
  </action>
164
165
  <verify>
165
- npx tsc --noEmit
166
- ls src/auth/discord.ts
167
- ls src/auth/types.ts
166
+ <automated>
167
+ npx tsc --noEmit
168
+ ls src/auth/discord.ts
169
+ ls src/auth/types.ts
170
+ </automated>
168
171
  </verify>
169
172
  <done>Discord OAuth client module exists and compiles without errors</done>
170
173
  </task>
171
174
  ```
172
175
 
176
+ > **Verify block forms**: The `<automated>` wrapper (Option A) is preferred — it enables machine-parsing
177
+ > for `auto_checkpoints` mode. Plain-text verify commands without the wrapper (Option B) remain valid
178
+ > for backward compatibility. Both forms are supported by the executor.
179
+
173
180
  ### TDD Task
174
181
 
175
182
  ```xml
@@ -204,6 +211,33 @@ The Summary section is generated by the planner agent at plan creation time. It
204
211
  </task>
205
212
  ```
206
213
 
214
+ ### Feature Task (TDD Variant)
215
+
216
+ Feature tasks add a `<feature>` element for structured TDD planning. The element contains two required children:
217
+
218
+ - **`<behavior>`** — the observable outcome from the user's perspective. Maps directly to a `must_haves.truths` entry.
219
+ - **`<implementation>`** — the technical approach at a high level (which files, patterns, or algorithms to use).
220
+
221
+ Prose structure (illustrative — not a live task block to avoid validator false-positives):
222
+
223
+ ```
224
+ task id="02-01-T3" type="auto" tdd="true" complexity="medium"
225
+ name: Implement rate limiter for OAuth endpoint
226
+ files: src/middleware/rate-limit.ts / tests/middleware/rate-limit.test.ts
227
+ feature:
228
+ behavior: OAuth endpoint rejects more than 5 requests per minute per IP with HTTP 429
229
+ implementation: Token-bucket algorithm; Redis-backed counter with TTL; express-rate-limit wrapper
230
+ action:
231
+ RED: Write failing tests for 429 response at >5 req/min
232
+ GREEN: Implement token-bucket middleware using Redis
233
+ REFACTOR: Extract counter logic to RateLimitStore class
234
+ verify:
235
+ automated: npm test -- --grep "rate limiter"
236
+ done: Rate limiter rejects excessive OAuth requests with 429
237
+ ```
238
+
239
+ The `<feature>` element is optional — standard TDD tasks without it are still valid. Use `<feature>` when the planner wants to record the behavior/implementation split explicitly for traceability.
240
+
207
241
  ### Checkpoint: Human Verify
208
242
 
209
243
  ```xml
@@ -291,9 +325,13 @@ Every task MUST have ALL 5. No exceptions.
291
325
  | `<name>` | What the task does | Imperative verb phrase. Short. |
292
326
  | `<files>` | Files touched | One per line. Actual file paths. |
293
327
  | `<action>` | How to do it | Numbered steps. Specific. Code snippets for complex work. |
294
- | `<verify>` | How to check | Executable shell commands. Or checkpoint format. |
328
+ | `<verify>` | How to check | Executable shell commands (plain-text or wrapped in `<automated>`). Or checkpoint format. |
295
329
  | `<done>` | How to know it worked | Observable user/system behavior. Maps to a must-have. |
296
330
 
331
+ > **Optional `<feature>` element**: Feature tasks (TDD variant) may add a `<feature>` element with
332
+ > `<behavior>` and `<implementation>` children for structured TDD planning. The 5 standard elements
333
+ > above are still required.
334
+
297
335
  ---
298
336
 
299
337
  ## Task ID Format
@@ -546,11 +546,10 @@ For each category, present the features and ask the user to classify each:
546
546
  - **Out of scope** — Will NOT be built
547
547
 
548
548
  **7d. Assign REQ-IDs:**
549
- For each committed requirement, assign an ID in the format `{CATEGORY}-{NN}`:
550
- - `AUTH-01`: User can log in with Discord OAuth
551
- - `AUTH-02`: Protected routes redirect to login
552
- - `UI-01`: Dashboard shows player statistics
553
- - `UI-02`: Mobile-responsive layout
549
+ For each committed requirement, assign an ID using the REQ-F/REQ-NF schema:
550
+ - Functional requirements: `REQ-F-xxx` numbered sequentially within each category (REQ-F-001, REQ-F-002, ...)
551
+ - Non-functional requirements: `REQ-NF-xxx` numbered sequentially across all NFR categories (REQ-NF-001, REQ-NF-002, ...)
552
+ - Examples: `REQ-F-001: User can log in with Discord OAuth`, `REQ-NF-001: Page loads in <2s on 4G`
554
553
 
555
554
  Each requirement must be:
556
555
  - **User-centric** — describes a capability from the user's perspective
@@ -663,28 +662,13 @@ Write the project state files from templates:
663
662
  **CRITICAL (no hook): Write CONTEXT.md NOW. Do NOT skip this step.**
664
663
 
665
664
  **9c. Write CONTEXT.md:**
666
- Create `.planning/CONTEXT.md` from information gathered during questioning:
667
-
668
- ```markdown
669
- # Project Context
670
-
671
- ## Locked Decisions
672
- {Technology choices, architecture decisions, and constraints that are NON-NEGOTIABLE}
673
-
674
- | Decision | Rationale | Locked By |
675
- |----------|-----------|-----------|
676
- | {e.g., "Use TypeScript"} | {User preference, team skill} | User |
677
-
678
- ## User Constraints
679
- {Budget, timeline, skill level, hosting, team size}
680
-
681
- ## Deferred Ideas
682
- {Features explicitly moved to v2 or out-of-scope}
683
-
684
- | Idea | Reason Deferred |
685
- |------|----------------|
686
- | {feature} | {reason} |
687
- ```
665
+ 1. Read `${CLAUDE_SKILL_DIR}/templates/project-CONTEXT.md.tmpl`
666
+ 2. Fill in from the questioning conversation:
667
+ - Locked Decisions: all technology choices and architecture decisions from Step 2
668
+ - User Constraints: budget, timeline, skill level, hosting, team
669
+ - Deferred Ideas: out-of-scope items identified in Step 7c scoping
670
+ - Claude's Discretion: any areas where user said "you decide"
671
+ 3. Write to `.planning/CONTEXT.md`
688
672
 
689
673
  **CRITICAL (no hook): Write HISTORY.md NOW. Do NOT skip this step.**
690
674
 
@@ -35,9 +35,12 @@ This skill runs **inline** (no Task delegation).
35
35
 
36
36
  ### Step 1: Parse Phase Number and Check for Existing Plans
37
37
 
38
- Parse `$ARGUMENTS` to get the phase number.
38
+ Parse `$ARGUMENTS`:
39
+ - If argument is `--project`: enter PROJECT mode (see Step 1-project below). Skip Steps 2-8.
40
+ - If argument is a phase number: enter PHASE mode (existing flow — continue with Step 1 as-is).
41
+ - If no argument: existing logic applies (read STATE.md for current phase).
39
42
 
40
- **Validation:**
43
+ **Validation (PHASE mode):**
41
44
  - Must be a valid phase number (integer or decimal like `3.1`)
42
45
  - If no argument provided, read STATE.md to get the current phase
43
46
  - If no current phase and no argument: "Which phase do you want to discuss? Run `$pbr-status` to see available phases."
@@ -63,6 +66,53 @@ Phase {N} not found.
63
66
  - Warn: "Phase {N} already has plans. Decisions from this discussion won't retroactively change them. Consider re-planning with `$pbr-plan {N}` after."
64
67
  - This is a **warning only** — do not block the discussion
65
68
 
69
+ ### Step 1-project: Project Discussion Mode (--project)
70
+
71
+ When invoked with `--project`, discuss project-level cross-cutting decisions.
72
+ This mode writes to `.planning/CONTEXT.md` (project-level), NOT a phase directory.
73
+
74
+ **Check for existing project CONTEXT.md:**
75
+ 1. Use Glob to check if `.planning/CONTEXT.md` exists.
76
+ 2. If it exists, ask the user (using the context-handling pattern from
77
+ `skills/shared/gate-prompts.md`):
78
+ question: "Project CONTEXT.md already exists. How should we handle it?"
79
+ options: Overwrite | Append | Cancel
80
+ 3. If Cancel: stop and display the existing CONTEXT.md path.
81
+
82
+ **Load project context:**
83
+ - Read `.planning/PROJECT.md` (if exists) — project vision and scope
84
+ - Read `.planning/REQUIREMENTS.md` (if exists) — requirements for constraint awareness
85
+ - Read `.planning/CONTEXT.md` (if exists) — current locked decisions (for Append mode)
86
+
87
+ **Run gray areas for project-level decisions (Steps 2.5-5 pattern):**
88
+ - Identify 3-4 cross-cutting architectural decisions across ALL phases
89
+ - Focus on: technology stack choices, infrastructure, security posture,
90
+ observability approach, deployment strategy, data storage decisions
91
+ - Follow the same Steps 3-5 pattern (gray areas → options → follow-ups)
92
+
93
+ **Write project CONTEXT.md:**
94
+ 1. Read `${CLAUDE_SKILL_DIR}/templates/project-CONTEXT.md.tmpl`
95
+ 2. Fill in from discussion decisions:
96
+ - Locked Decisions table: all decisions the user made (not "Let Claude decide")
97
+ - User Constraints: budget, team, timeline, hosting from the conversation
98
+ - Deferred Ideas: anything explicitly ruled out for this project
99
+ - Claude's Discretion: decisions marked "Let Claude decide"
100
+ 3. If Append mode: merge new decisions with existing CONTEXT.md content
101
+ 4. Write to `.planning/CONTEXT.md`
102
+
103
+ **Update STATE.md pointer:**
104
+ Add under Accumulated Context:
105
+ ```
106
+ Project context: .planning/CONTEXT.md ({N} locked decisions, {N} deferred, {N} discretion)
107
+ ```
108
+
109
+ **After writing:** Auto-sync to CLAUDE.md is handled by the post-write-dispatch hook.
110
+ Display: `✓ Project CONTEXT.md written — locked decisions will auto-sync to CLAUDE.md`
111
+
112
+ Skip to Cleanup step. Do NOT run Steps 2-8 of the phase flow.
113
+
114
+ ---
115
+
66
116
  ### Step 2: Load Phase Context
67
117
 
68
118
  Read the following files to understand what this phase needs to accomplish:
@@ -61,6 +61,19 @@ Stop all further checks.
61
61
  - PASS: All three required files exist
62
62
  - FAIL: List each missing file — "Run `$pbr-begin` to re-initialize, or create the file manually."
63
63
 
64
+ **Advisory checks — WARN if missing, do not FAIL:**
65
+
66
+ - `.planning/PROJECT.md`
67
+ If missing: `⚠ PROJECT.md not found. Run $pbr-begin to generate it, or create from plugins/pbr/templates/PROJECT.md.tmpl.`
68
+
69
+ - `.planning/REQUIREMENTS.md`
70
+ If missing: `⚠ REQUIREMENTS.md not found. Run $pbr-begin to generate it, or create from plugins/pbr/templates/REQUIREMENTS.md.tmpl.`
71
+
72
+ - `.planning/CONTEXT.md` (project-level)
73
+ If missing: `⚠ CONTEXT.md not found. Run $pbr-discuss --project to capture locked decisions.`
74
+
75
+ These files are generated by $pbr-begin. Absence is expected on projects created before v2.15.
76
+
64
77
  ### Check 2: Config Validity
65
78
 
66
79
  Parse `.planning/config.json` as JSON. Check required fields: `version`, `depth`. Check recommended fields: `features`, `models`.
@@ -484,7 +484,17 @@ Use AskUserQuestion (pattern: approve-revise-abort from `skills/shared/gate-prom
484
484
  - Or make small inline edits to plan files directly
485
485
 
486
486
  **If user selects 'Approve':**
487
- - **CONTEXT.md compliance reporting**: If `.planning/CONTEXT.md` exists, compare all locked decisions against the generated plans. Print: "CONTEXT.md compliance: {M}/{N} locked decisions mapped to tasks" where M = locked decisions that are reflected in at least one task, N = total locked decisions. If any locked decisions are unmapped, list them as warnings.
487
+ - **CONTEXT.md compliance reporting**: Check locked decisions from BOTH sources:
488
+ a. Project-level: `.planning/CONTEXT.md` (if exists) — cross-cutting decisions for all phases
489
+ b. Phase-level: `.planning/phases/{NN}-{slug}/CONTEXT.md` (if exists) — phase-specific decisions
490
+ Phase-level decisions override project-level for the same decision area.
491
+
492
+ Collect ALL locked decisions from both files (deduplicate identical decision text).
493
+ Compare against the generated plan tasks. Print:
494
+ `CONTEXT.md compliance: {M}/{N} locked decisions mapped to tasks`
495
+ where M = locked decisions reflected in at least one task action, N = total unique locked decisions.
496
+ If any locked decisions are unmapped, list them as warnings.
497
+ If neither CONTEXT.md exists: skip this check silently.
488
498
  - **Dependency fingerprinting**: For each dependency phase (phases that this phase depends on, per ROADMAP.md):
489
499
  1. Find all SUMMARY.md files in the dependency phase directory
490
500
  2. Compute a fingerprint string for each: `"len:{bytes}-mod:{mtime}"` and add as a `dependency_fingerprints` map in each plan's YAML frontmatter — this allows the build skill to detect stale plans if dependencies were rebuilt.
@@ -28,6 +28,7 @@ Task({
28
28
  - .planning/STATE.md
29
29
  - .planning/ROADMAP.md
30
30
  - .planning/REQUIREMENTS.md
31
+ - .planning/PROJECT.md (if exists — project vision and scope)
31
32
  - .planning/CONTEXT.md
32
33
  - Any .planning/phases/*/CONTEXT.md files
33
34
  - .planning/research/SUMMARY.md (if exists)
@@ -65,6 +66,7 @@ Task({
65
66
  - .planning/STATE.md
66
67
  - .planning/ROADMAP.md
67
68
  - .planning/REQUIREMENTS.md
69
+ - .planning/PROJECT.md (if exists — project vision and scope)
68
70
  - .planning/CONTEXT.md
69
71
  - Any .planning/phases/*/CONTEXT.md files
70
72
  - .planning/HISTORY.md (if exists — scan for decisions relevant to '{topic}' only, do NOT summarize all history)
@@ -111,6 +111,16 @@ Parse the JSON response. Capture:
111
111
 
112
112
  Store these for use in Step 4 display and Step 5 routing.
113
113
 
114
+ 6. **`.planning/CONTEXT.md`** (project-level, if exists)
115
+ - Note: project-level locked decisions file
116
+
117
+ ### Step 1d: Check Project Documents
118
+
119
+ Check existence of the three project-level documents and record their status for Step 4 display:
120
+ - `.planning/PROJECT.md` — exists or not
121
+ - `.planning/REQUIREMENTS.md` — exists or not
122
+ - `.planning/CONTEXT.md` — exists or not
123
+
114
124
  ### Step 2: Scan Phase Directories
115
125
 
116
126
  For each phase listed in ROADMAP.md:
@@ -221,6 +231,13 @@ Phase Status:
221
231
  | 2. {name} | {status indicator} {status text} | {completed}/{total} | {percentage}% |
222
232
  | ...
223
233
 
234
+ **Project documents:**
235
+ | File | Status |
236
+ |------|--------|
237
+ | PROJECT.md | {exists / not found — run $pbr-begin} |
238
+ | REQUIREMENTS.md | {exists / not found — run $pbr-begin} |
239
+ | CONTEXT.md | {exists / not found — run $pbr-discuss --project} |
240
+
224
241
  {If context tier is DEGRADING, POOR, or CRITICAL:}
225
242
  ⚠ Context: {percentage}% used ({tier}) — {recommendation_text}
226
243
  Run `/compact` to reclaim context before spawning more agents.
@@ -0,0 +1,41 @@
1
+ # {project_name}
2
+
3
+ > {ONE sentence core value statement}
4
+
5
+ ## Vision
6
+
7
+ {2-3 sentences describing the product and problem it solves. Who is it for? What does it replace or improve?}
8
+
9
+ ## Scope
10
+
11
+ ### In Scope (v1)
12
+
13
+ {Bulleted list of features and capabilities committed for this project.}
14
+
15
+ - {Feature area}: {brief description}
16
+
17
+ ### Out of Scope
18
+
19
+ {Features explicitly excluded from this project.}
20
+
21
+ - {Feature}: {brief reason why excluded}
22
+
23
+ ## Success Criteria
24
+
25
+ {Observable conditions that define project success. Each must be testable.}
26
+
27
+ - {Criterion 1 — specific and measurable}
28
+ - {Criterion 2 — specific and measurable}
29
+ - {Criterion 3 — specific and measurable}
30
+
31
+ ## Stakeholders
32
+
33
+ {Who cares about this project and why.}
34
+
35
+ - **Primary user**: {description}
36
+ - **Team**: {description}
37
+
38
+ ## Milestones
39
+
40
+ {project_name} planned in {phase_count} phases across {milestone_count} milestone(s).
41
+ See `.planning/ROADMAP.md` for phase details.
@@ -0,0 +1,52 @@
1
+ # Requirements
2
+
3
+ > Living document. Generated by `/pbr:begin`, updated via `/pbr:discuss`.
4
+ > All requirements flow from here into plans via `implements:[]` in PLAN.md frontmatter.
5
+
6
+ ## Functional Requirements
7
+
8
+ Capabilities the system must provide from the user's perspective.
9
+
10
+ ### {Category} (e.g., Authentication, API, UI)
11
+
12
+ | ID | Requirement | Priority | Status |
13
+ |----|-------------|----------|--------|
14
+ | REQ-F-001 | {User-centric, testable statement of capability} | Must | Open |
15
+ | REQ-F-002 | {User-centric, testable statement of capability} | Should | Open |
16
+
17
+ ### {Category 2}
18
+
19
+ | ID | Requirement | Priority | Status |
20
+ |----|-------------|----------|--------|
21
+ | REQ-F-010 | {User-centric, testable statement of capability} | Must | Open |
22
+
23
+ ## Non-Functional Requirements
24
+
25
+ Quality attributes and constraints the system must satisfy.
26
+
27
+ | ID | Requirement | Category | Priority |
28
+ |----|-------------|----------|----------|
29
+ | REQ-NF-001 | {Observable quality statement — e.g., "Page loads in <2s on 4G"} | Performance | Must |
30
+ | REQ-NF-002 | {Observable quality statement} | Security | Must |
31
+ | REQ-NF-003 | {Observable quality statement} | Reliability | Should |
32
+
33
+ ## Deferred Requirements (v2+)
34
+
35
+ Requirements explicitly out of scope for v1.
36
+
37
+ | ID | Requirement | Deferred Reason |
38
+ |----|-------------|----------------|
39
+ | REQ-F-099 | {requirement} | {reason — e.g., "Phase 2 priority"} |
40
+
41
+ ## Out of Scope
42
+
43
+ Features explicitly excluded. These must NOT appear in any plan.
44
+
45
+ - {Feature}: {brief rationale}
46
+
47
+ ## Traceability
48
+
49
+ | REQ-ID | Implemented In | Verified In |
50
+ |--------|---------------|------------|
51
+ | REQ-F-001 | Phase 01 PLAN-01 | Phase 01 VERIFICATION.md |
52
+ | REQ-F-002 | — | — |
@@ -23,6 +23,11 @@ anti_patterns:
23
23
  console_logs: {count}
24
24
  skipped_tests: {count}
25
25
  hardcoded_secrets: {count}
26
+ # populated by verifier from implements:[] in plan frontmatter
27
+ satisfied:
28
+ - "REQ-F-001" # REQ-IDs confirmed verified in this phase
29
+ unsatisfied:
30
+ - "REQ-F-002" # REQ-IDs that failed verification
26
31
  ---
27
32
 
28
33
  # Phase Verification: {phase_name}
@@ -0,0 +1,43 @@
1
+ # Project Context
2
+
3
+ > Cross-cutting decisions that ALL phases must honor.
4
+ > Updated via `/pbr:discuss --project`. Auto-synced to CLAUDE.md on write.
5
+ > Phase-level CONTEXT.md (in phase directories) overrides project-level for that phase.
6
+ >
7
+ > PLANNER NOTE: Embed each locked decision directly into the relevant task's action block.
8
+ > Executors NEVER read this file — PLAN.md is self-contained.
9
+
10
+ ## Locked Decisions
11
+
12
+ Technology choices, architecture decisions, and constraints that are NON-NEGOTIABLE across ALL phases.
13
+ The planner embeds these into PLAN.md task actions. Executors never read this file directly.
14
+
15
+ | Decision | Rationale | Locked By |
16
+ |----------|-----------|-----------|
17
+ | {e.g., "Use TypeScript strict mode"} | {User preference, team skill} | User |
18
+ | {e.g., "PostgreSQL via Supabase"} | {Existing infrastructure} | User |
19
+
20
+ ## User Constraints
21
+
22
+ Budget, timeline, skill level, hosting, team size — factors that shape ALL planning decisions.
23
+
24
+ - {e.g., "Solo developer, no team"}
25
+ - {e.g., "Deploy to Hetzner VPS"}
26
+ - {e.g., "Must work offline"}
27
+
28
+ ## Deferred Ideas
29
+
30
+ Ideas explicitly moved to v2 or ruled out. Plans at ANY phase MUST NOT include these.
31
+
32
+ | Idea | Reason Deferred |
33
+ |------|----------------|
34
+ | {feature} | {reason — e.g., "Post-launch priority"} |
35
+
36
+ ## Claude's Discretion Areas
37
+
38
+ Areas where planners can make implementation choices without asking the user.
39
+ Document the choice made and rationale when exercised.
40
+
41
+ | Area | Choice Made | Rationale |
42
+ |------|------------|-----------|
43
+ | {e.g., "Logging library"} | {e.g., "pino"} | {e.g., "Lightweight, structured output"} |