@claude-pw/framework 0.8.1 → 0.9.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/README.es.md +1 -1
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/README.pt-br.md +1 -1
- package/README.zh-cn.md +1 -1
- package/RELEASES.md +7 -0
- package/install.js +1 -1
- package/package.json +1 -1
- package/templates/CLAUDE.md.tpl +2 -1
- package/templates/claude/commands/cpw-cleanup.md +139 -0
- package/templates/claude/commands/cpw-next-step.md +9 -0
- package/templates/planning/config.json +7 -1
package/README.es.md
CHANGED
|
@@ -169,7 +169,7 @@ Issue capturado. ¿Arreglar ahora? (sí/no)
|
|
|
169
169
|
```
|
|
170
170
|
mi-proyecto/
|
|
171
171
|
├── .claude/
|
|
172
|
-
│ ├── commands/
|
|
172
|
+
│ ├── commands/ 12 slash commands (/cpw-*)
|
|
173
173
|
│ ├── agents/ 12 agentes especializados (4 con memoria persistente)
|
|
174
174
|
│ ├── rules/ 3 reglas context-aware (git, interfaces, testing)
|
|
175
175
|
│ ├── hooks/ Hooks Node.js (statusline, monitor de contexto)
|
package/README.ja.md
CHANGED
|
@@ -169,7 +169,7 @@ Issue captured. Fix now? (yes/no)
|
|
|
169
169
|
```
|
|
170
170
|
my-project/
|
|
171
171
|
├── .claude/
|
|
172
|
-
│ ├── commands/
|
|
172
|
+
│ ├── commands/ 12個のスラッシュコマンド (/cpw-*)
|
|
173
173
|
│ ├── agents/ 12個の専門エージェント(4つに永続メモリ)
|
|
174
174
|
│ ├── rules/ 3つのコンテキスト対応ルール(git、インターフェース、テスト)
|
|
175
175
|
│ ├── hooks/ Node.js フック(ステータスライン、コンテキストモニター)
|
package/README.md
CHANGED
|
@@ -169,7 +169,7 @@ Issue captured. Fix now? (yes/no)
|
|
|
169
169
|
```
|
|
170
170
|
my-project/
|
|
171
171
|
├── .claude/
|
|
172
|
-
│ ├── commands/
|
|
172
|
+
│ ├── commands/ 12 slash commands (/cpw-*)
|
|
173
173
|
│ ├── agents/ 12 specialized agents (4 with persistent memory)
|
|
174
174
|
│ ├── rules/ 3 context-aware rules (git, interfaces, testing)
|
|
175
175
|
│ ├── hooks/ Node.js hooks (statusline, context monitor)
|
package/README.pt-br.md
CHANGED
|
@@ -169,7 +169,7 @@ Issue captured. Fix now? (yes/no)
|
|
|
169
169
|
```
|
|
170
170
|
my-project/
|
|
171
171
|
├── .claude/
|
|
172
|
-
│ ├── commands/
|
|
172
|
+
│ ├── commands/ 12 slash commands (/cpw-*)
|
|
173
173
|
│ ├── agents/ 12 agentes especializados (4 com memória persistente)
|
|
174
174
|
│ ├── rules/ 3 regras sensíveis ao contexto (git, interfaces, testes)
|
|
175
175
|
│ ├── hooks/ Hooks Node.js (statusline, monitor de contexto)
|
package/README.zh-cn.md
CHANGED
package/RELEASES.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Formato: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
4
4
|
|
|
5
|
+
## [0.9.0] - 2026-03-15
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `/cpw-cleanup` command — archive completed phase files and clean accumulated state (.planning/archive/)
|
|
9
|
+
- `cleanupPolicy` in config.json — configurable retention for applied learnings, debug sessions, quick log entries
|
|
10
|
+
- Cleanup suggestion in `/cpw-next-step` after phase advancement (when 3+ completed phases unarchived)
|
|
11
|
+
|
|
5
12
|
## [0.3.0] - 2026-03-15
|
|
6
13
|
|
|
7
14
|
### Added
|
package/install.js
CHANGED
|
@@ -602,7 +602,7 @@ async function main() {
|
|
|
602
602
|
header('Listo');
|
|
603
603
|
console.log('');
|
|
604
604
|
console.log(` ${projectName}/`);
|
|
605
|
-
console.log(' ├── .claude/commands/
|
|
605
|
+
console.log(' ├── .claude/commands/ 12 commands (/cpw-startup, /cpw-next-step, /cpw-quick, ...)');
|
|
606
606
|
console.log(' ├── .claude/agents/ 11 agentes (plan-checker, debugger, researcher, implementer, ...)');
|
|
607
607
|
console.log(' ├── .claude/rules/ 3 reglas (interfaces, testing, git)');
|
|
608
608
|
console.log(' ├── .claude/hooks/ 2 hooks (statusline, context monitor)');
|
package/package.json
CHANGED
package/templates/CLAUDE.md.tpl
CHANGED
|
@@ -24,6 +24,7 @@ TODO: Phase 0
|
|
|
24
24
|
- Ad-hoc tasks that don't affect the plan -> /cpw-quick
|
|
25
25
|
- Debug that may take several sessions -> /cpw-debug (persists state)
|
|
26
26
|
- If something seems broken or inconsistent -> /cpw-health
|
|
27
|
+
- Completed phases accumulating? -> /cpw-cleanup (archive and free context)
|
|
27
28
|
- If the user corrects you, capture the correction in .planning/learnings/queue.md (include the active command in the Command field)
|
|
28
29
|
- Learnings are auto-processed based on config (autoReflect: off/remind/auto)
|
|
29
30
|
- When you discover something non-obvious (debug, workaround), evaluate for skill extraction → .claude/skills/
|
|
@@ -37,4 +38,4 @@ TODO: Phase 0
|
|
|
37
38
|
- plans/decisions.md — Decisions and RFCs
|
|
38
39
|
- src/interfaces/ — Contracts (RFC required to modify)
|
|
39
40
|
- .planning/ — Project state (gitignored by default, set commitPlanning: true to track)
|
|
40
|
-
- .planning/config.json — Workflow config (autoAdvance, granularity, modelProfile, modelOverrides, gitStrategy, commitPlanning, toolingSources, maxConsecutiveFailures, autoReflect)
|
|
41
|
+
- .planning/config.json — Workflow config (autoAdvance, granularity, modelProfile, modelOverrides, gitStrategy, commitPlanning, toolingSources, maxConsecutiveFailures, autoReflect, cleanupPolicy)
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Archive completed phases and clean accumulated state"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Arguments
|
|
6
|
+
- No arguments: dry-run (show what would be cleaned, ask for confirmation)
|
|
7
|
+
- `--execute`: skip confirmation, execute immediately
|
|
8
|
+
|
|
9
|
+
## 0. Load state
|
|
10
|
+
|
|
11
|
+
Read `.planning/config.json` -> extract `cleanupPolicy` (use defaults if missing):
|
|
12
|
+
- `archiveCompletedPhases`: true
|
|
13
|
+
- `keepAppliedLearnings`: 20
|
|
14
|
+
- `keepResolvedDebug`: 5
|
|
15
|
+
- `keepQuickLogDone`: 10
|
|
16
|
+
|
|
17
|
+
Read PLAN.md -> extract phases table. Identify phases with Status = "done".
|
|
18
|
+
Read STATUS.md -> identify current phase (to avoid archiving it).
|
|
19
|
+
|
|
20
|
+
If no completed phases and no accumulated state to clean:
|
|
21
|
+
```
|
|
22
|
+
Nothing to clean up. All phases are current or pending.
|
|
23
|
+
```
|
|
24
|
+
STOP.
|
|
25
|
+
|
|
26
|
+
## 1. Identify what to clean
|
|
27
|
+
|
|
28
|
+
### 1.1 Completed phase files
|
|
29
|
+
If `archiveCompletedPhases` is true:
|
|
30
|
+
For each phase with Status "done" in PLAN.md:
|
|
31
|
+
- Check if `plans/phase-N.md` still exists (not already archived)
|
|
32
|
+
- Check if `plans/phase-N-context.md` exists
|
|
33
|
+
- Add to archive list
|
|
34
|
+
- NEVER archive the current phase or pending phases
|
|
35
|
+
|
|
36
|
+
### 1.2 Quick log done entries
|
|
37
|
+
Read `.planning/quick/log.md` (if exists):
|
|
38
|
+
- Count entries with Status: done or dismissed
|
|
39
|
+
- If count > `keepQuickLogDone`: mark oldest excess entries for removal
|
|
40
|
+
|
|
41
|
+
### 1.3 Resolved debug sessions
|
|
42
|
+
List `.planning/debug/resolved/` (if exists):
|
|
43
|
+
- Count files
|
|
44
|
+
- If count > `keepResolvedDebug`: mark oldest files for deletion (by filename date prefix)
|
|
45
|
+
|
|
46
|
+
### 1.4 Applied learnings
|
|
47
|
+
Read `.planning/learnings/applied.md` (if exists):
|
|
48
|
+
- Count entries (each entry starts with `---`)
|
|
49
|
+
- If count > `keepAppliedLearnings`: mark oldest excess entries for trimming
|
|
50
|
+
|
|
51
|
+
### 1.5 Stale files
|
|
52
|
+
- `.planning/handoff.md` — if it exists AND STATUS.md does NOT show a handoff in progress
|
|
53
|
+
- `.planning/uat.md` — if it exists AND all phases it references are done (no active UAT)
|
|
54
|
+
|
|
55
|
+
## 2. Present cleanup plan
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
Cleanup Summary:
|
|
59
|
+
|
|
60
|
+
ARCHIVE (move to .planning/archive/):
|
|
61
|
+
- plans/phase-0.md (6 steps, all done)
|
|
62
|
+
- plans/phase-0-context.md
|
|
63
|
+
- plans/phase-1.md (4 steps, all done)
|
|
64
|
+
|
|
65
|
+
TRIM:
|
|
66
|
+
- quick/log.md: remove N done entries (keeping last M)
|
|
67
|
+
- debug/resolved/: delete N old sessions (keeping last M)
|
|
68
|
+
- learnings/applied.md: trim N old entries (keeping last M)
|
|
69
|
+
|
|
70
|
+
DELETE:
|
|
71
|
+
- .planning/handoff.md (stale)
|
|
72
|
+
|
|
73
|
+
NO CHANGES:
|
|
74
|
+
- plans/phase-2.md (current phase)
|
|
75
|
+
- plans/decisions.md (cumulative, always kept)
|
|
76
|
+
- docs/* (living documentation, always kept)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If nothing to clean in a category, omit it from the summary.
|
|
80
|
+
|
|
81
|
+
If `--execute`: show the summary and proceed to step 3.
|
|
82
|
+
Otherwise: ask "Proceed? (yes/no)". If no: STOP.
|
|
83
|
+
|
|
84
|
+
## 3. Execute
|
|
85
|
+
|
|
86
|
+
### 3.1 Archive phase files
|
|
87
|
+
```bash
|
|
88
|
+
mkdir -p .planning/archive
|
|
89
|
+
```
|
|
90
|
+
For each phase in the archive list:
|
|
91
|
+
- Move `plans/phase-N.md` to `.planning/archive/phase-N.md`
|
|
92
|
+
- Move `plans/phase-N-context.md` to `.planning/archive/phase-N-context.md` (if exists)
|
|
93
|
+
|
|
94
|
+
### 3.2 Update PLAN.md
|
|
95
|
+
For each archived phase, change the sub-plan column from `plans/phase-N.md` to `(archived)`:
|
|
96
|
+
```
|
|
97
|
+
| 0 | Stack and Scaffolding | plans/phase-0.md | done |
|
|
98
|
+
```
|
|
99
|
+
becomes:
|
|
100
|
+
```
|
|
101
|
+
| 0 | Stack and Scaffolding | (archived) | done |
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 3.3 Trim quick log
|
|
105
|
+
Remove done/dismissed entries beyond the keep limit from `.planning/quick/log.md`.
|
|
106
|
+
Keep the most recent N entries (by date). Preserve the table header.
|
|
107
|
+
|
|
108
|
+
### 3.4 Delete old debug sessions
|
|
109
|
+
Delete files from `.planning/debug/resolved/` beyond the keep limit.
|
|
110
|
+
Delete the oldest by filename date prefix.
|
|
111
|
+
|
|
112
|
+
### 3.5 Trim applied learnings
|
|
113
|
+
Remove the oldest entries from `.planning/learnings/applied.md` beyond the keep limit.
|
|
114
|
+
Keep the most recent N entries. Each entry is delimited by `---`.
|
|
115
|
+
|
|
116
|
+
### 3.6 Delete stale files
|
|
117
|
+
Delete identified stale files (handoff.md, uat.md).
|
|
118
|
+
|
|
119
|
+
### 3.7 Commit
|
|
120
|
+
Read `commitPlanning` from `.planning/config.json`.
|
|
121
|
+
|
|
122
|
+
Git add the changes:
|
|
123
|
+
- `PLAN.md` (always — sub-plan column updated)
|
|
124
|
+
- `plans/` (always — phase files removed)
|
|
125
|
+
- `.planning/` (only if `commitPlanning: true`)
|
|
126
|
+
|
|
127
|
+
`make commit m="chore: cleanup completed phases and accumulated state"`
|
|
128
|
+
|
|
129
|
+
## 4. Report
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Cleanup complete.
|
|
133
|
+
|
|
134
|
+
Archived: N phase files → .planning/archive/
|
|
135
|
+
Trimmed: M quick log entries, K debug sessions, L learnings
|
|
136
|
+
Deleted: P stale files
|
|
137
|
+
|
|
138
|
+
Next: /cpw-next-step to continue.
|
|
139
|
+
```
|
|
@@ -598,4 +598,13 @@ If all deliverables passed (or issues were fixed):
|
|
|
598
598
|
" 3. `/cpw-next-step` — start directly"
|
|
599
599
|
- If autoAdvance is **auto** or **yolo** (and no --phase): Suggest /clear for context refresh, then automatically continue with Phase N+1 (run tooling audit → first step).
|
|
600
600
|
|
|
601
|
+
### Cleanup suggestion
|
|
602
|
+
After phase advancement, count completed phases in PLAN.md that still have sub-plan files in `plans/` (sub-plan column is NOT `(archived)`).
|
|
603
|
+
If count >= 3:
|
|
604
|
+
```
|
|
605
|
+
Tip: You have N completed phase files that could be archived.
|
|
606
|
+
Run /cpw-cleanup to free up context.
|
|
607
|
+
```
|
|
608
|
+
This is a suggestion only — do NOT block advancement.
|
|
609
|
+
|
|
601
610
|
NEVER advance between phases without completing UAT first (in any mode).
|
|
@@ -7,5 +7,11 @@
|
|
|
7
7
|
"toolingSources": ["skills.sh", "claude-code-templates"],
|
|
8
8
|
"maxConsecutiveFailures": null,
|
|
9
9
|
"gitStrategy": "trunk-based",
|
|
10
|
-
"autoReflect": "remind"
|
|
10
|
+
"autoReflect": "remind",
|
|
11
|
+
"cleanupPolicy": {
|
|
12
|
+
"archiveCompletedPhases": true,
|
|
13
|
+
"keepAppliedLearnings": 20,
|
|
14
|
+
"keepResolvedDebug": 5,
|
|
15
|
+
"keepQuickLogDone": 10
|
|
16
|
+
}
|
|
11
17
|
}
|