@sienklogic/plan-build-run 2.52.0 → 2.53.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 (30) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +1 -1
  3. package/plugins/copilot-pbr/agents/executor.agent.md +0 -2
  4. package/plugins/copilot-pbr/plugin.json +1 -1
  5. package/plugins/copilot-pbr/references/signal-files.md +41 -0
  6. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  7. package/plugins/cursor-pbr/agents/executor.md +0 -2
  8. package/plugins/cursor-pbr/references/signal-files.md +41 -0
  9. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  10. package/plugins/pbr/agents/executor.md +0 -2
  11. package/plugins/pbr/references/signal-files.md +41 -0
  12. package/plugins/pbr/scripts/check-skill-workflow.js +7 -8
  13. package/plugins/pbr/scripts/check-subagent-output.js +7 -6
  14. package/plugins/pbr/scripts/enforce-pbr-workflow.js +15 -6
  15. package/plugins/pbr/scripts/log-subagent.js +7 -10
  16. /package/plugins/copilot-pbr/references/{agent-anti-patterns.md → archive/agent-anti-patterns.md} +0 -0
  17. /package/plugins/copilot-pbr/references/{checkpoints.md → archive/checkpoints.md} +0 -0
  18. /package/plugins/copilot-pbr/references/{context-quality-tiers.md → archive/context-quality-tiers.md} +0 -0
  19. /package/plugins/copilot-pbr/references/{pbr-rules.md → archive/pbr-rules.md} +0 -0
  20. /package/plugins/copilot-pbr/references/{verification-patterns.md → archive/verification-patterns.md} +0 -0
  21. /package/plugins/cursor-pbr/references/{agent-anti-patterns.md → archive/agent-anti-patterns.md} +0 -0
  22. /package/plugins/cursor-pbr/references/{checkpoints.md → archive/checkpoints.md} +0 -0
  23. /package/plugins/cursor-pbr/references/{context-quality-tiers.md → archive/context-quality-tiers.md} +0 -0
  24. /package/plugins/cursor-pbr/references/{pbr-rules.md → archive/pbr-rules.md} +0 -0
  25. /package/plugins/cursor-pbr/references/{verification-patterns.md → archive/verification-patterns.md} +0 -0
  26. /package/plugins/pbr/references/{agent-anti-patterns.md → archive/agent-anti-patterns.md} +0 -0
  27. /package/plugins/pbr/references/{checkpoints.md → archive/checkpoints.md} +0 -0
  28. /package/plugins/pbr/references/{context-quality-tiers.md → archive/context-quality-tiers.md} +0 -0
  29. /package/plugins/pbr/references/{pbr-rules.md → archive/pbr-rules.md} +0 -0
  30. /package/plugins/pbr/references/{verification-patterns.md → archive/verification-patterns.md} +0 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ 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.53.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.52.0...plan-build-run-v2.53.0) (2026-03-01)
9
+
10
+
11
+ ### Features
12
+
13
+ * **54-03:** archive 5 dead reference docs and create signal-files.md ([4dff42d](https://github.com/SienkLogic/plan-build-run/commit/4dff42db3690b89dee04306bfe1562c0da789c60))
14
+ * **54-04:** migrate signal file readers to sessionLoad with legacy fallback ([02d6ae9](https://github.com/SienkLogic/plan-build-run/commit/02d6ae9405ead3fdbe18239687ec312e02310e1e))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **54-04:** add comments to empty catch blocks to satisfy ESLint no-empty rule ([8280c54](https://github.com/SienkLogic/plan-build-run/commit/8280c5412b79bf61ca5ccdcb7cf82b9b3ca13be3))
20
+
8
21
  ## [2.52.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.51.0...plan-build-run-v2.52.0) (2026-03-01)
9
22
 
10
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sienklogic/plan-build-run",
3
- "version": "2.52.0",
3
+ "version": "2.53.0",
4
4
  "description": "Plan it, Build it, Run it — structured development workflow for Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -132,8 +132,6 @@ Only append to the LAST commit of the plan — intermediate commits (RED/GREEN i
132
132
 
133
133
  ## Deviation Rules
134
134
 
135
- Reference: `references/deviation-rules.md` for examples and decision tree.
136
-
137
135
  | Rule | Trigger | Action | Approval |
138
136
  |------|---------|--------|----------|
139
137
  | 1 — Bug | Code bug (typo, wrong import, syntax) | Auto-fix in same commit. 3 attempts max. | No |
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbr",
3
3
  "displayName": "Plan-Build-Run",
4
- "version": "2.52.0",
4
+ "version": "2.53.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",
@@ -0,0 +1,41 @@
1
+ # Signal Files Reference
2
+
3
+ Signal files are ephemeral files in `.planning/` that coordinate state between hook scripts
4
+ and skills. They are scoped to either the current session or the current phase/plan.
5
+
6
+ ## Session-Scoped Files
7
+
8
+ All 5 session signals are consolidated in `.planning/.session.json`. Scripts must read and write
9
+ `.session.json` via `pbr-tools session get|set|clear` — never read the raw `.session.json` file directly.
10
+ The `.session.json` schema is an object with the keys documented below.
11
+
12
+ | JSON Key | Former File | Written By | Read By | Semantics |
13
+ |----------|-------------|------------|---------|-----------|
14
+ | `activeSkill` | `.active-skill` | Skills (Write tool) | check-skill-workflow, enforce-pbr-workflow, check-subagent-output, log-subagent, block-skill-self-read | Which skill is active. Written at skill start, cleared at skill end (session-cleanup). |
15
+ | `compactCounter` | `.compact-counter` | suggest-compact.js | suggest-compact.js | Write count since last /compact. Resets on SessionStart. |
16
+ | `sessionStart` | `.session-start` | progress-tracker.js | local-llm metrics | ISO timestamp of session start. Used for LLM metrics correlation. |
17
+ | `activeOperation` | `.active-operation` | context-budget-check.js | context-budget-check.js | Current named operation for budget display. |
18
+ | `activePlan` | `.active-plan` | context-budget-check.js | context-budget-check.js | Current plan ID for budget display. |
19
+
20
+ **Atomic access**: Use `pbr-tools session get|set|clear` for safe reads/writes from hook scripts.
21
+
22
+ **Lifecycle**: Written during SessionStart (progress-tracker), cleared during SessionEnd (session-cleanup).
23
+ Stale sessions (> 60 min) are auto-cleaned by progress-tracker.js on next SessionStart.
24
+
25
+ ## One-Shot Files
26
+
27
+ These files are NOT consolidated — they use write-once, delete-on-read semantics.
28
+
29
+ | File | Written By | Read By | Semantics |
30
+ |------|------------|---------|-----------|
31
+ | `.planning/.auto-next` | auto-continue.js | auto-continue.js (Stop hook) | Next command to run after session stops. Deleted after read. |
32
+ | `.planning/.auto-verify` | event-handler.js | event-handler.js (SubagentStop hook) | Trigger auto-verification after agent completes. Deleted after read. |
33
+
34
+ ## Phase-Scoped Files
35
+
36
+ These files persist across sessions, scoped to a specific phase or plan.
37
+
38
+ | File Pattern | Written By | Read By | Semantics |
39
+ |-------------|------------|---------|-----------|
40
+ | `.planning/phases/{id}/.checkpoint-manifest.json` | build skill | validate-task.js, session-cleanup.js | Checkpoint state for a plan in progress. Cleaned up after 24h. |
41
+ | `.planning/phases/{id}/.PROGRESS-{taskId}` | executor agent | validate-task.js | Task progress marker for crash recovery. Orphaned files warn on SessionStart. |
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbr",
3
3
  "displayName": "Plan-Build-Run",
4
- "version": "2.52.0",
4
+ "version": "2.53.0",
5
5
  "description": "Plan-Build-Run — Structured development workflow for Cursor. Solves context rot through disciplined subagent delegation, structured planning, atomic execution, and goal-backward verification.",
6
6
  "author": {
7
7
  "name": "SienkLogic",
@@ -134,8 +134,6 @@ Only append to the LAST commit of the plan — intermediate commits (RED/GREEN i
134
134
 
135
135
  ## Deviation Rules
136
136
 
137
- Reference: `references/deviation-rules.md` for examples and decision tree.
138
-
139
137
  | Rule | Trigger | Action | Approval |
140
138
  |------|---------|--------|----------|
141
139
  | 1 — Bug | Code bug (typo, wrong import, syntax) | Auto-fix in same commit. 3 attempts max. | No |
@@ -0,0 +1,41 @@
1
+ # Signal Files Reference
2
+
3
+ Signal files are ephemeral files in `.planning/` that coordinate state between hook scripts
4
+ and skills. They are scoped to either the current session or the current phase/plan.
5
+
6
+ ## Session-Scoped Files
7
+
8
+ All 5 session signals are consolidated in `.planning/.session.json`. Scripts must read and write
9
+ `.session.json` via `pbr-tools session get|set|clear` — never read the raw `.session.json` file directly.
10
+ The `.session.json` schema is an object with the keys documented below.
11
+
12
+ | JSON Key | Former File | Written By | Read By | Semantics |
13
+ |----------|-------------|------------|---------|-----------|
14
+ | `activeSkill` | `.active-skill` | Skills (Write tool) | check-skill-workflow, enforce-pbr-workflow, check-subagent-output, log-subagent, block-skill-self-read | Which skill is active. Written at skill start, cleared at skill end (session-cleanup). |
15
+ | `compactCounter` | `.compact-counter` | suggest-compact.js | suggest-compact.js | Write count since last /compact. Resets on SessionStart. |
16
+ | `sessionStart` | `.session-start` | progress-tracker.js | local-llm metrics | ISO timestamp of session start. Used for LLM metrics correlation. |
17
+ | `activeOperation` | `.active-operation` | context-budget-check.js | context-budget-check.js | Current named operation for budget display. |
18
+ | `activePlan` | `.active-plan` | context-budget-check.js | context-budget-check.js | Current plan ID for budget display. |
19
+
20
+ **Atomic access**: Use `pbr-tools session get|set|clear` for safe reads/writes from hook scripts.
21
+
22
+ **Lifecycle**: Written during SessionStart (progress-tracker), cleared during SessionEnd (session-cleanup).
23
+ Stale sessions (> 60 min) are auto-cleaned by progress-tracker.js on next SessionStart.
24
+
25
+ ## One-Shot Files
26
+
27
+ These files are NOT consolidated — they use write-once, delete-on-read semantics.
28
+
29
+ | File | Written By | Read By | Semantics |
30
+ |------|------------|---------|-----------|
31
+ | `.planning/.auto-next` | auto-continue.js | auto-continue.js (Stop hook) | Next command to run after session stops. Deleted after read. |
32
+ | `.planning/.auto-verify` | event-handler.js | event-handler.js (SubagentStop hook) | Trigger auto-verification after agent completes. Deleted after read. |
33
+
34
+ ## Phase-Scoped Files
35
+
36
+ These files persist across sessions, scoped to a specific phase or plan.
37
+
38
+ | File Pattern | Written By | Read By | Semantics |
39
+ |-------------|------------|---------|-----------|
40
+ | `.planning/phases/{id}/.checkpoint-manifest.json` | build skill | validate-task.js, session-cleanup.js | Checkpoint state for a plan in progress. Cleaned up after 24h. |
41
+ | `.planning/phases/{id}/.PROGRESS-{taskId}` | executor agent | validate-task.js | Task progress marker for crash recovery. Orphaned files warn on SessionStart. |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pbr",
3
- "version": "2.52.0",
3
+ "version": "2.53.0",
4
4
  "description": "Plan-Build-Run — Structured development workflow for Claude Code. Solves context rot through disciplined subagent delegation, structured planning, atomic execution, and goal-backward verification.",
5
5
  "author": {
6
6
  "name": "SienkLogic",
@@ -141,8 +141,6 @@ Only append to the LAST commit of the plan — intermediate commits (RED/GREEN i
141
141
 
142
142
  ## Deviation Rules
143
143
 
144
- Reference: `references/deviation-rules.md` for examples and decision tree.
145
-
146
144
  | Rule | Trigger | Action | Approval |
147
145
  |------|---------|--------|----------|
148
146
  | 1 — Bug | Code bug (typo, wrong import, syntax) | Auto-fix in same commit. 3 attempts max. | No |
@@ -0,0 +1,41 @@
1
+ # Signal Files Reference
2
+
3
+ Signal files are ephemeral files in `.planning/` that coordinate state between hook scripts
4
+ and skills. They are scoped to either the current session or the current phase/plan.
5
+
6
+ ## Session-Scoped Files
7
+
8
+ All 5 session signals are consolidated in `.planning/.session.json`. Scripts must read and write
9
+ `.session.json` via `pbr-tools session get|set|clear` — never read the raw `.session.json` file directly.
10
+ The `.session.json` schema is an object with the keys documented below.
11
+
12
+ | JSON Key | Former File | Written By | Read By | Semantics |
13
+ |----------|-------------|------------|---------|-----------|
14
+ | `activeSkill` | `.active-skill` | Skills (Write tool) | check-skill-workflow, enforce-pbr-workflow, check-subagent-output, log-subagent, block-skill-self-read | Which skill is active. Written at skill start, cleared at skill end (session-cleanup). |
15
+ | `compactCounter` | `.compact-counter` | suggest-compact.js | suggest-compact.js | Write count since last /compact. Resets on SessionStart. |
16
+ | `sessionStart` | `.session-start` | progress-tracker.js | local-llm metrics | ISO timestamp of session start. Used for LLM metrics correlation. |
17
+ | `activeOperation` | `.active-operation` | context-budget-check.js | context-budget-check.js | Current named operation for budget display. |
18
+ | `activePlan` | `.active-plan` | context-budget-check.js | context-budget-check.js | Current plan ID for budget display. |
19
+
20
+ **Atomic access**: Use `pbr-tools session get|set|clear` for safe reads/writes from hook scripts.
21
+
22
+ **Lifecycle**: Written during SessionStart (progress-tracker), cleared during SessionEnd (session-cleanup).
23
+ Stale sessions (> 60 min) are auto-cleaned by progress-tracker.js on next SessionStart.
24
+
25
+ ## One-Shot Files
26
+
27
+ These files are NOT consolidated — they use write-once, delete-on-read semantics.
28
+
29
+ | File | Written By | Read By | Semantics |
30
+ |------|------------|---------|-----------|
31
+ | `.planning/.auto-next` | auto-continue.js | auto-continue.js (Stop hook) | Next command to run after session stops. Deleted after read. |
32
+ | `.planning/.auto-verify` | event-handler.js | event-handler.js (SubagentStop hook) | Trigger auto-verification after agent completes. Deleted after read. |
33
+
34
+ ## Phase-Scoped Files
35
+
36
+ These files persist across sessions, scoped to a specific phase or plan.
37
+
38
+ | File Pattern | Written By | Read By | Semantics |
39
+ |-------------|------------|---------|-----------|
40
+ | `.planning/phases/{id}/.checkpoint-manifest.json` | build skill | validate-task.js, session-cleanup.js | Checkpoint state for a plan in progress. Cleaned up after 24h. |
41
+ | `.planning/phases/{id}/.PROGRESS-{taskId}` | executor agent | validate-task.js | Task progress marker for crash recovery. Orphaned files warn on SessionStart. |
@@ -25,6 +25,7 @@ const fs = require('fs');
25
25
  const path = require('path');
26
26
  const { logHook } = require('./hook-logger');
27
27
  const { logEvent } = require('./event-logger');
28
+ const { sessionLoad } = require('./pbr-tools');
28
29
 
29
30
  function main() {
30
31
  let input = '';
@@ -80,15 +81,13 @@ function main() {
80
81
  }
81
82
 
82
83
  function readActiveSkill(planningDir) {
83
- const skillFile = path.join(planningDir, '.active-skill');
84
- if (!fs.existsSync(skillFile)) return null;
85
-
86
- try {
87
- const content = fs.readFileSync(skillFile, 'utf8').trim();
88
- return content || null;
89
- } catch (_e) {
90
- return null;
84
+ // Try .session.json first, fall back to legacy .active-skill
85
+ let activeSkill = sessionLoad(planningDir).activeSkill || null;
86
+ if (!activeSkill) {
87
+ try { activeSkill = fs.readFileSync(path.join(planningDir, '.active-skill'), 'utf8').trim(); } catch (_) { /* legacy file missing */ }
91
88
  }
89
+ // TODO(Phase 55+): Remove legacy .active-skill fallback once .session.json is confirmed stable
90
+ return activeSkill || null;
92
91
  }
93
92
 
94
93
  /**
@@ -20,7 +20,7 @@
20
20
  const fs = require('fs');
21
21
  const path = require('path');
22
22
  const { logHook } = require('./hook-logger');
23
- const { KNOWN_AGENTS } = require('./pbr-tools');
23
+ const { KNOWN_AGENTS, sessionLoad } = require('./pbr-tools');
24
24
  const { resolveConfig } = require('./local-llm/health');
25
25
  const { classifyError } = require('./local-llm/operations/classify-error');
26
26
 
@@ -437,11 +437,12 @@ async function main() {
437
437
  process.exit(0);
438
438
  }
439
439
 
440
- // Read active skill
441
- let activeSkill = '';
442
- try {
443
- activeSkill = fs.readFileSync(path.join(planningDir, '.active-skill'), 'utf8').trim();
444
- } catch (_e) { /* no active skill */ }
440
+ // Read active skill — try .session.json first, fall back to legacy .active-skill
441
+ let activeSkill = sessionLoad(planningDir).activeSkill || '';
442
+ if (!activeSkill) {
443
+ try { activeSkill = fs.readFileSync(path.join(planningDir, '.active-skill'), 'utf8').trim(); } catch (_) { /* legacy file missing */ }
444
+ }
445
+ // TODO(Phase 55+): Remove legacy .active-skill fallback once .session.json is confirmed stable
445
446
 
446
447
  // Check for expected outputs
447
448
  const found = outputSpec.check(planningDir);
@@ -21,6 +21,7 @@
21
21
  const fs = require('fs');
22
22
  const path = require('path');
23
23
  const { logHook } = require('./hook-logger');
24
+ const { sessionLoad } = require('./pbr-tools');
24
25
 
25
26
  /**
26
27
  * Load the enforcement configuration from .planning/config.json.
@@ -73,9 +74,13 @@ function checkUnmanagedSourceWrite(data) {
73
74
  // Skip if not a PBR project
74
75
  if (!fs.existsSync(planningDir)) return null;
75
76
 
76
- // Skip if a PBR skill is active
77
- const activeSkillFile = path.join(planningDir, '.active-skill');
78
- if (fs.existsSync(activeSkillFile)) return null;
77
+ // Skip if a PBR skill is active — try .session.json first, fall back to legacy .active-skill
78
+ let activeSkill = sessionLoad(planningDir).activeSkill || '';
79
+ if (!activeSkill) {
80
+ try { activeSkill = fs.readFileSync(path.join(planningDir, '.active-skill'), 'utf8').trim(); } catch (_) { /* legacy file missing */ }
81
+ }
82
+ // TODO(Phase 55+): Remove legacy .active-skill fallback once .session.json is confirmed stable
83
+ if (activeSkill) return null;
79
84
 
80
85
  // Skip if writing inside .planning/
81
86
  const normalizedFile = filePath.replace(/\\/g, '/');
@@ -208,9 +213,13 @@ function checkUnmanagedCommit(data) {
208
213
  // Skip if not a PBR project
209
214
  if (!fs.existsSync(planningDir)) return null;
210
215
 
211
- // Skip if a PBR skill is active
212
- const activeSkillFile = path.join(planningDir, '.active-skill');
213
- if (fs.existsSync(activeSkillFile)) return null;
216
+ // Skip if a PBR skill is active — try .session.json first, fall back to legacy .active-skill
217
+ let activeSkillCommit = sessionLoad(planningDir).activeSkill || '';
218
+ if (!activeSkillCommit) {
219
+ try { activeSkillCommit = fs.readFileSync(path.join(planningDir, '.active-skill'), 'utf8').trim(); } catch (_) { /* legacy file missing */ }
220
+ }
221
+ // TODO(Phase 55+): Remove legacy .active-skill fallback once .session.json is confirmed stable
222
+ if (activeSkillCommit) return null;
214
223
 
215
224
  const config = loadEnforcementConfig(planningDir);
216
225
  if (config.level === 'off') return null;
@@ -17,7 +17,7 @@ const fs = require('fs');
17
17
  const path = require('path');
18
18
  const { logHook } = require('./hook-logger');
19
19
  const { logEvent } = require('./event-logger');
20
- const { configLoad } = require('./pbr-tools');
20
+ const { configLoad, sessionLoad } = require('./pbr-tools');
21
21
 
22
22
  function readStdin() {
23
23
  try {
@@ -136,16 +136,13 @@ function buildAgentContext() {
136
136
  }
137
137
  }
138
138
 
139
- // Active skill context
140
- const activeSkillFile = path.join(planningDir, '.active-skill');
141
- if (fs.existsSync(activeSkillFile)) {
142
- try {
143
- const skill = fs.readFileSync(activeSkillFile, 'utf8').trim();
144
- if (skill) parts.push(`Active skill: /pbr:${skill}`);
145
- } catch (_e) {
146
- // skip
147
- }
139
+ // Active skill context — try .session.json first, fall back to legacy .active-skill
140
+ let activeSkill = sessionLoad(planningDir).activeSkill || '';
141
+ if (!activeSkill) {
142
+ try { activeSkill = fs.readFileSync(path.join(planningDir, '.active-skill'), 'utf8').trim(); } catch (_) { /* legacy file missing */ }
148
143
  }
144
+ // TODO(Phase 55+): Remove legacy .active-skill fallback once .session.json is confirmed stable
145
+ if (activeSkill) parts.push(`Active skill: /pbr:${activeSkill}`);
149
146
 
150
147
  // Config highlights
151
148
  const config = configLoad(planningDir);