context-planning 0.7.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/LICENSE +21 -0
- package/README.md +454 -0
- package/bin/commands/_helpers.js +53 -0
- package/bin/commands/_usage.js +67 -0
- package/bin/commands/capture.js +46 -0
- package/bin/commands/codebase-status.js +41 -0
- package/bin/commands/complete-milestone.js +57 -0
- package/bin/commands/config.js +70 -0
- package/bin/commands/doctor.js +139 -0
- package/bin/commands/gsd-import.js +90 -0
- package/bin/commands/inbox.js +81 -0
- package/bin/commands/index.js +33 -0
- package/bin/commands/init.js +87 -0
- package/bin/commands/install.js +43 -0
- package/bin/commands/scaffold-codebase.js +53 -0
- package/bin/commands/scaffold-milestone.js +58 -0
- package/bin/commands/scaffold-phase.js +65 -0
- package/bin/commands/status.js +42 -0
- package/bin/commands/statusline.js +108 -0
- package/bin/commands/tick.js +49 -0
- package/bin/commands/version.js +9 -0
- package/bin/commands/worktree.js +218 -0
- package/bin/commands/write-summary.js +54 -0
- package/bin/cp.cmd +2 -0
- package/bin/cp.js +54 -0
- package/commands/cp/capture.md +107 -0
- package/commands/cp/complete-milestone.md +166 -0
- package/commands/cp/execute-phase.md +220 -0
- package/commands/cp/map-codebase.md +211 -0
- package/commands/cp/new-milestone.md +136 -0
- package/commands/cp/new-project.md +132 -0
- package/commands/cp/plan-phase.md +195 -0
- package/commands/cp/progress.md +147 -0
- package/commands/cp/quick.md +104 -0
- package/commands/cp/resume.md +125 -0
- package/commands/cp/write-summary.md +33 -0
- package/docs/MIGRATION-v0.5.md +140 -0
- package/docs/architecture.md +189 -0
- package/docs/superpowers/plans/2026-05-20-v0-7-plan-16-01-design-md-infrastructure.md +1064 -0
- package/docs/superpowers/plans/2026-05-20-v0-7-plan-16-02-review-log-infrastructure.md +418 -0
- package/docs/superpowers/plans/2026-05-20-v0-7-plan-16-03-key-decisions-hard-block.md +295 -0
- package/docs/superpowers/specs/2026-05-20-generic-provider-harness-detection-design.md +380 -0
- package/docs/superpowers/specs/2026-05-20-v0-7-design-capture-design.md +400 -0
- package/docs/writing-providers.md +76 -0
- package/install/aider.js +204 -0
- package/install/claude.js +116 -0
- package/install/common.js +65 -0
- package/install/copilot.js +86 -0
- package/install/cursor.js +120 -0
- package/install/echo-provider.js +50 -0
- package/lib/codebase-mapper.js +169 -0
- package/lib/detect.js +280 -0
- package/lib/frontmatter.js +72 -0
- package/lib/gsd-compat.js +165 -0
- package/lib/import.js +543 -0
- package/lib/inbox.js +226 -0
- package/lib/lifecycle.js +929 -0
- package/lib/merge.js +157 -0
- package/lib/milestone.js +595 -0
- package/lib/paths.js +191 -0
- package/lib/provider.js +168 -0
- package/lib/roadmap.js +134 -0
- package/lib/state.js +99 -0
- package/lib/worktree.js +253 -0
- package/package.json +45 -0
- package/templates/DESIGN.md +78 -0
- package/templates/INBOX.md +13 -0
- package/templates/MILESTONE-CONTEXT.md +40 -0
- package/templates/MILESTONES.md +29 -0
- package/templates/PLAN.md +84 -0
- package/templates/PROJECT.md +43 -0
- package/templates/REVIEW-LOG.md +38 -0
- package/templates/ROADMAP.md +34 -0
- package/templates/STATE.md +78 -0
- package/templates/SUMMARY.md +75 -0
- package/templates/codebase/ARCHITECTURE.md +30 -0
- package/templates/codebase/CONCERNS.md +30 -0
- package/templates/codebase/CONVENTIONS.md +30 -0
- package/templates/codebase/INTEGRATIONS.md +30 -0
- package/templates/codebase/STACK.md +26 -0
- package/templates/codebase/STRUCTURE.md +32 -0
- package/templates/codebase/TESTING.md +39 -0
- package/templates/config.json +173 -0
- package/templates/phase-PLAN.md +32 -0
- package/templates/quick-PLAN.md +24 -0
- package/templates/quick-SUMMARY.md +25 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
---
|
|
2
|
+
phase: 16-design-capture-infrastructure
|
|
3
|
+
plan: "02"
|
|
4
|
+
type: execute
|
|
5
|
+
wave: 2
|
|
6
|
+
depends_on: ["16-01"]
|
|
7
|
+
files_modified:
|
|
8
|
+
- templates/REVIEW-LOG.md
|
|
9
|
+
- lib/paths.js
|
|
10
|
+
- lib/lifecycle.js
|
|
11
|
+
- lib/milestone.js
|
|
12
|
+
- test/unit-design.js
|
|
13
|
+
- commands/cp/execute-phase.md
|
|
14
|
+
autonomous: true
|
|
15
|
+
requirements: []
|
|
16
|
+
user_setup: []
|
|
17
|
+
must_haves:
|
|
18
|
+
truths:
|
|
19
|
+
- "scaffold-phase emits REVIEW-LOG.md alongside PLAN.md and DESIGN.md"
|
|
20
|
+
- "aggregateSummaries surfaces reviewLogRefs[] and reviewCount"
|
|
21
|
+
- "cp-execute-phase skill instructs orchestrator to append review entries"
|
|
22
|
+
artifacts:
|
|
23
|
+
- "templates/REVIEW-LOG.md exists with append-friendly schema"
|
|
24
|
+
- "test/unit-design.js extended with review-log assertions; passes"
|
|
25
|
+
- "npm test all green"
|
|
26
|
+
key_links:
|
|
27
|
+
- "docs/superpowers/specs/2026-05-20-v0-7-design-capture-design.md"
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
<objective>
|
|
31
|
+
Plan 16-02: REVIEW-LOG.md Infrastructure (Phase 16, milestone v0.7 Design Capture).
|
|
32
|
+
|
|
33
|
+
Purpose: Persist the SP subagent-driven-development review chain (rejection
|
|
34
|
+
history, code-quality feedback that drove the final implementation) per
|
|
35
|
+
phase. Append-only `.planning/phases/NN-slug/REVIEW-LOG.md`. The
|
|
36
|
+
cp-execute-phase skill INSTRUCTS the SP orchestrator to append entries
|
|
37
|
+
(skill-level instruction, not code — no upstream SP changes).
|
|
38
|
+
</objective>
|
|
39
|
+
|
|
40
|
+
<execution_context>
|
|
41
|
+
@.planning/config.json
|
|
42
|
+
</execution_context>
|
|
43
|
+
|
|
44
|
+
<context>
|
|
45
|
+
@.planning/PROJECT.md
|
|
46
|
+
@.planning/ROADMAP.md
|
|
47
|
+
@docs/superpowers/specs/2026-05-20-v0-7-design-capture-design.md
|
|
48
|
+
@.planning/phases/16-design-capture-infrastructure/DESIGN.md
|
|
49
|
+
</context>
|
|
50
|
+
|
|
51
|
+
<tasks>
|
|
52
|
+
|
|
53
|
+
# Implementation Plan — Bite-Sized Tasks
|
|
54
|
+
|
|
55
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: superpowers:subagent-driven-development.
|
|
56
|
+
|
|
57
|
+
## File Structure
|
|
58
|
+
|
|
59
|
+
| File | Action | Responsibility |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| `templates/REVIEW-LOG.md` | Create | Append-only template (header + empty entries section) |
|
|
62
|
+
| `lib/paths.js` | Modify | Add `reviewLogFile(phase, root)` helper + export |
|
|
63
|
+
| `lib/lifecycle.js` | Modify | Extend `scaffoldPhase` to emit REVIEW-LOG.md as 4th action |
|
|
64
|
+
| `lib/milestone.js` | Modify | Extend `aggregateSummaries` with `reviewLogRefs[]` and `reviewCount` (entry tally) |
|
|
65
|
+
| `test/unit-design.js` | Modify | Append 4 new test sections (template, helper, scaffold, aggregator) |
|
|
66
|
+
| `commands/cp/execute-phase.md` | Modify | Insert new "Step 4.5 — Append to REVIEW-LOG.md" between review and commit steps |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Task 1: Create templates/REVIEW-LOG.md
|
|
71
|
+
|
|
72
|
+
**Files:**
|
|
73
|
+
- Create: `templates/REVIEW-LOG.md`
|
|
74
|
+
|
|
75
|
+
- [ ] **Step 1: Write the template file**
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
---
|
|
79
|
+
phase: "{{PHASE_NUM}}"
|
|
80
|
+
milestone: {{MILESTONE_NAME}}
|
|
81
|
+
created: {{DATE}}
|
|
82
|
+
schema_version: 1
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
# Review Log: Phase {{PHASE_NUM}} — {{TITLE}}
|
|
86
|
+
|
|
87
|
+
Append-only log of subagent review cycles during execution. Each entry is
|
|
88
|
+
written by the cp-execute-phase orchestrator after a review round
|
|
89
|
+
(spec-compliance or code-quality). The cp aggregator counts entries when
|
|
90
|
+
rolling up the milestone summary.
|
|
91
|
+
|
|
92
|
+
## How to append
|
|
93
|
+
|
|
94
|
+
The orchestrator (cp-execute-phase Step 4.5) appends a block per review:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
## YYYY-MM-DD HH:MM — Plan NN-MM Task N — <reviewer-role>
|
|
98
|
+
|
|
99
|
+
**Verdict:** approved | rejected | needs-revision
|
|
100
|
+
|
|
101
|
+
**Findings:**
|
|
102
|
+
|
|
103
|
+
- <finding>
|
|
104
|
+
|
|
105
|
+
**Resolution:**
|
|
106
|
+
|
|
107
|
+
<what changed; commit SHA if applied>
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Entries
|
|
113
|
+
|
|
114
|
+
<!-- orchestrator appends below this marker; do not delete the marker -->
|
|
115
|
+
<!-- REVIEW-LOG-ENTRIES-BELOW -->
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
- [ ] **Step 2: Verify**
|
|
119
|
+
|
|
120
|
+
Run: `node -e "const fs=require('fs');const t=fs.readFileSync('templates/REVIEW-LOG.md','utf8');if(!t.includes('{{PHASE_NUM}}')||!t.includes('REVIEW-LOG-ENTRIES-BELOW')){console.error('missing markers');process.exit(1);}console.log('OK');"`
|
|
121
|
+
|
|
122
|
+
Expected: `OK`
|
|
123
|
+
|
|
124
|
+
- [ ] **Step 3: Commit**
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
git add templates/REVIEW-LOG.md
|
|
128
|
+
git commit -m "cp(16-02): add templates/REVIEW-LOG.md (append-only review log)
|
|
129
|
+
|
|
130
|
+
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Task 2: Add reviewLogFile helper in lib/paths.js
|
|
136
|
+
|
|
137
|
+
**Files:**
|
|
138
|
+
- Modify: `lib/paths.js`
|
|
139
|
+
|
|
140
|
+
- [ ] **Step 1: Add the helper after `designFile`**
|
|
141
|
+
|
|
142
|
+
```javascript
|
|
143
|
+
/** Full path to a phase REVIEW-LOG.md file. Returns null if no phase dir. */
|
|
144
|
+
function reviewLogFile(phaseNumOrSlug, root = repoRoot()) {
|
|
145
|
+
const dir = findPhaseDir(phaseNumOrSlug, root);
|
|
146
|
+
if (!dir) return null;
|
|
147
|
+
return path.join(dir, 'REVIEW-LOG.md');
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- [ ] **Step 2: Add `reviewLogFile` to `module.exports`** (after `designFile`).
|
|
152
|
+
|
|
153
|
+
- [ ] **Step 3: Smoke**
|
|
154
|
+
|
|
155
|
+
Run: `node -e "const p=require('./lib/paths');console.log(typeof p.reviewLogFile);"`
|
|
156
|
+
|
|
157
|
+
Expected: `function`
|
|
158
|
+
|
|
159
|
+
- [ ] **Step 4: Commit**
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
git add lib/paths.js
|
|
163
|
+
git commit -m "cp(16-02): add reviewLogFile helper
|
|
164
|
+
|
|
165
|
+
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Task 3: Extend scaffoldPhase to write REVIEW-LOG.md
|
|
171
|
+
|
|
172
|
+
**Files:**
|
|
173
|
+
- Modify: `lib/lifecycle.js` (function `scaffoldPhase`)
|
|
174
|
+
- Modify: `test/unit-design.js` (append test section)
|
|
175
|
+
|
|
176
|
+
- [ ] **Step 1: Failing test** — append to `test/unit-design.js` before cleanup loop:
|
|
177
|
+
|
|
178
|
+
```javascript
|
|
179
|
+
section('lib/lifecycle: scaffoldPhase emits REVIEW-LOG.md');
|
|
180
|
+
{
|
|
181
|
+
const lifecycle = require('../lib/lifecycle');
|
|
182
|
+
const root = mktmp('scaffold-review');
|
|
183
|
+
fs.mkdirSync(path.join(root, '.planning'), { recursive: true });
|
|
184
|
+
fs.writeFileSync(path.join(root, '.planning', 'ROADMAP.md'),
|
|
185
|
+
'# Roadmap\n\n## Phases\n\n### 🚧 Test Milestone (In Progress)\n');
|
|
186
|
+
const r = lifecycle.scaffoldPhase(root, '98', { name: 'review test', plans: 1 });
|
|
187
|
+
ok('scaffoldPhase ok', r.ok === true);
|
|
188
|
+
const reviewPath = path.join(r.phaseDir, 'REVIEW-LOG.md');
|
|
189
|
+
ok('REVIEW-LOG.md exists', fs.existsSync(reviewPath));
|
|
190
|
+
const rl = fs.readFileSync(reviewPath, 'utf8');
|
|
191
|
+
ok('REVIEW-LOG has phase frontmatter', /^phase:\s*"98"\s*$/m.test(rl));
|
|
192
|
+
ok('REVIEW-LOG has entries marker', rl.includes('REVIEW-LOG-ENTRIES-BELOW'));
|
|
193
|
+
ok('REVIEW-LOG no placeholders', !rl.includes('{{') && !rl.includes('}}'));
|
|
194
|
+
const wrote = r.actions.find((a) => a.path === reviewPath);
|
|
195
|
+
ok('actions include REVIEW-LOG.md write', !!wrote && wrote.kind === 'write');
|
|
196
|
+
ok('scaffoldPhase now emits 4 actions', r.actions.length === 4);
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
- [ ] **Step 2: Run** — `node test/unit-design.js` — expect new section to fail.
|
|
201
|
+
|
|
202
|
+
- [ ] **Step 3: Implement** — In `lib/lifecycle.js` `scaffoldPhase`, after the DESIGN.md render block (added in 16-01), add a parallel REVIEW-LOG.md render and push a 4th action:
|
|
203
|
+
|
|
204
|
+
```javascript
|
|
205
|
+
const reviewLogPath = path.join(phaseDirPath, 'REVIEW-LOG.md');
|
|
206
|
+
const reviewTemplate = paths.readTemplate('REVIEW-LOG.md');
|
|
207
|
+
const reviewRendered = reviewTemplate
|
|
208
|
+
.replace(/\{\{PHASE_NUM\}\}/g, numStr)
|
|
209
|
+
.replace(/\{\{MILESTONE_NAME\}\}/g, activeName)
|
|
210
|
+
.replace(/\{\{TITLE\}\}/g, cleanName)
|
|
211
|
+
.replace(/\{\{DATE\}\}/g, todayStr);
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Then add a 4th action entry to the `actions` array:
|
|
215
|
+
```javascript
|
|
216
|
+
{ path: reviewLogPath, before: null, after: reviewRendered, kind: 'write' },
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Adapt variable names (`numStr`, `activeName`, `cleanName`, `todayStr`) to whatever scaffoldPhase already uses locally.
|
|
220
|
+
|
|
221
|
+
- [ ] **Step 4: Run test** — `node test/unit-design.js` — expect all pass (44+ assertions).
|
|
222
|
+
|
|
223
|
+
- [ ] **Step 5: Full suite** — `npm test` — all 20 files `Failed: 0`. If `test/unit-lifecycle.js` asserts a specific action count (currently 3), update it to 4.
|
|
224
|
+
|
|
225
|
+
- [ ] **Step 6: Commit**
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
git add lib/lifecycle.js test/unit-design.js test/unit-lifecycle.js
|
|
229
|
+
git commit -m "cp(16-02): scaffoldPhase emits REVIEW-LOG.md (4th action)
|
|
230
|
+
|
|
231
|
+
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Task 4: Aggregator surfaces reviewLogRefs[] and reviewCount
|
|
237
|
+
|
|
238
|
+
**Files:**
|
|
239
|
+
- Modify: `lib/milestone.js` (function `aggregateSummaries`)
|
|
240
|
+
- Modify: `test/unit-design.js`
|
|
241
|
+
|
|
242
|
+
- [ ] **Step 1: Failing test** — append to `test/unit-design.js`:
|
|
243
|
+
|
|
244
|
+
```javascript
|
|
245
|
+
section('lib/milestone: aggregateSummaries surfaces reviewLogRefs[] + reviewCount');
|
|
246
|
+
{
|
|
247
|
+
const milestone = require('../lib/milestone');
|
|
248
|
+
const root = mktmp('agg-review');
|
|
249
|
+
const phasePath = path.join(root, '.planning', 'phases', '20-test');
|
|
250
|
+
fs.mkdirSync(phasePath, { recursive: true });
|
|
251
|
+
fs.writeFileSync(path.join(phasePath, 'REVIEW-LOG.md'),
|
|
252
|
+
'---\nphase: "20"\n---\n# Review Log\n\n<!-- REVIEW-LOG-ENTRIES-BELOW -->\n\n## 2026-05-20 — Plan 20-01 Task 1 — code-quality\n\n**Verdict:** approved\n\n---\n\n## 2026-05-20 — Plan 20-01 Task 2 — spec-compliance\n\n**Verdict:** rejected\n\n---\n');
|
|
253
|
+
const summaries = [{ phase: '20', plan: '01', phasePath, data: {} }];
|
|
254
|
+
const agg = milestone.aggregateSummaries(summaries);
|
|
255
|
+
ok('reviewLogRefs key exists', Array.isArray(agg.reviewLogRefs));
|
|
256
|
+
ok('reviewLogRefs has 1 entry (deduped by phase)', agg.reviewLogRefs.length === 1);
|
|
257
|
+
ok('reviewCount tallies all entries across phases', agg.reviewCount === 2);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
section('lib/milestone: aggregateSummaries empty review counts');
|
|
261
|
+
{
|
|
262
|
+
const milestone = require('../lib/milestone');
|
|
263
|
+
const root = mktmp('agg-noreview');
|
|
264
|
+
const phasePath = path.join(root, '.planning', 'phases', '21-norl');
|
|
265
|
+
fs.mkdirSync(phasePath, { recursive: true });
|
|
266
|
+
const summaries = [{ phase: '21', plan: '01', phasePath, data: {} }];
|
|
267
|
+
const agg = milestone.aggregateSummaries(summaries);
|
|
268
|
+
ok('reviewLogRefs empty', agg.reviewLogRefs.length === 0);
|
|
269
|
+
ok('reviewCount zero', agg.reviewCount === 0);
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
- [ ] **Step 2: Run** — `node test/unit-design.js` — expect fail.
|
|
274
|
+
|
|
275
|
+
- [ ] **Step 3: Implement** — In `lib/milestone.js` `aggregateSummaries`, after the existing `phaseDesignRefs` loop (added in 16-01), add:
|
|
276
|
+
|
|
277
|
+
```javascript
|
|
278
|
+
const _reviewSeen = new Set();
|
|
279
|
+
const reviewLogRefs = [];
|
|
280
|
+
let reviewCount = 0;
|
|
281
|
+
for (const s of summaries) {
|
|
282
|
+
if (!s) continue;
|
|
283
|
+
const phasePath = s.phasePath || s.phaseDir || s.path || null;
|
|
284
|
+
if (!phasePath) continue;
|
|
285
|
+
if (_reviewSeen.has(s.phase)) continue;
|
|
286
|
+
const rlPath = path.join(phasePath, 'REVIEW-LOG.md');
|
|
287
|
+
if (fs.existsSync(rlPath)) {
|
|
288
|
+
_reviewSeen.add(s.phase);
|
|
289
|
+
reviewLogRefs.push({ phase: s.phase, path: rlPath });
|
|
290
|
+
const body = fs.readFileSync(rlPath, 'utf8');
|
|
291
|
+
const matches = body.match(/^##\s+\d{4}-\d{2}-\d{2}/gm);
|
|
292
|
+
reviewCount += matches ? matches.length : 0;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Add `reviewLogRefs` and `reviewCount` to the return object.
|
|
298
|
+
|
|
299
|
+
- [ ] **Step 4: Test** — `node test/unit-design.js` — expect all pass.
|
|
300
|
+
|
|
301
|
+
- [ ] **Step 5: Full suite** — `npm test` — all green.
|
|
302
|
+
|
|
303
|
+
- [ ] **Step 6: Commit**
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
git add lib/milestone.js test/unit-design.js
|
|
307
|
+
git commit -m "cp(16-02): aggregateSummaries surfaces reviewLogRefs[] and reviewCount
|
|
308
|
+
|
|
309
|
+
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Task 5: Update cp-execute-phase skill with Step 4.5
|
|
315
|
+
|
|
316
|
+
**Files:**
|
|
317
|
+
- Modify: `commands/cp/execute-phase.md`
|
|
318
|
+
|
|
319
|
+
- [ ] **Step 1: Read the current skill** — find the steps that delegate to SP and the step that commits/closes. Identify where the orchestrator returns from a SP review cycle.
|
|
320
|
+
|
|
321
|
+
- [ ] **Step 2: Insert a new "Step 4.5 — Append to REVIEW-LOG.md" block** between the review step and the next step. Content:
|
|
322
|
+
|
|
323
|
+
```markdown
|
|
324
|
+
## Step 4.5 — Append to REVIEW-LOG.md (v0.7)
|
|
325
|
+
|
|
326
|
+
After EACH review cycle returned by SP `subagent-driven-development`
|
|
327
|
+
(spec-compliance OR code-quality), append one block to
|
|
328
|
+
`.planning/phases/{phase-dir}/REVIEW-LOG.md` BEFORE the
|
|
329
|
+
`<!-- REVIEW-LOG-ENTRIES-BELOW -->` marker is irrelevant — APPEND after
|
|
330
|
+
the marker:
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
## {{DATE}} {{TIME}} — Plan {{PLAN-ID}} Task {{TASK-N}} — {{REVIEWER-ROLE}}
|
|
334
|
+
|
|
335
|
+
**Verdict:** {approved | rejected | needs-revision}
|
|
336
|
+
|
|
337
|
+
**Findings:**
|
|
338
|
+
|
|
339
|
+
- {bullet list of substantive findings}
|
|
340
|
+
|
|
341
|
+
**Resolution:**
|
|
342
|
+
|
|
343
|
+
{what changed; commit SHA if applied; "N/A — accepted on first pass" allowed}
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Skip empty findings on clean approvals (use "Resolution: approved on
|
|
349
|
+
first pass" and omit findings bullet list).
|
|
350
|
+
|
|
351
|
+
If the file does not exist (older milestones), create it from
|
|
352
|
+
`templates/REVIEW-LOG.md` with substituted frontmatter first.
|
|
353
|
+
|
|
354
|
+
The cp aggregator counts these entries (via `aggregateSummaries`
|
|
355
|
+
`reviewCount`) when rolling up the milestone summary.
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Place this BEFORE the existing commit/close step.
|
|
359
|
+
|
|
360
|
+
- [ ] **Step 3: Sanity-check** — `node -e "const f=require('fs').readFileSync('commands/cp/execute-phase.md','utf8');if(!f.includes('## Step 4.5')||!f.includes('REVIEW-LOG.md')){console.error('missing');process.exit(1);}console.log('OK');"` — expect `OK`.
|
|
361
|
+
|
|
362
|
+
- [ ] **Step 4: Sync to .github/skills/** — Run `node bin/cp.js install copilot --force` (or manually copy `commands/cp/execute-phase.md` into `.github/skills/cp-execute-phase/SKILL.md` if install refuses).
|
|
363
|
+
|
|
364
|
+
- [ ] **Step 5: Commit**
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
git add commands/cp/execute-phase.md
|
|
368
|
+
git commit -m "cp(16-02): add cp-execute-phase Step 4.5 — append to REVIEW-LOG.md
|
|
369
|
+
|
|
370
|
+
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Task 6: Coverage gate + final verification
|
|
376
|
+
|
|
377
|
+
- [ ] **Step 1:** `npm run coverage:ci` — exit 0; lines ≥85, branches ≥75.
|
|
378
|
+
|
|
379
|
+
- [ ] **Step 2:** `node bin/cp.js scaffold-phase 99 --name smoke --dry-run` — output lists 4 actions (ROADMAP, PLAN, DESIGN, REVIEW-LOG).
|
|
380
|
+
|
|
381
|
+
- [ ] **Step 3:** Dogfood backfill — for phase 16, create REVIEW-LOG.md from template (note: append-only, will be empty until orchestrator records reviews going forward).
|
|
382
|
+
|
|
383
|
+
Add to `scripts/backfill-v07-design.js` (or new `scripts/backfill-v07-review-log.js`):
|
|
384
|
+
|
|
385
|
+
```javascript
|
|
386
|
+
const reviewPath = path.join(root, '.planning', 'phases', '16-design-capture-infrastructure', 'REVIEW-LOG.md');
|
|
387
|
+
const tplR = paths.readTemplate('REVIEW-LOG.md');
|
|
388
|
+
const rendered = tplR
|
|
389
|
+
.replace(/\{\{PHASE_NUM\}\}/g, '16')
|
|
390
|
+
.replace(/\{\{MILESTONE_NAME\}\}/g, 'v0.7 Design Capture')
|
|
391
|
+
.replace(/\{\{TITLE\}\}/g, 'design capture infrastructure')
|
|
392
|
+
.replace(/\{\{DATE\}\}/g, today);
|
|
393
|
+
if (!fs.existsSync(reviewPath)) fs.writeFileSync(reviewPath, rendered);
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
Run and verify file appears under `.planning/phases/16-.../REVIEW-LOG.md`.
|
|
397
|
+
|
|
398
|
+
</tasks>
|
|
399
|
+
|
|
400
|
+
<verification>
|
|
401
|
+
- [ ] `npm test` — all 20 files `Failed: 0`
|
|
402
|
+
- [ ] `npm run coverage:ci` — ≥85L / ≥75B
|
|
403
|
+
- [ ] `node bin/cp.js scaffold-phase --dry-run` shows REVIEW-LOG.md in 4 actions
|
|
404
|
+
- [ ] `commands/cp/execute-phase.md` contains "## Step 4.5"
|
|
405
|
+
</verification>
|
|
406
|
+
|
|
407
|
+
<success_criteria>
|
|
408
|
+
- templates/REVIEW-LOG.md exists with append-friendly schema and marker
|
|
409
|
+
- lib/paths exports reviewLogFile
|
|
410
|
+
- scaffoldPhase emits 4th action (REVIEW-LOG.md write)
|
|
411
|
+
- aggregateSummaries returns reviewLogRefs[] (deduped) and reviewCount (entry tally)
|
|
412
|
+
- cp-execute-phase skill has Step 4.5 instructing orchestrator to append
|
|
413
|
+
- Plan 16-03 unblocked (writeSummary validation is the last piece for v0.7)
|
|
414
|
+
</success_criteria>
|
|
415
|
+
|
|
416
|
+
<output>
|
|
417
|
+
After completion: `cp write-summary 16-02 --from <json>` → `.planning/phases/16-design-capture-infrastructure/16-02-SUMMARY.md`.
|
|
418
|
+
</output>
|