@claude-pw/framework 0.3.0 → 0.5.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 CHANGED
@@ -8,6 +8,20 @@ Workflow estructurado para proyectos con Claude Code.
8
8
 
9
9
  Claude Code es potente pero sin estructura, los proyectos no triviales se vuelven caóticos — sin plan, sin gestión de contexto, sin quality gates, sin continuidad entre sesiones. claude-pw soluciona esto instalando comandos, agentes, reglas y hooks sobre las features nativas de Claude Code. Node.js + markdown, agnóstico al lenguaje.
10
10
 
11
+ ## Instalación
12
+
13
+ Requiere [Node.js](https://nodejs.org/) >= 18 y [Claude Code](https://code.claude.com/docs/en/setup).
14
+
15
+ ```bash
16
+ npm install -g @claude-pw/framework
17
+ ```
18
+
19
+ O ejecuta directamente con npx (sin instalar):
20
+
21
+ ```bash
22
+ npx @claude-pw/framework mi-proyecto
23
+ ```
24
+
11
25
  ## Inicio rápido
12
26
 
13
27
  ### Proyecto nuevo
package/README.ja.md CHANGED
@@ -8,6 +8,20 @@ Claude Code のための構造化プロジェクトワークフロー。
8
8
 
9
9
  Claude Code は強力ですが、構造がなければ非自明なプロジェクトは混沌とします — 計画なし、コンテキスト管理なし、品質ゲートなし、セッション間の継続性なし。claude-pw は Claude Code のネイティブ機能の上にコマンド、エージェント、ルール、フックをインストールすることでこれを解決します。純粋な Node.js + markdown、言語非依存。
10
10
 
11
+ ## インストール
12
+
13
+ [Node.js](https://nodejs.org/) >= 18 と [Claude Code](https://code.claude.com/docs/en/setup) が必要です。
14
+
15
+ ```bash
16
+ npm install -g @claude-pw/framework
17
+ ```
18
+
19
+ または npx で直接実行(インストール不要):
20
+
21
+ ```bash
22
+ npx @claude-pw/framework my-project
23
+ ```
24
+
11
25
  ## クイックスタート
12
26
 
13
27
  ### 新規プロジェクト
package/README.md CHANGED
@@ -8,6 +8,20 @@ Structured Project Workflow for Claude Code.
8
8
 
9
9
  Claude Code is powerful but without structure, non-trivial projects get chaotic — no plan, no context management, no quality gates, no continuity between sessions. claude-pw fixes this by installing commands, agents, rules, and hooks on top of Claude Code's native features. Pure Node.js + markdown, language-agnostic.
10
10
 
11
+ ## Install
12
+
13
+ Requires [Node.js](https://nodejs.org/) >= 18 and [Claude Code](https://code.claude.com/docs/en/setup).
14
+
15
+ ```bash
16
+ npm install -g @claude-pw/framework
17
+ ```
18
+
19
+ Or run directly with npx (no install needed):
20
+
21
+ ```bash
22
+ npx @claude-pw/framework my-project
23
+ ```
24
+
11
25
  ## Quick start
12
26
 
13
27
  ### New project
package/README.pt-br.md CHANGED
@@ -8,6 +8,20 @@ Fluxo de trabalho estruturado para projetos com Claude Code.
8
8
 
9
9
  Claude Code é poderoso, mas sem estrutura, projetos não triviais viram caos — sem plano, sem gestão de contexto, sem portões de qualidade, sem continuidade entre sessões. claude-pw resolve isso instalando comandos, agentes, regras e hooks sobre os recursos nativos do Claude Code. Node.js puro + markdown, agnóstico de linguagem.
10
10
 
11
+ ## Instalação
12
+
13
+ Requer [Node.js](https://nodejs.org/) >= 18 e [Claude Code](https://code.claude.com/docs/en/setup).
14
+
15
+ ```bash
16
+ npm install -g @claude-pw/framework
17
+ ```
18
+
19
+ Ou execute diretamente com npx (sem instalação):
20
+
21
+ ```bash
22
+ npx @claude-pw/framework my-project
23
+ ```
24
+
11
25
  ## Início rápido
12
26
 
13
27
  ### Novo projeto
package/README.zh-cn.md CHANGED
@@ -8,6 +8,20 @@ Claude Code 结构化项目工作流。
8
8
 
9
9
  Claude Code 功能强大,但缺乏结构时,非简单项目会变得混乱——没有计划、没有上下文管理、没有质量门控、会话之间没有连续性。claude-pw 通过在 Claude Code 原生功能(命令、代理、规则、钩子)之上安装结构化工作流来解决这个问题。纯 Node.js + markdown,与编程语言无关。
10
10
 
11
+ ## 安装
12
+
13
+ 需要 [Node.js](https://nodejs.org/) >= 18 和 [Claude Code](https://code.claude.com/docs/en/setup)。
14
+
15
+ ```bash
16
+ npm install -g @claude-pw/framework
17
+ ```
18
+
19
+ 或使用 npx 直接运行(无需安装):
20
+
21
+ ```bash
22
+ npx @claude-pw/framework my-project
23
+ ```
24
+
11
25
  ## 快速开始
12
26
 
13
27
  ### 新项目
package/install.js CHANGED
@@ -517,7 +517,12 @@ async function main() {
517
517
 
518
518
  // Root files with template variable substitution
519
519
  const vars = { PROJECT_NAME: projectName, DATE: date };
520
- if (!fs.existsSync('CLAUDE.md')) copyTemplate(path.join(templatesDir, 'CLAUDE.md.tpl'), 'CLAUDE.md', vars);
520
+ if (fs.existsSync('CLAUDE.md')) {
521
+ const backupName = `CLAUDE.md.user-backup`;
522
+ fs.copyFileSync('CLAUDE.md', backupName);
523
+ info(`CLAUDE.md existente respaldado en ${backupName}`);
524
+ }
525
+ copyTemplate(path.join(templatesDir, 'CLAUDE.md.tpl'), 'CLAUDE.md', vars);
521
526
  if (!fs.existsSync('PLAN.md')) copyTemplate(path.join(templatesDir, 'PLAN.md.tpl'), 'PLAN.md', vars);
522
527
  if (!fs.existsSync('STATUS.md')) copyTemplate(path.join(templatesDir, 'STATUS.md.tpl'), 'STATUS.md', vars);
523
528
  copyIfMissing(path.join(templatesDir, 'CHANGELOG.md'), 'CHANGELOG.md');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-pw/framework",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Structured Project Workflow for Claude Code — adaptive pipeline, context management, quality gates",
5
5
  "bin": {
6
6
  "claude-pw": "./install.js"
@@ -1,5 +1,7 @@
1
1
  # {{PROJECT_NAME}}
2
2
 
3
+ > If `CLAUDE.md.user-backup` exists, it contains your original CLAUDE.md. Review it during `/cpw-startup` and merge any project-specific instructions into this file.
4
+
3
5
  ## Stack
4
6
  TODO: Phase 0
5
7
 
@@ -30,6 +30,17 @@ Use the exact section headers above — the startup command parses them by name.
30
30
  ## Project Context
31
31
  After mandatory read, check `.claude/skills/` and `.claude/rules/` — include discovered skills and rules in your Conventions section.
32
32
 
33
+ ## Tool Strategy
34
+
35
+ | Priority | Tool | Use for |
36
+ |----------|------|---------|
37
+ | 1st | Glob | File discovery — map structure before reading |
38
+ | 2nd | Grep | Pattern detection — imports, configs, conventions |
39
+ | 3rd | Read | Representative files — 1-2 per module, not everything |
40
+ | 4th | Bash | Dependency analysis — `ls`, `wc`, lockfile parsing |
41
+
42
+ Scan wide, read selectively. Do NOT read every file — use Glob/Grep to identify what matters, then Read only representative samples.
43
+
33
44
  ## Analysis to perform
34
45
 
35
46
  ### 1. Stack detection
@@ -32,6 +32,16 @@ Your summary report (not the file) is what the command sees immediately. Make th
32
32
  ## Project Context
33
33
  After mandatory read, check `.claude/skills/` for existing project knowledge on the research topic. Avoid recommending solutions that contradict learned skills.
34
34
 
35
+ ## Tool Strategy
36
+
37
+ | Priority | Tool | Use for | Trust |
38
+ |----------|------|---------|-------|
39
+ | 1st | WebFetch | Official docs, READMEs, changelogs (when you have the URL) | High |
40
+ | 2nd | WebSearch | Ecosystem discovery, community patterns, comparisons | Verify first |
41
+ | 3rd | Read + Grep | Existing project code for patterns and prior decisions | High |
42
+
43
+ **Verification protocol:** If a finding comes only from WebSearch, verify against official docs (WebFetch) before recommending. Mark unverified claims as "LOW confidence" in your output. Training data is 6-18 months stale — prefer live sources.
44
+
35
45
  ## Types of research
36
46
 
37
47
  ### 1. Libraries/frameworks (BUILD-OR-BUY)
@@ -24,6 +24,16 @@ Answer with a clear viable/not-viable verdict. If viable, include the suggested
24
24
  ## Project Context
25
25
  After mandatory read, check `.claude/skills/` for existing knowledge about the topic — someone may have already explored this.
26
26
 
27
+ ## Tool Strategy
28
+
29
+ | Priority | Tool | Use for | Trust |
30
+ |----------|------|---------|-------|
31
+ | 1st | Read + Grep | Check existing code and prior research (docs/research/) | High |
32
+ | 2nd | WebSearch | Find examples, docs, known issues | Verify first |
33
+ | 3rd | Bash (in /tmp) | Test viability with disposable POC | High (empirical) |
34
+
35
+ Prefer empirical evidence (run it) over theoretical research (read about it). If you can test it in /tmp in under 5 minutes, test it.
36
+
27
37
  1. Investigate: docs, existing code, libs
28
38
  2. If you need to try something, do it in /tmp (disposable POC)
29
39
  3. Answer the question concretely
@@ -60,7 +60,12 @@ The agent:
60
60
  - If "yes": implement the fix, run tests, commit
61
61
  - Run skill extraction check (see below)
62
62
  - Move session to `.planning/debug/resolved/[date]-[title-slug].md`
63
- - Report: "Bug resolved. Fix applied and committed."
63
+ - Report:
64
+ ```
65
+ Bug resolved. Fix applied and committed.
66
+
67
+ Next: `/cpw-next-step` to continue where you left off.
68
+ ```
64
69
 
65
70
  ### Skill extraction check
66
71
  After confirming the debug conclusion, run these 5 questions internally:
@@ -107,7 +112,12 @@ If no self-check triggers or gates don't pass: continue normally.
107
112
  - If attempts remain:
108
113
  "Attempt [N]/[max]. Eliminated causes: [list]. Do you want to continue? (yes/no/increase limit)"
109
114
  - If the limit is reached:
110
- "All [max] attempts exhausted. Options: (a) increase limit, (b) escalate to /cpw-impact, (c) close as unresolved."
115
+ ```
116
+ All [max] attempts exhausted.
117
+
118
+ Recommended: close as unresolved and continue with `/cpw-next-step`.
119
+ Alternatives: (a) increase limit (b) escalate to /cpw-impact
120
+ ```
111
121
 
112
122
  ## 5. BETWEEN SESSIONS
113
123
  When the user returns (new /cpw-debug or /cpw-next-step that detects an active session):
@@ -65,3 +65,10 @@ The agent checks:
65
65
 
66
66
  If the agent reports "ok": include in diagnostic as passed.
67
67
  If problems found: include in diagnostic with the agent's report.
68
+
69
+ ## 5. REPORT
70
+
71
+ After all checks complete, present the full diagnostic and guide next steps:
72
+ - If everything passed: "Project healthy. Continue with `/cpw-next-step`."
73
+ - If repairs were applied: "Repairs applied. Run `/cpw-health` again to verify, or continue with `/cpw-next-step`."
74
+ - If issues remain unresolved: "Unresolved issues listed above. Fix them manually, then run `/cpw-next-step`."
@@ -33,11 +33,30 @@ Delegate to the session-recovery agent in CHECK mode:
33
33
 
34
34
  If stage = CORRECTION:
35
35
  - Read "Pending corrections" from STATUS.md
36
- - Show the list to the user
37
- - Resolve each correction one by one
38
- - After fixing all: `make commit m="fix(phase-N): validator corrections"`
39
- - Report: "Corrections resolved. Re-running phase validation..."
40
- - Go to step 3 (Phase validation) to re-validate
36
+ - Read "Correction attempts" from session notes (default: 0)
37
+ - Show the list to the user. For each correction, offer:
38
+ - **Fix** resolve the correction now
39
+ - **Defer** move to next phase as a known issue (logged in plans/decisions.md)
40
+ - **Skip** not applicable, remove with justification
41
+
42
+ - After processing all corrections (fixed, deferred, or skipped):
43
+ - If any were fixed: `make commit m="fix(phase-N): validator corrections"`
44
+ - If any were deferred: add to plans/decisions.md as "Deferred from Phase N validation: [description]"
45
+ - Increment "Correction attempts" in STATUS.md session notes
46
+
47
+ - If correction attempts >= 2 AND there are still unfixed corrections:
48
+ ```
49
+ Phase N has been through 2 correction rounds with remaining issues.
50
+
51
+ Options:
52
+ 1. Fix remaining corrections (one more round)
53
+ 2. Defer all remaining to next phase and advance
54
+ 3. Run /cpw-health for a full diagnostic
55
+ ```
56
+
57
+ - If all corrections are fixed or deferred:
58
+ - Re-run phase validation (step 3) — but ONLY for fixed items
59
+ - Deferred items do NOT block phase advancement
41
60
 
42
61
  ## 1.4 Branch creation (only at phase start, non-trunk strategies)
43
62
 
@@ -376,6 +395,7 @@ Wait for its complete report.
376
395
  ## Session notes
377
396
  - Phase-validator found [X] corrections
378
397
  ```
398
+ - If there are deferred corrections from a previous round, do NOT re-add them — they are already in plans/decisions.md
379
399
  - Report: "Phase N has pending corrections. Run /cpw-next-step to resolve them."
380
400
  - STOP here. The next /cpw-next-step invocation will detect stage = CORRECTION and handle fixes, then re-run phase validation.
381
401
 
@@ -80,4 +80,9 @@ Add a line to `.planning/quick/log.md`:
80
80
  | [date] | [description] | [changed files] | [short commit hash] |
81
81
  ```
82
82
 
83
- Report: "Quick task completed. If this generated more work, consider adding it to the plan with /cpw-next-step."
83
+ Report:
84
+ ```
85
+ Quick task completed.
86
+
87
+ Next: `/cpw-next-step` to continue with the plan.
88
+ ```
@@ -158,6 +158,8 @@ Move processed entries to `.planning/learnings/applied.md` with this format:
158
158
  ```
159
159
  Remove processed entries from queue.md.
160
160
 
161
+ Report: "Learnings applied. Continue with `/cpw-next-step`."
162
+
161
163
  ## 6. Deduplication (only with --dedupe)
162
164
 
163
165
  ### 6.1 Load destinations
@@ -207,3 +209,5 @@ Unique entries: N (no changes needed)
207
209
  - For each similar group: ask whether to apply the consolidated version
208
210
  - Apply approved changes with Edit
209
211
  - `make commit m="learn: deduplicate learnings"`
212
+
213
+ Report: "Deduplication complete. Continue with `/cpw-next-step`."
@@ -314,8 +314,14 @@ Present the plan phase by phase for review:
314
314
 
315
315
  ## 6. COMMIT AND START
316
316
  - `make commit m="chore: initial plan from startup ([mode])"`
317
- - Report: "Plan generated. Run `/clear` first to reset context, then:"
318
- - " 1. `/cpw-discuss` — clarify ambiguities before building (recommended)"
319
- - " 2. `/cpw-todos` — review pending todos before starting"
320
- - " 3. `/cpw-next-step` — start Phase 0 directly"
321
317
  - IMPORTANT: startup fills the context window significantly. Always recommend `/clear` before continuing.
318
+ - Report:
319
+ ```
320
+ Plan generated and committed.
321
+
322
+ Next: run `/clear`, then `/cpw-next-step`
323
+
324
+ Optional before starting:
325
+ /cpw-discuss — clarify ambiguities for the current phase
326
+ /cpw-todos — review pending todos
327
+ ```
@@ -45,7 +45,7 @@ Append to `.planning/quick/log.md`:
45
45
  ```
46
46
 
47
47
  ### 5. Confirm and continue
48
- Report: "Captured: [description]. Continue with current work."
48
+ Report: "Captured: [description]. Continue with `/cpw-next-step`."
49
49
  Do NOT change context, read additional files, or start working on the todo.
50
50
 
51
51
  ---
@@ -98,3 +98,6 @@ Actions:
98
98
 
99
99
  ### Action d: Back to list
100
100
  - Return to step 2
101
+
102
+ When the user is done reviewing (no more selections or says "done"):
103
+ Report: "Todo review complete. Continue with `/cpw-next-step`."