@sienklogic/plan-build-run 2.54.0 → 2.55.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 (127) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/plugins/codex-pbr/agents/audit.md +223 -0
  4. package/plugins/codex-pbr/agents/codebase-mapper.md +196 -0
  5. package/plugins/codex-pbr/agents/debugger.md +245 -0
  6. package/plugins/codex-pbr/agents/dev-sync.md +142 -0
  7. package/plugins/codex-pbr/agents/executor.md +429 -0
  8. package/plugins/codex-pbr/agents/general.md +131 -0
  9. package/plugins/codex-pbr/agents/integration-checker.md +178 -0
  10. package/plugins/codex-pbr/agents/plan-checker.md +253 -0
  11. package/plugins/codex-pbr/agents/planner.md +343 -0
  12. package/plugins/codex-pbr/agents/researcher.md +253 -0
  13. package/plugins/codex-pbr/agents/synthesizer.md +183 -0
  14. package/plugins/codex-pbr/agents/verifier.md +352 -0
  15. package/plugins/codex-pbr/commands/audit.md +5 -0
  16. package/plugins/codex-pbr/commands/begin.md +5 -0
  17. package/plugins/codex-pbr/commands/build.md +5 -0
  18. package/plugins/codex-pbr/commands/config.md +5 -0
  19. package/plugins/codex-pbr/commands/continue.md +5 -0
  20. package/plugins/codex-pbr/commands/dashboard.md +5 -0
  21. package/plugins/codex-pbr/commands/debug.md +5 -0
  22. package/plugins/codex-pbr/commands/discuss.md +5 -0
  23. package/plugins/codex-pbr/commands/do.md +5 -0
  24. package/plugins/codex-pbr/commands/explore.md +5 -0
  25. package/plugins/codex-pbr/commands/health.md +5 -0
  26. package/plugins/codex-pbr/commands/help.md +5 -0
  27. package/plugins/codex-pbr/commands/import.md +5 -0
  28. package/plugins/codex-pbr/commands/milestone.md +5 -0
  29. package/plugins/codex-pbr/commands/note.md +5 -0
  30. package/plugins/codex-pbr/commands/pause.md +5 -0
  31. package/plugins/codex-pbr/commands/plan.md +5 -0
  32. package/plugins/codex-pbr/commands/quick.md +5 -0
  33. package/plugins/codex-pbr/commands/resume.md +5 -0
  34. package/plugins/codex-pbr/commands/review.md +5 -0
  35. package/plugins/codex-pbr/commands/scan.md +5 -0
  36. package/plugins/codex-pbr/commands/setup.md +5 -0
  37. package/plugins/codex-pbr/commands/status.md +5 -0
  38. package/plugins/codex-pbr/commands/statusline.md +5 -0
  39. package/plugins/codex-pbr/commands/test.md +5 -0
  40. package/plugins/codex-pbr/commands/todo.md +5 -0
  41. package/plugins/codex-pbr/commands/undo.md +5 -0
  42. package/plugins/codex-pbr/references/agent-contracts.md +324 -0
  43. package/plugins/codex-pbr/references/agent-teams.md +54 -0
  44. package/plugins/codex-pbr/references/common-bug-patterns.md +13 -0
  45. package/plugins/codex-pbr/references/config-reference.md +552 -0
  46. package/plugins/codex-pbr/references/continuation-format.md +212 -0
  47. package/plugins/codex-pbr/references/deviation-rules.md +112 -0
  48. package/plugins/codex-pbr/references/git-integration.md +256 -0
  49. package/plugins/codex-pbr/references/integration-patterns.md +117 -0
  50. package/plugins/codex-pbr/references/model-profiles.md +99 -0
  51. package/plugins/codex-pbr/references/model-selection.md +31 -0
  52. package/plugins/codex-pbr/references/pbr-tools-cli.md +400 -0
  53. package/plugins/codex-pbr/references/plan-authoring.md +246 -0
  54. package/plugins/codex-pbr/references/plan-format.md +313 -0
  55. package/plugins/codex-pbr/references/questioning.md +235 -0
  56. package/plugins/codex-pbr/references/reading-verification.md +127 -0
  57. package/plugins/codex-pbr/references/signal-files.md +41 -0
  58. package/plugins/codex-pbr/references/stub-patterns.md +160 -0
  59. package/plugins/codex-pbr/references/ui-formatting.md +444 -0
  60. package/plugins/codex-pbr/references/wave-execution.md +95 -0
  61. package/plugins/codex-pbr/skills/audit/SKILL.md +346 -0
  62. package/plugins/codex-pbr/skills/begin/SKILL.md +800 -0
  63. package/plugins/codex-pbr/skills/build/SKILL.md +958 -0
  64. package/plugins/codex-pbr/skills/config/SKILL.md +267 -0
  65. package/plugins/codex-pbr/skills/continue/SKILL.md +172 -0
  66. package/plugins/codex-pbr/skills/dashboard/SKILL.md +44 -0
  67. package/plugins/codex-pbr/skills/debug/SKILL.md +530 -0
  68. package/plugins/codex-pbr/skills/discuss/SKILL.md +355 -0
  69. package/plugins/codex-pbr/skills/do/SKILL.md +68 -0
  70. package/plugins/codex-pbr/skills/explore/SKILL.md +407 -0
  71. package/plugins/codex-pbr/skills/health/SKILL.md +300 -0
  72. package/plugins/codex-pbr/skills/help/SKILL.md +229 -0
  73. package/plugins/codex-pbr/skills/import/SKILL.md +538 -0
  74. package/plugins/codex-pbr/skills/milestone/SKILL.md +620 -0
  75. package/plugins/codex-pbr/skills/note/SKILL.md +215 -0
  76. package/plugins/codex-pbr/skills/pause/SKILL.md +258 -0
  77. package/plugins/codex-pbr/skills/plan/SKILL.md +650 -0
  78. package/plugins/codex-pbr/skills/quick/SKILL.md +417 -0
  79. package/plugins/codex-pbr/skills/resume/SKILL.md +403 -0
  80. package/plugins/codex-pbr/skills/review/SKILL.md +669 -0
  81. package/plugins/codex-pbr/skills/scan/SKILL.md +325 -0
  82. package/plugins/codex-pbr/skills/setup/SKILL.md +169 -0
  83. package/plugins/codex-pbr/skills/shared/commit-planning-docs.md +35 -0
  84. package/plugins/codex-pbr/skills/shared/config-loading.md +102 -0
  85. package/plugins/codex-pbr/skills/shared/context-budget.md +77 -0
  86. package/plugins/codex-pbr/skills/shared/context-loader-task.md +86 -0
  87. package/plugins/codex-pbr/skills/shared/digest-select.md +79 -0
  88. package/plugins/codex-pbr/skills/shared/domain-probes.md +125 -0
  89. package/plugins/codex-pbr/skills/shared/error-reporting.md +59 -0
  90. package/plugins/codex-pbr/skills/shared/gate-prompts.md +388 -0
  91. package/plugins/codex-pbr/skills/shared/phase-argument-parsing.md +45 -0
  92. package/plugins/codex-pbr/skills/shared/revision-loop.md +81 -0
  93. package/plugins/codex-pbr/skills/shared/state-update.md +169 -0
  94. package/plugins/codex-pbr/skills/shared/universal-anti-patterns.md +43 -0
  95. package/plugins/codex-pbr/skills/status/SKILL.md +449 -0
  96. package/plugins/codex-pbr/skills/statusline/SKILL.md +149 -0
  97. package/plugins/codex-pbr/skills/test/SKILL.md +210 -0
  98. package/plugins/codex-pbr/skills/todo/SKILL.md +281 -0
  99. package/plugins/codex-pbr/skills/undo/SKILL.md +172 -0
  100. package/plugins/codex-pbr/templates/CONTEXT.md.tmpl +52 -0
  101. package/plugins/codex-pbr/templates/INTEGRATION-REPORT.md.tmpl +167 -0
  102. package/plugins/codex-pbr/templates/RESEARCH-SUMMARY.md.tmpl +97 -0
  103. package/plugins/codex-pbr/templates/ROADMAP.md.tmpl +47 -0
  104. package/plugins/codex-pbr/templates/SUMMARY-complex.md.tmpl +95 -0
  105. package/plugins/codex-pbr/templates/SUMMARY-minimal.md.tmpl +48 -0
  106. package/plugins/codex-pbr/templates/SUMMARY.md.tmpl +81 -0
  107. package/plugins/codex-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  108. package/plugins/codex-pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  109. package/plugins/codex-pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  110. package/plugins/codex-pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  111. package/plugins/codex-pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  112. package/plugins/codex-pbr/templates/codebase/STACK.md.tmpl +78 -0
  113. package/plugins/codex-pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  114. package/plugins/codex-pbr/templates/codebase/TESTING.md.tmpl +107 -0
  115. package/plugins/codex-pbr/templates/continue-here.md.tmpl +73 -0
  116. package/plugins/codex-pbr/templates/pr-body.md.tmpl +22 -0
  117. package/plugins/codex-pbr/templates/prompt-partials/phase-project-context.md.tmpl +37 -0
  118. package/plugins/codex-pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  119. package/plugins/codex-pbr/templates/research/STACK.md.tmpl +71 -0
  120. package/plugins/codex-pbr/templates/research/SUMMARY.md.tmpl +112 -0
  121. package/plugins/codex-pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  122. package/plugins/codex-pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  123. package/plugins/codex-pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
  124. package/plugins/copilot-pbr/plugin.json +1 -1
  125. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  126. package/plugins/jules-pbr/AGENTS.md +600 -0
  127. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
@@ -0,0 +1,215 @@
1
+ ---
2
+ name: note
3
+ description: "Zero-friction idea capture. Append, list, or promote notes to todos."
4
+ ---
5
+
6
+ **STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.**
7
+
8
+ ## Step 0 — Immediate Output
9
+
10
+ **Before ANY tool calls**, display this banner:
11
+
12
+ ```
13
+ ╔══════════════════════════════════════════════════════════════╗
14
+ ║ PLAN-BUILD-RUN ► NOTE ║
15
+ ╚══════════════════════════════════════════════════════════════╝
16
+ ```
17
+
18
+ Then proceed to Step 1.
19
+
20
+ # $pbr-note — Quick Note Capture
21
+
22
+ You are running the **note** skill. Your job is zero-friction idea capture. One Write call, one confirmation line. No questions, no prompts.
23
+
24
+ This skill runs **inline** — no Task, no AskUserQuestion, no Bash.
25
+
26
+ ---
27
+
28
+ ## Storage Format
29
+
30
+ Notes are stored as **individual markdown files** in a notes directory:
31
+
32
+ - **Project scope**: `.planning/notes/{YYYY-MM-DD}-{slug}.md` — used when `.planning/` directory exists in cwd
33
+ - **Global scope**: `~/.claude/notes/{YYYY-MM-DD}-{slug}.md` — used as fallback when no `.planning/`, or when `--global` flag is present
34
+
35
+ Each note file has this format:
36
+
37
+ ```markdown
38
+ ---
39
+ date: "YYYY-MM-DD HH:mm"
40
+ promoted: false
41
+ ---
42
+
43
+ {note text verbatim}
44
+ ```
45
+
46
+ **`--global` flag**: Strip `--global` from anywhere in `$ARGUMENTS` before parsing. When present, force global scope regardless of whether `.planning/` exists.
47
+
48
+ **Important**: Do NOT create `.planning/` if it doesn't exist. If there's no `.planning/` directory, fall back to global scope silently.
49
+
50
+ ---
51
+
52
+ ## Subcommand Parsing
53
+
54
+ Parse `$ARGUMENTS` after stripping `--global`:
55
+
56
+ | Condition | Subcommand |
57
+ |-----------|------------|
58
+ | Arguments are exactly `list` (case-insensitive) | **list** |
59
+ | Arguments are exactly `promote <N>` where N is a number | **promote** |
60
+ | Arguments are empty (no text at all) | **list** |
61
+ | Anything else | **append** (the text IS the note) |
62
+
63
+ **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.
64
+
65
+ ---
66
+
67
+ ## Subcommand: append
68
+
69
+ Create a timestamped note file in the target directory.
70
+
71
+ ### Steps
72
+
73
+ 1. Determine scope (project or global) per Storage Format above
74
+ 2. Ensure the notes directory exists (`.planning/notes/` or `~/.claude/notes/`)
75
+ 3. Generate slug: first ~4 meaningful words of the note text, lowercase, hyphen-separated (strip articles/prepositions from the start)
76
+ 4. Generate filename: `{YYYY-MM-DD}-{slug}.md`
77
+ - If a file with that name already exists, append `-2`, `-3`, etc.
78
+ 5. Write the file with frontmatter and note text (see Storage Format)
79
+ 6. Confirm with exactly one line: `Noted ({scope}): {note text}`
80
+ - Where `{scope}` is "project" or "global"
81
+
82
+ ### Constraints
83
+
84
+ - **Never modify the note text** — capture verbatim, including typos
85
+ - **Never ask questions** — just write and confirm
86
+ - **Timestamp format**: Use local time, `YYYY-MM-DD HH:mm` (24-hour, no seconds)
87
+
88
+ ---
89
+
90
+ ## Subcommand: list
91
+
92
+ Show notes from both project and global scopes.
93
+
94
+ ### Steps
95
+
96
+ 1. Glob `.planning/notes/*.md` (if directory exists) — these are "project" notes
97
+ 2. Glob `~/.claude/notes/*.md` (if directory exists) — these are "global" notes
98
+ 3. For each file, read frontmatter to get `date` and `promoted` status
99
+ 4. Exclude files where `promoted: true` from active counts (but still show them, dimmed)
100
+ 5. Sort by date, number all active entries sequentially starting at 1
101
+ 6. If total active entries > 20, show only the last 10 with a note about how many were omitted
102
+
103
+ ### Display Format
104
+
105
+ ```
106
+ Notes:
107
+
108
+ Project (.planning/notes/):
109
+ 1. [2026-02-08 14:32] refactor the hook system to support async validators
110
+ 2. [promoted] [2026-02-08 14:40] add rate limiting to the API endpoints
111
+ 3. [2026-02-08 15:10] consider adding a --dry-run flag to build
112
+
113
+ Global (~/.claude/notes/):
114
+ 4. [2026-02-08 10:00] cross-project idea about shared config
115
+
116
+ {count} active note(s). Use `$pbr-note promote <N>` to convert to a todo.
117
+ ```
118
+
119
+ If a scope has no directory or no entries, show: `(no notes)`
120
+
121
+ ---
122
+
123
+ ## Subcommand: promote
124
+
125
+ Convert a note into a todo file.
126
+
127
+ ### Steps
128
+
129
+ 1. Run the **list** logic to build the numbered index (both scopes)
130
+ 2. Find entry N from the numbered list
131
+ 3. If N is invalid or refers to an already-promoted note, tell the user and stop
132
+ 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."
133
+ 5. Ensure `.planning/todos/pending/` directory exists
134
+ 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
135
+ 7. Extract the note text from the source file (body after frontmatter)
136
+ 8. Create `.planning/todos/pending/{id}.md`:
137
+
138
+ ```yaml
139
+ ---
140
+ title: "{note text}"
141
+ status: pending
142
+ priority: P2
143
+ source: "promoted from $pbr-note"
144
+ created: {YYYY-MM-DD}
145
+ theme: general
146
+ ---
147
+
148
+ ## Goal
149
+
150
+ {note text}
151
+
152
+ ## Context
153
+
154
+ Promoted from quick note captured on {original date}.
155
+
156
+ ## Acceptance Criteria
157
+
158
+ - [ ] {primary criterion derived from note text}
159
+ ```
160
+
161
+ 9. Mark the source note file as promoted: update its frontmatter to `promoted: true`
162
+ 10. Confirm: `Promoted note {N} to todo {id}: {note text}`
163
+
164
+ ---
165
+
166
+ ## Edge Cases
167
+
168
+ 1. **"list" as note text**: `$pbr-note list of things` → saves note "list of things" (subcommand only when `list` is the entire arg)
169
+ 2. **No `.planning/`**: Falls back to global `~/.claude/notes/` — works in any directory
170
+ 3. **Promote without project**: Warns that todos require `.planning/`, suggests `$pbr-begin`
171
+ 4. **Large files**: `list` shows last 10 when >20 active entries
172
+ 5. **Duplicate slugs**: Append `-2`, `-3` etc. to filename if slug already used on same date
173
+ 6. **`--global` position**: Stripped from anywhere — `--global my idea` and `my idea --global` both save "my idea" globally
174
+ 7. **Promote already-promoted**: Tell user "Note {N} is already promoted" and stop
175
+ 8. **Empty note text after stripping flags**: Treat as `list` subcommand
176
+
177
+ ---
178
+
179
+ ## Error Handling
180
+
181
+ ### Write failure
182
+ If the Write tool fails (permissions, disk full, etc.), display:
183
+ ```
184
+ ╔══════════════════════════════════════════════════════════════╗
185
+ ║ ERROR ║
186
+ ╚══════════════════════════════════════════════════════════════╝
187
+
188
+ Failed to write note to {target_file}.
189
+
190
+ **To fix:** Check file permissions or disk space.
191
+ ```
192
+
193
+ ### Promote target not found
194
+ If the specified note index is invalid, display:
195
+ ```
196
+ ╔══════════════════════════════════════════════════════════════╗
197
+ ║ ERROR ║
198
+ ╚══════════════════════════════════════════════════════════════╝
199
+
200
+ Note {N} not found. Valid range: 1-{max}.
201
+
202
+ **To fix:** Run `$pbr-note list` to see available notes.
203
+ ```
204
+
205
+ ---
206
+
207
+ ## Anti-Patterns
208
+
209
+ 1. **DO NOT** ask questions on append — just write and confirm
210
+ 2. **DO NOT** modify note text — capture verbatim
211
+ 3. **DO NOT** use Task, AskUserQuestion, or Bash
212
+ 4. **DO NOT** create `.planning/` if it doesn't exist — fall back to global
213
+ 5. **DO NOT** number promoted notes in the active count (but still display them)
214
+ 6. **DO NOT** over-format the confirmation — one line is enough
215
+ 7. **DO NOT** use a flat NOTES.md file — always use individual files in notes directory
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: pause
3
+ description: "Save your current session state for later resumption."
4
+ ---
5
+
6
+ **STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.**
7
+
8
+ ## Step 0 — Immediate Output
9
+
10
+ **Before ANY tool calls**, display this banner:
11
+
12
+ ```
13
+ ╔══════════════════════════════════════════════════════════════╗
14
+ ║ PLAN-BUILD-RUN ► PAUSING SESSION ║
15
+ ╚══════════════════════════════════════════════════════════════╝
16
+ ```
17
+
18
+ Then proceed to Step 1.
19
+
20
+ # $pbr-pause — Save Session State
21
+
22
+ 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.
23
+
24
+ This skill runs **inline** (no Task delegation).
25
+
26
+ ---
27
+
28
+ ## Core Principle
29
+
30
+ **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.
31
+
32
+ ---
33
+
34
+ ## Flow
35
+
36
+ ### Step 1: Read Current State
37
+
38
+ **Flag: `--checkpoint`**
39
+
40
+ If `$ARGUMENTS` contains `--checkpoint`:
41
+ - Perform a lightweight state dump without full session analysis
42
+ - Write a minimal .continue-here.md with just: Position, git status, and suggested next action
43
+ - Skip the detailed "Completed This Session" analysis (saves time)
44
+ - Useful for quick manual checkpoints at any point
45
+
46
+ Read the following files to understand where things stand:
47
+
48
+ 1. **`.planning/STATE.md`** — Current position
49
+ - Extract: current phase, current plan, progress, blockers
50
+ - If STATE.md doesn't exist, display:
51
+ ```
52
+ ╔══════════════════════════════════════════════════════════════╗
53
+ ║ ERROR ║
54
+ ╚══════════════════════════════════════════════════════════════╝
55
+
56
+ No Plan-Build-Run project state found. Nothing to pause.
57
+
58
+ **To fix:** Run `$pbr-begin` to initialize a project first.
59
+ ```
60
+
61
+ 2. **`.planning/config.json`** — Project settings
62
+ - Extract: project name, feature toggles
63
+
64
+ 3. **`.planning/ROADMAP.md`** — Phase overview
65
+ - Extract: current phase name, total phases
66
+
67
+ ### Step 2: Determine Current Phase Directory
68
+
69
+ From STATE.md, get the current phase number and find its directory:
70
+ 1. List directories in `.planning/phases/`
71
+ 2. Match the current phase number to a directory
72
+ 3. If no match: use the most recently modified phase directory
73
+
74
+ ### Step 3: Gather Session State
75
+
76
+ Collect the following information:
77
+
78
+ #### Current Position
79
+ - Phase number and name
80
+ - Plan number (if mid-phase) or "between plans"
81
+ - Status: in-progress, between-plans, between-phases, planning, reviewing
82
+
83
+ #### Work Completed This Session
84
+ Scan the current phase directory for SUMMARY.md files:
85
+ - Read each SUMMARY.md frontmatter
86
+ - Note which ones were created/modified recently (check timestamps or git log)
87
+ - For recently completed plans: extract the plan name and brief status
88
+
89
+ Also check git log for recent commits:
90
+ ```bash
91
+ git log --oneline -20 --since="8 hours ago"
92
+ ```
93
+ This gives a reasonable window for "this session's work."
94
+
95
+ #### Remaining Work
96
+ Scan for plan files without corresponding SUMMARY.md files:
97
+ - These are plans that haven't been executed yet
98
+ - List them with brief descriptions from their frontmatter
99
+
100
+ #### Key Decisions Made
101
+ Check for:
102
+ - Recent CONTEXT.md files (from `$pbr-discuss`)
103
+ - Key decisions in recent SUMMARY.md files
104
+ - Any deviations noted in summaries
105
+
106
+ #### Blockers or Concerns
107
+ From STATE.md blockers section and any:
108
+ - Failed verifications
109
+ - Checkpoint stops
110
+ - Active debug sessions
111
+ - Unresolved issues noted in summaries
112
+
113
+ #### What to Do Next
114
+ Determine the logical next action (same routing logic as `$pbr-status`):
115
+ - If mid-plan execution: "Continue building phase N"
116
+ - If between plans in a phase: "Execute next plan (plan M)"
117
+ - If phase complete, not reviewed: "Review phase N"
118
+ - If phase reviewed, has gaps: "Fix gaps in phase N"
119
+ - If phase complete: "Plan phase N+1"
120
+
121
+ ### Step 4: Write .continue-here.md
122
+
123
+ **CRITICAL: Write pause state NOW before displaying confirmation. Do NOT skip this step.**
124
+
125
+ Write the handoff file to the current phase directory:
126
+
127
+ **Path:** `.planning/phases/{NN}-{phase-name}/.continue-here.md`
128
+
129
+ **Content:**
130
+
131
+ 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.
132
+
133
+ ### Step 5: Update STATE.md
134
+
135
+ **CRITICAL -- DO NOT SKIP: Update STATE.md frontmatter AND body. Both must be updated atomically.**
136
+
137
+ First, update the STATE.md YAML frontmatter:
138
+ - Set `last_command: "$pbr-pause"`
139
+ - Set `last_activity: {ISO datetime}`
140
+
141
+ Then update the Session Continuity section of STATE.md:
142
+
143
+ ```markdown
144
+ ### Session Continuity
145
+
146
+ **Last paused:** {ISO datetime}
147
+ **Position:** Phase {N}, Plan {M}
148
+ **Continue file:** .planning/phases/{NN}-{phase-name}/.continue-here.md
149
+ **Next action:** {suggested command}
150
+ ```
151
+
152
+ If the Session Continuity section doesn't exist, create it at the end of STATE.md.
153
+
154
+ ### Step 6: Commit as WIP
155
+
156
+ Reference: `skills/shared/commit-planning-docs.md` for the standard commit pattern.
157
+
158
+ If `planning.commit_docs: true` in config.json:
159
+
160
+ ```bash
161
+ git add .planning/phases/{NN}-{phase-name}/.continue-here.md
162
+ git add .planning/STATE.md
163
+ git commit -m "wip(planning): save session state — phase {N} plan {M}"
164
+ ```
165
+
166
+ **Commit rules:**
167
+ - Always use `wip(planning):` prefix for pause commits
168
+ - Include phase and plan numbers
169
+ - Stage only the continue-here and STATE.md files
170
+ - Do NOT stage any code changes (those should already be committed by the executor)
171
+
172
+ ### Step 7: Confirm to User
173
+
174
+ Display branded confirmation:
175
+
176
+ ```
177
+ ╔══════════════════════════════════════════════════════════════╗
178
+ ║ PLAN-BUILD-RUN ► SESSION SAVED ✓ ║
179
+ ╚══════════════════════════════════════════════════════════════╝
180
+
181
+ Position: Phase {N} — {phase name}, Plan {M}
182
+ Completed: {count} plans this session
183
+ Remaining: {count} plans in this phase
184
+
185
+
186
+
187
+ ╔══════════════════════════════════════════════════════════════╗
188
+ ║ ▶ NEXT UP ║
189
+ ╚══════════════════════════════════════════════════════════════╝
190
+
191
+ **Resume in your next session**
192
+
193
+ `$pbr-resume`
194
+
195
+ <sub>`/clear` first → fresh context window</sub>
196
+
197
+
198
+ ```
199
+
200
+ ---
201
+
202
+ ## What Gets Captured
203
+
204
+ | Information | Source | Why It Matters |
205
+ |-------------|--------|---------------|
206
+ | Phase + plan position | STATE.md | Know where to start |
207
+ | Completed work | SUMMARY.md files, git log | Know what's already done |
208
+ | Remaining work | Plan files without summaries | Know what's left |
209
+ | Decisions | CONTEXT.md, SUMMARY.md | Preserve user preferences |
210
+ | Blockers | STATE.md, verification files | Don't repeat failed approaches |
211
+ | Next steps | Routing logic | Immediate action on resume |
212
+
213
+ ---
214
+
215
+ ## Edge Cases
216
+
217
+ ### No work was done this session
218
+ - Still write the continue-here file
219
+ - "Completed This Session" section says: "No plans completed (discussion/planning only)"
220
+ - Capture any decisions or context from the conversation
221
+
222
+ ### Multiple phases were worked on
223
+ - Write .continue-here.md in the MOST RECENT phase directory
224
+ - Reference the other phases in the "Completed This Session" section
225
+ - Next steps should focus on the current position
226
+
227
+ ### Mid-task pause (executor was interrupted)
228
+ - Note which task was in progress
229
+ - Warn: "Task {name} was in progress when paused. It may need to be re-executed."
230
+ - Check git log to see if any partial commits exist
231
+
232
+ ### .continue-here.md already exists
233
+ - **Always REPLACE** the existing file entirely — never append
234
+ - Appending causes stale data from previous sessions to persist, which confuses resume
235
+ - The old .continue-here.md content is superseded by the current state
236
+ - No need to ask the user — the current session state is always more accurate
237
+
238
+ ### STATE.md doesn't exist
239
+ - Warn: "No STATE.md found. Creating a minimal pause file."
240
+ - Write .continue-here.md based on git log and file system scan only
241
+ - Don't try to update STATE.md
242
+
243
+ ### No git history (fresh project)
244
+ - Skip the git log step
245
+ - Estimate session work from file modification times
246
+ - Still write the continue-here file
247
+
248
+ ---
249
+
250
+ ## Anti-Patterns
251
+
252
+ 1. **DO NOT** include full file contents in .continue-here.md — keep it concise
253
+ 2. **DO NOT** stage code files in the WIP commit — only planning docs
254
+ 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
255
+ 4. **DO NOT** write multiple .continue-here.md files — one per pause
256
+ 5. **DO NOT** include sensitive information (API keys, passwords) in the handoff
257
+ 6. **DO NOT** modify any code files — this skill only writes planning docs
258
+ 7. **DO NOT** skip the "Next Steps" section — it's the most important part for resumption