@sienklogic/plan-build-run 2.10.0 β†’ 2.11.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 (122) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/package.json +1 -1
  3. package/plugins/copilot-pbr/agents/codebase-mapper.agent.md +42 -0
  4. package/plugins/copilot-pbr/agents/debugger.agent.md +4 -1
  5. package/plugins/copilot-pbr/agents/executor.agent.md +31 -1
  6. package/plugins/copilot-pbr/agents/integration-checker.agent.md +33 -2
  7. package/plugins/copilot-pbr/agents/planner.agent.md +58 -1
  8. package/plugins/copilot-pbr/agents/researcher.agent.md +23 -0
  9. package/plugins/copilot-pbr/agents/synthesizer.agent.md +24 -0
  10. package/plugins/copilot-pbr/agents/verifier.agent.md +35 -1
  11. package/plugins/copilot-pbr/plugin.json +1 -1
  12. package/plugins/copilot-pbr/references/agent-contracts.md +297 -0
  13. package/plugins/copilot-pbr/references/ui-formatting.md +38 -56
  14. package/plugins/copilot-pbr/skills/begin/SKILL.md +30 -7
  15. package/plugins/copilot-pbr/skills/build/SKILL.md +28 -31
  16. package/plugins/copilot-pbr/skills/config/SKILL.md +9 -12
  17. package/plugins/copilot-pbr/skills/continue/SKILL.md +6 -6
  18. package/plugins/copilot-pbr/skills/dashboard/SKILL.md +3 -3
  19. package/plugins/copilot-pbr/skills/debug/SKILL.md +23 -26
  20. package/plugins/copilot-pbr/skills/discuss/SKILL.md +20 -10
  21. package/plugins/copilot-pbr/skills/do/SKILL.md +3 -3
  22. package/plugins/copilot-pbr/skills/explore/SKILL.md +11 -14
  23. package/plugins/copilot-pbr/skills/health/SKILL.md +75 -19
  24. package/plugins/copilot-pbr/skills/help/SKILL.md +6 -6
  25. package/plugins/copilot-pbr/skills/import/SKILL.md +22 -18
  26. package/plugins/copilot-pbr/skills/milestone/SKILL.md +90 -48
  27. package/plugins/copilot-pbr/skills/note/SKILL.md +3 -3
  28. package/plugins/copilot-pbr/skills/pause/SKILL.md +11 -10
  29. package/plugins/copilot-pbr/skills/plan/SKILL.md +22 -9
  30. package/plugins/copilot-pbr/skills/plan/templates/planner-prompt.md.tmpl +1 -1
  31. package/plugins/copilot-pbr/skills/quick/SKILL.md +9 -12
  32. package/plugins/copilot-pbr/skills/resume/SKILL.md +9 -9
  33. package/plugins/copilot-pbr/skills/review/SKILL.md +17 -12
  34. package/plugins/copilot-pbr/skills/scan/SKILL.md +9 -11
  35. package/plugins/copilot-pbr/skills/setup/SKILL.md +31 -8
  36. package/plugins/copilot-pbr/skills/shared/error-reporting.md +2 -1
  37. package/plugins/copilot-pbr/skills/shared/progress-display.md +0 -1
  38. package/plugins/copilot-pbr/skills/shared/universal-anti-patterns.md +10 -6
  39. package/plugins/copilot-pbr/skills/status/SKILL.md +3 -3
  40. package/plugins/copilot-pbr/skills/statusline/SKILL.md +12 -8
  41. package/plugins/copilot-pbr/skills/todo/SKILL.md +51 -28
  42. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  43. package/plugins/cursor-pbr/agents/codebase-mapper.md +42 -0
  44. package/plugins/cursor-pbr/agents/debugger.md +4 -1
  45. package/plugins/cursor-pbr/agents/executor.md +31 -1
  46. package/plugins/cursor-pbr/agents/integration-checker.md +33 -2
  47. package/plugins/cursor-pbr/agents/planner.md +58 -1
  48. package/plugins/cursor-pbr/agents/researcher.md +23 -0
  49. package/plugins/cursor-pbr/agents/synthesizer.md +24 -0
  50. package/plugins/cursor-pbr/agents/verifier.md +35 -1
  51. package/plugins/cursor-pbr/references/agent-contracts.md +297 -0
  52. package/plugins/cursor-pbr/references/ui-formatting.md +38 -56
  53. package/plugins/cursor-pbr/skills/begin/SKILL.md +30 -7
  54. package/plugins/cursor-pbr/skills/build/SKILL.md +28 -31
  55. package/plugins/cursor-pbr/skills/config/SKILL.md +9 -10
  56. package/plugins/cursor-pbr/skills/continue/SKILL.md +6 -6
  57. package/plugins/cursor-pbr/skills/dashboard/SKILL.md +3 -3
  58. package/plugins/cursor-pbr/skills/debug/SKILL.md +23 -23
  59. package/plugins/cursor-pbr/skills/discuss/SKILL.md +20 -10
  60. package/plugins/cursor-pbr/skills/do/SKILL.md +3 -3
  61. package/plugins/cursor-pbr/skills/explore/SKILL.md +11 -12
  62. package/plugins/cursor-pbr/skills/health/SKILL.md +75 -19
  63. package/plugins/cursor-pbr/skills/help/SKILL.md +6 -6
  64. package/plugins/cursor-pbr/skills/import/SKILL.md +22 -16
  65. package/plugins/cursor-pbr/skills/milestone/SKILL.md +90 -48
  66. package/plugins/cursor-pbr/skills/note/SKILL.md +3 -3
  67. package/plugins/cursor-pbr/skills/pause/SKILL.md +11 -9
  68. package/plugins/cursor-pbr/skills/plan/SKILL.md +22 -9
  69. package/plugins/cursor-pbr/skills/plan/templates/planner-prompt.md.tmpl +1 -1
  70. package/plugins/cursor-pbr/skills/quick/SKILL.md +9 -12
  71. package/plugins/cursor-pbr/skills/resume/SKILL.md +9 -9
  72. package/plugins/cursor-pbr/skills/review/SKILL.md +17 -12
  73. package/plugins/cursor-pbr/skills/scan/SKILL.md +9 -10
  74. package/plugins/cursor-pbr/skills/setup/SKILL.md +31 -8
  75. package/plugins/cursor-pbr/skills/shared/error-reporting.md +2 -1
  76. package/plugins/cursor-pbr/skills/shared/progress-display.md +0 -1
  77. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +10 -6
  78. package/plugins/cursor-pbr/skills/status/SKILL.md +3 -3
  79. package/plugins/cursor-pbr/skills/statusline/SKILL.md +12 -8
  80. package/plugins/cursor-pbr/skills/todo/SKILL.md +51 -28
  81. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  82. package/plugins/pbr/agents/codebase-mapper.md +42 -0
  83. package/plugins/pbr/agents/debugger.md +4 -1
  84. package/plugins/pbr/agents/executor.md +31 -1
  85. package/plugins/pbr/agents/integration-checker.md +34 -2
  86. package/plugins/pbr/agents/planner.md +58 -1
  87. package/plugins/pbr/agents/researcher.md +23 -0
  88. package/plugins/pbr/agents/synthesizer.md +24 -0
  89. package/plugins/pbr/agents/verifier.md +36 -1
  90. package/plugins/pbr/references/agent-contracts.md +297 -0
  91. package/plugins/pbr/references/ui-formatting.md +37 -54
  92. package/plugins/pbr/scripts/check-skill-workflow.js +11 -0
  93. package/plugins/pbr/scripts/check-state-sync.js +58 -0
  94. package/plugins/pbr/scripts/check-subagent-output.js +43 -4
  95. package/plugins/pbr/scripts/validate-task.js +69 -17
  96. package/plugins/pbr/skills/begin/SKILL.md +36 -11
  97. package/plugins/pbr/skills/build/SKILL.md +37 -25
  98. package/plugins/pbr/skills/config/SKILL.md +12 -10
  99. package/plugins/pbr/skills/continue/SKILL.md +11 -9
  100. package/plugins/pbr/skills/dashboard/SKILL.md +3 -3
  101. package/plugins/pbr/skills/debug/SKILL.md +29 -23
  102. package/plugins/pbr/skills/discuss/SKILL.md +20 -10
  103. package/plugins/pbr/skills/do/SKILL.md +3 -3
  104. package/plugins/pbr/skills/explore/SKILL.md +14 -12
  105. package/plugins/pbr/skills/health/SKILL.md +76 -20
  106. package/plugins/pbr/skills/help/SKILL.md +8 -6
  107. package/plugins/pbr/skills/import/SKILL.md +25 -16
  108. package/plugins/pbr/skills/milestone/SKILL.md +88 -45
  109. package/plugins/pbr/skills/note/SKILL.md +3 -3
  110. package/plugins/pbr/skills/pause/SKILL.md +13 -9
  111. package/plugins/pbr/skills/plan/SKILL.md +28 -13
  112. package/plugins/pbr/skills/plan/templates/planner-prompt.md.tmpl +1 -1
  113. package/plugins/pbr/skills/quick/SKILL.md +12 -10
  114. package/plugins/pbr/skills/resume/SKILL.md +11 -9
  115. package/plugins/pbr/skills/review/SKILL.md +35 -24
  116. package/plugins/pbr/skills/scan/SKILL.md +12 -10
  117. package/plugins/pbr/skills/setup/SKILL.md +30 -7
  118. package/plugins/pbr/skills/shared/error-reporting.md +2 -0
  119. package/plugins/pbr/skills/shared/universal-anti-patterns.md +10 -6
  120. package/plugins/pbr/skills/status/SKILL.md +8 -6
  121. package/plugins/pbr/skills/statusline/SKILL.md +12 -8
  122. package/plugins/pbr/skills/todo/SKILL.md +51 -28
@@ -21,6 +21,19 @@ const fs = require('fs');
21
21
  const path = require('path');
22
22
  const { logHook } = require('./hook-logger');
23
23
 
24
+ /**
25
+ * Check if a file was modified recently (within thresholdMs).
26
+ * Returns false if file doesn't exist or on error.
27
+ */
28
+ function isRecent(filePath, thresholdMs = 300000) {
29
+ try {
30
+ const stat = fs.statSync(filePath);
31
+ return (Date.now() - stat.mtimeMs) < thresholdMs;
32
+ } catch (_e) {
33
+ return false;
34
+ }
35
+ }
36
+
24
37
  // Agent type β†’ expected output patterns
25
38
  const AGENT_OUTPUTS = {
26
39
  'pbr:executor': {
@@ -46,9 +59,16 @@ const AGENT_OUTPUTS = {
46
59
  const researchDir = path.join(planningDir, 'research');
47
60
  if (!fs.existsSync(researchDir)) return [];
48
61
  try {
49
- return fs.readdirSync(researchDir)
62
+ const allFiles = fs.readdirSync(researchDir)
50
63
  .filter(f => f.endsWith('.md'))
51
64
  .map(f => path.join('research', f));
65
+ if (allFiles.length === 0) return [];
66
+ const recentFiles = allFiles.filter(f => isRecent(path.join(planningDir, f)));
67
+ if (recentFiles.length === 0) {
68
+ // Files exist but none are recent β€” return them but flag staleness
69
+ allFiles._stale = true;
70
+ }
71
+ return allFiles;
52
72
  } catch (_e) {
53
73
  return [];
54
74
  }
@@ -61,14 +81,27 @@ const AGENT_OUTPUTS = {
61
81
  if (fs.existsSync(researchDir)) {
62
82
  try {
63
83
  const files = fs.readdirSync(researchDir).filter(f => f.endsWith('.md'));
64
- if (files.length > 0) return files.map(f => path.join('research', f));
84
+ if (files.length > 0) {
85
+ const allFiles = files.map(f => path.join('research', f));
86
+ const recentFiles = allFiles.filter(f => isRecent(path.join(planningDir, f)));
87
+ if (recentFiles.length === 0) {
88
+ allFiles._stale = true;
89
+ }
90
+ return allFiles;
91
+ }
65
92
  } catch (_e) { /* best-effort */ }
66
93
  }
67
94
  const contextFile = path.join(planningDir, 'CONTEXT.md');
68
95
  if (fs.existsSync(contextFile)) {
69
96
  try {
70
97
  const stat = fs.statSync(contextFile);
71
- if (stat.size > 0) return ['CONTEXT.md'];
98
+ if (stat.size > 0) {
99
+ const result = ['CONTEXT.md'];
100
+ if (!isRecent(contextFile)) {
101
+ result._stale = true;
102
+ }
103
+ return result;
104
+ }
72
105
  } catch (_e) { /* best-effort */ }
73
106
  }
74
107
  return [];
@@ -255,6 +288,12 @@ function main() {
255
288
  // Skill-specific post-completion validation
256
289
  const skillWarnings = [];
257
290
 
291
+ // Mtime-based recency check for researcher and synthesizer
292
+ if (found._stale && (agentType === 'pbr:researcher' || agentType === 'pbr:synthesizer')) {
293
+ const label = agentType === 'pbr:researcher' ? 'Researcher' : 'Synthesizer';
294
+ skillWarnings.push(`${label} output may be stale β€” no recent output files detected.`);
295
+ }
296
+
258
297
  // GAP-04: Begin planner must produce core files
259
298
  if (activeSkill === 'begin' && agentType === 'pbr:planner') {
260
299
  const coreFiles = ['REQUIREMENTS.md', 'ROADMAP.md', 'STATE.md'];
@@ -317,5 +356,5 @@ function main() {
317
356
  process.exit(0);
318
357
  }
319
358
 
320
- module.exports = { AGENT_OUTPUTS, findInPhaseDir, findInQuickDir, checkSummaryCommits };
359
+ module.exports = { AGENT_OUTPUTS, findInPhaseDir, findInQuickDir, checkSummaryCommits, isRecent };
321
360
  if (require.main === module || process.argv[1] === __filename) { main(); }
@@ -114,7 +114,8 @@ function checkQuickExecutorGate(data) {
114
114
  return {
115
115
  block: true,
116
116
  reason: 'Cannot spawn executor: .planning/quick/ directory does not exist. ' +
117
- 'You must create the quick task directory and PLAN.md first (Steps 4-6).'
117
+ 'You must create the quick task directory and PLAN.md first (Steps 4-6). ' +
118
+ 'To fix: Re-run /pbr:quick to create the quick task directory and PLAN.md.'
118
119
  };
119
120
  }
120
121
 
@@ -138,13 +139,15 @@ function checkQuickExecutorGate(data) {
138
139
  return {
139
140
  block: true,
140
141
  reason: 'Cannot spawn executor: no PLAN.md found in any .planning/quick/*/ directory. ' +
141
- 'You must create .planning/quick/{NNN}-{slug}/PLAN.md first (Steps 4-6).'
142
+ 'You must create .planning/quick/{NNN}-{slug}/PLAN.md first (Steps 4-6). ' +
143
+ 'To fix: Re-run /pbr:quick to create the quick task directory and PLAN.md.'
142
144
  };
143
145
  }
144
146
  } catch (_e) {
145
147
  return {
146
148
  block: true,
147
- reason: 'Cannot spawn executor: failed to read .planning/quick/ directory.'
149
+ reason: 'Cannot spawn executor: failed to read .planning/quick/ directory. ' +
150
+ 'To fix: Re-run /pbr:quick to create the quick task directory and PLAN.md.'
148
151
  };
149
152
  }
150
153
 
@@ -187,7 +190,7 @@ function checkBuildExecutorGate(data) {
187
190
  if (!fs.existsSync(phasesDir)) {
188
191
  return {
189
192
  block: true,
190
- reason: 'Cannot spawn executor: .planning/phases/ directory does not exist. Run /pbr:plan first.'
193
+ reason: 'Cannot spawn executor: .planning/phases/ directory does not exist. To fix: Run /pbr:plan {N} to create plans first.'
191
194
  };
192
195
  }
193
196
 
@@ -195,7 +198,7 @@ function checkBuildExecutorGate(data) {
195
198
  if (dirs.length === 0) {
196
199
  return {
197
200
  block: true,
198
- reason: `Cannot spawn executor: no phase directory found for phase ${currentPhase}. Run /pbr:plan first.`
201
+ reason: `Cannot spawn executor: no phase directory found for phase ${currentPhase}. To fix: Run /pbr:plan ${currentPhase} to create plans first.`
199
202
  };
200
203
  }
201
204
 
@@ -213,7 +216,7 @@ function checkBuildExecutorGate(data) {
213
216
  if (!hasPlan) {
214
217
  return {
215
218
  block: true,
216
- reason: `Cannot spawn executor: no PLAN.md found in .planning/phases/${dirs[0]}/. Run /pbr:plan first.`
219
+ reason: `Cannot spawn executor: no PLAN.md found in .planning/phases/${dirs[0]}/. To fix: Run /pbr:plan ${currentPhase} to create plans first.`
217
220
  };
218
221
  }
219
222
  } catch (_e) {
@@ -248,7 +251,7 @@ function checkPlanExecutorGate(data) {
248
251
 
249
252
  return {
250
253
  block: true,
251
- reason: 'Plan skill should not spawn executors. Use /pbr:build to execute plans.'
254
+ reason: 'Plan skill should not spawn executors. To fix: Run /pbr:build to execute plans. The plan skill creates plans; the build skill executes them.'
252
255
  };
253
256
  }
254
257
 
@@ -296,7 +299,7 @@ function checkReviewPlannerGate(data) {
296
299
  if (!hasVerification) {
297
300
  return {
298
301
  block: true,
299
- reason: 'Review planner gate: Cannot spawn planner for gap closure without a VERIFICATION.md. Run /pbr:review first to generate verification results.'
302
+ reason: 'Review planner gate: Cannot spawn planner for gap closure without a VERIFICATION.md. To fix: Run /pbr:review {N} to create VERIFICATION.md first.'
300
303
  };
301
304
  }
302
305
  } catch (_e) {
@@ -358,7 +361,7 @@ function checkReviewVerifierGate(data) {
358
361
  if (!hasSummary) {
359
362
  return {
360
363
  block: true,
361
- reason: 'Review verifier gate: Cannot spawn verifier without SUMMARY.md in phase directory. Run /pbr:build first.'
364
+ reason: 'Review verifier gate: Cannot spawn verifier without SUMMARY.md in phase directory. To fix: Run /pbr:build {N} to create SUMMARY.md first.'
362
365
  };
363
366
  }
364
367
  } catch (_e) {
@@ -443,14 +446,22 @@ function checkMilestoneCompleteGate(data) {
443
446
  if (pDirs.length === 0) {
444
447
  return {
445
448
  block: true,
446
- reason: `Milestone complete gate: Phase ${paddedPhase} directory not found. All milestone phases must be verified before completing milestone.`
449
+ reason: `Milestone complete gate: Phase ${paddedPhase} directory not found. All milestone phases must be verified before completing milestone. To fix: Run /pbr:review ${paddedPhase} β€” phase must have status: passed.`
447
450
  };
448
451
  }
449
- const hasVerification = fs.existsSync(path.join(phasesDir, pDirs[0], 'VERIFICATION.md'));
452
+ const verificationFile = path.join(phasesDir, pDirs[0], 'VERIFICATION.md');
453
+ const hasVerification = fs.existsSync(verificationFile);
450
454
  if (!hasVerification) {
451
455
  return {
452
456
  block: true,
453
- reason: `Milestone complete gate: Phase ${paddedPhase} (${pDirs[0]}) lacks VERIFICATION.md. All milestone phases must be verified before completing milestone.`
457
+ reason: `Milestone complete gate: Phase ${paddedPhase} (${pDirs[0]}) lacks VERIFICATION.md. All milestone phases must be verified before completing milestone. To fix: Run /pbr:review ${paddedPhase} β€” phase must have status: passed.`
458
+ };
459
+ }
460
+ const verStatus = getVerificationStatus(verificationFile);
461
+ if (verStatus === 'gaps_found') {
462
+ return {
463
+ block: true,
464
+ reason: `Milestone complete gate: Phase ${paddedPhase} VERIFICATION.md has status: gaps_found. Close all gaps before completing milestone. To fix: Run /pbr:review ${paddedPhase} β€” phase must have status: passed.`
454
465
  };
455
466
  }
456
467
  }
@@ -538,14 +549,14 @@ function checkBuildDependencyGate(data) {
538
549
  if (pDirs.length === 0) {
539
550
  return {
540
551
  block: true,
541
- reason: `Build dependency gate: Dependent phase ${paddedPhase} lacks VERIFICATION.md. Run /pbr:review on dependent phases first.`
552
+ reason: `Build dependency gate: Dependent phase ${paddedPhase} lacks VERIFICATION.md. To fix: Run /pbr:review on the dependency phase first.`
542
553
  };
543
554
  }
544
555
  const hasVerification = fs.existsSync(path.join(phasesDir, pDirs[0], 'VERIFICATION.md'));
545
556
  if (!hasVerification) {
546
557
  return {
547
558
  block: true,
548
- reason: `Build dependency gate: Dependent phase ${paddedPhase} lacks VERIFICATION.md. Run /pbr:review on dependent phases first.`
559
+ reason: `Build dependency gate: Dependent phase ${paddedPhase} lacks VERIFICATION.md. To fix: Run /pbr:review on the dependency phase first.`
549
560
  };
550
561
  }
551
562
  }
@@ -561,6 +572,45 @@ function checkBuildDependencyGate(data) {
561
572
  * spawned, warn if .checkpoint-manifest.json is missing in the phase dir.
562
573
  * Returns a warning string or null.
563
574
  */
575
+ /**
576
+ * Parse VERIFICATION.md frontmatter to extract status field.
577
+ * Returns the status string or 'unknown' if not parseable.
578
+ */
579
+ function getVerificationStatus(filePath) {
580
+ try {
581
+ const content = fs.readFileSync(filePath, 'utf8');
582
+ const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
583
+ if (!fmMatch) return 'unknown';
584
+ const statusMatch = fmMatch[1].match(/^status:\s*(\S+)/m);
585
+ return statusMatch ? statusMatch[1] : 'unknown';
586
+ } catch (_e) {
587
+ return 'unknown';
588
+ }
589
+ }
590
+
591
+ /**
592
+ * Advisory check: when pbr:debugger is spawned and .active-skill is 'debug',
593
+ * warn if .planning/debug/ directory does not exist.
594
+ * Returns a warning string or null.
595
+ */
596
+ function checkDebuggerAdvisory(data) {
597
+ const subagentType = data.tool_input?.subagent_type || '';
598
+ if (subagentType !== 'pbr:debugger') return null;
599
+ // Only advise when spawned from the debug skill
600
+ const activeSkillPath = path.join(process.cwd(), '.planning', '.active-skill');
601
+ try {
602
+ const activeSkill = fs.readFileSync(activeSkillPath, 'utf8').trim();
603
+ if (activeSkill !== 'debug') return null;
604
+ } catch (_e) {
605
+ return null; // No .active-skill file β€” skip advisory
606
+ }
607
+ const debugDir = path.join(process.cwd(), '.planning', 'debug');
608
+ if (!fs.existsSync(debugDir)) {
609
+ return 'Debugger advisory: .planning/debug/ does not exist. Create it before spawning the debugger so output has a target location.';
610
+ }
611
+ return null;
612
+ }
613
+
564
614
  function checkCheckpointManifest(data) {
565
615
  const toolInput = data.tool_input || {};
566
616
  const subagentType = toolInput.subagent_type || '';
@@ -595,7 +645,7 @@ function checkCheckpointManifest(data) {
595
645
  const phaseDir = path.join(phasesDir, dirs[0]);
596
646
  const manifestFile = path.join(phaseDir, '.checkpoint-manifest.json');
597
647
  if (!fs.existsSync(manifestFile)) {
598
- return 'Build advisory: .checkpoint-manifest.json not found in phase directory. The build skill should write this before spawning executors.';
648
+ return 'Build advisory: .checkpoint-manifest.json not found in phase directory. The build skill should write this before spawning executors. To fix: Run /pbr:health to regenerate checkpoint manifest.';
599
649
  }
600
650
  } catch (_e) {
601
651
  return null;
@@ -624,7 +674,7 @@ function checkActiveSkillIntegrity(data) {
624
674
 
625
675
  const activeSkillFile = path.join(planningDir, '.active-skill');
626
676
  if (!fs.existsSync(activeSkillFile)) {
627
- return 'Active-skill integrity: .planning/.active-skill not found. Skill-specific enforcement is disabled. The invoking skill should write this file.';
677
+ return 'Active-skill integrity: .planning/.active-skill not found. Skill-specific enforcement is disabled. The invoking skill should write this file. To fix: Wait for the current skill to finish, or delete .planning/.active-skill if stale.';
628
678
  }
629
679
 
630
680
  return null;
@@ -727,6 +777,8 @@ function main() {
727
777
  const warnings = checkTask(data);
728
778
  const manifestWarning = checkCheckpointManifest(data);
729
779
  if (manifestWarning) warnings.push(manifestWarning);
780
+ const debuggerWarning = checkDebuggerAdvisory(data);
781
+ if (debuggerWarning) warnings.push(debuggerWarning);
730
782
  const activeSkillWarning = checkActiveSkillIntegrity(data);
731
783
  if (activeSkillWarning) warnings.push(activeSkillWarning);
732
784
 
@@ -747,5 +799,5 @@ function main() {
747
799
  });
748
800
  }
749
801
 
750
- module.exports = { checkTask, checkQuickExecutorGate, checkBuildExecutorGate, checkPlanExecutorGate, checkReviewPlannerGate, checkReviewVerifierGate, checkMilestoneCompleteGate, checkBuildDependencyGate, checkCheckpointManifest, checkActiveSkillIntegrity, KNOWN_AGENTS, MAX_DESCRIPTION_LENGTH };
802
+ module.exports = { checkTask, checkQuickExecutorGate, checkBuildExecutorGate, checkPlanExecutorGate, checkReviewPlannerGate, checkReviewVerifierGate, checkMilestoneCompleteGate, checkBuildDependencyGate, checkCheckpointManifest, checkDebuggerAdvisory, getVerificationStatus, checkActiveSkillIntegrity, KNOWN_AGENTS, MAX_DESCRIPTION_LENGTH };
751
803
  if (require.main === module || process.argv[1] === __filename) { main(); }
@@ -23,9 +23,9 @@ Additionally for this skill:
23
23
  **Before ANY tool calls**, display this banner:
24
24
 
25
25
  ```
26
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27
- PLAN-BUILD-RUN β–Ί STARTING PROJECT
28
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26
+ ╔══════════════════════════════════════════════════════════════╗
27
+ β•‘ PLAN-BUILD-RUN β–Ί STARTING PROJECT β•‘
28
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
29
29
  ```
30
30
 
31
31
  Then proceed to Step 1.
@@ -168,6 +168,8 @@ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
168
168
 
169
169
  **After gathering preferences:**
170
170
 
171
+ **CRITICAL: You MUST create the .planning/ directory and write config.json NOW. Do not proceed without this.**
172
+
171
173
  1. Read the config template from `skills/begin/templates/config.json.tmpl`
172
174
  2. Apply the user's choices to the template
173
175
  3. Create `.planning/` directory
@@ -175,6 +177,8 @@ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
175
177
 
176
178
  **IMPORTANT**: This step MUST happen BEFORE research (Step 5) because depth controls how many researchers to spawn.
177
179
 
180
+ **CRITICAL: Write .active-skill NOW.** Write the text "begin" to `.planning/.active-skill` using the Write tool. Verify the file exists before proceeding.
181
+
178
182
  ---
179
183
 
180
184
  ### Step 4: Research Decision (inline)
@@ -209,7 +213,7 @@ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
209
213
 
210
214
  Spawn parallel Task() subagents for research. Each researcher writes to `.planning/research/`.
211
215
 
212
- **Create `.planning/research/` directory first.**
216
+ **CRITICAL: Create .planning/research/ directory NOW before spawning researchers. Do NOT skip this step.**
213
217
 
214
218
  **For each research topic, spawn a Task():**
215
219
 
@@ -343,6 +347,9 @@ Each requirement must be:
343
347
  - **Specific** β€” not vague ("fast" is bad, "page loads in <2s" is good)
344
348
 
345
349
  **7e. Write REQUIREMENTS.md:**
350
+
351
+ **CRITICAL: Write REQUIREMENTS.md NOW. The roadmap planner depends on this file.**
352
+
346
353
  Read the template from `skills/begin/templates/REQUIREMENTS.md.tmpl` and write `.planning/REQUIREMENTS.md` with:
347
354
  - All v1 requirements grouped by category
348
355
  - All v2 requirements with deferral reasons
@@ -401,6 +408,10 @@ Read `skills/begin/templates/roadmap-prompt.md.tmpl` for the prompt structure.
401
408
 
402
409
  Write the project state files from templates:
403
410
 
411
+ **CRITICAL: You MUST write all 5 state initialization files (Steps 9a-9e). Do NOT skip any.**
412
+
413
+ **CRITICAL: Write PROJECT.md NOW. Do NOT skip this step.**
414
+
404
415
  **9a. Write PROJECT.md:**
405
416
  1. Read `skills/begin/templates/PROJECT.md.tmpl`
406
417
  2. Fill in:
@@ -413,6 +424,8 @@ Write the project state files from templates:
413
424
  3. Write to `.planning/PROJECT.md`
414
425
  4. Ensure the `## Milestones` section is filled in with the project name and phase count from the roadmap
415
426
 
427
+ **CRITICAL: Write STATE.md NOW. Do NOT skip this step.**
428
+
416
429
  **9b. Write STATE.md:**
417
430
  1. Read `skills/begin/templates/STATE.md.tmpl`
418
431
  2. Fill in:
@@ -425,6 +438,8 @@ Write the project state files from templates:
425
438
  4. Fill in the `## Milestone` section with the project name and total phase count
426
439
  5. **STATE.md size limit**: Follow size limit enforcement rules in `skills/shared/state-update.md` (150 lines max).
427
440
 
441
+ **CRITICAL: Write CONTEXT.md NOW. Do NOT skip this step.**
442
+
428
443
  **9c. Write CONTEXT.md:**
429
444
  Create `.planning/CONTEXT.md` from information gathered during questioning:
430
445
 
@@ -449,6 +464,8 @@ Create `.planning/CONTEXT.md` from information gathered during questioning:
449
464
  | {feature} | {reason} |
450
465
  ```
451
466
 
467
+ **CRITICAL: Write HISTORY.md NOW. Do NOT skip this step.**
468
+
452
469
  **9d. Write HISTORY.md:**
453
470
  Create `.planning/HISTORY.md` with an initial entry:
454
471
 
@@ -462,6 +479,8 @@ Create `.planning/HISTORY.md` with an initial entry:
462
479
  - Roadmap: {N} phases planned
463
480
  ```
464
481
 
482
+ **CRITICAL: Create phase directories NOW. Do NOT skip this step.**
483
+
465
484
  **9e. Create phase directories:**
466
485
  For each phase in the roadmap, create the directory structure:
467
486
  ```
@@ -505,6 +524,10 @@ If `gates.confirm_project` is true in config:
505
524
 
506
525
  ---
507
526
 
527
+ ## Cleanup
528
+
529
+ Delete `.planning/.active-skill` if it exists. This must happen on all paths (success, partial, and failure) before reporting results.
530
+
508
531
  ## Completion
509
532
 
510
533
  After all steps complete, present the final summary:
@@ -512,9 +535,9 @@ After all steps complete, present the final summary:
512
535
  Use the branded stage banner from `references/ui-formatting.md`:
513
536
 
514
537
  ```
515
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
516
- PLAN-BUILD-RUN β–Ί PROJECT INITIALIZED βœ“
517
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
538
+ ╔══════════════════════════════════════════════════════════════╗
539
+ β•‘ PLAN-BUILD-RUN β–Ί PROJECT INITIALIZED βœ“ β•‘
540
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
518
541
 
519
542
  **{name}**
520
543
 
@@ -530,9 +553,11 @@ Requirements: {N} committed, {M} deferred, {K} out-of-scope
530
553
 
531
554
  Then use the "Next Up" routing block:
532
555
  ```
533
- ───────────────────────────────────────────────────────────────
534
556
 
535
- ## β–Ά Next Up
557
+
558
+ ╔══════════════════════════════════════════════════════════════╗
559
+ β•‘ β–Ά NEXT UP β•‘
560
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
536
561
 
537
562
  **Phase 1: {Name}** β€” {one-line goal}
538
563
 
@@ -540,7 +565,7 @@ Then use the "Next Up" routing block:
540
565
 
541
566
  <sub>`/clear` first β†’ fresh context window</sub>
542
567
 
543
- ───────────────────────────────────────────────────────────────
568
+
544
569
 
545
570
  **Also available:**
546
571
  - `/pbr:explore` β€” open-ended exploration before planning
@@ -548,7 +573,7 @@ Then use the "Next Up" routing block:
548
573
  - `/pbr:milestone new` β€” add a second milestone with new phases
549
574
  - `/pbr:config` β€” adjust workflow settings
550
575
 
551
- ───────────────────────────────────────────────────────────────
576
+
552
577
  ```
553
578
 
554
579
  ---
@@ -24,9 +24,9 @@ Additionally for this skill:
24
24
  **Before ANY tool calls**, display this banner:
25
25
 
26
26
  ```
27
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
28
- PLAN-BUILD-RUN β–Ί BUILDING PHASE {N}
29
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27
+ ╔══════════════════════════════════════════════════════════════╗
28
+ β•‘ PLAN-BUILD-RUN β–Ί BUILDING PHASE {N} β•‘
29
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
30
30
  ```
31
31
 
32
32
  Where `{N}` is the phase number from `$ARGUMENTS`. Then proceed to Step 1.
@@ -65,7 +65,7 @@ Reference: `skills/shared/config-loading.md` for the tooling shortcut and config
65
65
  1. Parse `$ARGUMENTS` for phase number and flags
66
66
  2. Read `.planning/config.json` for parallelization, model, and gate settings (see config-loading.md for field reference)
67
67
  3. Resolve depth profile: run `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth` to get the effective feature/gate settings for the current depth. Store the result for use in later gating decisions.
68
- 4. Write `.planning/.active-skill` with the content `build` (registers with workflow enforcement hook)
68
+ 4. **CRITICAL: Write .active-skill NOW.** Write `.planning/.active-skill` with the content `build` (registers with workflow enforcement hook)
69
69
  5. Validate:
70
70
  - Phase directory exists at `.planning/phases/{NN}-{slug}/`
71
71
  - PLAN.md files exist in the directory
@@ -198,6 +198,8 @@ Validate wave consistency:
198
198
 
199
199
  ### Step 5b: Write Checkpoint Manifest (inline)
200
200
 
201
+ **CRITICAL: Write .checkpoint-manifest.json NOW before entering the wave loop.**
202
+
201
203
  Before entering the wave loop, write `.planning/phases/{NN}-{slug}/.checkpoint-manifest.json`:
202
204
 
203
205
  ```json
@@ -693,6 +695,8 @@ If triggered:
693
695
  ```
694
696
  4. Do NOT block on this β€” use `run_in_background: true` and continue to Step 8a. Report completion in Step 8f if it finishes in time.
695
697
 
698
+ **CRITICAL: Update ROADMAP.md progress table NOW. Do NOT skip this step.**
699
+
696
700
  **8a. Update ROADMAP.md Progress table** (REQUIRED β€” do this BEFORE updating STATE.md):
697
701
 
698
702
  **Tooling shortcut**: Use the CLI for atomic ROADMAP.md table updates instead of manual editing:
@@ -709,6 +713,8 @@ These return `{ success, old_status, new_status }` or `{ success, old_plans, new
709
713
  5. Update the `Status` column to the final_status determined in Step 8-pre
710
714
  6. Save the file β€” do NOT skip this step
711
715
 
716
+ **CRITICAL: Update STATE.md NOW with phase completion status. Do NOT skip this step.**
717
+
712
718
  **8b. Update STATE.md:**
713
719
  - Phase status: {final_status from Step 8-pre}
714
720
  - Plan completion count
@@ -803,18 +809,20 @@ Then present the appropriate branded banner:
803
809
 
804
810
  **If `passed` + more phases:**
805
811
  ```
806
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
807
- PLAN-BUILD-RUN β–Ί PHASE {N} COMPLETE βœ“
808
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
812
+ ╔══════════════════════════════════════════════════════════════╗
813
+ β•‘ PLAN-BUILD-RUN β–Ί PHASE {N} COMPLETE βœ“ β•‘
814
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
809
815
 
810
816
  **Phase {N}: {Name}**
811
817
 
812
818
  {X} plans executed
813
819
  Goal verified βœ“
814
820
 
815
- ───────────────────────────────────────────────────────────────
816
821
 
817
- ## β–Ά Next Up
822
+
823
+ ╔══════════════════════════════════════════════════════════════╗
824
+ β•‘ β–Ά NEXT UP β•‘
825
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
818
826
 
819
827
  **Phase {N+1}: {Name}** β€” {Goal from ROADMAP.md}
820
828
 
@@ -822,28 +830,30 @@ Goal verified βœ“
822
830
 
823
831
  <sub>`/clear` first β†’ fresh context window</sub>
824
832
 
825
- ───────────────────────────────────────────────────────────────
833
+
826
834
 
827
835
  **Also available:**
828
836
  - `/pbr:review {N}` β€” manual acceptance testing before continuing
829
837
  - `/pbr:discuss {N+1}` β€” talk through the next phase before planning
830
838
  - `/pbr:status` β€” see full project status
831
839
 
832
- ───────────────────────────────────────────────────────────────
840
+
833
841
  ```
834
842
 
835
843
  **If `passed` + last phase:**
836
844
  ```
837
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
838
- PLAN-BUILD-RUN β–Ί MILESTONE COMPLETE πŸŽ‰
839
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
845
+ ╔══════════════════════════════════════════════════════════════╗
846
+ β•‘ PLAN-BUILD-RUN β–Ί MILESTONE COMPLETE πŸŽ‰ β•‘
847
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
840
848
 
841
849
  {N} phases completed
842
850
  All phase goals verified βœ“
843
851
 
844
- ───────────────────────────────────────────────────────────────
845
852
 
846
- ## β–Ά Next Up
853
+
854
+ ╔══════════════════════════════════════════════════════════════╗
855
+ β•‘ β–Ά NEXT UP β•‘
856
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
847
857
 
848
858
  **Audit milestone** β€” verify requirements, cross-phase integration, E2E flows
849
859
 
@@ -851,20 +861,20 @@ All phase goals verified βœ“
851
861
 
852
862
  <sub>`/clear` first β†’ fresh context window</sub>
853
863
 
854
- ───────────────────────────────────────────────────────────────
864
+
855
865
 
856
866
  **Also available:**
857
867
  - `/pbr:review` β€” manual acceptance testing
858
868
  - `/pbr:milestone complete` β€” archive milestone after audit passes
859
869
 
860
- ───────────────────────────────────────────────────────────────
870
+
861
871
  ```
862
872
 
863
873
  **If `gaps_found`:**
864
874
  ```
865
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
866
- PLAN-BUILD-RUN β–Ί PHASE {N} GAPS FOUND ⚠
867
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
875
+ ╔══════════════════════════════════════════════════════════════╗
876
+ β•‘ PLAN-BUILD-RUN β–Ί PHASE {N} GAPS FOUND ⚠ β•‘
877
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
868
878
 
869
879
  **Phase {N}: {Name}**
870
880
 
@@ -875,9 +885,11 @@ Report: .planning/phases/{phase_dir}/VERIFICATION.md
875
885
 
876
886
  {Extract gap summaries from VERIFICATION.md}
877
887
 
878
- ───────────────────────────────────────────────────────────────
879
888
 
880
- ## β–Ά Next Up
889
+
890
+ ╔══════════════════════════════════════════════════════════════╗
891
+ β•‘ β–Ά NEXT UP β•‘
892
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
881
893
 
882
894
  **Plan gap closure** β€” create additional plans to complete the phase
883
895
 
@@ -885,13 +897,13 @@ Report: .planning/phases/{phase_dir}/VERIFICATION.md
885
897
 
886
898
  <sub>`/clear` first β†’ fresh context window</sub>
887
899
 
888
- ───────────────────────────────────────────────────────────────
900
+
889
901
 
890
902
  **Also available:**
891
903
  - `cat .planning/phases/{phase_dir}/VERIFICATION.md` β€” see full report
892
904
  - `/pbr:review {N}` β€” manual testing before planning
893
905
 
894
- ───────────────────────────────────────────────────────────────
906
+
895
907
  ```
896
908
 
897
909
  **8g. Display USER-SETUP.md (conditional):**
@@ -11,9 +11,9 @@ allowed-tools: Read, Write, Bash, Glob, AskUserQuestion
11
11
  **Before ANY tool calls**, display this banner:
12
12
 
13
13
  ```
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
- PLAN-BUILD-RUN β–Ί CONFIGURATION
16
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14
+ ╔══════════════════════════════════════════════════════════════╗
15
+ β•‘ PLAN-BUILD-RUN β–Ί CONFIGURATION β•‘
16
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
17
17
  ```
18
18
 
19
19
  Then proceed to Step 1.
@@ -187,17 +187,19 @@ If user types something else (freeform): interpret as a direct setting command a
187
187
 
188
188
  Update config.json with new values. Show what changed with a branded completion:
189
189
  ```
190
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
191
- PLAN-BUILD-RUN β–Ί CONFIG UPDATED βœ“
192
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
190
+ ╔══════════════════════════════════════════════════════════════╗
191
+ β•‘ PLAN-BUILD-RUN β–Ί CONFIG UPDATED βœ“ β•‘
192
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
193
193
 
194
194
  Updated:
195
195
  depth: standard β†’ quick
196
196
  models.executor: inherit β†’ sonnet
197
197
 
198
- ───────────────────────────────────────────────────────────────
199
198
 
200
- ## β–Ά Next Up
199
+
200
+ ╔══════════════════════════════════════════════════════════════╗
201
+ β•‘ β–Ά NEXT UP β•‘
202
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
201
203
 
202
204
  **Continue your workflow** β€” settings saved
203
205
 
@@ -205,13 +207,13 @@ Updated:
205
207
 
206
208
  <sub>`/clear` first β†’ fresh context window</sub>
207
209
 
208
- ───────────────────────────────────────────────────────────────
210
+
209
211
 
210
212
  **Also available:**
211
213
  - `/pbr:continue` β€” execute next logical step
212
214
  - `/pbr:config` β€” change more settings
213
215
 
214
- ───────────────────────────────────────────────────────────────
216
+
215
217
  ```
216
218
 
217
219
  ## Config Schema