@claude-pw/framework 0.7.0 → 0.8.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/install.js +2 -2
- package/package.json +1 -1
- package/templates/claude/agents/code-reviewer.md +77 -0
- package/templates/claude/agents/codebase-mapper.md +39 -0
- package/templates/claude/agents/debugger.md +1 -0
- package/templates/claude/agents/decision-impact.md +1 -0
- package/templates/claude/agents/implementer.md +1 -0
- package/templates/claude/agents/interface-reviewer.md +1 -0
- package/templates/claude/agents/learning-extractor.md +2 -0
- package/templates/claude/agents/plan-checker.md +1 -0
- package/templates/claude/agents/researcher.md +6 -5
- package/templates/claude/agents/spike-explorer.md +1 -0
- package/templates/claude/commands/cpw-next-step.md +1 -6
- package/templates/claude/settings.json +0 -9
- package/templates/claude/hooks/cpw-phase-approve.sh +0 -16
package/install.js
CHANGED
|
@@ -117,13 +117,13 @@ function applyModelProfile(agentsDir, configFile) {
|
|
|
117
117
|
'phase-validator': 'opus', 'session-recovery': 'opus', debugger: 'opus',
|
|
118
118
|
researcher: 'opus', 'codebase-mapper': 'opus', 'plan-checker': 'opus',
|
|
119
119
|
'spike-explorer': 'opus', 'decision-impact': 'opus', 'interface-reviewer': 'opus',
|
|
120
|
-
'learning-extractor': 'opus', implementer: 'opus',
|
|
120
|
+
'learning-extractor': 'opus', implementer: 'opus', 'code-reviewer': 'opus',
|
|
121
121
|
},
|
|
122
122
|
budget: {
|
|
123
123
|
'phase-validator': 'sonnet', 'session-recovery': 'haiku', debugger: 'haiku',
|
|
124
124
|
researcher: 'sonnet', 'codebase-mapper': 'haiku', 'plan-checker': 'haiku',
|
|
125
125
|
'spike-explorer': 'haiku', 'decision-impact': 'haiku', 'interface-reviewer': 'haiku',
|
|
126
|
-
'learning-extractor': 'haiku', implementer: 'sonnet',
|
|
126
|
+
'learning-extractor': 'haiku', implementer: 'sonnet', 'code-reviewer': 'sonnet',
|
|
127
127
|
},
|
|
128
128
|
};
|
|
129
129
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-reviewer
|
|
3
|
+
description: Code review — security, quality, performance, conventions compliance
|
|
4
|
+
tools: Read, Glob, Grep, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
memory: project
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
> **Mandatory Initial Read**: If your prompt contains a `<files_to_read>` block, you MUST read every listed file before any other action. Skip files marked `(if exists)` when absent. This is your primary context.
|
|
10
|
+
|
|
11
|
+
## Pipeline Context
|
|
12
|
+
|
|
13
|
+
### Called by
|
|
14
|
+
- `/cpw-next-step` ACCEPTANCE stage (optional — when step involves significant code changes)
|
|
15
|
+
- User directly for ad-hoc reviews
|
|
16
|
+
|
|
17
|
+
### Output consumed by
|
|
18
|
+
- `/cpw-next-step` includes review findings in ACCEPTANCE summary
|
|
19
|
+
- User reads directly for ad-hoc reviews
|
|
20
|
+
|
|
21
|
+
Report problems only. If everything is clean: "Review passed."
|
|
22
|
+
|
|
23
|
+
## Project Context
|
|
24
|
+
After mandatory read, check `docs/conventions.md` and `.claude/rules/` for project-specific standards to enforce.
|
|
25
|
+
|
|
26
|
+
## Review dimensions
|
|
27
|
+
|
|
28
|
+
### 1. Security (check first)
|
|
29
|
+
- Input validation on all external data
|
|
30
|
+
- No hardcoded secrets, tokens, or credentials
|
|
31
|
+
- SQL/NoSQL injection vectors
|
|
32
|
+
- XSS in rendered output
|
|
33
|
+
- Auth/authz on protected routes
|
|
34
|
+
- Sensitive data exposure in logs or errors
|
|
35
|
+
|
|
36
|
+
### 2. Correctness
|
|
37
|
+
- Logic matches the design intent
|
|
38
|
+
- Edge cases handled (null, empty, boundary values)
|
|
39
|
+
- Error handling: no silent failures, errors propagated or logged
|
|
40
|
+
- Resource cleanup (connections, file handles, timers)
|
|
41
|
+
|
|
42
|
+
### 3. Performance
|
|
43
|
+
- No N+1 queries or unbounded loops
|
|
44
|
+
- Appropriate use of indexes, caching, pagination
|
|
45
|
+
- No unnecessary re-renders or re-computations
|
|
46
|
+
- Async operations where I/O bound
|
|
47
|
+
|
|
48
|
+
### 4. Conventions compliance
|
|
49
|
+
- Follows `docs/conventions.md` if it exists
|
|
50
|
+
- Follows `.claude/rules/*.md` patterns
|
|
51
|
+
- Consistent naming, structure, error handling with rest of codebase
|
|
52
|
+
- No `any` / `unknown` without justification (TypeScript)
|
|
53
|
+
|
|
54
|
+
### 5. Test coverage
|
|
55
|
+
- New code has corresponding tests
|
|
56
|
+
- Edge cases tested
|
|
57
|
+
- Tests are meaningful (not just coverage theater)
|
|
58
|
+
|
|
59
|
+
## Output format
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
## Code Review
|
|
63
|
+
|
|
64
|
+
### Critical (must fix)
|
|
65
|
+
- [file:line] [description]
|
|
66
|
+
|
|
67
|
+
### Warnings (should fix)
|
|
68
|
+
- [file:line] [description]
|
|
69
|
+
|
|
70
|
+
### Suggestions (nice to have)
|
|
71
|
+
- [file:line] [description]
|
|
72
|
+
|
|
73
|
+
### Passed
|
|
74
|
+
- [what was checked and found clean]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
If no issues found in a category, omit it. If all clean: "Review passed."
|
|
@@ -3,6 +3,7 @@ name: codebase-mapper
|
|
|
3
3
|
description: Analyzes existing codebase and produces structured documentation
|
|
4
4
|
tools: Read, Glob, Grep, Bash
|
|
5
5
|
model: sonnet
|
|
6
|
+
memory: project
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
You analyze an existing codebase to document its current state.
|
|
@@ -24,6 +25,9 @@ You analyze an existing codebase to document its current state.
|
|
|
24
25
|
| `## Conventions` | `docs/conventions.md` | Code style rules for the project |
|
|
25
26
|
| `## Integrations` | `docs/architecture.md` | Dependency mapping |
|
|
26
27
|
| `## Concerns` | `docs/tech-debt.md` | Bluefield rewrite prioritization |
|
|
28
|
+
| `## Dependencies` | `docs/architecture.md` | Dependency audit, upgrade planning |
|
|
29
|
+
| `## Patterns` | `docs/architecture.md` | Architecture decisions |
|
|
30
|
+
| `## Dev Workflow` | `docs/tooling.md` | Makefile generation, onboarding |
|
|
27
31
|
|
|
28
32
|
Use the exact section headers above — the startup command parses them by name.
|
|
29
33
|
|
|
@@ -76,6 +80,22 @@ Scan wide, read selectively. Do NOT read every file — use Glob/Grep to identif
|
|
|
76
80
|
- Identify services: databases, caches, message queues, cloud services
|
|
77
81
|
- Result: list of integrations with type and usage
|
|
78
82
|
|
|
83
|
+
### 5.5 Dependency analysis
|
|
84
|
+
- Identify top 10 significant dependencies (skip types packages and basic utils)
|
|
85
|
+
- For each: what it does in THIS project's context, not generic description
|
|
86
|
+
- Flag version constraints that matter (e.g., React 18 vs 19, Next.js 14 vs 15)
|
|
87
|
+
- Note unusual or custom packages (anything not widely known)
|
|
88
|
+
- Result: dependency table with role and notes
|
|
89
|
+
|
|
90
|
+
### 5.7 Pattern recognition
|
|
91
|
+
Detect these patterns if present:
|
|
92
|
+
- **Monorepo**: packages/, apps/, turbo.json, pnpm-workspace.yaml, lerna.json
|
|
93
|
+
- **State management**: Redux, Zustand, Jotai, Pinia, MobX, Context API
|
|
94
|
+
- **Auth**: NextAuth, Clerk, Auth0, Supabase Auth, custom JWT
|
|
95
|
+
- **Deployment**: vercel.json, netlify.toml, fly.toml, Dockerfile, k8s/
|
|
96
|
+
- **Data flow**: trace how data moves from user action → API → database → response
|
|
97
|
+
- Result: list of detected patterns with confidence
|
|
98
|
+
|
|
79
99
|
### 6. Concerns and technical debt
|
|
80
100
|
- Search for: TODO, FIXME, HACK, XXX, TEMP in the code
|
|
81
101
|
- Identify large files (>400 lines)
|
|
@@ -109,6 +129,25 @@ The /cpw-startup command handles splitting it into docs/ files.
|
|
|
109
129
|
## Integrations
|
|
110
130
|
[table: name, type, usage]
|
|
111
131
|
|
|
132
|
+
## Dependencies
|
|
133
|
+
| Package | Role in project | Version | Notes |
|
|
134
|
+
|---------|----------------|---------|-------|
|
|
135
|
+
[top 10 significant deps]
|
|
136
|
+
|
|
137
|
+
## Patterns
|
|
138
|
+
- Monorepo: [yes/no — tool if yes]
|
|
139
|
+
- State: [library or "none"]
|
|
140
|
+
- Auth: [approach]
|
|
141
|
+
- Deploy: [target]
|
|
142
|
+
- Data flow: [user → API → DB → response summary]
|
|
143
|
+
|
|
144
|
+
## Dev Workflow
|
|
145
|
+
- Install: [command]
|
|
146
|
+
- Dev: [command]
|
|
147
|
+
- Test: [command]
|
|
148
|
+
- Build: [command]
|
|
149
|
+
- Deploy: [command or "manual"]
|
|
150
|
+
|
|
112
151
|
## Concerns
|
|
113
152
|
[prioritized list with location]
|
|
114
153
|
```
|
|
@@ -3,6 +3,7 @@ name: decision-impact
|
|
|
3
3
|
description: Impact of a decision on the entire plan
|
|
4
4
|
tools: Read, Glob, Grep
|
|
5
5
|
model: sonnet
|
|
6
|
+
maxTurns: 10
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
> **Mandatory Initial Read**: If your prompt contains a `<files_to_read>` block, you MUST read every listed file before any other action. Skip files marked `(if exists)` when absent. This is your primary context.
|
|
@@ -3,6 +3,7 @@ name: implementer
|
|
|
3
3
|
description: Implements approved design and runs tests in fresh context — keeps orchestrator lean
|
|
4
4
|
tools: Read, Glob, Grep, Bash, Write, Edit
|
|
5
5
|
model: sonnet
|
|
6
|
+
maxTurns: 50
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
You receive an approved design and implement it with a fresh context window.
|
|
@@ -3,6 +3,7 @@ name: interface-reviewer
|
|
|
3
3
|
description: Interface consistency
|
|
4
4
|
tools: Read, Glob, Grep
|
|
5
5
|
model: sonnet
|
|
6
|
+
maxTurns: 10
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
> **Mandatory Initial Read**: If your prompt contains a `<files_to_read>` block, you MUST read every listed file before any other action. Skip files marked `(if exists)` when absent. This is your primary context.
|
|
@@ -3,6 +3,8 @@ name: learning-extractor
|
|
|
3
3
|
description: Analyzes session corrections and extracts actionable learnings
|
|
4
4
|
tools: Read, Glob, Grep
|
|
5
5
|
model: haiku
|
|
6
|
+
memory: project
|
|
7
|
+
maxTurns: 5
|
|
6
8
|
---
|
|
7
9
|
|
|
8
10
|
Your job: decide if a correction is a generalizable learning and where it should live.
|
|
@@ -3,6 +3,7 @@ name: plan-checker
|
|
|
3
3
|
description: Project status without polluting context
|
|
4
4
|
tools: Read, Glob, Grep
|
|
5
5
|
model: sonnet
|
|
6
|
+
maxTurns: 5
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
> **Mandatory Initial Read**: If your prompt contains a `<files_to_read>` block, you MUST read every listed file before any other action. Skip files marked `(if exists)` when absent. This is your primary context.
|
|
@@ -49,10 +49,11 @@ When asked to evaluate options:
|
|
|
49
49
|
- Search top 3-5 options in npm/pypi/crates/etc.
|
|
50
50
|
- For each one evaluate:
|
|
51
51
|
- Maintenance: last release, commit frequency, open issues
|
|
52
|
-
- Popularity: downloads, stars
|
|
52
|
+
- Popularity: downloads, stars, community size
|
|
53
53
|
- API: quality, documentation, examples
|
|
54
54
|
- Size: bundle size, transitive dependencies
|
|
55
55
|
- License: compatible?
|
|
56
|
+
- Community: adoption trends, known issues, expert opinions
|
|
56
57
|
- Recommend one with justification
|
|
57
58
|
|
|
58
59
|
### 2. Architecture/patterns
|
|
@@ -79,17 +80,17 @@ Context: [what decision this research feeds]
|
|
|
79
80
|
Type: [library | architecture | feasibility]
|
|
80
81
|
|
|
81
82
|
## Findings
|
|
82
|
-
[concrete findings with data]
|
|
83
|
+
[concrete findings with data — mark each as HIGH/MEDIUM/LOW confidence]
|
|
83
84
|
|
|
84
85
|
## Options (if applicable)
|
|
85
|
-
| Option | Pros | Cons | Recommendation |
|
|
86
|
-
|
|
86
|
+
| Option | Pros | Cons | Community adoption | Recommendation |
|
|
87
|
+
|--------|------|------|-------------------|----------------|
|
|
87
88
|
|
|
88
89
|
## Recommendation
|
|
89
90
|
[concrete recommendation with justification]
|
|
90
91
|
|
|
91
92
|
## Sources
|
|
92
|
-
|
|
93
|
+
[numbered citations — use format: [N] Author/Project. "Title." Platform, Date. URL]
|
|
93
94
|
```
|
|
94
95
|
|
|
95
96
|
Report summary to the caller. The detail stays in the file for future reference.
|
|
@@ -3,6 +3,7 @@ name: spike-explorer
|
|
|
3
3
|
description: Isolated technical exploration -- tests code and reports feasibility
|
|
4
4
|
tools: Read, Glob, Grep, Bash, WebSearch
|
|
5
5
|
model: sonnet
|
|
6
|
+
maxTurns: 20
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
Difference from researcher: you TEST code (disposable POC). The researcher only searches for info.
|
|
@@ -8,10 +8,6 @@ description: "Load context and execute the next pipeline stage"
|
|
|
8
8
|
|
|
9
9
|
## 0. Health check (session start)
|
|
10
10
|
|
|
11
|
-
### Orphan phase-active cleanup
|
|
12
|
-
If `.planning/.phase-active` exists AND `--phase` flag is NOT active:
|
|
13
|
-
- Delete the file (leftover from interrupted session)
|
|
14
|
-
|
|
15
11
|
### Post-update detection
|
|
16
12
|
If `.planning/.updated-from` exists:
|
|
17
13
|
- Read the file — it contains the previous version
|
|
@@ -270,7 +266,7 @@ Estimated context resets: [N / based on step count, suggest /clear every 3 steps
|
|
|
270
266
|
```
|
|
271
267
|
|
|
272
268
|
Ask: "Execute this plan? (yes / adjust / cancel)"
|
|
273
|
-
- **yes**:
|
|
269
|
+
- **yes**: proceed with auto-advance. When delegating to agents during --phase, spawn them with `permissionMode: bypassPermissions` to avoid permission interruptions.
|
|
274
270
|
- **adjust**: ask what to change (skip a step, reorder, modify pipeline). Update sub-plan if needed, re-present.
|
|
275
271
|
- **cancel**: exit --phase mode, continue as normal /cpw-next-step (step by step)
|
|
276
272
|
|
|
@@ -580,7 +576,6 @@ If all deliverables passed (or issues were fixed):
|
|
|
580
576
|
## Session notes
|
|
581
577
|
- (empty)
|
|
582
578
|
```
|
|
583
|
-
- Delete `.planning/.phase-active` if it exists (re-enables normal tool permissions)
|
|
584
579
|
- If `--phase` flag is active: STOP. Do NOT advance to next phase. Report:
|
|
585
580
|
```
|
|
586
581
|
Phase N complete. UAT passed.
|
|
@@ -4,15 +4,6 @@
|
|
|
4
4
|
"command": "node .claude/hooks/cpw-statusline.js"
|
|
5
5
|
},
|
|
6
6
|
"hooks": {
|
|
7
|
-
"PreToolUse": [
|
|
8
|
-
{
|
|
9
|
-
"matcher": "",
|
|
10
|
-
"hooks": [{
|
|
11
|
-
"type": "command",
|
|
12
|
-
"command": "bash .claude/hooks/cpw-phase-approve.sh"
|
|
13
|
-
}]
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
7
|
"UserPromptSubmit": [
|
|
17
8
|
{
|
|
18
9
|
"matcher": "",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Auto-approve tool calls during --phase execution
|
|
3
|
-
# Created by: /cpw-next-step --phase (creates .planning/.phase-active)
|
|
4
|
-
# Removed by: /cpw-next-step at UAT or phase end
|
|
5
|
-
|
|
6
|
-
PHASE_FILE=".planning/.phase-active"
|
|
7
|
-
|
|
8
|
-
if [ -f "$PHASE_FILE" ]; then
|
|
9
|
-
# Check for stale file (>24h)
|
|
10
|
-
if [ "$(find "$PHASE_FILE" -mmin +1440 2>/dev/null)" ]; then
|
|
11
|
-
rm -f "$PHASE_FILE"
|
|
12
|
-
exit 0
|
|
13
|
-
fi
|
|
14
|
-
echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow","permissionDecisionReason":"--phase active: plan approved by user"}}'
|
|
15
|
-
fi
|
|
16
|
-
exit 0
|