@sienklogic/plan-build-run 2.21.0 → 2.22.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 (104) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/CLAUDE.md +2 -2
  3. package/package.json +1 -1
  4. package/plugins/copilot-pbr/agents/codebase-mapper.agent.md +1 -1
  5. package/plugins/copilot-pbr/agents/debugger.agent.md +2 -0
  6. package/plugins/copilot-pbr/agents/executor.agent.md +4 -1
  7. package/plugins/copilot-pbr/agents/general.agent.md +2 -1
  8. package/plugins/copilot-pbr/agents/integration-checker.agent.md +2 -0
  9. package/plugins/copilot-pbr/agents/plan-checker.agent.md +1 -1
  10. package/plugins/copilot-pbr/agents/planner.agent.md +3 -1
  11. package/plugins/copilot-pbr/agents/researcher.agent.md +5 -3
  12. package/plugins/copilot-pbr/agents/synthesizer.agent.md +1 -1
  13. package/plugins/copilot-pbr/agents/verifier.agent.md +3 -3
  14. package/plugins/copilot-pbr/hooks/hooks.json +37 -13
  15. package/plugins/copilot-pbr/plugin.json +1 -1
  16. package/plugins/copilot-pbr/skills/audit/SKILL.md +1 -1
  17. package/plugins/copilot-pbr/skills/build/SKILL.md +7 -8
  18. package/plugins/copilot-pbr/skills/config/SKILL.md +1 -1
  19. package/plugins/copilot-pbr/skills/continue/SKILL.md +8 -2
  20. package/plugins/copilot-pbr/skills/debug/SKILL.md +1 -1
  21. package/plugins/copilot-pbr/skills/import/SKILL.md +3 -1
  22. package/plugins/copilot-pbr/skills/milestone/SKILL.md +2 -0
  23. package/plugins/copilot-pbr/skills/pause/SKILL.md +7 -1
  24. package/plugins/copilot-pbr/skills/plan/SKILL.md +1 -1
  25. package/plugins/copilot-pbr/skills/review/SKILL.md +4 -4
  26. package/plugins/copilot-pbr/skills/scan/SKILL.md +4 -4
  27. package/plugins/copilot-pbr/skills/shared/config-loading.md +1 -1
  28. package/plugins/copilot-pbr/skills/shared/context-budget.md +3 -3
  29. package/plugins/copilot-pbr/skills/shared/state-loading.md +1 -1
  30. package/plugins/copilot-pbr/skills/shared/state-update.md +12 -4
  31. package/plugins/copilot-pbr/skills/shared/universal-anti-patterns.md +1 -1
  32. package/plugins/copilot-pbr/templates/ROADMAP.md.tmpl +7 -0
  33. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  34. package/plugins/cursor-pbr/agents/codebase-mapper.md +1 -1
  35. package/plugins/cursor-pbr/agents/debugger.md +2 -0
  36. package/plugins/cursor-pbr/agents/executor.md +4 -1
  37. package/plugins/cursor-pbr/agents/general.md +2 -1
  38. package/plugins/cursor-pbr/agents/integration-checker.md +2 -0
  39. package/plugins/cursor-pbr/agents/plan-checker.md +1 -1
  40. package/plugins/cursor-pbr/agents/planner.md +3 -1
  41. package/plugins/cursor-pbr/agents/researcher.md +5 -3
  42. package/plugins/cursor-pbr/agents/synthesizer.md +1 -1
  43. package/plugins/cursor-pbr/agents/verifier.md +3 -3
  44. package/plugins/cursor-pbr/hooks/hooks.json +20 -0
  45. package/plugins/cursor-pbr/skills/audit/SKILL.md +1 -1
  46. package/plugins/cursor-pbr/skills/build/SKILL.md +7 -8
  47. package/plugins/cursor-pbr/skills/config/SKILL.md +1 -1
  48. package/plugins/cursor-pbr/skills/continue/SKILL.md +8 -2
  49. package/plugins/cursor-pbr/skills/debug/SKILL.md +1 -1
  50. package/plugins/cursor-pbr/skills/import/SKILL.md +3 -1
  51. package/plugins/cursor-pbr/skills/milestone/SKILL.md +2 -0
  52. package/plugins/cursor-pbr/skills/pause/SKILL.md +7 -1
  53. package/plugins/cursor-pbr/skills/plan/SKILL.md +1 -1
  54. package/plugins/cursor-pbr/skills/review/SKILL.md +4 -4
  55. package/plugins/cursor-pbr/skills/scan/SKILL.md +4 -4
  56. package/plugins/cursor-pbr/skills/shared/config-loading.md +1 -1
  57. package/plugins/cursor-pbr/skills/shared/context-budget.md +3 -3
  58. package/plugins/cursor-pbr/skills/shared/state-loading.md +1 -1
  59. package/plugins/cursor-pbr/skills/shared/state-update.md +12 -4
  60. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +1 -1
  61. package/plugins/cursor-pbr/templates/ROADMAP.md.tmpl +7 -0
  62. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  63. package/plugins/pbr/agents/codebase-mapper.md +1 -1
  64. package/plugins/pbr/agents/debugger.md +2 -0
  65. package/plugins/pbr/agents/executor.md +4 -1
  66. package/plugins/pbr/agents/general.md +2 -1
  67. package/plugins/pbr/agents/integration-checker.md +2 -0
  68. package/plugins/pbr/agents/plan-checker.md +0 -1
  69. package/plugins/pbr/agents/planner.md +2 -1
  70. package/plugins/pbr/agents/researcher.md +2 -0
  71. package/plugins/pbr/agents/synthesizer.md +0 -1
  72. package/plugins/pbr/agents/verifier.md +1 -1
  73. package/plugins/pbr/commands/do.md +5 -0
  74. package/plugins/pbr/hooks/hooks.json +20 -0
  75. package/plugins/pbr/scripts/auto-continue.js +26 -2
  76. package/plugins/pbr/scripts/block-skill-self-read.js +72 -0
  77. package/plugins/pbr/scripts/check-agent-state-write.js +63 -0
  78. package/plugins/pbr/scripts/check-cross-plugin-sync.js +93 -0
  79. package/plugins/pbr/scripts/check-dangerous-commands.js +2 -2
  80. package/plugins/pbr/scripts/check-phase-boundary.js +2 -8
  81. package/plugins/pbr/scripts/check-plan-format.js +188 -24
  82. package/plugins/pbr/scripts/check-roadmap-sync.js +140 -1
  83. package/plugins/pbr/scripts/check-skill-workflow.js +3 -11
  84. package/plugins/pbr/scripts/check-state-sync.js +75 -11
  85. package/plugins/pbr/scripts/check-subagent-output.js +78 -6
  86. package/plugins/pbr/scripts/check-summary-gate.js +1 -1
  87. package/plugins/pbr/scripts/log-tool-failure.js +1 -4
  88. package/plugins/pbr/scripts/post-write-dispatch.js +47 -0
  89. package/plugins/pbr/scripts/pre-write-dispatch.js +9 -2
  90. package/plugins/pbr/scripts/session-cleanup.js +3 -4
  91. package/plugins/pbr/scripts/status-line.js +44 -11
  92. package/plugins/pbr/scripts/validate-commit.js +8 -7
  93. package/plugins/pbr/scripts/validate-skill-args.js +2 -1
  94. package/plugins/pbr/scripts/validate-task.js +14 -24
  95. package/plugins/pbr/skills/build/SKILL.md +7 -8
  96. package/plugins/pbr/skills/continue/SKILL.md +8 -2
  97. package/plugins/pbr/skills/health/SKILL.md +0 -2
  98. package/plugins/pbr/skills/import/SKILL.md +2 -0
  99. package/plugins/pbr/skills/milestone/SKILL.md +2 -0
  100. package/plugins/pbr/skills/pause/SKILL.md +7 -1
  101. package/plugins/pbr/skills/plan/SKILL.md +1 -1
  102. package/plugins/pbr/skills/review/SKILL.md +4 -4
  103. package/plugins/pbr/skills/shared/state-update.md +10 -2
  104. package/plugins/pbr/templates/ROADMAP.md.tmpl +2 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,65 @@ 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.22.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.21.1...plan-build-run-v2.22.0) (2026-02-23)
9
+
10
+
11
+ ### Features
12
+
13
+ * **24-01:** add check-agent-state-write.js module ([b73ab69](https://github.com/SienkLogic/plan-build-run/commit/b73ab69d8893970595d538a6289d8183b7b08b2b))
14
+ * **24-01:** wire agent state write blocker into pre-write-dispatch ([9f46053](https://github.com/SienkLogic/plan-build-run/commit/9f460530d21e4c3f37389f0bd2731ad0fd99e593))
15
+ * **24-02:** add .auto-next fallback writes to auto_advance hard stops in build skill ([9d59fc1](https://github.com/SienkLogic/plan-build-run/commit/9d59fc13b494cacdbe71e4e236d89bba0724a412))
16
+ * **25-01:** add ROADMAP.md read to continue skill for milestone boundary detection ([49482c2](https://github.com/SienkLogic/plan-build-run/commit/49482c2a7c0fbe49a39b215bf9070381295daa1c))
17
+ * **25-01:** GREEN - add validateRoadmap and ROADMAP.md validation to check-plan-format ([73256de](https://github.com/SienkLogic/plan-build-run/commit/73256dea9ea9c86a55dbd63fe057678e9757a798))
18
+ * **25-01:** GREEN - PLAN.md writes trigger ROADMAP Planning status without regression ([e8e028a](https://github.com/SienkLogic/plan-build-run/commit/e8e028ae3528a856a8c406a3b508802550e0f75f))
19
+ * **25-02:** GREEN - add checkRoadmapWrite routing to post-write-dispatch ([c7db2e0](https://github.com/SienkLogic/plan-build-run/commit/c7db2e0a4433a962a4f499941b29927a16583425))
20
+ * **25-02:** GREEN - implement isHighRisk with status regression and phase gap detection ([cea48b4](https://github.com/SienkLogic/plan-build-run/commit/cea48b4ccce2554a7c698af280e2725a233e69cb))
21
+ * **25-02:** GREEN - implement validatePostMilestone for milestone completion checks ([c666de8](https://github.com/SienkLogic/plan-build-run/commit/c666de84530eb7a6310a8def7744cec4ff5f8358))
22
+ * **26-02:** GREEN - add 150-line advisory warning to checkStateWrite ([9374009](https://github.com/SienkLogic/plan-build-run/commit/937400997580e9666f9efa18b4e0a80c5fe3b668))
23
+ * **26-02:** GREEN - add cross-plugin sync advisory hook ([a55ad12](https://github.com/SienkLogic/plan-build-run/commit/a55ad1273a7193cc521cd6e953ea185f51e7af50))
24
+ * **27-01:** add PreToolUse Read hook to block SKILL.md self-reads ([afe6acd](https://github.com/SienkLogic/plan-build-run/commit/afe6acd8a55a0807e28266b35b2f4fe961c9ecf5))
25
+ * **27-01:** add session length guard to auto-continue with warn at 3, hard-stop at 6 ([fd394d8](https://github.com/SienkLogic/plan-build-run/commit/fd394d893f2e7d93ad4a4bb29acd0a889da3fd67))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **24-01:** remove building from ADVANCED_STATUSES gate ([6e1fdf7](https://github.com/SienkLogic/plan-build-run/commit/6e1fdf7fb3897efdb1dca2ef77dbab78bab13ed2))
31
+ * **24-02:** raise consecutive-continue guard threshold from 3 to 6 ([918394c](https://github.com/SienkLogic/plan-build-run/commit/918394c34356f84772a4454061b312601f8ca26d))
32
+ * **24-02:** remove .auto-next cleanup from session-cleanup to prevent race with Stop hook ([d86e39e](https://github.com/SienkLogic/plan-build-run/commit/d86e39e48b51a3765e42c2807ee7ef277f8d3a5d))
33
+ * **25-02:** remove unused path import and result variable (lint) ([f84764a](https://github.com/SienkLogic/plan-build-run/commit/f84764ae3b4a5fce09a7d126624bb1719c57c10b))
34
+ * **26-01:** add CRITICAL dual-update markers to import Step 8b and milestone new Step 8 ([36bd68c](https://github.com/SienkLogic/plan-build-run/commit/36bd68c42d2fc556581de8f2f23a7b9d6447392b))
35
+ * **26-01:** add CRITICAL frontmatter update marker to pause skill STATE.md step ([ec35f3b](https://github.com/SienkLogic/plan-build-run/commit/ec35f3b529c1fe2b2928bb8ef97d768b101f2f0b))
36
+ * **26-02:** sync cross-plugin-sync hook to cursor-pbr and copilot-pbr hooks.json ([2083a1d](https://github.com/SienkLogic/plan-build-run/commit/2083a1d11c1ced3c7f2b4dc83df2c2a4ed684529))
37
+
38
+
39
+ ### Documentation
40
+
41
+ * **27-01:** add no-reread anti-pattern to executor agents across all plugins ([8b572fa](https://github.com/SienkLogic/plan-build-run/commit/8b572fa6f43dfc3fe1a0ae8caf167ce2351f46f9))
42
+
43
+ ## [2.21.1](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.21.0...plan-build-run-v2.21.1) (2026-02-23)
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * **23-01:** register /pbr:do command and fix critical audit findings ([274f324](https://github.com/SienkLogic/plan-build-run/commit/274f3247ea32557954c45eb321f5551bc3d8b3de))
49
+ * **23-02:** replace CLAUDE_PLUGIN_ROOT with PLUGIN_ROOT in cursor-pbr ([7fa53be](https://github.com/SienkLogic/plan-build-run/commit/7fa53beafaba95ab4c36499e7fb333ec83c58ecc))
50
+ * **23-03:** replace CLAUDE_PLUGIN_ROOT with PLUGIN_ROOT in copilot-pbr ([071f739](https://github.com/SienkLogic/plan-build-run/commit/071f739eab3854e03a68f6b93ad7de40854c8b72))
51
+ * **23-04:** replace subagents terminology with agents in cursor-pbr ([444765f](https://github.com/SienkLogic/plan-build-run/commit/444765f3277d077fba200c6d5f5fde594abdaf9a))
52
+ * **23-05:** fix subagents terminology in copilot-pbr and sync ROADMAP template ([e019e83](https://github.com/SienkLogic/plan-build-run/commit/e019e832b4c2808cec951eda44f0f57cb8755b8c))
53
+ * **23-07:** strip hookSpecificOutput wrapper from check-phase-boundary and pre-write-dispatch ([61e4e1e](https://github.com/SienkLogic/plan-build-run/commit/61e4e1ec7a7db3bc8ac4184e58c94ab5c324eb38))
54
+ * **23-09:** reorder copilot-pbr hooks.json postToolUseFailure before preToolUse to match pbr canonical ordering ([1180c9d](https://github.com/SienkLogic/plan-build-run/commit/1180c9d4ffb2c1bbbe4bc201a5dab126aee43ded))
55
+ * **23-09:** use decision:block in validate-skill-args.js, remove orphaned JSDoc in validate-task.js ([ec8c1d2](https://github.com/SienkLogic/plan-build-run/commit/ec8c1d24f9436c1dee703ec3509eb065fb2c4c92))
56
+ * **23-10:** correct dispatch table — move check-doc-sprawl and check-skill-workflow to pre-write-dispatch ([c6acc27](https://github.com/SienkLogic/plan-build-run/commit/c6acc2791ba652d5f81da231d301afcc90ab5c57))
57
+ * **23-10:** remove dead body from checkStatuslineRules in check-skill-workflow.js ([5a518ec](https://github.com/SienkLogic/plan-build-run/commit/5a518ec4772de1cf2991201e2657f5737efe2ebd))
58
+ * **23-10:** remove redundant allowed-tools Note from health SKILL.md Auto-Fix section ([7dcd549](https://github.com/SienkLogic/plan-build-run/commit/7dcd549bbd0e11b6eb4177e5ed1d4fd5eddc7d9b))
59
+ * **23-12:** fix remaining subagents terminology in scan SKILL.md derivatives ([67b15e8](https://github.com/SienkLogic/plan-build-run/commit/67b15e881d752ad1eb66bfb31496f634cb3c1768))
60
+ * **23-12:** fix test property paths and heredoc extraction to achieve 70% branch coverage ([4b857fe](https://github.com/SienkLogic/plan-build-run/commit/4b857fe73b8d82e6efe05114a7b09737c65dee12))
61
+ * **23-12:** remove excess tool grants from synthesizer and plan-checker agents ([04432b3](https://github.com/SienkLogic/plan-build-run/commit/04432b35dde761e95d14ca98353091bc936512a6))
62
+ * **quick-001:** fix agent prompt issues from audit (items 4-7) ([2772154](https://github.com/SienkLogic/plan-build-run/commit/27721547694686e2f425e95a7257b9cc48316c86))
63
+ * **quick-001:** fix agent prompt issues from audit (items 8-10) ([1c41a8f](https://github.com/SienkLogic/plan-build-run/commit/1c41a8f29a5069f4bb7cec612875b59dc6a22b22))
64
+ * **quick-001:** fix STATE.md body drift, stale status line, and ROADMAP sync gaps ([896494d](https://github.com/SienkLogic/plan-build-run/commit/896494d1215a7aadb7aa5b28c050db282cdcd784))
65
+ * **tools:** fix CI lint errors and macOS symlink test failure ([e5294a0](https://github.com/SienkLogic/plan-build-run/commit/e5294a0e0eefde674203ef0ed587d5def5c0f865))
66
+
8
67
  ## [2.21.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.20.0...plan-build-run-v2.21.0) (2026-02-23)
9
68
 
10
69
 
package/CLAUDE.md CHANGED
@@ -59,13 +59,13 @@ Markdown files with YAML frontmatter defining specialized subagent prompts. Agen
59
59
  |------------|-------------|-------------|
60
60
  | SessionStart | progress-tracker.js | — (injects project state) |
61
61
  | PostToolUse (Write\|Edit) | post-write-dispatch.js | check-plan-format.js, check-roadmap-sync.js, check-state-sync.js |
62
- | PostToolUse (Write\|Edit) | post-write-quality.js | check-doc-sprawl.js, check-skill-workflow.js |
62
+ | PostToolUse (Write\|Edit) | post-write-quality.js | — (autoFormat, typeCheck, detectConsoleLogs) |
63
63
  | PostToolUse (Task) | check-subagent-output.js | — (validates agent output) |
64
64
  | PostToolUse (Write\|Edit) | suggest-compact.js | — (context budget warnings) |
65
65
  | PostToolUse (Read) | track-context-budget.js | — (tracks reads for budget) |
66
66
  | PostToolUseFailure | log-tool-failure.js | — (logs failures) |
67
67
  | PreToolUse (Bash) | pre-bash-dispatch.js | validate-commit.js, check-dangerous-commands.js, check-phase-boundary.js |
68
- | PreToolUse (Write\|Edit) | pre-write-dispatch.js | (write guards) |
68
+ | PreToolUse (Write\|Edit) | pre-write-dispatch.js | check-skill-workflow.js, check-summary-gate.js, check-phase-boundary.js, check-doc-sprawl.js |
69
69
  | PreCompact | context-budget-check.js | — (preserves STATE.md) |
70
70
  | Stop | auto-continue.js | — (chains next command) |
71
71
  | SubagentStart/Stop | log-subagent.js | — (tracks lifecycle) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sienklogic/plan-build-run",
3
- "version": "2.21.0",
3
+ "version": "2.22.0",
4
4
  "description": "Plan it, Build it, Run it — structured development workflow for Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -22,7 +22,7 @@ You are **codebase-mapper**, the codebase analysis agent for the Plan-Build-Run
22
22
 
23
23
  ### Forbidden Files
24
24
 
25
- When exploring, NEVER commit or recommend committing:
25
+ When exploring, NEVER write to or include in your output:
26
26
  - `.env` files (except `.env.example` or `.env.template`)
27
27
  - `*.key`, `*.pem`, `*.pfx`, `*.p12` — private keys and certificates
28
28
  - Files containing `credential` or `secret` in their name
@@ -8,6 +8,8 @@ target: "github-copilot"
8
8
 
9
9
  # Plan-Build-Run Debugger
10
10
 
11
+ > **Memory note:** Project memory is enabled to provide debugging continuity across investigation sessions.
12
+
11
13
  You are **debugger**, the systematic debugging agent. Investigate bugs using the scientific method: hypothesize, test, collect evidence, narrow the search space.
12
14
 
13
15
  ## Output Budget
@@ -8,6 +8,8 @@ target: "github-copilot"
8
8
 
9
9
  # Plan-Build-Run Executor
10
10
 
11
+ > **Memory note:** Project memory is enabled to provide build history context for deviation awareness.
12
+
11
13
  You are **executor**, the code execution agent for Plan-Build-Run. You receive verified plans and execute them task-by-task, producing working code with atomic commits, deviation handling, and self-verification.
12
14
 
13
15
  **You are a builder, not a designer.** Plans tell you WHAT to build. You figure out HOW at the code level. You do NOT redesign, skip, reorder, or add scope.
@@ -175,7 +177,7 @@ must_haves:
175
177
  ### Completeness Checklist
176
178
 
177
179
  Before deleting `.PROGRESS-{plan_id}`, verify SUMMARY.md has:
178
- - [ ] YAML frontmatter with `plan_id`, `status`, `tasks_completed`, `tasks_total`
180
+ - [ ] YAML frontmatter with `plan`, `status`, `tasks_completed`, `tasks_total`
179
181
  - [ ] Deviations section (use "None" if empty)
180
182
  - [ ] Files Changed listing at least one file
181
183
  - [ ] At least one commit hash reference
@@ -252,6 +254,7 @@ Record timestamps at start and end using `node -e "console.log(new Date().toISOS
252
254
  11. DO NOT continue past a checkpoint — STOP means STOP
253
255
  12. DO NOT re-execute completed tasks when continuing
254
256
  13. DO NOT force-push or amend commits
257
+ 14. DO NOT re-read PLAN.md or PLAN files if the plan was already provided in your prompt context — this wastes tokens on redundant reads
255
258
 
256
259
  ---
257
260
 
@@ -12,7 +12,8 @@ You are **general**, a lightweight utility agent for the Plan-Build-Run developm
12
12
 
13
13
  ## When You're Used
14
14
 
15
- - `/pbr:quick` ad-hoc task delegation
15
+ This agent is available for ad-hoc `Task()` calls from skills or custom orchestration. It is not currently spawned by any built-in PBR skill automatically — it must be invoked explicitly.
16
+
16
17
  - Simple file generation or formatting tasks
17
18
  - Tasks that need Plan-Build-Run context but not specialized methodology
18
19
  - Fallback when a specialized agent would be overkill
@@ -36,6 +36,8 @@ You MUST perform all applicable categories (skip only if zero items exist for th
36
36
  4. **E2E Flow Completeness** — Critical user workflows must trace from UI through API to data layer and back without breaks.
37
37
  5. **Cross-Phase Dependency Satisfaction** — Phase N's declared dependencies on Phase M must be actually satisfied in code.
38
38
 
39
+ > **First-phase edge case**: If no completed phases exist yet, focus on verifying the current phase's internal consistency — exports match imports within the phase, API contracts are self-consistent. Cross-phase checks are not applicable and should be skipped.
40
+
39
41
  ### Agent Contract Compliance
40
42
 
41
43
  Read `references/agent-contracts.md` to validate agent-to-agent handoffs. Verify that each agent's actual output matches its declared contract schema — especially `provides`/`consumes` fields in SUMMARY.md and status enums in VERIFICATION.md.
@@ -140,7 +140,7 @@ Code-producing tasks should include test expectations. Check that tasks creating
140
140
 
141
141
  ## Verification Process
142
142
 
143
- 1. **Load Plans** — Read all plan files. Parse YAML frontmatter and XML tasks. Use `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js frontmatter {path}` and `plan-index {phase}` for frontmatter; read body for XML.
143
+ 1. **Load Plans** — Read all plan files. Parse YAML frontmatter and XML tasks. Use `node ${PLUGIN_ROOT}/scripts/pbr-tools.js frontmatter {path}` and `plan-index {phase}` for frontmatter; read body for XML.
144
144
  2. **Load Context** — If CONTEXT.md provided, extract locked decisions, deferred ideas, user constraints.
145
145
  3. **Load Phase Goal** — From input instruction, phase directory, or plan frontmatter must_haves.
146
146
  4. **Run All 10 Dimensions** — Evaluate each plan against all dimensions. Collect issues.
@@ -8,6 +8,8 @@ target: "github-copilot"
8
8
 
9
9
  # Plan-Build-Run Planner
10
10
 
11
+ > **Memory note:** Project memory is enabled to provide planning continuity and awareness of prior phase decisions.
12
+
11
13
  You are **planner**, the planning agent for the Plan-Build-Run development system. You transform research, phase goals, and user requirements into executable plans that the executor agent can follow mechanically.
12
14
 
13
15
  ## Core Principle: Context Fidelity
@@ -30,7 +32,7 @@ Invoked with a VERIFICATION.md containing gaps. Read the report, identify gaps,
30
32
  Invoked with plan-checker feedback containing issues. Revise flagged plan(s) to address all blockers and warnings. See Revision Mode below.
31
33
 
32
34
  ### Mode 4: Roadmap Mode
33
- Invoked with a request to create/update the project roadmap. Produce `.planning/ROADMAP.md` using the template at `${CLAUDE_PLUGIN_ROOT}/templates/ROADMAP.md.tmpl`.
35
+ Invoked with a request to create/update the project roadmap. Produce `.planning/ROADMAP.md` using the template at `${PLUGIN_ROOT}/templates/ROADMAP.md.tmpl`.
34
36
 
35
37
  #### Fallback Format: ROADMAP.md (if template unreadable)
36
38
 
@@ -52,6 +52,8 @@ All claims must be attributed to a source level. Higher levels override lower le
52
52
 
53
53
  **Attribution rules**: Every factual claim needs a source tag (`[S1]`, `[S2]`, etc.). Version-sensitive information (API signatures, config syntax) MUST come from S1-S3. When citing S2, note the version: `[S2-v14.2]`. Contradictions resolve in favor of higher source level.
54
54
 
55
+ **Offline Fallback**: If web tools are unavailable (air-gapped environment, MCP not configured), rely on local sources: codebase analysis via Glob/Grep, existing documentation, and README files. Assign these S3-S4 confidence levels. Do not attempt WebFetch or WebSearch — note in the output header that external sources were unavailable.
56
+
55
57
  ---
56
58
 
57
59
  ## Confidence Levels
@@ -101,15 +103,15 @@ Before writing output, verify: every claim has source attribution, every recomme
101
103
  ## Output Formats
102
104
 
103
105
  ### Project Research
104
- Read `${CLAUDE_PLUGIN_ROOT}/templates/research-outputs/project-research.md.tmpl` for format.
106
+ Read `${PLUGIN_ROOT}/templates/research-outputs/project-research.md.tmpl` for format.
105
107
  Key sections: User Constraints, Executive Summary, Standard Stack, Architecture Patterns, Common Pitfalls, Code Examples, Integration Points, Coverage Assessment, Open Questions, Sources.
106
108
 
107
109
  ### Phase Research
108
- Read `${CLAUDE_PLUGIN_ROOT}/templates/research-outputs/phase-research.md.tmpl` for format.
110
+ Read `${PLUGIN_ROOT}/templates/research-outputs/phase-research.md.tmpl` for format.
109
111
  Key sections: User Constraints, Phase Goal, Implementation Approach, Dependencies, Pitfalls, Testing Strategy, Coverage Assessment, Sources.
110
112
 
111
113
  ### Synthesis
112
- Read `${CLAUDE_PLUGIN_ROOT}/templates/research-outputs/synthesis.md.tmpl` for format.
114
+ Read `${PLUGIN_ROOT}/templates/research-outputs/synthesis.md.tmpl` for format.
113
115
  Key sections: Executive Summary, Key Findings, Contradictions Resolved, Recommended Approach, Risks and Mitigations, Sources.
114
116
 
115
117
  ### Fallback Format (if templates unreadable)
@@ -54,7 +54,7 @@ Output to `.planning/research/SUMMARY.md` (or specified path).
54
54
 
55
55
  ## Output Format
56
56
 
57
- Read `${CLAUDE_PLUGIN_ROOT}/templates/RESEARCH-SUMMARY.md.tmpl` for the complete output format.
57
+ Read `${PLUGIN_ROOT}/templates/RESEARCH-SUMMARY.md.tmpl` for the complete output format.
58
58
 
59
59
  Key sections: Executive Summary (3-5 sentences), Recommended Stack (table), Architecture Recommendations, Key Patterns, Pitfalls & Warnings, Contradictions Resolved, Open Questions, Sources.
60
60
 
@@ -48,8 +48,8 @@ Look for an existing `VERIFICATION.md` in the phase directory.
48
48
 
49
49
  Use `pbr-tools.js` CLI to efficiently load phase data (saves ~500-800 tokens vs. manual parsing):
50
50
  ```bash
51
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js must-haves {phase_number}
52
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js phase-info {phase_number}
51
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js must-haves {phase_number}
52
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js phase-info {phase_number}
53
53
  ```
54
54
 
55
55
  Stop and report error if pbr-tools CLI is unavailable. Also read CONTEXT.md for locked decisions and deferred ideas, and ROADMAP.md for the phase goal and dependencies.
@@ -216,7 +216,7 @@ Read `references/stub-patterns.md` for stub detection patterns by technology. Re
216
216
 
217
217
  ### Verifier-Specific Anti-Patterns
218
218
  1. DO NOT trust SUMMARY.md claims without verifying the actual codebase
219
- 2. DO NOT attempt to fix issues — you have no Write/Edit tools and that is intentional
219
+ 2. DO NOT attempt to fix issues — you have no Edit tool and that is intentional; Write access is only for VERIFICATION.md output
220
220
  3. DO NOT mark stubs as SUBSTANTIVE — if it has a TODO, it's a stub
221
221
  4. DO NOT mark orphaned code as WIRED — if nothing imports it, it's orphaned
222
222
  5. DO NOT skip Level 2 or Level 3 checks — existence alone is insufficient
@@ -77,7 +77,32 @@
77
77
  ]
78
78
  }
79
79
  ],
80
+ "postToolUseFailure": [
81
+ {
82
+ "hooks": [
83
+ {
84
+ "type": "command",
85
+ "bash": "node \"$(cd \"$(dirname \"$0\")\" && pwd)/../../pbr/scripts/run-hook.js\" log-tool-failure.js",
86
+ "powershell": "node (Join-Path (Split-Path -Parent $PSScriptRoot) 'pbr\\scripts\\run-hook.js') log-tool-failure.js",
87
+ "cwd": ".",
88
+ "timeoutSec": 15
89
+ }
90
+ ]
91
+ }
92
+ ],
80
93
  "preToolUse": [
94
+ {
95
+ "matcher": "Read",
96
+ "hooks": [
97
+ {
98
+ "type": "command",
99
+ "bash": "node \"$(cd \"$(dirname \"$0\")\" && pwd)/../../pbr/scripts/run-hook.js\" block-skill-self-read.js",
100
+ "powershell": "node (Join-Path (Split-Path -Parent $PSScriptRoot) 'pbr\\scripts\\run-hook.js') block-skill-self-read.js",
101
+ "cwd": ".",
102
+ "timeoutSec": 15
103
+ }
104
+ ]
105
+ },
81
106
  {
82
107
  "matcher": "Bash",
83
108
  "hooks": [
@@ -90,6 +115,18 @@
90
115
  }
91
116
  ]
92
117
  },
118
+ {
119
+ "matcher": "Bash",
120
+ "hooks": [
121
+ {
122
+ "type": "command",
123
+ "bash": "node \"$(cd \"$(dirname \"$0\")\" && pwd)/../../pbr/scripts/run-hook.js\" check-cross-plugin-sync.js",
124
+ "powershell": "node (Join-Path (Split-Path -Parent $PSScriptRoot) 'pbr\\scripts\\run-hook.js') check-cross-plugin-sync.js",
125
+ "cwd": ".",
126
+ "timeoutSec": 15
127
+ }
128
+ ]
129
+ },
93
130
  {
94
131
  "matcher": "Write|Edit",
95
132
  "hooks": [
@@ -139,19 +176,6 @@
139
176
  ]
140
177
  }
141
178
  ],
142
- "postToolUseFailure": [
143
- {
144
- "hooks": [
145
- {
146
- "type": "command",
147
- "bash": "node \"$(cd \"$(dirname \"$0\")\" && pwd)/../../pbr/scripts/run-hook.js\" log-tool-failure.js",
148
- "powershell": "node (Join-Path (Split-Path -Parent $PSScriptRoot) 'pbr\\scripts\\run-hook.js') log-tool-failure.js",
149
- "cwd": ".",
150
- "timeoutSec": 15
151
- }
152
- ]
153
- }
154
- ],
155
179
  "preCompact": [
156
180
  {
157
181
  "hooks": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbr",
3
3
  "displayName": "Plan-Build-Run",
4
- "version": "2.21.0",
4
+ "version": "2.22.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",
@@ -85,7 +85,7 @@ find ~/.claude/projects/{encoded-path}/ -name "*.jsonl" -maxdepth 1 \
85
85
 
86
86
  For each session file found, also check for subagent logs:
87
87
  ```bash
88
- ls ~/.claude/projects/{encoded-path}/{session-id}/subagents/*.jsonl 2>/dev/null
88
+ ls ~/.claude/projects/{encoded-path}/{session-id}/agents/*.jsonl 2>/dev/null
89
89
  ```
90
90
 
91
91
  Display discovery results:
@@ -718,11 +718,10 @@ These return `{ success, old_status, new_status }` or `{ success, old_plans, new
718
718
 
719
719
  **CRITICAL: Update STATE.md NOW with phase completion status. Do NOT skip this step.**
720
720
 
721
- **8b. Update STATE.md:**
722
- - Phase status: {final_status from Step 8-pre}
723
- - Plan completion count
724
- - Last activity timestamp
725
- - Progress bar
721
+ **8b. Update STATE.md (CRITICAL — update BOTH frontmatter AND body):**
722
+ - Frontmatter: `status`, `plans_complete`, `last_activity`, `progress_percent`, `last_command`
723
+ - Body `## Current Position`: `Phase:` line, `Plan:` line, `Status:` line, `Last activity:` line, `Progress:` bar
724
+ - These MUST stay in sync — the status line reads frontmatter, humans read the body
726
725
 
727
726
  **8c. Commit planning docs (if configured):**
728
727
  Reference: `skills/shared/commit-planning-docs.md` for the standard commit pattern.
@@ -752,9 +751,9 @@ Chain to the next skill directly within this session. This eliminates manual pha
752
751
  |-------------|-------------|-----|
753
752
  | Verification passed, more phases | Plan next phase | `Skill({ skill: "pbr:plan", args: "{N+1}" })` |
754
753
  | Verification skipped | Run review | `Skill({ skill: "pbr:review", args: "{N}" })` |
755
- | Verification gaps found | **HARD STOP** — present gaps to user | Do NOT auto-advance past failures |
756
- | Last phase in current milestone | **HARD STOP** — milestone boundary | Suggest `/pbr:milestone audit`. Explain: "auto_advance pauses at milestone boundaries — your sign-off is required." |
757
- | Build errors occurred | **HARD STOP** — errors need human review | Do NOT auto-advance past errors |
754
+ | Verification gaps found | **HARD STOP** — present gaps to user | If `auto_continue` also true: write `.planning/.auto-next` with `/pbr:review {N}` before stopping. Do NOT auto-advance past failures. |
755
+ | Last phase in current milestone | **HARD STOP** — milestone boundary | If `auto_continue` also true: write `.planning/.auto-next` with `/pbr:milestone complete` before stopping. Suggest `/pbr:milestone audit`. Explain: "auto_advance pauses at milestone boundaries — your sign-off is required." |
756
+ | Build errors occurred | **HARD STOP** — errors need human review | If `auto_continue` also true: write `.planning/.auto-next` with `/pbr:build {N}` before stopping. Do NOT auto-advance past errors. |
758
757
 
759
758
  After invoking the chained skill, it runs within the same session. When it completes, the chained skill may itself chain further (review→plan, plan→build) if auto_advance remains true. This creates the full cycle: build→review→plan→build→...
760
759
 
@@ -133,7 +133,7 @@ After setting depth, the profile is automatically resolved. Show the user the ef
133
133
  "Depth set to {value}. Effective profile:"
134
134
  Then display the profile summary (research, plan-check, verify, scan mappers, debug rounds, inline verify).
135
135
 
136
- To resolve the profile, run: `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth`
136
+ To resolve the profile, run: `node ${PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth`
137
137
 
138
138
  If the user wants to override a specific profile setting, they can set `depth_profiles.{depth}.{key}` directly.
139
139
  For example: to use quick mode but keep plan-checking, the user would set depth to quick and then override:
@@ -48,6 +48,12 @@ Read `.planning/STATE.md` and determine current position:
48
48
  - Current plan progress
49
49
  - Phase status (planning, building, reviewing, complete)
50
50
 
51
+ Then read `.planning/ROADMAP.md` to identify the current milestone boundary:
52
+ - Find which `## Milestone:` section contains the current phase
53
+ - Determine if the current phase is the **last phase** in that milestone section
54
+ - If this is the last phase and it is verified/complete, warn: "This is the final phase of milestone {name}. After verification, run `/pbr:milestone` to complete it."
55
+ - If the current phase's `Depends on` references a phase from the **previous** milestone that is not yet complete, warn: "Cross-milestone dependency: Phase {N} depends on Phase {M} from milestone {prev}, which is not yet complete."
56
+
51
57
  If STATE.md doesn't exist, display:
52
58
  ```
53
59
  ERROR
@@ -67,10 +73,10 @@ Before proceeding to priority evaluation, check for runaway continue chains:
67
73
  - Check `.planning/.active-skill` file — if it contains `continue`, treat as a chained continue
68
74
  - Check STATE.md `last_action` field — if it contains `continue`, treat as a chained continue
69
75
  - If neither source is available, assume this is the first invocation (do not warn)
70
- 4. **If this is the 3rd consecutive `/pbr:continue` in a row**, display:
76
+ 4. **If this is the 6th consecutive `/pbr:continue` in a row**, display:
71
77
 
72
78
  ```
73
- WARNING: Context budget warning: 3 consecutive auto-continues detected.
79
+ WARNING: Context budget warning: 6 consecutive auto-continues detected.
74
80
  Recommend running /pbr:pause then resuming in a fresh session.
75
81
  ```
76
82
 
@@ -54,7 +54,7 @@ This handles the case where neither `.planning/` nor `.planning/debug/` exist ye
54
54
 
55
55
  ### Step 2: Check for Active Debug Sessions
56
56
 
57
- **Load depth profile:** Run `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth` to get `debug.max_hypothesis_rounds`. If the command fails (no config.json or CLI error), default to 5 rounds. Initialize a round counter at 0. This counter increments each time a continuation debugger is spawned.
57
+ **Load depth profile:** Run `node ${PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth` to get `debug.max_hypothesis_rounds`. If the command fails (no config.json or CLI error), default to 5 rounds. Initialize a round counter at 0. This counter increments each time a continuation debugger is spawned.
58
58
 
59
59
  Scan `.planning/debug/` for existing debug files:
60
60
 
@@ -337,6 +337,8 @@ Perform all state updates in this order:
337
337
  5. Update the `Status` column to `planned`
338
338
  6. Save the file — do NOT skip this step
339
339
 
340
+ **CRITICAL -- DO NOT SKIP: Update STATE.md frontmatter AND body with import status.**
341
+
340
342
  **8b. Update STATE.md:**
341
343
  - Set current phase plan status to "planned"
342
344
  - Note source: "imported from {filepath}" or "imported from user input"
@@ -359,7 +361,7 @@ If the import process surfaced new locked decisions (from blocker resolutions in
359
361
  **8e. Emit workflow event (conditional):**
360
362
  If the event-logger script is available:
361
363
  ```bash
362
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js event workflow plan-import --phase {N} --plans {count} --source {filepath_or_user_input}
364
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js event workflow plan-import --phase {N} --plans {count} --source {filepath_or_user_input}
363
365
  ```
364
366
  Falls back silently if the command is not available.
365
367
 
@@ -146,6 +146,8 @@ Start a new milestone cycle with new phases.
146
146
  - **Status:** In progress
147
147
  ```
148
148
 
149
+ **CRITICAL -- DO NOT SKIP: Update STATE.md frontmatter AND body with new milestone info.**
150
+
149
151
  8. **Update STATE.md:**
150
152
  - Set current phase to the first new phase
151
153
  - Update milestone info
@@ -130,7 +130,13 @@ Read `skills/pause/templates/continue-here.md.tmpl` for the handoff file format.
130
130
 
131
131
  ### Step 5: Update STATE.md
132
132
 
133
- Update the Session Continuity section of STATE.md:
133
+ **CRITICAL -- DO NOT SKIP: Update STATE.md frontmatter AND body. Both must be updated atomically.**
134
+
135
+ First, update the STATE.md YAML frontmatter:
136
+ - Set `last_command: "/pbr:pause"`
137
+ - Set `last_activity: {ISO datetime}`
138
+
139
+ Then update the Session Continuity section of STATE.md:
134
140
 
135
141
  ```markdown
136
142
  ### Session Continuity
@@ -462,7 +462,7 @@ Use the approve-revise-abort pattern from `skills/shared/gate-prompts.md`:
462
462
  4. Update the `Plans Complete` column to `0/{N}` where N = number of plan files just created
463
463
  5. Update the `Status` column to `planned`
464
464
  6. Save the file — do NOT skip this step
465
- - Update STATE.md: set current phase plan status to "planned"
465
+ - Update STATE.md **(CRITICAL update BOTH frontmatter AND body)**: set `status: "planned"`, `plans_total`, `last_command` in frontmatter AND update `Status:`, `Plan:` lines in body `## Current Position`
466
466
  - **If `features.auto_advance` is `true` AND `mode` is `autonomous`:** Chain directly to build. This continues the build->review->plan->build cycle automatically.
467
467
  - **Otherwise:** Suggest next action: `/pbr:build {N}`
468
468
 
@@ -311,10 +311,10 @@ If all automated checks and UAT items passed:
311
311
  4. Update the `Status` column to `verified`
312
312
  5. Update the `Completed` column to the current date (YYYY-MM-DD)
313
313
  6. Save the file — do NOT skip this step
314
- 2. Update `.planning/STATE.md`:
315
- - Phase status: "verified"
316
- - Progress updated
317
- - Last activity timestamp
314
+ 2. Update `.planning/STATE.md` **(CRITICAL — update BOTH frontmatter AND body):**
315
+ - Frontmatter: `status: "verified"`, `progress_percent`, `last_activity`, `last_command`
316
+ - Body `## Current Position`: `Status:` line, `Last activity:` line, `Progress:` bar
317
+ - These MUST stay in sync — see `skills/shared/state-update.md`
318
318
  - **STATE.md size limit:** Follow size limit enforcement rules in `skills/shared/state-update.md` (150 lines max).
319
319
  3. Update VERIFICATION.md with UAT results (append UAT section)
320
320
  3. Present completion:
@@ -28,9 +28,9 @@ This skill **spawns 4 parallel Task(subagent_type: "pbr:codebase-mapper")** agen
28
28
  Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
29
29
 
30
30
  Additionally for this skill:
31
- - **Never** analyze the codebase yourself — delegate ALL analysis to the 4 parallel codebase-mapper subagents
31
+ - **Never** analyze the codebase yourself — delegate ALL analysis to the 4 parallel codebase-mapper agents
32
32
  - **Minimize** reading mapper outputs — read only frontmatter or first 20 lines of each output document
33
- - **Delegate** all file reading, pattern analysis, and architecture mapping to the codebase-mapper subagents
33
+ - **Delegate** all file reading, pattern analysis, and architecture mapping to the codebase-mapper agents
34
34
 
35
35
  ---
36
36
 
@@ -50,7 +50,7 @@ Check if `.planning/codebase/` directory exists:
50
50
 
51
51
  First, resolve the depth profile so you know which areas are available:
52
52
  ```bash
53
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth
53
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth
54
54
  ```
55
55
  Read `profile["scan.mapper_areas"]` to determine available areas (quick: tech, arch; standard/comprehensive: tech, arch, quality, concerns).
56
56
 
@@ -93,7 +93,7 @@ Refer to the "Reconnaissance Detection Reference" section of `skills/scan/templa
93
93
 
94
94
  **Resolve mapper configuration:** Before spawning, resolve the depth profile:
95
95
  ```bash
96
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth
96
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth
97
97
  ```
98
98
 
99
99
  Read `profile["scan.mapper_count"]` and `profile["scan.mapper_areas"]` to determine how many mappers to spawn and which focus areas to cover.
@@ -11,7 +11,7 @@ Standard pattern for loading `.planning/config.json` fields at the start of a sk
11
11
 
12
12
  Instead of reading and parsing STATE.md, ROADMAP.md, and config.json manually, run:
13
13
  ```bash
14
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state load
14
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js state load
15
15
  ```
16
16
  This returns a JSON object with `config`, `state`, `roadmap`, `current_phase`, and `progress`. Falls back gracefully if the script is missing -- parse files manually in that case.
17
17
 
@@ -1,7 +1,7 @@
1
1
  <!-- canonical: ../../../pbr/skills/shared/context-budget.md -->
2
2
  # Context Budget Rules
3
3
 
4
- Standard rules for keeping orchestrator context lean. Reference this fragment in skills that spawn Task() subagents.
4
+ Standard rules for keeping orchestrator context lean. Reference this fragment in skills that spawn Task() agents.
5
5
 
6
6
  See also: `skills/shared/universal-anti-patterns.md` for the complete set of universal rules (context budget + file reading + behavioral rules).
7
7
 
@@ -14,7 +14,7 @@ Every skill that spawns agents or reads significant content must follow these ru
14
14
  1. **Never** read agent definition files (`agents/*.md`) — `subagent_type` auto-loads them
15
15
  2. **Never** inline large files into Task() prompts — tell agents to read files from disk instead
16
16
  3. **Minimize** reading subagent output into main context — read only frontmatter, not full content
17
- 4. **Delegate** heavy work to subagents — the orchestrator routes, it doesn't execute
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
20
  ## Customization
@@ -24,7 +24,7 @@ Skills should add skill-specific rules below the reference line. Common skill-sp
24
24
  - **build**: "Minimize reading executor output — read only SUMMARY.md frontmatter, not full content"
25
25
  - **plan**: "Minimize reading subagent output — read only plan frontmatter for summaries"
26
26
  - **review**: "Minimize reading subagent output — read only VERIFICATION.md frontmatter for summaries"
27
- - **scan**: "Delegate ALL analysis to the 4 parallel codebase-mapper subagents"
27
+ - **scan**: "Delegate ALL analysis to the 4 parallel codebase-mapper agents"
28
28
  - **quick**: "Never implement the task yourself — ALL code changes go through a spawned executor"
29
29
  - **debug**: "Never perform investigation work yourself — delegate ALL analysis to the debugger subagent"
30
30
 
@@ -42,7 +42,7 @@ Reading order (always this sequence):
42
42
  - Do NOT read HISTORY.md for normal build/plan/review operations
43
43
  - Read ONLY when: debugging a regression that may trace to a prior phase,
44
44
  or when a milestone audit needs historical context
45
- - Use: `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js history load`
45
+ - Use: `node ${PLUGIN_ROOT}/scripts/pbr-tools.js history load`
46
46
  - This returns structured JSON -- do not read the raw file
47
47
  ```
48
48
 
@@ -5,12 +5,17 @@ Standard pattern for updating `.planning/STATE.md`. Include this fragment in ski
5
5
 
6
6
  ---
7
7
 
8
+ **CRITICAL: STATE.md has TWO representations — YAML frontmatter AND markdown body. You MUST update BOTH when changing state. The status line reads frontmatter; humans and hooks read the body. If you only update frontmatter, the body goes stale and the status line shows wrong data. Do NOT skip body updates under any circumstances.**
9
+
10
+ ---
11
+
8
12
  ## When to Update STATE.md
9
13
 
10
14
  | Event | What to Update |
11
15
  |-------|---------------|
12
- | Phase status changes (planned, building, verified) | Current Position section |
13
- | Plan completes or fails | Plan counter, status, last activity |
16
+ | Phase status changes (planned, building, verified) | Frontmatter fields AND Current Position section |
17
+ | Plan completes or fails | Frontmatter fields AND Plan counter, status, last activity |
18
+ | Phase advances to next phase | Frontmatter fields AND Phase line, Status, Last activity, Progress bar |
14
19
  | New decision made | Accumulated Context > Decisions |
15
20
  | Blocker discovered or resolved | Accumulated Context > Blockers/Concerns |
16
21
  | Session starts or ends | Session Continuity section |
@@ -32,6 +37,9 @@ See: .planning/PROJECT.md (updated {date})
32
37
  Update `Current focus` when phase changes.
33
38
 
34
39
  ### 2. Current Position (lines 9-14)
40
+
41
+ **CRITICAL: This section MUST match the frontmatter fields above it. When you update `current_phase` or `status` in frontmatter, you MUST also update the corresponding lines below. A hook will auto-fix drift, but do not rely on it.**
42
+
35
43
  ```
36
44
  ## Current Position
37
45
  Phase: {N} of {total} ({Phase name})
@@ -113,8 +121,8 @@ When a milestone completes or a phase is verified, archive historical context to
113
121
 
114
122
  Use `pbr-tools.js history append`:
115
123
  ```
116
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js history append phase "Phase 3 (Auth)" "Verified 2026-02-10. Key decisions: JWT + httpOnly cookies, Discord OAuth."
117
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js history append milestone "v1.0 User Auth" "Phases 1-4. All verified. Core auth flow complete."
124
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js history append phase "Phase 3 (Auth)" "Verified 2026-02-10. Key decisions: JWT + httpOnly cookies, Discord OAuth."
125
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js history append milestone "v1.0 User Auth" "Phases 1-4. All verified. Core auth flow complete."
118
126
  ```
119
127
 
120
128
  ### After Archiving