prizmkit 1.1.1 → 1.1.3
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/bundled/VERSION.json +3 -3
- package/bundled/adapters/claude/agent-adapter.js +18 -0
- package/bundled/adapters/claude/command-adapter.js +1 -27
- package/bundled/agents/prizm-dev-team-critic.md +2 -0
- package/bundled/agents/prizm-dev-team-dev.md +2 -0
- package/bundled/agents/prizm-dev-team-reviewer.md +2 -0
- package/bundled/dev-pipeline/README.md +63 -63
- package/bundled/dev-pipeline/assets/feature-list-example.json +1 -1
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +1 -1
- package/bundled/dev-pipeline/{launch-daemon.sh → launch-feature-daemon.sh} +33 -33
- package/bundled/dev-pipeline/launch-refactor-daemon.sh +454 -0
- package/bundled/dev-pipeline/lib/branch.sh +1 -1
- package/bundled/dev-pipeline/reset-feature.sh +3 -3
- package/bundled/dev-pipeline/reset-refactor.sh +312 -0
- package/bundled/dev-pipeline/{retry-bug.sh → retry-bugfix.sh} +47 -59
- package/bundled/dev-pipeline/retry-feature.sh +41 -54
- package/bundled/dev-pipeline/retry-refactor.sh +358 -0
- package/bundled/dev-pipeline/run-bugfix.sh +6 -0
- package/bundled/dev-pipeline/{run.sh → run-feature.sh} +31 -31
- package/bundled/dev-pipeline/run-refactor.sh +787 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +177 -10
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +419 -0
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +393 -0
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +726 -0
- package/bundled/dev-pipeline/templates/agent-prompts/critic-code-challenge.md +13 -0
- package/bundled/dev-pipeline/templates/agent-prompts/critic-plan-challenge.md +7 -0
- package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +7 -0
- package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +26 -0
- package/bundled/dev-pipeline/templates/agent-prompts/dev-resume.md +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +12 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +29 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +8 -7
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +11 -10
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +2 -3
- package/bundled/dev-pipeline/templates/feature-list-schema.json +1 -1
- package/bundled/dev-pipeline/templates/refactor-list-schema.json +159 -0
- package/bundled/dev-pipeline/templates/sections/ac-verification-checklist.md +13 -0
- package/bundled/dev-pipeline/templates/sections/feature-context.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +9 -8
- package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +9 -8
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +2 -1
- package/bundled/dev-pipeline/templates/sections/phase-critic-code.md +8 -10
- package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +9 -10
- package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +8 -9
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +7 -10
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +8 -15
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +7 -12
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +8 -19
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery.md +75 -0
- package/bundled/skills/_metadata.json +33 -6
- package/bundled/skills/app-planner/SKILL.md +105 -320
- package/bundled/skills/app-planner/assets/app-design-guide.md +101 -0
- package/bundled/skills/app-planner/references/frontend-design-guide.md +1 -1
- package/bundled/skills/app-planner/references/project-brief-guide.md +49 -80
- package/bundled/skills/bug-fix-workflow/SKILL.md +2 -2
- package/bundled/skills/bug-planner/SKILL.md +68 -5
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +3 -2
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +19 -5
- package/bundled/skills/{dev-pipeline-launcher → feature-pipeline-launcher}/SKILL.md +32 -32
- package/bundled/skills/feature-planner/SKILL.md +337 -0
- package/bundled/skills/{app-planner → feature-planner}/assets/evaluation-guide.md +4 -4
- package/bundled/skills/{app-planner → feature-planner}/assets/planning-guide.md +3 -171
- package/bundled/skills/{app-planner → feature-planner}/references/browser-interaction.md +6 -5
- package/bundled/skills/feature-planner/references/decomposition-patterns.md +75 -0
- package/bundled/skills/{app-planner → feature-planner}/references/error-recovery.md +8 -8
- package/bundled/skills/{app-planner → feature-planner}/references/incremental-feature-planning.md +1 -1
- package/bundled/skills/{app-planner/references/new-app-planning.md → feature-planner/references/new-project-planning.md} +1 -1
- package/bundled/skills/{app-planner → feature-planner}/scripts/validate-and-generate.py +4 -4
- package/bundled/skills/feature-workflow/SKILL.md +23 -23
- package/bundled/skills/prizm-kit/SKILL.md +1 -3
- package/bundled/skills/prizmkit-analyze/SKILL.md +2 -5
- package/bundled/skills/prizmkit-code-review/SKILL.md +2 -2
- package/bundled/skills/prizmkit-committer/SKILL.md +4 -8
- package/bundled/skills/prizmkit-deploy/SKILL.md +1 -5
- package/bundled/skills/prizmkit-implement/SKILL.md +3 -50
- package/bundled/skills/prizmkit-init/SKILL.md +5 -77
- package/bundled/skills/prizmkit-plan/SKILL.md +1 -12
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +6 -24
- package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +21 -0
- package/bundled/skills/prizmkit-retrospective/SKILL.md +12 -117
- package/bundled/skills/recovery-workflow/SKILL.md +166 -316
- package/bundled/skills/recovery-workflow/evals/evals.json +29 -13
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +232 -274
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +352 -0
- package/bundled/skills/refactor-planner/SKILL.md +436 -0
- package/bundled/skills/refactor-planner/assets/planning-guide.md +292 -0
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +301 -0
- package/bundled/skills/refactor-planner/references/refactor-scoping-guide.md +221 -0
- package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +786 -0
- package/bundled/skills/refactor-workflow/SKILL.md +299 -319
- package/package.json +1 -1
- package/src/clean.js +3 -3
- package/src/scaffold.js +6 -6
- package/bundled/skills/prizmkit-plan/assets/spec-template.md +0 -56
- package/bundled/skills/prizmkit-plan/references/clarify-guide.md +0 -67
- package/src/config.js +0 -504
- package/src/prompts.js +0 -210
- /package/bundled/skills/{dev-pipeline-launcher → feature-pipeline-launcher}/scripts/preflight-check.py +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Refactor Scoping Guide
|
|
2
|
+
|
|
3
|
+
This guide helps assess refactoring scope, determine the appropriate approach, and identify risks before decomposing into executable items.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Scope Classification
|
|
8
|
+
|
|
9
|
+
Every refactoring effort falls into one of three scope categories. Classification determines the planning depth required.
|
|
10
|
+
|
|
11
|
+
### Incremental Refactoring
|
|
12
|
+
|
|
13
|
+
**Definition**: Gradual, low-risk improvements applied piece by piece. Each step is independently deployable.
|
|
14
|
+
|
|
15
|
+
**Characteristics**:
|
|
16
|
+
- Targets a specific area without restructuring the whole module
|
|
17
|
+
- Each item can be merged independently
|
|
18
|
+
- Low coordination overhead between items
|
|
19
|
+
- Suitable for ongoing tech debt reduction
|
|
20
|
+
|
|
21
|
+
**When to use**:
|
|
22
|
+
- Code smell is localized (one file, one function, one class)
|
|
23
|
+
- Team wants continuous improvement without large PRs
|
|
24
|
+
- Risk tolerance is low
|
|
25
|
+
- No architectural changes needed
|
|
26
|
+
|
|
27
|
+
**Planning depth**: Lightweight. Phase 3 (Code Analysis) can be abbreviated. Fast path may apply.
|
|
28
|
+
|
|
29
|
+
### Full Refactoring
|
|
30
|
+
|
|
31
|
+
**Definition**: Comprehensive restructuring of an entire module, subsystem, or architectural layer.
|
|
32
|
+
|
|
33
|
+
**Characteristics**:
|
|
34
|
+
- Touches many files across the target area
|
|
35
|
+
- Items have significant interdependencies
|
|
36
|
+
- Requires careful ordering and coordination
|
|
37
|
+
- Higher risk, bigger payoff
|
|
38
|
+
- May need a feature branch or phased rollout
|
|
39
|
+
|
|
40
|
+
**When to use**:
|
|
41
|
+
- Module has accumulated significant tech debt
|
|
42
|
+
- Current structure actively impedes feature development
|
|
43
|
+
- Multiple code smells are interconnected
|
|
44
|
+
- Architecture needs fundamental restructuring
|
|
45
|
+
|
|
46
|
+
**Planning depth**: Full workflow required. All 7 phases mandatory. No fast path.
|
|
47
|
+
|
|
48
|
+
### Targeted Refactoring
|
|
49
|
+
|
|
50
|
+
**Definition**: Focused on a specific concern, pattern, or dependency — not the entire module.
|
|
51
|
+
|
|
52
|
+
**Characteristics**:
|
|
53
|
+
- Clear, narrow objective (e.g., "extract payment logic", "break circular dependency")
|
|
54
|
+
- May touch multiple files but only for the specific concern
|
|
55
|
+
- Moderate risk
|
|
56
|
+
- Well-defined "done" state
|
|
57
|
+
|
|
58
|
+
**When to use**:
|
|
59
|
+
- Specific pain point identified (circular dependency, god class, leaky abstraction)
|
|
60
|
+
- New feature requires cleaner structure in one area
|
|
61
|
+
- Code review identified a specific structural issue
|
|
62
|
+
|
|
63
|
+
**Planning depth**: Standard workflow. Phase 3 focuses on the specific concern.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 2. File Impact Analysis
|
|
68
|
+
|
|
69
|
+
Before decomposing, assess the blast radius of the proposed refactoring.
|
|
70
|
+
|
|
71
|
+
### Impact Assessment Steps
|
|
72
|
+
|
|
73
|
+
1. **Identify primary targets**: Files/modules directly being refactored
|
|
74
|
+
2. **Trace imports/dependencies**: What files import from the targets?
|
|
75
|
+
3. **Trace test files**: What test files exercise the targets?
|
|
76
|
+
4. **Trace configuration**: Do any config files reference the targets (routes, DI containers, etc.)?
|
|
77
|
+
5. **Count total affected files**: Primary + importing + testing + config
|
|
78
|
+
|
|
79
|
+
### Impact Categories
|
|
80
|
+
|
|
81
|
+
| Affected Files | Impact Level | Planning Implication |
|
|
82
|
+
|---------------|-------------|---------------------|
|
|
83
|
+
| 1-3 | Low | Single item likely sufficient |
|
|
84
|
+
| 4-8 | Medium | 2-4 items, standard workflow |
|
|
85
|
+
| 9-15 | High | 5+ items, careful dependency ordering |
|
|
86
|
+
| 16+ | Very High | Consider phased approach, split into multiple planning sessions |
|
|
87
|
+
|
|
88
|
+
### Dependency Graph Analysis
|
|
89
|
+
|
|
90
|
+
For each target file, map:
|
|
91
|
+
- **Incoming dependencies**: Who imports/uses this file? (blast radius)
|
|
92
|
+
- **Outgoing dependencies**: What does this file import? (coupling assessment)
|
|
93
|
+
- **Circular dependencies**: Does this file participate in any cycles? (critical risk)
|
|
94
|
+
|
|
95
|
+
Tools to assess:
|
|
96
|
+
```bash
|
|
97
|
+
# Find all importers of a module (JS/TS)
|
|
98
|
+
grep -r "from.*['\"].*target-module" --include="*.js" --include="*.ts" -l
|
|
99
|
+
|
|
100
|
+
# Find all importers of a module (Python)
|
|
101
|
+
grep -r "from.*target_module\|import.*target_module" --include="*.py" -l
|
|
102
|
+
|
|
103
|
+
# Count total affected files
|
|
104
|
+
# Primary targets + importers + their test files
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 3. Cross-Module Dependency Assessment
|
|
110
|
+
|
|
111
|
+
Cross-module refactoring carries higher risk because changes ripple through module boundaries.
|
|
112
|
+
|
|
113
|
+
### Assessment Checklist
|
|
114
|
+
|
|
115
|
+
| Question | If Yes |
|
|
116
|
+
|----------|--------|
|
|
117
|
+
| Does the refactoring change any module's public API? | All consumers must be updated. Document API changes explicitly. |
|
|
118
|
+
| Does it change import paths? | All importers must be updated. Consider re-exports for backward compatibility. |
|
|
119
|
+
| Does it move shared types/interfaces? | All type consumers must be updated. May need temporary type aliases. |
|
|
120
|
+
| Does it change event/message contracts? | All subscribers/handlers must be updated. Version the contract if possible. |
|
|
121
|
+
| Does it affect database schema? | Migration required. This may be beyond refactoring scope. |
|
|
122
|
+
| Does it change configuration format? | Config consumers must be updated. Consider backward-compatible format. |
|
|
123
|
+
|
|
124
|
+
### Cross-Module Risk Mitigation
|
|
125
|
+
|
|
126
|
+
1. **Re-export pattern**: When moving a module, leave a re-export at the old path during transition
|
|
127
|
+
2. **Adapter pattern**: When changing an interface, create an adapter that bridges old and new
|
|
128
|
+
3. **Feature flag**: For risky cross-module changes, implement behind a flag
|
|
129
|
+
4. **Phased rollout**: Update consumers module by module, not all at once
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 4. Risk Assessment Framework
|
|
134
|
+
|
|
135
|
+
Assess risk for each refactoring item and for the overall plan.
|
|
136
|
+
|
|
137
|
+
### Per-Item Risk Factors
|
|
138
|
+
|
|
139
|
+
| Factor | Low Risk | Medium Risk | High Risk |
|
|
140
|
+
|--------|----------|-------------|-----------|
|
|
141
|
+
| Test coverage | >80% on target | 40-80% | <40% |
|
|
142
|
+
| Dependency count | 0-2 dependents | 3-5 dependents | 6+ dependents |
|
|
143
|
+
| Code age | Recently written/modified | 6-12 months old | 1+ year untouched |
|
|
144
|
+
| Documentation | Well-documented | Partially documented | No documentation |
|
|
145
|
+
| Complexity (cyclomatic) | <10 | 10-20 | >20 |
|
|
146
|
+
| Cross-module impact | None | 1 other module | 2+ other modules |
|
|
147
|
+
|
|
148
|
+
### Overall Plan Risk
|
|
149
|
+
|
|
150
|
+
Aggregate item risks to assess the plan:
|
|
151
|
+
- **Low risk plan**: All items are low risk, or mostly low with 1-2 medium
|
|
152
|
+
- **Medium risk plan**: Mix of low and medium, or 1-2 high risk items
|
|
153
|
+
- **High risk plan**: Multiple high risk items, or cross-module migration
|
|
154
|
+
|
|
155
|
+
### Risk Mitigation Strategies
|
|
156
|
+
|
|
157
|
+
| Risk Level | Strategy |
|
|
158
|
+
|-----------|----------|
|
|
159
|
+
| Low | Standard test-gate, proceed normally |
|
|
160
|
+
| Medium | Ensure snapshot comparison, add extra acceptance criteria |
|
|
161
|
+
| High | Require manual verification step, consider writing tests first, split into smaller items |
|
|
162
|
+
| Very High | Recommend writing comprehensive tests before refactoring, consider phased approach across multiple sessions |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 5. When to Split Large Refactors
|
|
167
|
+
|
|
168
|
+
### Splitting Heuristics
|
|
169
|
+
|
|
170
|
+
Split a refactoring plan into multiple sessions when:
|
|
171
|
+
|
|
172
|
+
1. **Item count exceeds 8**: More than 8 items in a single plan increases coordination risk. Split into logical phases.
|
|
173
|
+
2. **Estimated duration exceeds a day**: If the pipeline is expected to run for many hours, split at natural boundaries.
|
|
174
|
+
3. **Risk accumulates**: If items 1-4 are low risk but items 5-8 are high risk, execute them in separate sessions to validate the foundation first.
|
|
175
|
+
4. **Cross-module boundaries**: If the refactoring touches modules A and B, consider separate plans for each module.
|
|
176
|
+
5. **Different preservation strategies needed**: If some items need test-gate and others need manual verification, split to handle each strategy appropriately.
|
|
177
|
+
|
|
178
|
+
### How to Split
|
|
179
|
+
|
|
180
|
+
1. **By module**: Each module gets its own `refactor-list.json` session
|
|
181
|
+
2. **By risk level**: Low-risk items first, high-risk items in a subsequent session
|
|
182
|
+
3. **By operation type**: All renames first, then extracts, then structural changes
|
|
183
|
+
4. **By dependency layer**: Foundation changes first, consumer updates second
|
|
184
|
+
|
|
185
|
+
### Merging Split Plans
|
|
186
|
+
|
|
187
|
+
When executing split plans sequentially:
|
|
188
|
+
- Run the first plan fully (including validation)
|
|
189
|
+
- Verify all tests pass after the first plan
|
|
190
|
+
- Then start planning the second phase (the codebase has changed)
|
|
191
|
+
- Do NOT pre-plan the second phase based on the original code state
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 6. Scope Boundary Enforcement
|
|
196
|
+
|
|
197
|
+
During planning, actively enforce scope boundaries to prevent scope creep.
|
|
198
|
+
|
|
199
|
+
### In-Scope Markers
|
|
200
|
+
|
|
201
|
+
Explicitly define what IS in scope:
|
|
202
|
+
- Specific files or directories
|
|
203
|
+
- Specific refactoring operations
|
|
204
|
+
- Specific code smells being addressed
|
|
205
|
+
|
|
206
|
+
### Out-of-Scope Markers
|
|
207
|
+
|
|
208
|
+
Explicitly define what is NOT in scope:
|
|
209
|
+
- New features (redirect to `feature-planner`)
|
|
210
|
+
- Bug fixes (redirect to `bug-planner`)
|
|
211
|
+
- Performance optimization that changes behavior
|
|
212
|
+
- Database schema changes (requires migration planning)
|
|
213
|
+
- API contract changes (requires consumer coordination)
|
|
214
|
+
|
|
215
|
+
### Scope Creep Detection
|
|
216
|
+
|
|
217
|
+
Flag and discuss with the user when:
|
|
218
|
+
- A refactoring item implies new functionality
|
|
219
|
+
- An item requires changing external interfaces
|
|
220
|
+
- An item's description includes "also add" or "while we're at it"
|
|
221
|
+
- An item's acceptance criteria describe new behavior, not preserved behavior
|