@claude-pw/framework 0.10.0 → 0.11.1

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/README.es.md CHANGED
@@ -54,12 +54,13 @@ npx @claude-pw/framework --update
54
54
  ## Cómo funciona
55
55
 
56
56
  ```
57
- /cpw-startup → /cpw-discuss → /cpw-next-step (repetir hasta terminar)
57
+ /cpw-startup → /cpw-next-step (repetir) plan completo → /cpw-startup (nuevo ciclo)
58
58
  ```
59
59
 
60
- 1. **`/cpw-startup`** te entrevista, escanea código existente (si hay), y genera un plan con fases, pasos y docs de arquitectura
60
+ 1. **`/cpw-startup`** te entrevista, escanea código existente (si hay), y genera un plan con fases, pasos y docs de arquitectura. En ciclos posteriores, carga el contexto previo y agrega nuevas fases.
61
61
  2. **`/cpw-discuss`** identifica zonas grises y captura tus preferencias antes de construir (opcional, por fase)
62
62
  3. **`/cpw-next-step`** ejecuta un pipeline adaptativo por paso — luego cierra, commitea y avanza automáticamente
63
+ 4. Cuando todas las fases se completan, **`/cpw-cleanup --complete`** se ejecuta automáticamente: genera un resumen del plan, revisa docs, archiva todas las fases, resetea el estado de ejecución y deja el proyecto listo para el siguiente `/cpw-startup`
63
64
 
64
65
  Cada paso pasa por:
65
66
 
@@ -137,6 +138,7 @@ Issue capturado. ¿Arreglar ahora? (sí/no)
137
138
  | `/cpw-todos` | Captura ideas para después o revisa todos pendientes |
138
139
  | `/cpw-reflect` | Revisa correcciones capturadas, convierte en learnings (`--scan-history`, `--dedupe`) |
139
140
  | `/cpw-impact` | Analiza impacto de decisiones en todo el plan |
141
+ | `/cpw-cleanup` | Archiva fases completadas y limpia estado (`--complete` para reset completo del plan) |
140
142
  | `/cpw-update` | Actualización inteligente del framework — diff, merge de conflictos, preserva customizaciones |
141
143
 
142
144
  ## Configuración
package/README.ja.md CHANGED
@@ -54,12 +54,13 @@ npx @claude-pw/framework --update
54
54
  ## 仕組み
55
55
 
56
56
  ```
57
- /cpw-startup → /cpw-discuss → /cpw-next-step(完了まで繰り返し)
57
+ /cpw-startup → /cpw-next-step(繰り返し)→ 計画完了 → /cpw-startup(新サイクル)
58
58
  ```
59
59
 
60
- 1. **`/cpw-startup`** インタビューを行い、既存コード(あれば)をスキャンし、フェーズ・ステップ・アーキテクチャドキュメントを含む計画を生成
60
+ 1. **`/cpw-startup`** インタビューを行い、既存コード(あれば)をスキャンし、フェーズ・ステップ・アーキテクチャドキュメントを含む計画を生成。後続サイクルでは、以前のコンテキストを読み込み、新しいフェーズを追加。
61
61
  2. **`/cpw-discuss`** グレーゾーンを特定し、ビルド前にあなたの好みを把握(任意、フェーズごと)
62
62
  3. **`/cpw-next-step`** ステップごとに適応型パイプラインを実行 — 完了後、自動的にクローズ・コミット・次へ進行
63
+ 4. 全フェーズ完了時、**`/cpw-cleanup --complete`** が自動実行:計画サマリー生成、ドキュメントレビュー、全フェーズアーカイブ、実行状態リセット、次の `/cpw-startup` に備える
63
64
 
64
65
  各ステップは以下を経由します:
65
66
 
@@ -137,6 +138,7 @@ Issue captured. Fix now? (yes/no)
137
138
  | `/cpw-todos` | アイデアの記録または保留中の TODO の確認 |
138
139
  | `/cpw-reflect` | キャプチャした修正をレビューし、学習に変換(`--scan-history`, `--dedupe`) |
139
140
  | `/cpw-impact` | 計画全体にわたる意思決定の影響分析 |
141
+ | `/cpw-cleanup` | 完了フェーズのアーカイブと状態クリーンアップ(`--complete` で計画全体リセット) |
140
142
  | `/cpw-update` | スマートフレームワーク更新 — 差分、コンフリクトマージ、カスタマイズ保持 |
141
143
 
142
144
  ## 設定
package/README.md CHANGED
@@ -54,12 +54,13 @@ npx @claude-pw/framework --update
54
54
  ## How it works
55
55
 
56
56
  ```
57
- /cpw-startup → /cpw-discuss → /cpw-next-step (repeat until done)
57
+ /cpw-startup → /cpw-next-step (repeat) plan complete → /cpw-startup (new cycle)
58
58
  ```
59
59
 
60
- 1. **`/cpw-startup`** interviews you, scans existing code (if any), and generates a plan with phases, steps, and architecture docs
60
+ 1. **`/cpw-startup`** interviews you, scans existing code (if any), and generates a plan with phases, steps, and architecture docs. On subsequent cycles, loads prior context and appends new phases.
61
61
  2. **`/cpw-discuss`** identifies gray areas and captures your preferences before building (optional, per phase)
62
62
  3. **`/cpw-next-step`** runs an adaptive pipeline per step — then closes, commits, and advances automatically
63
+ 4. When all phases complete, **`/cpw-cleanup --complete`** runs automatically: generates a plan summary, reviews docs for drift, archives all phase files, resets execution state, and leaves the project ready for the next `/cpw-startup`
63
64
 
64
65
  Every step goes through:
65
66
 
@@ -137,6 +138,7 @@ Issue captured. Fix now? (yes/no)
137
138
  | `/cpw-todos` | Capture ideas for later or review pending todos |
138
139
  | `/cpw-reflect` | Review captured corrections, convert to learnings (`--scan-history`, `--dedupe`) |
139
140
  | `/cpw-impact` | Analyze decision impact across the entire plan |
141
+ | `/cpw-cleanup` | Archive completed phases and clean state (`--complete` for full plan reset) |
140
142
  | `/cpw-update` | Smart framework update — diff, merge conflicts, preserve customizations |
141
143
 
142
144
  ## Configuration
@@ -152,6 +154,9 @@ Issue captured. Fix now? (yes/no)
152
154
  | `gitStrategy` | `trunk-based` / `feature-branch` / `gitflow` | `trunk-based` | `trunk-based` = push to main. `feature-branch` = branch per phase, PR to merge. `gitflow` = develop + feature branches. |
153
155
  | `commitPlanning` | `true` / `false` | `false` | Track `.planning/` in git (for teams) |
154
156
  | `autoReflect` | `off` / `remind` / `auto` | `remind` | Auto-process learnings at session end or CLOSE stage |
157
+ | `cleanupPolicy` | `{...}` | see below | Retention limits for mid-plan cleanup |
158
+
159
+ `cleanupPolicy` defaults: `archiveCompletedPhases: true`, `keepAppliedLearnings: 20`, `keepResolvedDebug: 5`, `keepQuickLogDone: 10`
155
160
 
156
161
  ## What goes in git
157
162
 
package/README.pt-br.md CHANGED
@@ -54,12 +54,13 @@ npx @claude-pw/framework --update
54
54
  ## Como funciona
55
55
 
56
56
  ```
57
- /cpw-startup → /cpw-discuss → /cpw-next-step (repetir até concluir)
57
+ /cpw-startup → /cpw-next-step (repetir) plano completo → /cpw-startup (novo ciclo)
58
58
  ```
59
59
 
60
- 1. **`/cpw-startup`** entrevista você, analisa o código existente (se houver) e gera um plano com fases, etapas e documentos de arquitetura
60
+ 1. **`/cpw-startup`** entrevista você, analisa o código existente (se houver) e gera um plano com fases, etapas e documentos de arquitetura. Em ciclos posteriores, carrega o contexto anterior e adiciona novas fases.
61
61
  2. **`/cpw-discuss`** identifica áreas cinzentas e captura suas preferências antes de construir (opcional, por fase)
62
62
  3. **`/cpw-next-step`** executa um pipeline adaptativo por etapa — então fecha, commita e avança automaticamente
63
+ 4. Quando todas as fases completam, **`/cpw-cleanup --complete`** executa automaticamente: gera resumo do plano, revisa docs, arquiva todas as fases, reseta estado de execução e deixa o projeto pronto para o próximo `/cpw-startup`
63
64
 
64
65
  Cada etapa passa por:
65
66
 
@@ -137,6 +138,7 @@ Issue captured. Fix now? (yes/no)
137
138
  | `/cpw-todos` | Capturar ideias para depois ou revisar todos pendentes |
138
139
  | `/cpw-reflect` | Revisar correções capturadas, converter em aprendizados (`--scan-history`, `--dedupe`) |
139
140
  | `/cpw-impact` | Analisar impacto de decisões em todo o plano |
141
+ | `/cpw-cleanup` | Arquivar fases completadas e limpar estado (`--complete` para reset completo do plano) |
140
142
  | `/cpw-update` | Atualização inteligente do framework — diff, merge de conflitos, preserva customizações |
141
143
 
142
144
  ## Configuração
package/README.zh-cn.md CHANGED
@@ -54,12 +54,13 @@ npx @claude-pw/framework --update
54
54
  ## 工作原理
55
55
 
56
56
  ```
57
- /cpw-startup → /cpw-discuss → /cpw-next-step(重复直到完成)
57
+ /cpw-startup → /cpw-next-step(重复)→ 计划完成 → /cpw-startup(新周期)
58
58
  ```
59
59
 
60
- 1. **`/cpw-startup`** 对你进行访谈,扫描现有代码(如果有),生成包含阶段、步骤和架构文档的计划
60
+ 1. **`/cpw-startup`** 对你进行访谈,扫描现有代码(如果有),生成包含阶段、步骤和架构文档的计划。后续周期中,加载之前的上下文并追加新阶段。
61
61
  2. **`/cpw-discuss`** 识别灰色地带,在构建前捕获你的偏好(可选,按阶段)
62
62
  3. **`/cpw-next-step`** 按步骤运行自适应流水线——然后自动关闭、提交并推进
63
+ 4. 当所有阶段完成时,**`/cpw-cleanup --complete`** 自动运行:生成计划摘要、审查文档、归档所有阶段文件、重置执行状态,为下一个 `/cpw-startup` 做好准备
63
64
 
64
65
  每个步骤经过:
65
66
 
@@ -137,6 +138,7 @@ UAT 演练:
137
138
  | `/cpw-todos` | 捕获想法或查看待办事项 |
138
139
  | `/cpw-reflect` | 审查捕获的修正,转化为学习成果(`--scan-history`、`--dedupe`) |
139
140
  | `/cpw-impact` | 分析决策对整个计划的影响 |
141
+ | `/cpw-cleanup` | 归档已完成阶段并清理状态(`--complete` 用于完整计划重置) |
140
142
  | `/cpw-update` | 智能框架更新 — 差异对比、冲突合并、保留自定义 |
141
143
 
142
144
  ## 配置
package/RELEASES.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  Formato: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
4
4
 
5
+ ## [0.11.0] - 2026-03-15
6
+
7
+ ### Changed
8
+ - Plan completion is now a clean cycle: last phase → auto-delegates to `/cpw-cleanup --complete`
9
+ - `/cpw-cleanup --complete` mode: generates plan summary, reviews docs, archives ALL phases, resets execution state, deletes STATUS.md
10
+ - `/cpw-startup` new cycle detection simplified: PLAN.md + config.json exist, STATUS.md absent
11
+ - `/cpw-next-step` slimmed down — completion logic moved to cleanup (net -110 lines)
12
+ - Workflow is now fully cyclical: startup → next-step (loop) → cleanup --complete → startup
13
+
5
14
  ## [0.10.0] - 2026-03-15
6
15
 
7
16
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-pw/framework",
3
- "version": "0.10.0",
3
+ "version": "0.11.1",
4
4
  "description": "Structured Project Workflow for Claude Code — adaptive pipeline, context management, quality gates",
5
5
  "bin": {
6
6
  "claude-pw": "./install.js"
@@ -5,8 +5,123 @@ description: "Archive completed phases and clean accumulated state"
5
5
  ## Arguments
6
6
  - No arguments: dry-run (show what would be cleaned, ask for confirmation)
7
7
  - `--execute`: skip confirmation, execute immediately
8
+ - `--complete`: full plan completion cycle (summary, docs review, archive ALL, reset state). Auto-triggered by `/cpw-next-step` when the last phase completes. Can also be run manually.
8
9
 
9
- ## 0. Load state
10
+ ---
11
+
12
+ ## --complete mode (plan completion cycle)
13
+
14
+ If `--complete` is passed, execute the full completion cycle. This mode is designed to
15
+ close a finished plan, archive everything, and leave the project ready for `/cpw-startup`.
16
+
17
+ ### 1. Plan completion summary
18
+ Generate `.planning/plan-summary.md`:
19
+ - Read all phase sub-plans (plans/phase-N.md for each phase in PLAN.md)
20
+ - Read plans/decisions.md
21
+ - For each phase, extract: name, step count, Objective line
22
+ - From decisions.md, extract decisions made during these phases
23
+ - Get date range from git: first plan commit and today
24
+
25
+ Write `.planning/plan-summary.md`:
26
+ ```markdown
27
+ # Plan Summary
28
+
29
+ ## Completed
30
+ - **Date**: [today]
31
+ - **Phases**: [N]
32
+ - **Steps**: [total across all phases]
33
+
34
+ ## Phases
35
+ | # | Phase | Steps | Key output |
36
+ |---|-------|-------|------------|
37
+ | 0 | Stack and Scaffolding | 6 | Project setup, toolchain, CI |
38
+ | 1 | Interfaces | 5 | Module contracts, type system |
39
+ | ... | ... | ... | ... |
40
+
41
+ ## Key decisions
42
+ - Phase N: [decision summary from decisions.md]
43
+ - ...
44
+
45
+ ## Key deliverables
46
+ - [extracted from each phase's Objective]
47
+ - ...
48
+ ```
49
+
50
+ If a previous `.planning/plan-summary.md` exists (from a prior cycle), rename it
51
+ to `.planning/plan-summary-[date].md` before writing the new one.
52
+
53
+ ### 2. Docs evolution review
54
+ Review if docs/ need updating after the full plan:
55
+ - Read `docs/architecture.md` — does it reflect what was actually built?
56
+ Compare with the plan phases and deliverables. If outdated, update it.
57
+ - Read `docs/interfaces.md` — are interfaces current with the final state of `src/interfaces/`?
58
+ If outdated, update it.
59
+ - If any docs were updated:
60
+ `make commit m="docs: update architecture and interfaces after plan completion"`
61
+
62
+ This is a lightweight pass to catch drift — not a full rewrite.
63
+
64
+ ### 3. Archive ALL phase files
65
+ ```bash
66
+ mkdir -p .planning/archive
67
+ ```
68
+ For every phase in PLAN.md (regardless of `archiveCompletedPhases` config — in --complete mode, everything gets archived):
69
+ - Move `plans/phase-N.md` to `.planning/archive/phase-N.md`
70
+ - Move `plans/phase-N-context.md` to `.planning/archive/phase-N-context.md` (if exists)
71
+
72
+ Update PLAN.md: sub-plan column → `(archived)` for all phases.
73
+
74
+ ### 4. Reset execution state
75
+ Clean all execution artifacts. These served the current plan cycle and are not needed for the next:
76
+ - **Delete** `STATUS.md` (session pointer — no longer needed)
77
+ - **Reset** `.planning/quick/log.md` to empty table header only
78
+ - **Delete** all files in `.planning/debug/resolved/`
79
+ - **Delete** `.planning/debug/active-session.md` (if exists)
80
+ - **Reset** `.planning/learnings/queue.md` to empty
81
+ - **Reset** `.planning/learnings/applied.md` to empty (already applied to rules/skills)
82
+ - **Delete** `.planning/handoff.md` (if exists)
83
+ - **Delete** `.planning/uat.md` (if exists)
84
+
85
+ Do NOT touch (project context that survives between cycles):
86
+ - `plans/decisions.md` — cumulative project history
87
+ - `docs/*` — project documentation (just reviewed in step 2)
88
+ - `.planning/config.json` — workflow settings carry over
89
+ - `.planning/plan-summary.md` — just generated in step 1
90
+ - `PLAN.md` — updated with (archived) markers
91
+ - `CLAUDE.md` — project instructions
92
+ - `.claude/skills/*` — extracted knowledge
93
+ - `.claude/rules/*` — project rules
94
+ - All source code, tests, Makefile, etc.
95
+
96
+ ### 5. Commit
97
+ `make commit m="chore: plan complete — archived [N] phases, reset execution state"`
98
+
99
+ ### 6. Report
100
+ ```
101
+ ══════════════════════════════════════
102
+ PLAN COMPLETE
103
+ ══════════════════════════════════════
104
+ All [N] phases finished.
105
+ Summary: .planning/plan-summary.md
106
+
107
+ Archived: [N] phase files → .planning/archive/
108
+ Cleaned: STATUS.md, quick log, debug sessions, learnings
109
+
110
+ Project is ready for the next development cycle.
111
+ Run /cpw-startup to begin.
112
+ ══════════════════════════════════════
113
+ ```
114
+
115
+ STOP.
116
+
117
+ ---
118
+
119
+ ## Standard mode (mid-plan cleanup)
120
+
121
+ If `--complete` is NOT passed, run the standard cleanup flow below.
122
+ This is for archiving completed phases while the plan is still in progress.
123
+
124
+ ### 0. Load state
10
125
 
11
126
  Read `.planning/config.json` -> extract `cleanupPolicy` (use defaults if missing):
12
127
  - `archiveCompletedPhases`: true
@@ -23,9 +138,9 @@ Nothing to clean up. All phases are current or pending.
23
138
  ```
24
139
  STOP.
25
140
 
26
- ## 1. Identify what to clean
141
+ ### 1. Identify what to clean
27
142
 
28
- ### 1.1 Completed phase files
143
+ #### 1.1 Completed phase files
29
144
  If `archiveCompletedPhases` is true:
30
145
  For each phase with Status "done" in PLAN.md:
31
146
  - Check if `plans/phase-N.md` still exists (not already archived)
@@ -33,26 +148,26 @@ For each phase with Status "done" in PLAN.md:
33
148
  - Add to archive list
34
149
  - NEVER archive the current phase or pending phases
35
150
 
36
- ### 1.2 Quick log done entries
151
+ #### 1.2 Quick log done entries
37
152
  Read `.planning/quick/log.md` (if exists):
38
153
  - Count entries with Status: done or dismissed
39
154
  - If count > `keepQuickLogDone`: mark oldest excess entries for removal
40
155
 
41
- ### 1.3 Resolved debug sessions
156
+ #### 1.3 Resolved debug sessions
42
157
  List `.planning/debug/resolved/` (if exists):
43
158
  - Count files
44
159
  - If count > `keepResolvedDebug`: mark oldest files for deletion (by filename date prefix)
45
160
 
46
- ### 1.4 Applied learnings
161
+ #### 1.4 Applied learnings
47
162
  Read `.planning/learnings/applied.md` (if exists):
48
163
  - Count entries (each entry starts with `---`)
49
164
  - If count > `keepAppliedLearnings`: mark oldest excess entries for trimming
50
165
 
51
- ### 1.5 Stale files
166
+ #### 1.5 Stale files
52
167
  - `.planning/handoff.md` — if it exists AND STATUS.md does NOT show a handoff in progress
53
168
  - `.planning/uat.md` — if it exists AND all phases it references are done (no active UAT)
54
169
 
55
- ## 2. Present cleanup plan
170
+ ### 2. Present cleanup plan
56
171
 
57
172
  ```
58
173
  Cleanup Summary:
@@ -87,9 +202,9 @@ STOP.
87
202
  If `--execute`: show the summary and proceed to step 3.
88
203
  Otherwise: ask "Proceed? (yes/no)". If no: STOP.
89
204
 
90
- ## 3. Execute
205
+ ### 3. Execute
91
206
 
92
- ### 3.1 Archive phase files
207
+ #### 3.1 Archive phase files
93
208
  ```bash
94
209
  mkdir -p .planning/archive
95
210
  ```
@@ -97,7 +212,7 @@ For each phase in the archive list:
97
212
  - Move `plans/phase-N.md` to `.planning/archive/phase-N.md`
98
213
  - Move `plans/phase-N-context.md` to `.planning/archive/phase-N-context.md` (if exists)
99
214
 
100
- ### 3.2 Update PLAN.md
215
+ #### 3.2 Update PLAN.md
101
216
  For each archived phase, change the sub-plan column from `plans/phase-N.md` to `(archived)`:
102
217
  ```
103
218
  | 0 | Stack and Scaffolding | plans/phase-0.md | done |
@@ -107,22 +222,22 @@ becomes:
107
222
  | 0 | Stack and Scaffolding | (archived) | done |
108
223
  ```
109
224
 
110
- ### 3.3 Trim quick log
225
+ #### 3.3 Trim quick log
111
226
  Remove done/dismissed entries beyond the keep limit from `.planning/quick/log.md`.
112
227
  Keep the most recent N entries (by date). Preserve the table header.
113
228
 
114
- ### 3.4 Delete old debug sessions
229
+ #### 3.4 Delete old debug sessions
115
230
  Delete files from `.planning/debug/resolved/` beyond the keep limit.
116
231
  Delete the oldest by filename date prefix.
117
232
 
118
- ### 3.5 Trim applied learnings
233
+ #### 3.5 Trim applied learnings
119
234
  Remove the oldest entries from `.planning/learnings/applied.md` beyond the keep limit.
120
235
  Keep the most recent N entries. Each entry is delimited by `---`.
121
236
 
122
- ### 3.6 Delete stale files
237
+ #### 3.6 Delete stale files
123
238
  Delete identified stale files (handoff.md, uat.md).
124
239
 
125
- ### 3.7 Commit
240
+ #### 3.7 Commit
126
241
  Read `commitPlanning` from `.planning/config.json`.
127
242
 
128
243
  Build commit message based on what was actually executed:
@@ -139,7 +254,7 @@ Check if there are staged changes (`git diff --cached --quiet`).
139
254
  - If there are changes: `make commit m="[built message]"`
140
255
  - If there are NO changes (e.g., only .planning/ was modified and commitPlanning is false): skip commit. Report: "Only local state cleaned (.planning/ is gitignored) — no commit needed."
141
256
 
142
- ## 4. Report
257
+ ### 4. Report
143
258
 
144
259
  ```
145
260
  Cleanup complete.
@@ -43,25 +43,24 @@ Delegate to the session-recovery agent in CHECK mode:
43
43
  ## 1. Load context
44
44
 
45
45
  If STATUS.md does not exist:
46
- - Report:
47
- ```
48
- No STATUS.md found — this project hasn't been initialized yet.
49
-
50
- Next: run `/cpw-startup` to set up the project.
51
- ```
52
- - STOP. Do not continue.
46
+ - If PLAN.md exists AND `.planning/config.json` exists:
47
+ - This project completed a plan cycle. Report:
48
+ ```
49
+ Plan completed — project is ready for the next development cycle.
53
50
 
54
- - Read STATUS.md -> phase, step, stage
55
- - If phase = "DONE":
51
+ Next: run `/cpw-startup` to start a new cycle.
52
+ ```
53
+ - STOP.
54
+ - Otherwise:
56
55
  - Report:
57
56
  ```
58
- Plan is completeall phases finished.
57
+ No STATUS.md foundthis project hasn't been initialized yet.
59
58
 
60
- Next:
61
- /cpw-cleanup — archive completed phases
62
- /cpw-startup — start a new development cycle
59
+ Next: run `/cpw-startup` to set up the project.
63
60
  ```
64
- - STOP. Do not continue.
61
+ - STOP.
62
+
63
+ - Read STATUS.md -> phase, step, stage
65
64
  - Read indicated sub-plan (plans/phase-N.md)
66
65
  - If the file does not exist: report "Sub-plan plans/phase-N.md not found. STATUS.md may be pointing to a non-existent phase. Run `/cpw-health` to diagnose." STOP.
67
66
  - If `plans/phase-N-context.md` exists (from /cpw-discuss), load it too
@@ -583,84 +582,12 @@ Read PLAN.md. Check if there is a next phase (any phase with Status "pending" or
583
582
 
584
583
  **If there is NO next phase — plan complete:**
585
584
 
586
- #### Plan completion summary
587
- Generate `.planning/plan-summary.md`:
588
- - Read all phase sub-plans (plans/phase-N.md for each phase in PLAN.md)
589
- - Read plans/decisions.md
590
- - For each phase, extract: name, step count, Objective line
591
- - From decisions.md, extract decisions made during these phases
592
- - Get date range from git: first plan commit and today
593
-
594
- Write `.planning/plan-summary.md`:
595
- ```markdown
596
- # Plan Summary
597
-
598
- ## Completed
599
- - **Date**: [today]
600
- - **Phases**: [N]
601
- - **Steps**: [total across all phases]
602
-
603
- ## Phases
604
- | # | Phase | Steps | Key output |
605
- |---|-------|-------|------------|
606
- | 0 | Stack and Scaffolding | 6 | Project setup, toolchain, CI |
607
- | 1 | Interfaces | 5 | Module contracts, type system |
608
- | ... | ... | ... | ... |
609
-
610
- ## Key decisions
611
- - Phase N: [decision summary from decisions.md]
612
- - ...
613
-
614
- ## Key deliverables
615
- - [extracted from each phase's Objective]
616
- - ...
617
- ```
618
-
619
- If a previous `.planning/plan-summary.md` exists (from a prior cycle), rename it
620
- to `.planning/plan-summary-[date].md` before writing the new one.
621
-
622
- #### Docs evolution review
623
- Review if docs/ need updating after the full plan:
624
- - Read `docs/architecture.md` — does it reflect what was actually built?
625
- Compare with the plan phases and deliverables. If outdated, update it.
626
- - Read `docs/interfaces.md` — are interfaces current with the final state of `src/interfaces/`?
627
- If outdated, update it.
628
- - If any docs were updated:
629
- `make commit m="docs: update architecture and interfaces after plan completion"`
630
-
631
- This is a lightweight pass to catch drift — not a full rewrite.
585
+ All phases are done. Delegate the full completion cycle to `/cpw-cleanup --complete`.
586
+ This will: generate plan summary, review docs, archive all phases, reset execution state.
632
587
 
633
- #### Mark DONE
634
- - Update STATUS.md to DONE state:
635
- ```
636
- ## Now
637
- - Phase: DONE
638
- - Step: --
639
- - Stage: --
640
- - Sub-plan: --
588
+ Execute `/cpw-cleanup --complete` now (invoke the command inline, do NOT ask the user to run it manually).
641
589
 
642
- ## Required context
643
- - PLAN.md
644
-
645
- ## Session notes
646
- - All phases completed on [date]
647
- - Plan summary: .planning/plan-summary.md
648
- ```
649
- - `make commit m="chore: plan complete — summary and status updated"`
650
- - Report:
651
- ```
652
- ══════════════════════════════════════
653
- PLAN COMPLETE
654
- ══════════════════════════════════════
655
- All [N] phases finished.
656
- Summary: .planning/plan-summary.md
657
-
658
- Next steps:
659
- 1. /cpw-cleanup — archive completed phases and clean state
660
- 2. /cpw-startup — start a new development cycle (adds new phases to the existing project)
661
- 3. Nothing — the project is done
662
- ```
663
- - STOP. Do NOT attempt to advance to a non-existent phase.
590
+ After cleanup completes, STOP. Do NOT attempt to advance to a non-existent phase.
664
591
 
665
592
  **If there IS a next phase — normal advancement:**
666
593
  - Reset STATUS.md for next phase:
@@ -10,9 +10,8 @@ analysis report. You can stop after the scan by declining plan generation.
10
10
 
11
11
  ### Check for existing completed plan (new cycle detection)
12
12
  Detect new cycle by ANY of these signals:
13
- 1. STATUS.md exists with `Phase: DONE` (explicit completion)
14
- 2. PLAN.md exists AND all phases have Status "done" AND no phase has Status "in progress" or "pending" (implicit completion — STATUS.md may be missing or corrupted)
15
- 3. PLAN.md exists with phases marked "(archived)" AND no active phases (post-cleanup completion)
13
+ 1. PLAN.md exists AND `.planning/config.json` exists AND STATUS.md does NOT exist (post-completion state — STATUS.md was deleted by /cpw-cleanup --complete)
14
+ 2. PLAN.md exists AND all phases have Status "done" AND no phase has Status "in progress" or "pending" (implicit completion — cleanup may not have run)
16
15
 
17
16
  If PLAN.md exists with phases "in progress" or "pending" → NOT a new cycle. Skip to standard mode detection below.
18
17