@sienklogic/plan-build-run 2.0.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.
- package/CHANGELOG.md +56 -0
- package/CLAUDE.md +149 -0
- package/LICENSE +21 -0
- package/README.md +247 -0
- package/dashboard/bin/cli.js +25 -0
- package/dashboard/package.json +34 -0
- package/dashboard/public/.gitkeep +0 -0
- package/dashboard/public/css/layout.css +406 -0
- package/dashboard/public/css/status-colors.css +98 -0
- package/dashboard/public/js/htmx-title.js +5 -0
- package/dashboard/public/js/sidebar-toggle.js +20 -0
- package/dashboard/src/app.js +78 -0
- package/dashboard/src/middleware/errorHandler.js +52 -0
- package/dashboard/src/middleware/notFoundHandler.js +9 -0
- package/dashboard/src/repositories/planning.repository.js +128 -0
- package/dashboard/src/routes/events.routes.js +40 -0
- package/dashboard/src/routes/index.routes.js +31 -0
- package/dashboard/src/routes/pages.routes.js +195 -0
- package/dashboard/src/server.js +42 -0
- package/dashboard/src/services/dashboard.service.js +222 -0
- package/dashboard/src/services/phase.service.js +167 -0
- package/dashboard/src/services/project.service.js +57 -0
- package/dashboard/src/services/roadmap.service.js +171 -0
- package/dashboard/src/services/sse.service.js +58 -0
- package/dashboard/src/services/todo.service.js +254 -0
- package/dashboard/src/services/watcher.service.js +48 -0
- package/dashboard/src/views/coming-soon.ejs +11 -0
- package/dashboard/src/views/error.ejs +13 -0
- package/dashboard/src/views/index.ejs +5 -0
- package/dashboard/src/views/layout.ejs +1 -0
- package/dashboard/src/views/partials/dashboard-content.ejs +77 -0
- package/dashboard/src/views/partials/footer.ejs +3 -0
- package/dashboard/src/views/partials/head.ejs +21 -0
- package/dashboard/src/views/partials/header.ejs +12 -0
- package/dashboard/src/views/partials/layout-bottom.ejs +15 -0
- package/dashboard/src/views/partials/layout-top.ejs +8 -0
- package/dashboard/src/views/partials/phase-content.ejs +181 -0
- package/dashboard/src/views/partials/phases-content.ejs +117 -0
- package/dashboard/src/views/partials/roadmap-content.ejs +142 -0
- package/dashboard/src/views/partials/sidebar.ejs +38 -0
- package/dashboard/src/views/partials/todo-create-content.ejs +53 -0
- package/dashboard/src/views/partials/todo-detail-content.ejs +38 -0
- package/dashboard/src/views/partials/todos-content.ejs +53 -0
- package/dashboard/src/views/phase-detail.ejs +5 -0
- package/dashboard/src/views/phases.ejs +5 -0
- package/dashboard/src/views/roadmap.ejs +5 -0
- package/dashboard/src/views/todo-create.ejs +5 -0
- package/dashboard/src/views/todo-detail.ejs +5 -0
- package/dashboard/src/views/todos.ejs +5 -0
- package/package.json +57 -0
- package/plugins/pbr/.claude-plugin/plugin.json +13 -0
- package/plugins/pbr/UI-CONSISTENCY-GAPS.md +61 -0
- package/plugins/pbr/agents/codebase-mapper.md +271 -0
- package/plugins/pbr/agents/debugger.md +281 -0
- package/plugins/pbr/agents/executor.md +407 -0
- package/plugins/pbr/agents/general.md +164 -0
- package/plugins/pbr/agents/integration-checker.md +141 -0
- package/plugins/pbr/agents/plan-checker.md +280 -0
- package/plugins/pbr/agents/planner.md +358 -0
- package/plugins/pbr/agents/researcher.md +363 -0
- package/plugins/pbr/agents/synthesizer.md +230 -0
- package/plugins/pbr/agents/verifier.md +454 -0
- package/plugins/pbr/commands/begin.md +5 -0
- package/plugins/pbr/commands/build.md +5 -0
- package/plugins/pbr/commands/config.md +5 -0
- package/plugins/pbr/commands/continue.md +5 -0
- package/plugins/pbr/commands/debug.md +5 -0
- package/plugins/pbr/commands/discuss.md +5 -0
- package/plugins/pbr/commands/explore.md +5 -0
- package/plugins/pbr/commands/health.md +5 -0
- package/plugins/pbr/commands/help.md +5 -0
- package/plugins/pbr/commands/import.md +5 -0
- package/plugins/pbr/commands/milestone.md +5 -0
- package/plugins/pbr/commands/note.md +5 -0
- package/plugins/pbr/commands/pause.md +5 -0
- package/plugins/pbr/commands/plan.md +5 -0
- package/plugins/pbr/commands/quick.md +5 -0
- package/plugins/pbr/commands/resume.md +5 -0
- package/plugins/pbr/commands/review.md +5 -0
- package/plugins/pbr/commands/scan.md +5 -0
- package/plugins/pbr/commands/setup.md +5 -0
- package/plugins/pbr/commands/status.md +5 -0
- package/plugins/pbr/commands/todo.md +5 -0
- package/plugins/pbr/contexts/dev.md +27 -0
- package/plugins/pbr/contexts/research.md +28 -0
- package/plugins/pbr/contexts/review.md +36 -0
- package/plugins/pbr/hooks/hooks.json +183 -0
- package/plugins/pbr/references/agent-anti-patterns.md +24 -0
- package/plugins/pbr/references/agent-interactions.md +134 -0
- package/plugins/pbr/references/agent-teams.md +54 -0
- package/plugins/pbr/references/checkpoints.md +157 -0
- package/plugins/pbr/references/common-bug-patterns.md +13 -0
- package/plugins/pbr/references/continuation-format.md +212 -0
- package/plugins/pbr/references/deviation-rules.md +112 -0
- package/plugins/pbr/references/git-integration.md +226 -0
- package/plugins/pbr/references/integration-patterns.md +117 -0
- package/plugins/pbr/references/model-profiles.md +99 -0
- package/plugins/pbr/references/model-selection.md +31 -0
- package/plugins/pbr/references/pbr-rules.md +193 -0
- package/plugins/pbr/references/plan-authoring.md +181 -0
- package/plugins/pbr/references/plan-format.md +283 -0
- package/plugins/pbr/references/planning-config.md +213 -0
- package/plugins/pbr/references/questioning.md +214 -0
- package/plugins/pbr/references/reading-verification.md +127 -0
- package/plugins/pbr/references/stub-patterns.md +160 -0
- package/plugins/pbr/references/subagent-coordination.md +119 -0
- package/plugins/pbr/references/ui-formatting.md +399 -0
- package/plugins/pbr/references/verification-patterns.md +198 -0
- package/plugins/pbr/references/wave-execution.md +95 -0
- package/plugins/pbr/scripts/auto-continue.js +80 -0
- package/plugins/pbr/scripts/check-dangerous-commands.js +136 -0
- package/plugins/pbr/scripts/check-doc-sprawl.js +102 -0
- package/plugins/pbr/scripts/check-phase-boundary.js +196 -0
- package/plugins/pbr/scripts/check-plan-format.js +270 -0
- package/plugins/pbr/scripts/check-roadmap-sync.js +252 -0
- package/plugins/pbr/scripts/check-skill-workflow.js +262 -0
- package/plugins/pbr/scripts/check-state-sync.js +476 -0
- package/plugins/pbr/scripts/check-subagent-output.js +144 -0
- package/plugins/pbr/scripts/config-schema.json +251 -0
- package/plugins/pbr/scripts/context-budget-check.js +287 -0
- package/plugins/pbr/scripts/event-handler.js +151 -0
- package/plugins/pbr/scripts/event-logger.js +92 -0
- package/plugins/pbr/scripts/hook-logger.js +76 -0
- package/plugins/pbr/scripts/hooks-schema.json +79 -0
- package/plugins/pbr/scripts/log-subagent.js +152 -0
- package/plugins/pbr/scripts/log-tool-failure.js +88 -0
- package/plugins/pbr/scripts/pbr-tools.js +1301 -0
- package/plugins/pbr/scripts/post-write-dispatch.js +66 -0
- package/plugins/pbr/scripts/post-write-quality.js +207 -0
- package/plugins/pbr/scripts/pre-bash-dispatch.js +56 -0
- package/plugins/pbr/scripts/pre-write-dispatch.js +62 -0
- package/plugins/pbr/scripts/progress-tracker.js +228 -0
- package/plugins/pbr/scripts/session-cleanup.js +254 -0
- package/plugins/pbr/scripts/status-line.js +285 -0
- package/plugins/pbr/scripts/suggest-compact.js +119 -0
- package/plugins/pbr/scripts/task-completed.js +45 -0
- package/plugins/pbr/scripts/track-context-budget.js +119 -0
- package/plugins/pbr/scripts/validate-commit.js +200 -0
- package/plugins/pbr/scripts/validate-plugin-structure.js +172 -0
- package/plugins/pbr/skills/begin/SKILL.md +545 -0
- package/plugins/pbr/skills/begin/templates/PROJECT.md.tmpl +33 -0
- package/plugins/pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +18 -0
- package/plugins/pbr/skills/begin/templates/STATE.md.tmpl +49 -0
- package/plugins/pbr/skills/begin/templates/config.json.tmpl +63 -0
- package/plugins/pbr/skills/begin/templates/researcher-prompt.md.tmpl +19 -0
- package/plugins/pbr/skills/begin/templates/roadmap-prompt.md.tmpl +30 -0
- package/plugins/pbr/skills/begin/templates/synthesis-prompt.md.tmpl +16 -0
- package/plugins/pbr/skills/build/SKILL.md +962 -0
- package/plugins/pbr/skills/config/SKILL.md +241 -0
- package/plugins/pbr/skills/continue/SKILL.md +127 -0
- package/plugins/pbr/skills/debug/SKILL.md +489 -0
- package/plugins/pbr/skills/debug/templates/continuation-prompt.md.tmpl +16 -0
- package/plugins/pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +27 -0
- package/plugins/pbr/skills/discuss/SKILL.md +338 -0
- package/plugins/pbr/skills/discuss/templates/CONTEXT.md.tmpl +61 -0
- package/plugins/pbr/skills/discuss/templates/decision-categories.md +9 -0
- package/plugins/pbr/skills/explore/SKILL.md +362 -0
- package/plugins/pbr/skills/health/SKILL.md +186 -0
- package/plugins/pbr/skills/health/templates/check-pattern.md.tmpl +30 -0
- package/plugins/pbr/skills/health/templates/output-format.md.tmpl +63 -0
- package/plugins/pbr/skills/help/SKILL.md +140 -0
- package/plugins/pbr/skills/import/SKILL.md +490 -0
- package/plugins/pbr/skills/milestone/SKILL.md +673 -0
- package/plugins/pbr/skills/milestone/templates/audit-report.md.tmpl +48 -0
- package/plugins/pbr/skills/milestone/templates/stats-file.md.tmpl +30 -0
- package/plugins/pbr/skills/note/SKILL.md +212 -0
- package/plugins/pbr/skills/pause/SKILL.md +235 -0
- package/plugins/pbr/skills/pause/templates/continue-here.md.tmpl +71 -0
- package/plugins/pbr/skills/plan/SKILL.md +628 -0
- package/plugins/pbr/skills/plan/decimal-phase-calc.md +98 -0
- package/plugins/pbr/skills/plan/templates/checker-prompt.md.tmpl +21 -0
- package/plugins/pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +32 -0
- package/plugins/pbr/skills/plan/templates/planner-prompt.md.tmpl +38 -0
- package/plugins/pbr/skills/plan/templates/researcher-prompt.md.tmpl +19 -0
- package/plugins/pbr/skills/plan/templates/revision-prompt.md.tmpl +23 -0
- package/plugins/pbr/skills/quick/SKILL.md +335 -0
- package/plugins/pbr/skills/resume/SKILL.md +388 -0
- package/plugins/pbr/skills/review/SKILL.md +652 -0
- package/plugins/pbr/skills/review/templates/debugger-prompt.md.tmpl +60 -0
- package/plugins/pbr/skills/review/templates/gap-planner-prompt.md.tmpl +40 -0
- package/plugins/pbr/skills/review/templates/verifier-prompt.md.tmpl +115 -0
- package/plugins/pbr/skills/scan/SKILL.md +269 -0
- package/plugins/pbr/skills/scan/templates/mapper-prompt.md.tmpl +201 -0
- package/plugins/pbr/skills/setup/SKILL.md +227 -0
- package/plugins/pbr/skills/shared/commit-planning-docs.md +35 -0
- package/plugins/pbr/skills/shared/config-loading.md +102 -0
- package/plugins/pbr/skills/shared/context-budget.md +40 -0
- package/plugins/pbr/skills/shared/context-loader-task.md +86 -0
- package/plugins/pbr/skills/shared/digest-select.md +79 -0
- package/plugins/pbr/skills/shared/domain-probes.md +125 -0
- package/plugins/pbr/skills/shared/error-reporting.md +79 -0
- package/plugins/pbr/skills/shared/gate-prompts.md +388 -0
- package/plugins/pbr/skills/shared/phase-argument-parsing.md +45 -0
- package/plugins/pbr/skills/shared/progress-display.md +53 -0
- package/plugins/pbr/skills/shared/revision-loop.md +81 -0
- package/plugins/pbr/skills/shared/state-loading.md +62 -0
- package/plugins/pbr/skills/shared/state-update.md +161 -0
- package/plugins/pbr/skills/shared/universal-anti-patterns.md +33 -0
- package/plugins/pbr/skills/status/SKILL.md +353 -0
- package/plugins/pbr/skills/todo/SKILL.md +181 -0
- package/plugins/pbr/templates/CONTEXT.md.tmpl +52 -0
- package/plugins/pbr/templates/INTEGRATION-REPORT.md.tmpl +151 -0
- package/plugins/pbr/templates/RESEARCH-SUMMARY.md.tmpl +97 -0
- package/plugins/pbr/templates/ROADMAP.md.tmpl +40 -0
- package/plugins/pbr/templates/SUMMARY.md.tmpl +81 -0
- package/plugins/pbr/templates/VERIFICATION-DETAIL.md.tmpl +116 -0
- package/plugins/pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
- package/plugins/pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
- package/plugins/pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
- package/plugins/pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
- package/plugins/pbr/templates/codebase/STACK.md.tmpl +78 -0
- package/plugins/pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
- package/plugins/pbr/templates/codebase/TESTING.md.tmpl +107 -0
- package/plugins/pbr/templates/continue-here.md.tmpl +73 -0
- package/plugins/pbr/templates/prompt-partials/phase-project-context.md.tmpl +37 -0
- package/plugins/pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
- package/plugins/pbr/templates/research/STACK.md.tmpl +71 -0
- package/plugins/pbr/templates/research/SUMMARY.md.tmpl +112 -0
- package/plugins/pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
- package/plugins/pbr/templates/research-outputs/project-research.md.tmpl +99 -0
- package/plugins/pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: resume
|
|
3
|
+
description: "Pick up where you left off. Restores context and suggests next action."
|
|
4
|
+
allowed-tools: Read, Write, Glob, Grep, AskUserQuestion
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /pbr:resume — Resume Previous Session
|
|
8
|
+
|
|
9
|
+
You are running the **resume** skill. Your job is to find the last pause point, restore context for the user, and suggest the next action so they can continue seamlessly.
|
|
10
|
+
|
|
11
|
+
This skill runs **inline** (no Task delegation).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Core Principle
|
|
16
|
+
|
|
17
|
+
**Get the user back to work in under 30 seconds.** Read the handoff, show what matters, and suggest the next command. Don't make them re-discover their own project state.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Resumption Priority Hierarchy
|
|
22
|
+
|
|
23
|
+
When resuming, scan for conditions in this priority order. Handle the HIGHEST priority item first:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
1. 🔴 UAT-BLOCKER (diagnosed) → Fix must come first
|
|
27
|
+
2. 🟡 Interrupted agent → Resume agent from checkpoint
|
|
28
|
+
3. 🟡 .continue-here checkpoint → Resume from checkpoint
|
|
29
|
+
4. 🟡 Incomplete plan → Complete plan execution
|
|
30
|
+
5. 🟢 Phase complete → Transition to next phase
|
|
31
|
+
6. 🟢 Ready to plan/execute → Normal workflow
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Scanning for Priority Items
|
|
35
|
+
|
|
36
|
+
Before presenting the standard resume view, check:
|
|
37
|
+
|
|
38
|
+
1. **UAT Blockers**: Search for VERIFICATION.md files with `status: gaps_found` in any phase. If found and gaps are marked as blocking, surface them first: "Phase {N} has {count} blocking verification gaps. These should be fixed before continuing."
|
|
39
|
+
|
|
40
|
+
2. **Interrupted Agents**: Check for `.checkpoint-manifest.json` files in phase directories with `checkpoints_pending` entries. These indicate a build was interrupted mid-checkpoint.
|
|
41
|
+
|
|
42
|
+
3. **Stale .continue-here.md**: If the file references commits that don't exist in git log, warn about state corruption.
|
|
43
|
+
|
|
44
|
+
### Auto-Reconcile STATE.md Against Filesystem
|
|
45
|
+
|
|
46
|
+
On every resume, reconcile STATE.md claims against filesystem reality. This catches both corruption and drift from interrupted operations.
|
|
47
|
+
|
|
48
|
+
**Step 1: Detect discrepancies** — Compare STATE.md values against the filesystem:
|
|
49
|
+
|
|
50
|
+
| STATE.md Claim | Filesystem Check |
|
|
51
|
+
|----------------|------------------|
|
|
52
|
+
| Phase number | Does `.planning/phases/{NN}-*/` exist? |
|
|
53
|
+
| Plan count | Count `*-PLAN.md` files in the phase directory |
|
|
54
|
+
| Completed plans | Count `SUMMARY.md` files in the phase directory |
|
|
55
|
+
| Status "verified" | Does `VERIFICATION.md` with `status: passed` exist? |
|
|
56
|
+
| Status "building" | Are there PLAN.md files without SUMMARY.md? |
|
|
57
|
+
| Progress percentage | Recalculate from completed phases / total phases |
|
|
58
|
+
|
|
59
|
+
**Step 2: Classify** — If any discrepancy found:
|
|
60
|
+
- **Obvious corruption** (duplicate headers, impossible percentages, phase directory missing): flag as corruption
|
|
61
|
+
- **Stale data** (plan count wrong, status outdated): flag as drift
|
|
62
|
+
|
|
63
|
+
**Step 3: Repair** —
|
|
64
|
+
- For **corruption**: Present repair and ask for confirmation: "STATE.md appears corrupted. Based on the file system, you're at Phase {N} with {M}/{T} plans complete. Should I repair STATE.md?"
|
|
65
|
+
- For **drift**: Auto-repair silently and note: "Updated STATE.md to match filesystem (plan count {old}→{new}, status {old}→{new})."
|
|
66
|
+
- Log all repairs to `.planning/logs/events.jsonl` with category `state-reconcile`
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Flow
|
|
71
|
+
|
|
72
|
+
### Step 1: Read STATE.md
|
|
73
|
+
|
|
74
|
+
Read `.planning/STATE.md` for the last known position.
|
|
75
|
+
|
|
76
|
+
**Extract:**
|
|
77
|
+
- Current phase and plan
|
|
78
|
+
- Session Continuity section (if exists):
|
|
79
|
+
- Last paused date
|
|
80
|
+
- Continue file location
|
|
81
|
+
- Suggested next action
|
|
82
|
+
|
|
83
|
+
**If STATE.md doesn't exist:**
|
|
84
|
+
- Go to **Recovery Flow** (Step 4)
|
|
85
|
+
|
|
86
|
+
### Step 2: Search for .continue-here.md Files
|
|
87
|
+
|
|
88
|
+
Search for `.continue-here.md` files across all phase directories:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
.planning/phases/**/.continue-here.md
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**If exactly one found:**
|
|
95
|
+
- This is the resume point. Go to **Normal Resume** (Step 3a).
|
|
96
|
+
|
|
97
|
+
**If multiple found:**
|
|
98
|
+
Use the **pause-point-select** pattern (see `skills/shared/gate-prompts.md`):
|
|
99
|
+
|
|
100
|
+
Use AskUserQuestion:
|
|
101
|
+
question: "Found multiple pause points. Which would you like to resume?"
|
|
102
|
+
header: "Resume"
|
|
103
|
+
options:
|
|
104
|
+
- label: "Phase {A}" description: "Paused {date}, {brief context}"
|
|
105
|
+
- label: "Phase {B}" description: "Paused {date}, {brief context}"
|
|
106
|
+
- label: "Phase {C}" description: "Paused {date}, {brief context}"
|
|
107
|
+
- label: "Phase {D}" description: "Paused {date}, {brief context}"
|
|
108
|
+
multiSelect: false
|
|
109
|
+
|
|
110
|
+
Build options dynamically from discovered `.continue-here.md` files. Include phase name and pause date in each option. If more than 4 pause points exist, show the 4 most recent and replace the last option with:
|
|
111
|
+
- label: "Show earlier" description: "See older pause points"
|
|
112
|
+
|
|
113
|
+
When "Show earlier" is selected, re-prompt with the next batch of 4.
|
|
114
|
+
|
|
115
|
+
Use the selected pause point for the rest of the resume flow.
|
|
116
|
+
|
|
117
|
+
**If none found:**
|
|
118
|
+
- Check STATE.md for position info
|
|
119
|
+
- If STATE.md has position: go to **Inferred Resume** (Step 3b)
|
|
120
|
+
- If STATE.md has no position: go to **Recovery Flow** (Step 4)
|
|
121
|
+
|
|
122
|
+
### Step 3a: Normal Resume (from .continue-here.md)
|
|
123
|
+
|
|
124
|
+
1. Read the `.continue-here.md` file completely
|
|
125
|
+
2. Parse all sections:
|
|
126
|
+
- Position (phase, plan, status)
|
|
127
|
+
- Completed work
|
|
128
|
+
- Remaining work
|
|
129
|
+
- Decisions
|
|
130
|
+
- Blockers
|
|
131
|
+
- Next steps
|
|
132
|
+
|
|
133
|
+
3. Display the resume context using the branded banner:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
137
|
+
PLAN-BUILD-RUN ► SESSION RESTORED ✓
|
|
138
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
139
|
+
|
|
140
|
+
Resuming session from {pause date}
|
|
141
|
+
|
|
142
|
+
Position: Phase {N} -- {name}
|
|
143
|
+
Plan: {M} of {total}
|
|
144
|
+
Status: {status}
|
|
145
|
+
|
|
146
|
+
Completed last session:
|
|
147
|
+
{bulleted list of completed work}
|
|
148
|
+
|
|
149
|
+
Remaining in this phase:
|
|
150
|
+
{bulleted list of remaining plans}
|
|
151
|
+
|
|
152
|
+
{If decisions were made:}
|
|
153
|
+
Key decisions:
|
|
154
|
+
{bulleted list of decisions}
|
|
155
|
+
|
|
156
|
+
{If blockers exist:}
|
|
157
|
+
Blockers:
|
|
158
|
+
{bulleted list of blockers}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
4. Validate the resume point:
|
|
162
|
+
- Check that the phase directory still exists
|
|
163
|
+
- Check that the plan files mentioned still exist
|
|
164
|
+
- Check git log to verify commits mentioned in completed work
|
|
165
|
+
- If anything is inconsistent, warn: "Some state has changed since the pause. {details}"
|
|
166
|
+
|
|
167
|
+
5. Present the next action from the continue-here file.
|
|
168
|
+
|
|
169
|
+
**If only one clear next action exists**, present it with branded routing:
|
|
170
|
+
```
|
|
171
|
+
───────────────────────────────────────────────────────────────
|
|
172
|
+
|
|
173
|
+
## ▶ Next Up
|
|
174
|
+
|
|
175
|
+
**{explanation from continue-here}**
|
|
176
|
+
|
|
177
|
+
`{suggested command}`
|
|
178
|
+
|
|
179
|
+
<sub>`/clear` first → fresh context window</sub>
|
|
180
|
+
|
|
181
|
+
───────────────────────────────────────────────────────────────
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**If multiple reasonable actions exist** (e.g., the continue-here suggests one thing but the filesystem state suggests another), use the **action-routing** pattern (see `skills/shared/gate-prompts.md`):
|
|
185
|
+
|
|
186
|
+
Use AskUserQuestion:
|
|
187
|
+
question: "How would you like to proceed?"
|
|
188
|
+
header: "Next Step"
|
|
189
|
+
options:
|
|
190
|
+
- label: "{continue-here suggestion}" description: "Resume from pause point"
|
|
191
|
+
- label: "{filesystem-inferred action}" description: "Based on current state"
|
|
192
|
+
- label: "Show status" description: "Run /pbr:status for full overview"
|
|
193
|
+
- label: "Something else" description: "Enter a different command"
|
|
194
|
+
multiSelect: false
|
|
195
|
+
|
|
196
|
+
**After user selects an option:**
|
|
197
|
+
- Display "Run: `/dev:{action} {args}`" so the user can execute it
|
|
198
|
+
- This skill does not auto-execute — it suggests and the user acts
|
|
199
|
+
|
|
200
|
+
6. Clean up:
|
|
201
|
+
- **DO NOT** delete the .continue-here.md file yet
|
|
202
|
+
- It will be naturally superseded when the next pause happens
|
|
203
|
+
- Or it can be manually removed after the user confirms they're back on track
|
|
204
|
+
|
|
205
|
+
### Step 3b: Inferred Resume (from STATE.md only)
|
|
206
|
+
|
|
207
|
+
When there's no .continue-here.md but STATE.md has position info:
|
|
208
|
+
|
|
209
|
+
1. Read STATE.md position
|
|
210
|
+
2. Scan the current phase directory for plan and summary files
|
|
211
|
+
3. Determine what's complete vs. remaining
|
|
212
|
+
4. Present a reduced resume context:
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
Resuming from STATE.md (no pause file found)
|
|
216
|
+
|
|
217
|
+
Position: Phase {N} -- {name}
|
|
218
|
+
Progress: {completed}/{total} plans complete
|
|
219
|
+
|
|
220
|
+
{Plans with summaries listed as complete}
|
|
221
|
+
{Plans without summaries listed as remaining}
|
|
222
|
+
|
|
223
|
+
Note: No detailed pause context available. Run `/pbr:status` for a full overview.
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
5. Suggest the next action based on phase state using the **action-routing** pattern:
|
|
227
|
+
|
|
228
|
+
Use AskUserQuestion:
|
|
229
|
+
question: "What would you like to do next?"
|
|
230
|
+
header: "Next Step"
|
|
231
|
+
options: (build dynamically from phase state)
|
|
232
|
+
- label: "/pbr:build {N}" description: "Continue building (plans remaining)"
|
|
233
|
+
- label: "/pbr:review {N}" description: "Review completed phase"
|
|
234
|
+
- label: "/pbr:plan {N} --gaps" description: "Fix verification gaps"
|
|
235
|
+
- label: "/pbr:plan {N+1}" description: "Plan the next phase"
|
|
236
|
+
multiSelect: false
|
|
237
|
+
|
|
238
|
+
Show only the options that apply to the current state (1-3 real options + "Something else").
|
|
239
|
+
|
|
240
|
+
### Step 4: Recovery Flow
|
|
241
|
+
|
|
242
|
+
When neither .continue-here.md nor STATE.md position data exists:
|
|
243
|
+
|
|
244
|
+
1. Check if `.planning/` directory exists at all
|
|
245
|
+
- If no, display:
|
|
246
|
+
```
|
|
247
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
248
|
+
║ ERROR ║
|
|
249
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
250
|
+
|
|
251
|
+
No Plan-Build-Run project found.
|
|
252
|
+
|
|
253
|
+
**To fix:** Run `/pbr:begin` to start a new project, or `/pbr:scan` to analyze an existing codebase.
|
|
254
|
+
```
|
|
255
|
+
- Stop here.
|
|
256
|
+
|
|
257
|
+
2. If `.planning/` exists, scan for any project state:
|
|
258
|
+
- Check for ROADMAP.md
|
|
259
|
+
- Check for any phase directories
|
|
260
|
+
- Check for any SUMMARY.md files
|
|
261
|
+
- Check for config.json
|
|
262
|
+
|
|
263
|
+
3. If some state exists:
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
Found a Plan-Build-Run project but no pause point.
|
|
267
|
+
|
|
268
|
+
Project has:
|
|
269
|
+
- {count} phases in ROADMAP.md
|
|
270
|
+
- {count} phase directories
|
|
271
|
+
- {count} completed plans (SUMMARY.md files)
|
|
272
|
+
|
|
273
|
+
Attempting to determine position...
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
4. Infer position:
|
|
277
|
+
- Find the last phase with SUMMARY.md files
|
|
278
|
+
- Check if all plans in that phase have summaries
|
|
279
|
+
- Determine the next action
|
|
280
|
+
|
|
281
|
+
5. Present recovery status:
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
Best guess for current position:
|
|
285
|
+
|
|
286
|
+
Phase {N}: {name}
|
|
287
|
+
- {X} of {Y} plans completed
|
|
288
|
+
- Last activity: {date from most recent SUMMARY.md or git log}
|
|
289
|
+
|
|
290
|
+
Suggested: Run `/pbr:status` for a full overview, then choose your next action.
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Resume Routing
|
|
296
|
+
|
|
297
|
+
After displaying context, route to the appropriate action:
|
|
298
|
+
|
|
299
|
+
| Situation | Suggested Action |
|
|
300
|
+
|-----------|-----------------|
|
|
301
|
+
| Mid-phase, plans remaining | `/pbr:build {N}` (executor will skip completed plans) |
|
|
302
|
+
| Phase complete, not reviewed | `/pbr:review {N}` |
|
|
303
|
+
| Phase reviewed, has gaps | `/pbr:plan {N} --gaps` |
|
|
304
|
+
| Phase complete and verified | `/pbr:plan {N+1}` |
|
|
305
|
+
| Between milestones | `/pbr:milestone new` |
|
|
306
|
+
| Active debug session | `/pbr:debug` (will offer to resume) |
|
|
307
|
+
| Pending todos exist | Mention: "Also {count} pending todos. `/pbr:todo list`" |
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## State Validation
|
|
312
|
+
|
|
313
|
+
When resuming, validate that the project state is consistent:
|
|
314
|
+
|
|
315
|
+
### Git State Check
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
git status --short
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
If there are uncommitted changes:
|
|
322
|
+
- Warn: "There are uncommitted changes in the working directory."
|
|
323
|
+
- List the changed files
|
|
324
|
+
- Suggest: "These may be from an interrupted build. Review them before continuing."
|
|
325
|
+
|
|
326
|
+
### Plan-Summary Consistency
|
|
327
|
+
|
|
328
|
+
For each plan file in the current phase:
|
|
329
|
+
- Check if SUMMARY.md exists
|
|
330
|
+
- If SUMMARY.md exists, check its status field
|
|
331
|
+
- If status is `partial` or `failed`, warn
|
|
332
|
+
|
|
333
|
+
### Continuation Context Freshness
|
|
334
|
+
|
|
335
|
+
If .continue-here.md is more than 7 days old:
|
|
336
|
+
- Warn: "This pause point is {N} days old. The codebase may have changed."
|
|
337
|
+
- Suggest: "Run `/pbr:status` to verify the current state before continuing."
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## Edge Cases
|
|
342
|
+
|
|
343
|
+
### .continue-here.md references deleted files
|
|
344
|
+
- Warn about each missing file
|
|
345
|
+
- Attempt to find equivalent files (renamed, moved)
|
|
346
|
+
- If phase directory is gone: "Phase {N} directory was removed. This pause point is invalid."
|
|
347
|
+
- Suggest `/pbr:status` for recovery
|
|
348
|
+
|
|
349
|
+
### Git history doesn't match .continue-here.md
|
|
350
|
+
- Commits referenced in the handoff may have been rebased, amended, or rolled back
|
|
351
|
+
- Warn: "Some commits referenced in the pause file couldn't be found in git history."
|
|
352
|
+
- Don't treat this as fatal — the file system state matters more than commit hashes
|
|
353
|
+
|
|
354
|
+
### User made changes between sessions (outside Plan-Build-Run)
|
|
355
|
+
- The user may have manually edited files, committed changes, or modified configs
|
|
356
|
+
- These changes won't be reflected in .continue-here.md
|
|
357
|
+
- Check git log for commits not referenced in the handoff
|
|
358
|
+
- If found: "Found {N} commits since the last pause that aren't tracked in the handoff."
|
|
359
|
+
|
|
360
|
+
### Multiple users / branches
|
|
361
|
+
- If git branch has changed since the pause:
|
|
362
|
+
- Warn: "You're on branch `{current}` but the pause was on `{paused-branch}`."
|
|
363
|
+
- Suggest switching branches or starting fresh
|
|
364
|
+
|
|
365
|
+
### Empty project (just initialized)
|
|
366
|
+
- If `.planning/` exists but only has config.json, display:
|
|
367
|
+
```
|
|
368
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
369
|
+
║ ERROR ║
|
|
370
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
371
|
+
|
|
372
|
+
Project was initialized but no work has been done.
|
|
373
|
+
|
|
374
|
+
**To fix:** Run `/pbr:plan 1` to start planning, or `/pbr:discuss 1` to talk through the first phase.
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Anti-Patterns
|
|
380
|
+
|
|
381
|
+
1. **DO NOT** auto-execute the suggested next action — just suggest it
|
|
382
|
+
2. **DO NOT** delete .continue-here.md during resume — let the next pause overwrite it
|
|
383
|
+
3. **DO NOT** modify any project files — resume is read-only (except cleaning up stale state)
|
|
384
|
+
4. **DO NOT** assume .continue-here.md is accurate — always validate against the file system
|
|
385
|
+
5. **DO NOT** show overwhelming amounts of detail — focus on actionable information
|
|
386
|
+
6. **DO NOT** ignore inconsistencies — surface them as warnings
|
|
387
|
+
7. **DO NOT** skip the git state check — uncommitted changes are important to surface
|
|
388
|
+
8. **DO NOT** suggest multiple actions without clear priority — one primary suggestion
|