@sienklogic/plan-build-run 2.3.0 → 2.4.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 (151) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +54 -20
  3. package/dashboard/src/services/dashboard.service.js +24 -1
  4. package/dashboard/src/services/milestone.service.js +68 -17
  5. package/package.json +1 -1
  6. package/plugins/copilot-pbr/CHANGELOG.md +19 -0
  7. package/plugins/copilot-pbr/README.md +129 -0
  8. package/plugins/copilot-pbr/agents/codebase-mapper.agent.md +109 -0
  9. package/plugins/copilot-pbr/agents/debugger.agent.md +169 -0
  10. package/plugins/copilot-pbr/agents/executor.agent.md +237 -0
  11. package/plugins/copilot-pbr/agents/general.agent.md +88 -0
  12. package/plugins/copilot-pbr/agents/integration-checker.agent.md +88 -0
  13. package/plugins/copilot-pbr/agents/plan-checker.agent.md +199 -0
  14. package/plugins/copilot-pbr/agents/planner.agent.md +181 -0
  15. package/plugins/copilot-pbr/agents/researcher.agent.md +163 -0
  16. package/plugins/copilot-pbr/agents/synthesizer.agent.md +102 -0
  17. package/plugins/copilot-pbr/agents/verifier.agent.md +194 -0
  18. package/plugins/copilot-pbr/hooks/hooks.json +144 -0
  19. package/plugins/copilot-pbr/plugin.json +30 -0
  20. package/plugins/copilot-pbr/references/agent-anti-patterns.md +25 -0
  21. package/plugins/copilot-pbr/references/agent-interactions.md +135 -0
  22. package/plugins/copilot-pbr/references/agent-teams.md +55 -0
  23. package/plugins/copilot-pbr/references/checkpoints.md +158 -0
  24. package/plugins/copilot-pbr/references/common-bug-patterns.md +14 -0
  25. package/plugins/copilot-pbr/references/config-reference.md +442 -0
  26. package/plugins/copilot-pbr/references/continuation-format.md +213 -0
  27. package/plugins/copilot-pbr/references/deviation-rules.md +113 -0
  28. package/plugins/copilot-pbr/references/git-integration.md +227 -0
  29. package/plugins/copilot-pbr/references/integration-patterns.md +118 -0
  30. package/plugins/copilot-pbr/references/model-profiles.md +100 -0
  31. package/plugins/copilot-pbr/references/model-selection.md +32 -0
  32. package/plugins/copilot-pbr/references/pbr-rules.md +194 -0
  33. package/plugins/copilot-pbr/references/plan-authoring.md +182 -0
  34. package/plugins/copilot-pbr/references/plan-format.md +288 -0
  35. package/plugins/copilot-pbr/references/planning-config.md +214 -0
  36. package/plugins/copilot-pbr/references/questioning.md +215 -0
  37. package/plugins/copilot-pbr/references/reading-verification.md +128 -0
  38. package/plugins/copilot-pbr/references/stub-patterns.md +161 -0
  39. package/plugins/copilot-pbr/references/subagent-coordination.md +120 -0
  40. package/plugins/copilot-pbr/references/ui-formatting.md +462 -0
  41. package/plugins/copilot-pbr/references/verification-patterns.md +199 -0
  42. package/plugins/copilot-pbr/references/wave-execution.md +96 -0
  43. package/plugins/copilot-pbr/rules/pbr-workflow.mdc +48 -0
  44. package/plugins/copilot-pbr/setup.ps1 +93 -0
  45. package/plugins/copilot-pbr/setup.sh +92 -0
  46. package/plugins/copilot-pbr/skills/begin/SKILL.md +566 -0
  47. package/plugins/copilot-pbr/skills/begin/templates/PROJECT.md.tmpl +34 -0
  48. package/plugins/copilot-pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +19 -0
  49. package/plugins/copilot-pbr/skills/begin/templates/STATE.md.tmpl +50 -0
  50. package/plugins/copilot-pbr/skills/begin/templates/config.json.tmpl +64 -0
  51. package/plugins/copilot-pbr/skills/begin/templates/researcher-prompt.md.tmpl +20 -0
  52. package/plugins/copilot-pbr/skills/begin/templates/roadmap-prompt.md.tmpl +31 -0
  53. package/plugins/copilot-pbr/skills/begin/templates/synthesis-prompt.md.tmpl +17 -0
  54. package/plugins/copilot-pbr/skills/build/SKILL.md +901 -0
  55. package/plugins/copilot-pbr/skills/config/SKILL.md +253 -0
  56. package/plugins/copilot-pbr/skills/continue/SKILL.md +159 -0
  57. package/plugins/copilot-pbr/skills/dashboard/SKILL.md +31 -0
  58. package/plugins/copilot-pbr/skills/debug/SKILL.md +511 -0
  59. package/plugins/copilot-pbr/skills/debug/templates/continuation-prompt.md.tmpl +17 -0
  60. package/plugins/copilot-pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +28 -0
  61. package/plugins/copilot-pbr/skills/discuss/SKILL.md +343 -0
  62. package/plugins/copilot-pbr/skills/discuss/templates/CONTEXT.md.tmpl +62 -0
  63. package/plugins/copilot-pbr/skills/discuss/templates/decision-categories.md +10 -0
  64. package/plugins/copilot-pbr/skills/do/SKILL.md +66 -0
  65. package/plugins/copilot-pbr/skills/explore/SKILL.md +374 -0
  66. package/plugins/copilot-pbr/skills/health/SKILL.md +218 -0
  67. package/plugins/copilot-pbr/skills/health/templates/check-pattern.md.tmpl +31 -0
  68. package/plugins/copilot-pbr/skills/health/templates/output-format.md.tmpl +64 -0
  69. package/plugins/copilot-pbr/skills/help/SKILL.md +152 -0
  70. package/plugins/copilot-pbr/skills/import/SKILL.md +498 -0
  71. package/plugins/copilot-pbr/skills/milestone/SKILL.md +703 -0
  72. package/plugins/copilot-pbr/skills/milestone/templates/audit-report.md.tmpl +49 -0
  73. package/plugins/copilot-pbr/skills/milestone/templates/stats-file.md.tmpl +31 -0
  74. package/plugins/copilot-pbr/skills/note/SKILL.md +227 -0
  75. package/plugins/copilot-pbr/skills/pause/SKILL.md +246 -0
  76. package/plugins/copilot-pbr/skills/pause/templates/continue-here.md.tmpl +72 -0
  77. package/plugins/copilot-pbr/skills/plan/SKILL.md +649 -0
  78. package/plugins/copilot-pbr/skills/plan/templates/checker-prompt.md.tmpl +22 -0
  79. package/plugins/copilot-pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +33 -0
  80. package/plugins/copilot-pbr/skills/plan/templates/planner-prompt.md.tmpl +39 -0
  81. package/plugins/copilot-pbr/skills/plan/templates/researcher-prompt.md.tmpl +20 -0
  82. package/plugins/copilot-pbr/skills/plan/templates/revision-prompt.md.tmpl +24 -0
  83. package/plugins/copilot-pbr/skills/quick/SKILL.md +351 -0
  84. package/plugins/copilot-pbr/skills/resume/SKILL.md +399 -0
  85. package/plugins/copilot-pbr/skills/review/SKILL.md +648 -0
  86. package/plugins/copilot-pbr/skills/review/templates/debugger-prompt.md.tmpl +61 -0
  87. package/plugins/copilot-pbr/skills/review/templates/gap-planner-prompt.md.tmpl +41 -0
  88. package/plugins/copilot-pbr/skills/review/templates/verifier-prompt.md.tmpl +116 -0
  89. package/plugins/copilot-pbr/skills/scan/SKILL.md +301 -0
  90. package/plugins/copilot-pbr/skills/scan/templates/mapper-prompt.md.tmpl +202 -0
  91. package/plugins/copilot-pbr/skills/setup/SKILL.md +250 -0
  92. package/plugins/copilot-pbr/skills/shared/commit-planning-docs.md +36 -0
  93. package/plugins/copilot-pbr/skills/shared/config-loading.md +103 -0
  94. package/plugins/copilot-pbr/skills/shared/context-budget.md +41 -0
  95. package/plugins/copilot-pbr/skills/shared/context-loader-task.md +87 -0
  96. package/plugins/copilot-pbr/skills/shared/digest-select.md +80 -0
  97. package/plugins/copilot-pbr/skills/shared/domain-probes.md +126 -0
  98. package/plugins/copilot-pbr/skills/shared/error-reporting.md +80 -0
  99. package/plugins/copilot-pbr/skills/shared/gate-prompts.md +389 -0
  100. package/plugins/copilot-pbr/skills/shared/phase-argument-parsing.md +46 -0
  101. package/plugins/copilot-pbr/skills/shared/progress-display.md +54 -0
  102. package/plugins/copilot-pbr/skills/shared/revision-loop.md +82 -0
  103. package/plugins/copilot-pbr/skills/shared/state-loading.md +63 -0
  104. package/plugins/copilot-pbr/skills/shared/state-update.md +162 -0
  105. package/plugins/copilot-pbr/skills/shared/universal-anti-patterns.md +34 -0
  106. package/plugins/copilot-pbr/skills/status/SKILL.md +362 -0
  107. package/plugins/copilot-pbr/skills/todo/SKILL.md +256 -0
  108. package/plugins/copilot-pbr/templates/CONTEXT.md.tmpl +53 -0
  109. package/plugins/copilot-pbr/templates/INTEGRATION-REPORT.md.tmpl +152 -0
  110. package/plugins/copilot-pbr/templates/RESEARCH-SUMMARY.md.tmpl +98 -0
  111. package/plugins/copilot-pbr/templates/ROADMAP.md.tmpl +41 -0
  112. package/plugins/copilot-pbr/templates/SUMMARY.md.tmpl +82 -0
  113. package/plugins/copilot-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  114. package/plugins/copilot-pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  115. package/plugins/copilot-pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  116. package/plugins/copilot-pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  117. package/plugins/copilot-pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  118. package/plugins/copilot-pbr/templates/codebase/STACK.md.tmpl +78 -0
  119. package/plugins/copilot-pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  120. package/plugins/copilot-pbr/templates/codebase/TESTING.md.tmpl +107 -0
  121. package/plugins/copilot-pbr/templates/continue-here.md.tmpl +74 -0
  122. package/plugins/copilot-pbr/templates/prompt-partials/phase-project-context.md.tmpl +38 -0
  123. package/plugins/copilot-pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  124. package/plugins/copilot-pbr/templates/research/STACK.md.tmpl +71 -0
  125. package/plugins/copilot-pbr/templates/research/SUMMARY.md.tmpl +112 -0
  126. package/plugins/copilot-pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  127. package/plugins/copilot-pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  128. package/plugins/copilot-pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
  129. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +13 -3
  130. package/plugins/cursor-pbr/skills/dashboard/SKILL.md +14 -4
  131. package/plugins/cursor-pbr/skills/do/SKILL.md +67 -0
  132. package/plugins/cursor-pbr/skills/milestone/SKILL.md +10 -7
  133. package/plugins/cursor-pbr/skills/todo/SKILL.md +28 -5
  134. package/plugins/cursor-pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  135. package/plugins/cursor-pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  136. package/plugins/cursor-pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  137. package/plugins/cursor-pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  138. package/plugins/cursor-pbr/templates/codebase/STACK.md.tmpl +78 -0
  139. package/plugins/cursor-pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  140. package/plugins/cursor-pbr/templates/codebase/TESTING.md.tmpl +107 -0
  141. package/plugins/cursor-pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  142. package/plugins/cursor-pbr/templates/research/STACK.md.tmpl +71 -0
  143. package/plugins/cursor-pbr/templates/research/SUMMARY.md.tmpl +112 -0
  144. package/plugins/cursor-pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  145. package/plugins/cursor-pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  146. package/plugins/cursor-pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
  147. package/plugins/pbr/.claude-plugin/plugin.json +7 -2
  148. package/plugins/pbr/scripts/validate-skill-args.js +54 -10
  149. package/plugins/pbr/skills/do/SKILL.md +70 -0
  150. package/plugins/pbr/skills/milestone/SKILL.md +10 -7
  151. package/plugins/pbr/skills/todo/SKILL.md +29 -6
@@ -0,0 +1,49 @@
1
+ <\!-- canonical: ../../../../pbr/skills/milestone/templates/audit-report.md.tmpl -->
2
+ # Template: Milestone Audit Report
3
+ # Used by: milestone/SKILL.md (audit subcommand, Step 5)
4
+ # Variables: {version}, {status}, {date}, {phase entries}, {integration results}, {requirements}, {tech debt}
5
+
6
+ ---
7
+ milestone: "{version}"
8
+ status: "{passed | gaps_found | tech_debt}"
9
+ date: "{ISO date}"
10
+ ---
11
+
12
+ # Milestone Audit: {version}
13
+
14
+ ## Overall Status: {PASSED / GAPS FOUND / TECH DEBT}
15
+
16
+ ## Phase Verification Summary
17
+
18
+ | Phase | Verified | Gaps | Integration |
19
+ |-------|----------|------|-------------|
20
+ | {N}. {name} | {yes/no} | {count} | {ok/issues} |
21
+
22
+ ## Integration Check Results
23
+
24
+ ### Dependency Graph
25
+ {Mermaid or ASCII representation of phase dependencies}
26
+
27
+ ### Integration Issues
28
+ {List of integration problems found, or "None"}
29
+
30
+ - **{Issue}**: {description}
31
+ - Affected phases: {list}
32
+ - Severity: {critical/high/medium/low}
33
+ - Suggested fix: {brief suggestion}
34
+
35
+ ## Requirements Coverage
36
+
37
+ | Requirement | Status | Verified By |
38
+ |-------------|--------|-------------|
39
+ | {req} | {covered/uncovered} | {phase/plan or "N/A"} |
40
+
41
+ ## Tech Debt Identified
42
+
43
+ {Issues that don't block the milestone but should be addressed}
44
+
45
+ - {debt item}: {description}
46
+
47
+ ## Recommendations
48
+
49
+ {Summary of what needs to be done, if anything}
@@ -0,0 +1,31 @@
1
+ <\!-- canonical: ../../../../pbr/skills/milestone/templates/stats-file.md.tmpl -->
2
+ # Template: Milestone Stats File
3
+ # Used by: milestone/SKILL.md (complete subcommand, Step 5)
4
+ # Variables: {version}, {name}, {date}, {days}, {counts}, {accomplishments}, {decisions}, {tech stack}, {patterns}
5
+
6
+ # Milestone {version} Stats
7
+
8
+ **Name:** {milestone name}
9
+ **Completed:** {ISO date}
10
+ **Duration:** {days}
11
+
12
+ ## Metrics
13
+ - Phases: {count}
14
+ - Plans executed: {count}
15
+ - Quick tasks: {count}
16
+ - Total commits: {count}
17
+ - Files changed: {count}
18
+ - Lines added: {count}
19
+ - Lines removed: {count}
20
+
21
+ ## Accomplishments
22
+ {bulleted list of key features/capabilities built}
23
+
24
+ ## Key Decisions
25
+ {bulleted list of important decisions made}
26
+
27
+ ## Technology Stack
28
+ {list of technologies used}
29
+
30
+ ## Patterns Established
31
+ {list of patterns applied}
@@ -0,0 +1,227 @@
1
+ ---
2
+ name: note
3
+ description: "Zero-friction idea capture. Append, list, or promote notes to todos."
4
+ ---
5
+
6
+ ## Step 0 — Immediate Output
7
+
8
+ **Before ANY tool calls**, display this banner:
9
+
10
+ ```
11
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ PLAN-BUILD-RUN ► NOTE
13
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14
+ ```
15
+
16
+ Then proceed to Step 1.
17
+
18
+ # /pbr:note — Quick Note Capture
19
+
20
+ You are running the **note** skill. Your job is zero-friction idea capture. One Write call, one confirmation line. No questions, no prompts.
21
+
22
+ This skill runs **inline** — no Task, no AskUserQuestion, no Bash.
23
+
24
+ ---
25
+
26
+ ## Scope Detection
27
+
28
+ Two scopes exist. Auto-detect which to use:
29
+
30
+ 1. **Project scope**: `.planning/NOTES.md` — used when `.planning/` directory exists in cwd
31
+ 2. **Global scope**: `~/.claude/notes.md` — used as fallback when no `.planning/`, or when `--global` flag is present
32
+
33
+ **`--global` flag**: Strip `--global` from anywhere in `$ARGUMENTS` before parsing. When present, force global scope regardless of whether `.planning/` exists.
34
+
35
+ **Important**: Do NOT create `.planning/` if it doesn't exist. If there's no `.planning/` directory, fall back to global scope silently.
36
+
37
+ ---
38
+
39
+ ## Subcommand Parsing
40
+
41
+ Parse `$ARGUMENTS` after stripping `--global`:
42
+
43
+ | Condition | Subcommand |
44
+ |-----------|------------|
45
+ | Arguments are exactly `list` (case-insensitive) | **list** |
46
+ | Arguments are exactly `promote <N>` where N is a number | **promote** |
47
+ | Arguments are empty (no text at all) | **list** |
48
+ | Anything else | **append** (the text IS the note) |
49
+
50
+ **Critical**: `list` is only a subcommand when it's the ENTIRE argument. `/pbr:note list of groceries` saves a note with text "list of groceries". Same for `promote` — only a subcommand when followed by exactly one number.
51
+
52
+ ---
53
+
54
+ ## Subcommand: append
55
+
56
+ Append a timestamped note to the target file.
57
+
58
+ ### Steps
59
+
60
+ 1. Determine scope (project or global) per Scope Detection above
61
+ 2. Read the target file if it exists
62
+ 3. If the file doesn't exist, create it with this header:
63
+
64
+ ```markdown
65
+ # Notes
66
+
67
+ Quick captures from `/pbr:note`. Ideas worth remembering.
68
+
69
+ ---
70
+
71
+ ```
72
+
73
+ 4. Ensure the file content ends with a newline before appending
74
+ 5. Append: `- [YYYY-MM-DD HH:mm] {note text verbatim}`
75
+ 6. Write the file
76
+ 7. Confirm with exactly one line: `Noted ({scope}): {note text}`
77
+ - Where `{scope}` is "project" or "global"
78
+
79
+ ### Constraints
80
+
81
+ - **Never modify the note text** — capture verbatim, including typos
82
+ - **Never ask questions** — just write and confirm
83
+ - **Timestamp format**: Use local time, `YYYY-MM-DD HH:mm` (24-hour, no seconds)
84
+
85
+ ---
86
+
87
+ ## Subcommand: list
88
+
89
+ Show notes from both project and global scopes.
90
+
91
+ ### Steps
92
+
93
+ 1. Read `.planning/NOTES.md` (if exists) — these are "project" notes
94
+ 2. Read `~/.claude/notes.md` (if exists) — these are "global" notes
95
+ 3. Parse entries: lines matching `^- \[` are notes
96
+ 4. Exclude lines containing `[promoted]` from active counts (but still show them, dimmed)
97
+ 5. Number all active entries sequentially starting at 1, using plain integers (1, 2, 3...) for display (across both scopes)
98
+ 6. If total active entries > 20, show only the last 10 with a note about how many were omitted
99
+
100
+ ### Display Format
101
+
102
+ ```
103
+ Notes:
104
+
105
+ Project (.planning/NOTES.md):
106
+ 1. [2026-02-08 14:32] refactor the hook system to support async validators
107
+ 2. [promoted] [2026-02-08 14:40] add rate limiting to the API endpoints
108
+ 3. [2026-02-08 15:10] consider adding a --dry-run flag to build
109
+
110
+ Global (~/.claude/notes.md):
111
+ 4. [2026-02-08 10:00] cross-project idea about shared config
112
+
113
+ {count} active note(s). Use `/pbr:note promote <N>` to convert to a todo.
114
+ ```
115
+
116
+ If a scope has no file or no entries, show: `(no notes)`
117
+
118
+ ---
119
+
120
+ ## Subcommand: promote
121
+
122
+ Convert a note into a todo file.
123
+
124
+ ### Steps
125
+
126
+ 1. Run the **list** logic to build the numbered index (both scopes)
127
+ 2. Find entry N from the numbered list
128
+ 3. If N is invalid or refers to an already-promoted note, tell the user and stop
129
+ 4. **Requires `.planning/` directory** — if it doesn't exist, warn: "Todos require a Plan-Build-Run project. Run `/pbr:begin` to initialize one, or use `/pbr:todo add` in an existing project."
130
+ 5. Ensure `.planning/todos/pending/` directory exists
131
+ 6. Generate todo ID: `{NNN}-{slug}` where NNN is the next sequential number (scan both `.planning/todos/pending/` and `.planning/todos/done/` for the highest existing number, increment by 1, zero-pad to 3 digits) and slug is the first ~4 meaningful words of the note text, lowercase, hyphen-separated
132
+ 7. Extract the note text (everything after the timestamp)
133
+ 8. Create `.planning/todos/pending/{id}.md`:
134
+
135
+ ```yaml
136
+ ---
137
+ title: "{note text}"
138
+ status: pending
139
+ priority: P2
140
+ source: "promoted from /pbr:note"
141
+ created: {YYYY-MM-DD}
142
+ theme: general
143
+ ---
144
+
145
+ ## Goal
146
+
147
+ {note text}
148
+
149
+ ## Context
150
+
151
+ Promoted from quick note captured on {original date}.
152
+
153
+ ## Acceptance Criteria
154
+
155
+ - [ ] {primary criterion derived from note text}
156
+ ```
157
+
158
+ 9. Mark the original note as promoted: replace `- [` with `- [promoted] [` on that line
159
+ 10. Confirm: `Promoted note {N} to todo {id}: {note text}`
160
+
161
+ ---
162
+
163
+ ## NOTES.md Format Reference
164
+
165
+ ```markdown
166
+ # Notes
167
+
168
+ Quick captures from `/pbr:note`. Ideas worth remembering.
169
+
170
+ ---
171
+
172
+ - [2026-02-08 14:32] refactor the hook system to support async validators
173
+ - [promoted] [2026-02-08 14:40] add rate limiting to the API endpoints
174
+ - [2026-02-08 15:10] consider adding a --dry-run flag to build
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Edge Cases
180
+
181
+ 1. **"list" as note text**: `/pbr:note list of things` → saves note "list of things" (subcommand only when `list` is the entire arg)
182
+ 2. **No `.planning/`**: Falls back to global `~/.claude/notes.md` — works in any directory
183
+ 3. **Promote without project**: Warns that todos require `.planning/`, suggests `/pbr:begin`
184
+ 4. **Large files**: `list` shows last 10 when >20 active entries
185
+ 5. **Missing newline**: Always ensure trailing newline before appending
186
+ 6. **`--global` position**: Stripped from anywhere — `--global my idea` and `my idea --global` both save "my idea" globally
187
+ 7. **Promote already-promoted**: Tell user "Note {N} is already promoted" and stop
188
+ 8. **Empty note text after stripping flags**: Treat as `list` subcommand
189
+
190
+ ---
191
+
192
+ ## Error Handling
193
+
194
+ ### Write failure
195
+ If the Write tool fails (permissions, disk full, etc.), display:
196
+ ```
197
+ ╔══════════════════════════════════════════════════════════════╗
198
+ ║ ERROR ║
199
+ ╚══════════════════════════════════════════════════════════════╝
200
+
201
+ Failed to write note to {target_file}.
202
+
203
+ **To fix:** Check file permissions or disk space.
204
+ ```
205
+
206
+ ### Promote target not found
207
+ If the specified note index is invalid, display:
208
+ ```
209
+ ╔══════════════════════════════════════════════════════════════╗
210
+ ║ ERROR ║
211
+ ╚══════════════════════════════════════════════════════════════╝
212
+
213
+ Note {N} not found. Valid range: 1-{max}.
214
+
215
+ **To fix:** Run `/pbr:note list` to see available notes.
216
+ ```
217
+
218
+ ---
219
+
220
+ ## Anti-Patterns
221
+
222
+ 1. **DO NOT** ask questions on append — just write and confirm
223
+ 2. **DO NOT** modify note text — capture verbatim
224
+ 3. **DO NOT** use Task, AskUserQuestion, or Bash
225
+ 4. **DO NOT** create `.planning/` if it doesn't exist — fall back to global
226
+ 5. **DO NOT** number promoted notes in the active count (but still display them)
227
+ 6. **DO NOT** over-format the confirmation — one line is enough
@@ -0,0 +1,246 @@
1
+ ---
2
+ name: pause
3
+ description: "Save your current session state for later resumption."
4
+ ---
5
+
6
+ ## Step 0 — Immediate Output
7
+
8
+ **Before ANY tool calls**, display this banner:
9
+
10
+ ```
11
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ PLAN-BUILD-RUN ► PAUSING SESSION
13
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14
+ ```
15
+
16
+ Then proceed to Step 1.
17
+
18
+ # /pbr:pause — Save Session State
19
+
20
+ You are running the **pause** skill. Your job is to capture the current session state so the user can resume exactly where they left off in a future conversation. This creates a `.continue-here.md` handoff file with everything the next session needs.
21
+
22
+ This skill runs **inline** (no Task delegation).
23
+
24
+ ---
25
+
26
+ ## Core Principle
27
+
28
+ **Capture everything the next session needs to hit the ground running.** The resume skill will read this file cold, with zero prior context. Write it as if you're handing off to a colleague who has never seen this project.
29
+
30
+ ---
31
+
32
+ ## Flow
33
+
34
+ ### Step 1: Read Current State
35
+
36
+ **Flag: `--checkpoint`**
37
+
38
+ If `$ARGUMENTS` contains `--checkpoint`:
39
+ - Perform a lightweight state dump without full session analysis
40
+ - Write a minimal .continue-here.md with just: Position, git status, and suggested next action
41
+ - Skip the detailed "Completed This Session" analysis (saves time)
42
+ - Useful for quick manual checkpoints at any point
43
+
44
+ Read the following files to understand where things stand:
45
+
46
+ 1. **`.planning/STATE.md`** — Current position
47
+ - Extract: current phase, current plan, progress, blockers
48
+ - If STATE.md doesn't exist, display:
49
+ ```
50
+ ╔══════════════════════════════════════════════════════════════╗
51
+ ║ ERROR ║
52
+ ╚══════════════════════════════════════════════════════════════╝
53
+
54
+ No Plan-Build-Run project state found. Nothing to pause.
55
+
56
+ **To fix:** Run `/pbr:begin` to initialize a project first.
57
+ ```
58
+
59
+ 2. **`.planning/config.json`** — Project settings
60
+ - Extract: project name, feature toggles
61
+
62
+ 3. **`.planning/ROADMAP.md`** — Phase overview
63
+ - Extract: current phase name, total phases
64
+
65
+ ### Step 2: Determine Current Phase Directory
66
+
67
+ From STATE.md, get the current phase number and find its directory:
68
+ 1. List directories in `.planning/phases/`
69
+ 2. Match the current phase number to a directory
70
+ 3. If no match: use the most recently modified phase directory
71
+
72
+ ### Step 3: Gather Session State
73
+
74
+ Collect the following information:
75
+
76
+ #### Current Position
77
+ - Phase number and name
78
+ - Plan number (if mid-phase) or "between plans"
79
+ - Status: in-progress, between-plans, between-phases, planning, reviewing
80
+
81
+ #### Work Completed This Session
82
+ Scan the current phase directory for SUMMARY.md files:
83
+ - Read each SUMMARY.md frontmatter
84
+ - Note which ones were created/modified recently (check timestamps or git log)
85
+ - For recently completed plans: extract the plan name and brief status
86
+
87
+ Also check git log for recent commits:
88
+ ```bash
89
+ git log --oneline -20 --since="8 hours ago"
90
+ ```
91
+ This gives a reasonable window for "this session's work."
92
+
93
+ #### Remaining Work
94
+ Scan for plan files without corresponding SUMMARY.md files:
95
+ - These are plans that haven't been executed yet
96
+ - List them with brief descriptions from their frontmatter
97
+
98
+ #### Key Decisions Made
99
+ Check for:
100
+ - Recent CONTEXT.md files (from `/pbr:discuss`)
101
+ - Key decisions in recent SUMMARY.md files
102
+ - Any deviations noted in summaries
103
+
104
+ #### Blockers or Concerns
105
+ From STATE.md blockers section and any:
106
+ - Failed verifications
107
+ - Checkpoint stops
108
+ - Active debug sessions
109
+ - Unresolved issues noted in summaries
110
+
111
+ #### What to Do Next
112
+ Determine the logical next action (same routing logic as `/pbr:status`):
113
+ - If mid-plan execution: "Continue building phase N"
114
+ - If between plans in a phase: "Execute next plan (plan M)"
115
+ - If phase complete, not reviewed: "Review phase N"
116
+ - If phase reviewed, has gaps: "Fix gaps in phase N"
117
+ - If phase complete: "Plan phase N+1"
118
+
119
+ ### Step 4: Write .continue-here.md
120
+
121
+ Write the handoff file to the current phase directory:
122
+
123
+ **Path:** `.planning/phases/{NN}-{phase-name}/.continue-here.md`
124
+
125
+ **Content:**
126
+
127
+ Read `skills/pause/templates/continue-here.md.tmpl` for the handoff file format. Fill in all `{variable}` placeholders with actual session data gathered in Steps 1-3.
128
+
129
+ ### Step 5: Update STATE.md
130
+
131
+ Update the Session Continuity section of STATE.md:
132
+
133
+ ```markdown
134
+ ### Session Continuity
135
+
136
+ **Last paused:** {ISO datetime}
137
+ **Position:** Phase {N}, Plan {M}
138
+ **Continue file:** .planning/phases/{NN}-{phase-name}/.continue-here.md
139
+ **Next action:** {suggested command}
140
+ ```
141
+
142
+ If the Session Continuity section doesn't exist, create it at the end of STATE.md.
143
+
144
+ ### Step 6: Commit as WIP
145
+
146
+ Reference: `skills/shared/commit-planning-docs.md` for the standard commit pattern.
147
+
148
+ If `planning.commit_docs: true` in config.json:
149
+
150
+ ```bash
151
+ git add .planning/phases/{NN}-{phase-name}/.continue-here.md
152
+ git add .planning/STATE.md
153
+ git commit -m "wip(planning): save session state — phase {N} plan {M}"
154
+ ```
155
+
156
+ **Commit rules:**
157
+ - Always use `wip(planning):` prefix for pause commits
158
+ - Include phase and plan numbers
159
+ - Stage only the continue-here and STATE.md files
160
+ - Do NOT stage any code changes (those should already be committed by the executor)
161
+
162
+ ### Step 7: Confirm to User
163
+
164
+ Display branded confirmation:
165
+
166
+ ```
167
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
168
+ PLAN-BUILD-RUN ► SESSION SAVED ✓
169
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
170
+
171
+ Position: Phase {N} — {phase name}, Plan {M}
172
+ Completed: {count} plans this session
173
+ Remaining: {count} plans in this phase
174
+
175
+ ───────────────────────────────────────────────────────────────
176
+
177
+ ## ▶ Next Up
178
+
179
+ **Resume in your next session**
180
+
181
+ `/pbr:resume`
182
+
183
+ <sub>`/clear` first → fresh context window</sub>
184
+
185
+ ───────────────────────────────────────────────────────────────
186
+ ```
187
+
188
+ ---
189
+
190
+ ## What Gets Captured
191
+
192
+ | Information | Source | Why It Matters |
193
+ |-------------|--------|---------------|
194
+ | Phase + plan position | STATE.md | Know where to start |
195
+ | Completed work | SUMMARY.md files, git log | Know what's already done |
196
+ | Remaining work | Plan files without summaries | Know what's left |
197
+ | Decisions | CONTEXT.md, SUMMARY.md | Preserve user preferences |
198
+ | Blockers | STATE.md, verification files | Don't repeat failed approaches |
199
+ | Next steps | Routing logic | Immediate action on resume |
200
+
201
+ ---
202
+
203
+ ## Edge Cases
204
+
205
+ ### No work was done this session
206
+ - Still write the continue-here file
207
+ - "Completed This Session" section says: "No plans completed (discussion/planning only)"
208
+ - Capture any decisions or context from the conversation
209
+
210
+ ### Multiple phases were worked on
211
+ - Write .continue-here.md in the MOST RECENT phase directory
212
+ - Reference the other phases in the "Completed This Session" section
213
+ - Next steps should focus on the current position
214
+
215
+ ### Mid-task pause (executor was interrupted)
216
+ - Note which task was in progress
217
+ - Warn: "Task {name} was in progress when paused. It may need to be re-executed."
218
+ - Check git log to see if any partial commits exist
219
+
220
+ ### .continue-here.md already exists
221
+ - **Always REPLACE** the existing file entirely — never append
222
+ - Appending causes stale data from previous sessions to persist, which confuses resume
223
+ - The old .continue-here.md content is superseded by the current state
224
+ - No need to ask the user — the current session state is always more accurate
225
+
226
+ ### STATE.md doesn't exist
227
+ - Warn: "No STATE.md found. Creating a minimal pause file."
228
+ - Write .continue-here.md based on git log and file system scan only
229
+ - Don't try to update STATE.md
230
+
231
+ ### No git history (fresh project)
232
+ - Skip the git log step
233
+ - Estimate session work from file modification times
234
+ - Still write the continue-here file
235
+
236
+ ---
237
+
238
+ ## Anti-Patterns
239
+
240
+ 1. **DO NOT** include full file contents in .continue-here.md — keep it concise
241
+ 2. **DO NOT** stage code files in the WIP commit — only planning docs
242
+ 3. **DO NOT** skip the commit when `planning.commit_docs` is enabled — the WIP commit preserves the pause state in version control and ensures `.continue-here.md` is not lost if working tree changes occur
243
+ 4. **DO NOT** write multiple .continue-here.md files — one per pause
244
+ 5. **DO NOT** include sensitive information (API keys, passwords) in the handoff
245
+ 6. **DO NOT** modify any code files — this skill only writes planning docs
246
+ 7. **DO NOT** skip the "Next Steps" section — it's the most important part for resumption
@@ -0,0 +1,72 @@
1
+ <\!-- canonical: ../../../../pbr/skills/pause/templates/continue-here.md.tmpl -->
2
+ # Template: Continue Here Handoff File
3
+ # Used by: pause/SKILL.md (Step 4)
4
+ # Output path: .planning/phases/{NN}-{phase-name}/.continue-here.md
5
+ # Variables: {datetime}, {hours}, {phase}, {plan}, {status}, {session work}, {remaining}, {decisions}, {blockers}, {context}, {next steps}
6
+
7
+ # Continue Here
8
+
9
+ **Paused:** {ISO datetime}
10
+ **Session duration:** ~{estimated hours} (based on git log timestamps)
11
+
12
+ ## Position
13
+
14
+ Phase: {N} -- {name}
15
+ Plan: {M} of {total} (or "between plans" / "phase complete")
16
+ Status: {in-progress / between-plans / reviewing / planning}
17
+
18
+ ## Completed This Session
19
+
20
+ {List of work done, with commit references where available}
21
+
22
+ - Plan {A}: {summary} (commit: {short hash})
23
+ - Plan {B}: {summary} (commit: {short hash})
24
+ - Quick task: {description} (commit: {short hash})
25
+
26
+ {If nothing was completed:}
27
+ - No plans completed this session (discussion/planning only)
28
+
29
+ ## Remaining
30
+
31
+ {What still needs to be done in this phase}
32
+
33
+ - Plan {C}: {brief description from plan frontmatter}
34
+ - Plan {D}: {brief description from plan frontmatter}
35
+
36
+ {If phase is complete:}
37
+ - Phase {N} is complete. Next: {review or next phase}
38
+
39
+ ## Decisions Made
40
+
41
+ {Key decisions from this session that affect future work}
42
+
43
+ - {decision 1}: {brief description}
44
+ - {decision 2}: {brief description}
45
+
46
+ {If no notable decisions:}
47
+ - No major decisions this session
48
+
49
+ ## Blockers
50
+
51
+ {Any issues preventing progress}
52
+
53
+ - {blocker description}
54
+
55
+ {If no blockers:}
56
+ - None
57
+
58
+ ## Context Notes
59
+
60
+ {Any additional context that would help the next session}
61
+
62
+ - {note about something tricky}
63
+ - {note about something to watch out for}
64
+ - {note about user preferences expressed during this session}
65
+
66
+ ## Next Steps
67
+
68
+ {Ordered list of what to do when resuming}
69
+
70
+ 1. {Specific first action with command}
71
+ 2. {Following action}
72
+ 3. {And so on}