claude-code-workflow 7.2.23 → 7.2.24
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/.codex/skills/team-arch-opt/SKILL.md +242 -175
- package/.codex/skills/team-arch-opt/roles/analyzer/role.md +78 -78
- package/.codex/skills/team-arch-opt/roles/coordinator/commands/analyze.md +57 -57
- package/.codex/skills/team-arch-opt/roles/coordinator/commands/monitor.md +246 -204
- package/.codex/skills/team-arch-opt/roles/coordinator/role.md +196 -184
- package/.codex/skills/team-arch-opt/roles/designer/role.md +115 -115
- package/.codex/skills/team-arch-opt/roles/refactorer/role.md +102 -102
- package/.codex/skills/team-arch-opt/roles/reviewer/role.md +111 -111
- package/.codex/skills/team-arch-opt/roles/validator/role.md +115 -115
- package/.codex/skills/team-arch-opt/specs/pipelines.md +102 -102
- package/.codex/skills/team-brainstorm/SKILL.md +72 -4
- package/.codex/skills/team-brainstorm/roles/challenger/role.md +61 -61
- package/.codex/skills/team-brainstorm/roles/coordinator/commands/analyze.md +58 -58
- package/.codex/skills/team-brainstorm/roles/coordinator/commands/monitor.md +212 -171
- package/.codex/skills/team-brainstorm/roles/coordinator/role.md +172 -160
- package/.codex/skills/team-brainstorm/roles/evaluator/role.md +56 -56
- package/.codex/skills/team-brainstorm/roles/ideator/role.md +69 -69
- package/.codex/skills/team-brainstorm/roles/synthesizer/role.md +57 -57
- package/.codex/skills/team-brainstorm/specs/pipelines.md +72 -72
- package/.codex/skills/team-coordinate/SKILL.md +71 -3
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +45 -5
- package/.codex/skills/team-coordinate/roles/coordinator/role.md +402 -389
- package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +111 -111
- package/.codex/skills/team-coordinate/specs/pipelines.md +97 -97
- package/.codex/skills/team-coordinate/specs/quality-gates.md +112 -112
- package/.codex/skills/team-designer/SKILL.md +153 -153
- package/.codex/skills/team-designer/phases/01-requirements-analysis.md +250 -250
- package/.codex/skills/team-designer/phases/02-scaffold-generation.md +228 -228
- package/.codex/skills/team-designer/phases/03-content-generation.md +330 -330
- package/.codex/skills/team-designer/phases/04-validation.md +320 -320
- package/.codex/skills/team-executor/SKILL.md +29 -2
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +23 -15
- package/.codex/skills/team-frontend/SKILL.md +77 -3
- package/.codex/skills/team-frontend/roles/analyst/role.md +92 -92
- package/.codex/skills/team-frontend/roles/architect/role.md +86 -86
- package/.codex/skills/team-frontend/roles/coordinator/commands/analyze.md +52 -52
- package/.codex/skills/team-frontend/roles/coordinator/commands/monitor.md +222 -188
- package/.codex/skills/team-frontend/roles/coordinator/role.md +189 -177
- package/.codex/skills/team-frontend/roles/developer/role.md +93 -93
- package/.codex/skills/team-frontend/roles/qa/role.md +79 -79
- package/.codex/skills/team-frontend/specs/pipelines.md +76 -76
- package/.codex/skills/team-frontend-debug/SKILL.md +66 -3
- package/.codex/skills/team-frontend-debug/roles/analyzer/role.md +208 -208
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +174 -174
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/dispatch.md +198 -198
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/monitor.md +177 -143
- package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +164 -152
- package/.codex/skills/team-frontend-debug/roles/fixer/role.md +147 -147
- package/.codex/skills/team-frontend-debug/roles/reproducer/role.md +147 -147
- package/.codex/skills/team-frontend-debug/roles/tester/role.md +231 -231
- package/.codex/skills/team-frontend-debug/roles/verifier/role.md +172 -172
- package/.codex/skills/team-frontend-debug/specs/debug-tools.md +215 -215
- package/.codex/skills/team-frontend-debug/specs/pipelines.md +94 -94
- package/.codex/skills/team-issue/SKILL.md +83 -4
- package/.codex/skills/team-issue/roles/coordinator/commands/analyze.md +64 -64
- package/.codex/skills/team-issue/roles/coordinator/commands/dispatch.md +273 -273
- package/.codex/skills/team-issue/roles/coordinator/commands/monitor.md +235 -194
- package/.codex/skills/team-issue/roles/coordinator/role.md +206 -194
- package/.codex/skills/team-issue/roles/explorer/role.md +94 -94
- package/.codex/skills/team-issue/roles/implementer/role.md +87 -87
- package/.codex/skills/team-issue/roles/integrator/role.md +84 -84
- package/.codex/skills/team-issue/roles/planner/role.md +81 -81
- package/.codex/skills/team-issue/roles/reviewer/role.md +86 -86
- package/.codex/skills/team-issue/specs/pipelines.md +124 -124
- package/.codex/skills/team-iterdev/SKILL.md +64 -3
- package/.codex/skills/team-iterdev/roles/architect/role.md +65 -65
- package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +62 -62
- package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +227 -186
- package/.codex/skills/team-iterdev/roles/coordinator/role.md +193 -181
- package/.codex/skills/team-iterdev/roles/developer/role.md +74 -74
- package/.codex/skills/team-iterdev/roles/reviewer/role.md +66 -66
- package/.codex/skills/team-iterdev/roles/tester/role.md +88 -88
- package/.codex/skills/team-iterdev/specs/pipelines.md +94 -94
- package/.codex/skills/team-lifecycle-v4/MIGRATION-PLAN.md +6 -6
- package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -242
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +1 -1
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +66 -24
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +13 -1
- package/.codex/skills/team-lifecycle-v4/roles/supervisor/role.md +1 -1
- package/.codex/skills/team-lifecycle-v4/templates/architecture.md +254 -254
- package/.codex/skills/team-lifecycle-v4/templates/epics.md +196 -196
- package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +133 -133
- package/.codex/skills/team-lifecycle-v4/templates/requirements.md +224 -224
- package/.codex/skills/team-perf-opt/SKILL.md +68 -3
- package/.codex/skills/team-perf-opt/roles/benchmarker/role.md +89 -89
- package/.codex/skills/team-perf-opt/roles/coordinator/commands/analyze.md +61 -61
- package/.codex/skills/team-perf-opt/roles/coordinator/commands/monitor.md +35 -1
- package/.codex/skills/team-perf-opt/roles/coordinator/role.md +179 -167
- package/.codex/skills/team-perf-opt/roles/optimizer/role.md +97 -97
- package/.codex/skills/team-perf-opt/roles/profiler/role.md +73 -73
- package/.codex/skills/team-perf-opt/roles/reviewer/role.md +75 -75
- package/.codex/skills/team-perf-opt/roles/strategist/role.md +94 -94
- package/.codex/skills/team-perf-opt/specs/pipelines.md +65 -65
- package/.codex/skills/team-planex/SKILL.md +65 -3
- package/.codex/skills/team-planex/roles/coordinator/commands/analyze.md +52 -52
- package/.codex/skills/team-planex/roles/coordinator/commands/monitor.md +210 -164
- package/.codex/skills/team-planex/roles/coordinator/role.md +171 -159
- package/.codex/skills/team-planex/roles/executor/role.md +91 -91
- package/.codex/skills/team-planex/roles/planner/role.md +112 -112
- package/.codex/skills/team-planex/specs/pipelines.md +93 -93
- package/.codex/skills/team-quality-assurance/SKILL.md +60 -3
- package/.codex/skills/team-quality-assurance/roles/analyst/role.md +80 -80
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -72
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +108 -108
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +243 -209
- package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +176 -164
- package/.codex/skills/team-quality-assurance/roles/executor/role.md +66 -66
- package/.codex/skills/team-quality-assurance/roles/generator/role.md +68 -68
- package/.codex/skills/team-quality-assurance/roles/scout/role.md +67 -67
- package/.codex/skills/team-quality-assurance/roles/strategist/role.md +71 -71
- package/.codex/skills/team-quality-assurance/specs/pipelines.md +115 -115
- package/.codex/skills/team-review/SKILL.md +58 -3
- package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +71 -71
- package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +90 -90
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +225 -185
- package/.codex/skills/team-review/roles/coordinator/role.md +175 -163
- package/.codex/skills/team-review/roles/fixer/role.md +76 -76
- package/.codex/skills/team-review/roles/reviewer/role.md +68 -68
- package/.codex/skills/team-review/roles/scanner/role.md +71 -71
- package/.codex/skills/team-review/specs/pipelines.md +102 -102
- package/.codex/skills/team-roadmap-dev/SKILL.md +55 -3
- package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/analyze.md +61 -61
- package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +502 -468
- package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +335 -322
- package/.codex/skills/team-roadmap-dev/roles/executor/role.md +71 -71
- package/.codex/skills/team-roadmap-dev/roles/planner/role.md +76 -76
- package/.codex/skills/team-roadmap-dev/roles/verifier/role.md +74 -74
- package/.codex/skills/team-roadmap-dev/specs/pipelines.md +93 -93
- package/.codex/skills/team-tech-debt/SKILL.md +56 -3
- package/.codex/skills/team-tech-debt/roles/assessor/role.md +69 -69
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -47
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +272 -231
- package/.codex/skills/team-tech-debt/roles/coordinator/role.md +172 -160
- package/.codex/skills/team-tech-debt/roles/executor/role.md +76 -76
- package/.codex/skills/team-tech-debt/roles/planner/role.md +69 -69
- package/.codex/skills/team-tech-debt/roles/scanner/role.md +82 -82
- package/.codex/skills/team-tech-debt/roles/validator/role.md +75 -75
- package/.codex/skills/team-tech-debt/specs/pipelines.md +47 -47
- package/.codex/skills/team-testing/SKILL.md +72 -3
- package/.codex/skills/team-testing/roles/analyst/role.md +95 -95
- package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +70 -70
- package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +106 -106
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +283 -242
- package/.codex/skills/team-testing/roles/coordinator/role.md +184 -172
- package/.codex/skills/team-testing/roles/executor/role.md +96 -96
- package/.codex/skills/team-testing/roles/generator/role.md +95 -95
- package/.codex/skills/team-testing/roles/strategist/role.md +83 -83
- package/.codex/skills/team-testing/specs/pipelines.md +101 -101
- package/.codex/skills/team-uidesign/SKILL.md +65 -3
- package/.codex/skills/team-uidesign/roles/coordinator/commands/analyze.md +59 -59
- package/.codex/skills/team-uidesign/roles/coordinator/commands/dispatch.md +156 -156
- package/.codex/skills/team-uidesign/roles/coordinator/commands/monitor.md +234 -194
- package/.codex/skills/team-uidesign/roles/coordinator/role.md +211 -199
- package/.codex/skills/team-uidesign/roles/designer/role.md +69 -69
- package/.codex/skills/team-uidesign/roles/implementer/role.md +72 -72
- package/.codex/skills/team-uidesign/roles/researcher/role.md +82 -82
- package/.codex/skills/team-uidesign/roles/reviewer/role.md +67 -67
- package/.codex/skills/team-uidesign/specs/pipelines.md +76 -76
- package/.codex/skills/team-ultra-analyze/SKILL.md +73 -3
- package/.codex/skills/team-ultra-analyze/roles/analyst/role.md +90 -90
- package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/analyze.md +73 -73
- package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +50 -9
- package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +255 -243
- package/.codex/skills/team-ultra-analyze/roles/discussant/role.md +104 -104
- package/.codex/skills/team-ultra-analyze/roles/explorer/role.md +74 -74
- package/.codex/skills/team-ultra-analyze/roles/synthesizer/role.md +78 -78
- package/.codex/skills/team-ultra-analyze/specs/pipelines.md +64 -64
- package/.codex/skills/team-ux-improve/SKILL.md +64 -3
- package/.codex/skills/team-ux-improve/roles/coordinator/commands/analyze.md +62 -62
- package/.codex/skills/team-ux-improve/roles/coordinator/commands/dispatch.md +233 -233
- package/.codex/skills/team-ux-improve/roles/coordinator/commands/monitor.md +195 -160
- package/.codex/skills/team-ux-improve/roles/coordinator/role.md +170 -158
- package/.codex/skills/team-ux-improve/roles/designer/role.md +122 -122
- package/.codex/skills/team-ux-improve/roles/diagnoser/role.md +93 -93
- package/.codex/skills/team-ux-improve/roles/explorer/role.md +77 -77
- package/.codex/skills/team-ux-improve/roles/implementer/role.md +102 -102
- package/.codex/skills/team-ux-improve/roles/scanner/role.md +93 -93
- package/.codex/skills/team-ux-improve/roles/tester/role.md +84 -84
- package/.codex/skills/team-ux-improve/specs/pipelines.md +54 -54
- package/README.md +1 -0
- package/package.json +1 -1
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
---
|
|
2
|
-
role: refactorer
|
|
3
|
-
prefix: REFACTOR
|
|
4
|
-
inner_loop: true
|
|
5
|
-
message_types: [state_update]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Code Refactorer
|
|
9
|
-
|
|
10
|
-
Implement architecture refactoring changes following the design plan. For FIX tasks, apply targeted corrections based on review/validation feedback.
|
|
11
|
-
|
|
12
|
-
## Modes
|
|
13
|
-
|
|
14
|
-
| Mode | Task Prefix | Trigger | Focus |
|
|
15
|
-
|------|-------------|---------|-------|
|
|
16
|
-
| Refactor | REFACTOR | Design plan ready | Apply refactorings per plan priority |
|
|
17
|
-
| Fix | FIX | Review/validation feedback | Targeted fixes for identified issues |
|
|
18
|
-
|
|
19
|
-
## Phase 2: Plan & Context Loading
|
|
20
|
-
|
|
21
|
-
| Input | Source | Required |
|
|
22
|
-
|-------|--------|----------|
|
|
23
|
-
| Refactoring plan | <session>/artifacts/refactoring-plan.md | Yes (REFACTOR, no branch) |
|
|
24
|
-
| Branch refactoring detail | <session>/artifacts/branches/B{NN}/refactoring-detail.md | Yes (REFACTOR with branch) |
|
|
25
|
-
| Pipeline refactoring plan | <session>/artifacts/pipelines/{P}/refactoring-plan.md | Yes (REFACTOR with pipeline) |
|
|
26
|
-
| Review/validation feedback | From task description | Yes (FIX) |
|
|
27
|
-
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
|
28
|
-
| Wisdom files | <session>/wisdom/patterns.md | No |
|
|
29
|
-
| Context accumulator | From prior REFACTOR/FIX tasks | Yes (inner loop) |
|
|
30
|
-
|
|
31
|
-
1. Extract session path and task mode (REFACTOR or FIX) from task description
|
|
32
|
-
2. **Detect branch/pipeline context** from task description:
|
|
33
|
-
|
|
34
|
-
| Task Description Field | Value | Context |
|
|
35
|
-
|----------------------|-------|---------|
|
|
36
|
-
| `BranchId: B{NN}` | Present | Fan-out branch -- load single refactoring detail |
|
|
37
|
-
| `PipelineId: {P}` | Present | Independent pipeline -- load pipeline-scoped plan |
|
|
38
|
-
| Neither present | - | Single mode -- load full refactoring plan |
|
|
39
|
-
|
|
40
|
-
3. **Load refactoring context by mode**:
|
|
41
|
-
- **Single mode (no branch)**: Read `<session>/artifacts/refactoring-plan.md` -- extract ALL priority-ordered changes
|
|
42
|
-
- **Fan-out branch**: Read `<session>/artifacts/branches/B{NN}/refactoring-detail.md` -- extract ONLY this branch's refactoring (single REFACTOR-ID)
|
|
43
|
-
- **Independent pipeline**: Read `<session>/artifacts/pipelines/{P}/refactoring-plan.md` -- extract this pipeline's plan
|
|
44
|
-
|
|
45
|
-
4. For FIX: parse review/validation feedback for specific issues to address
|
|
46
|
-
5. Use `explore` CLI tool to load implementation context for target files
|
|
47
|
-
6. For inner loop (single mode only): load context_accumulator from prior REFACTOR/FIX tasks
|
|
48
|
-
|
|
49
|
-
**Meta.json namespace**:
|
|
50
|
-
- Single: write to `refactorer` namespace
|
|
51
|
-
- Fan-out: write to `refactorer.B{NN}` namespace
|
|
52
|
-
- Independent: write to `refactorer.{P}` namespace
|
|
53
|
-
|
|
54
|
-
## Phase 3: Code Implementation
|
|
55
|
-
|
|
56
|
-
Implementation backend selection:
|
|
57
|
-
|
|
58
|
-
| Backend | Condition | Method |
|
|
59
|
-
|---------|-----------|--------|
|
|
60
|
-
| CLI | Multi-file refactoring with clear plan | ccw cli --tool gemini --mode write |
|
|
61
|
-
| Direct | Single-file changes or targeted fixes | Inline Edit/Write tools |
|
|
62
|
-
|
|
63
|
-
For REFACTOR tasks:
|
|
64
|
-
- **Single mode**: Apply refactorings in plan priority order (P0 first, then P1, etc.)
|
|
65
|
-
- **Fan-out branch**: Apply ONLY this branch's single refactoring (from refactoring-detail.md)
|
|
66
|
-
- **Independent pipeline**: Apply this pipeline's refactorings in priority order
|
|
67
|
-
- Follow implementation guidance from plan (target files, patterns)
|
|
68
|
-
- **Preserve existing behavior -- refactoring must not change functionality**
|
|
69
|
-
- **Update ALL import references** when moving/renaming modules
|
|
70
|
-
- **Update ALL test files** that reference moved/renamed symbols
|
|
71
|
-
|
|
72
|
-
For FIX tasks:
|
|
73
|
-
- Read specific issues from review/validation feedback
|
|
74
|
-
- Apply targeted corrections to flagged code locations
|
|
75
|
-
- Verify the fix addresses the exact concern raised
|
|
76
|
-
|
|
77
|
-
General rules:
|
|
78
|
-
- Make minimal, focused changes per refactoring
|
|
79
|
-
- Add comments only where refactoring logic is non-obvious
|
|
80
|
-
- Preserve existing code style and conventions
|
|
81
|
-
- Verify no dangling imports after module moves
|
|
82
|
-
|
|
83
|
-
## Phase 4: Self-Validation
|
|
84
|
-
|
|
85
|
-
| Check | Method | Pass Criteria |
|
|
86
|
-
|-------|--------|---------------|
|
|
87
|
-
| Syntax | IDE diagnostics or build check | No new errors |
|
|
88
|
-
| File integrity | Verify all planned files exist and are modified | All present |
|
|
89
|
-
| Import integrity | Verify no broken imports after moves | All imports resolve |
|
|
90
|
-
| Acceptance | Match refactoring plan success criteria | All structural changes applied |
|
|
91
|
-
| No regression | Run existing tests if available | No new failures |
|
|
92
|
-
|
|
93
|
-
If validation fails, attempt auto-fix (max 2 attempts) before reporting error.
|
|
94
|
-
|
|
95
|
-
Append to context_accumulator for next REFACTOR/FIX task (single/inner-loop mode only):
|
|
96
|
-
- Files modified, refactorings applied, validation results
|
|
97
|
-
- Any discovered patterns or caveats for subsequent iterations
|
|
98
|
-
|
|
99
|
-
**Branch output paths**:
|
|
100
|
-
- Single: write artifacts to `<session>/artifacts/`
|
|
101
|
-
- Fan-out: write artifacts to `<session>/artifacts/branches/B{NN}/`
|
|
102
|
-
- Independent: write artifacts to `<session>/artifacts/pipelines/{P}/`
|
|
1
|
+
---
|
|
2
|
+
role: refactorer
|
|
3
|
+
prefix: REFACTOR
|
|
4
|
+
inner_loop: true
|
|
5
|
+
message_types: [state_update]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Code Refactorer
|
|
9
|
+
|
|
10
|
+
Implement architecture refactoring changes following the design plan. For FIX tasks, apply targeted corrections based on review/validation feedback.
|
|
11
|
+
|
|
12
|
+
## Modes
|
|
13
|
+
|
|
14
|
+
| Mode | Task Prefix | Trigger | Focus |
|
|
15
|
+
|------|-------------|---------|-------|
|
|
16
|
+
| Refactor | REFACTOR | Design plan ready | Apply refactorings per plan priority |
|
|
17
|
+
| Fix | FIX | Review/validation feedback | Targeted fixes for identified issues |
|
|
18
|
+
|
|
19
|
+
## Phase 2: Plan & Context Loading
|
|
20
|
+
|
|
21
|
+
| Input | Source | Required |
|
|
22
|
+
|-------|--------|----------|
|
|
23
|
+
| Refactoring plan | <session>/artifacts/refactoring-plan.md | Yes (REFACTOR, no branch) |
|
|
24
|
+
| Branch refactoring detail | <session>/artifacts/branches/B{NN}/refactoring-detail.md | Yes (REFACTOR with branch) |
|
|
25
|
+
| Pipeline refactoring plan | <session>/artifacts/pipelines/{P}/refactoring-plan.md | Yes (REFACTOR with pipeline) |
|
|
26
|
+
| Review/validation feedback | From task description | Yes (FIX) |
|
|
27
|
+
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
|
28
|
+
| Wisdom files | <session>/wisdom/patterns.md | No |
|
|
29
|
+
| Context accumulator | From prior REFACTOR/FIX tasks | Yes (inner loop) |
|
|
30
|
+
|
|
31
|
+
1. Extract session path and task mode (REFACTOR or FIX) from task description
|
|
32
|
+
2. **Detect branch/pipeline context** from task description:
|
|
33
|
+
|
|
34
|
+
| Task Description Field | Value | Context |
|
|
35
|
+
|----------------------|-------|---------|
|
|
36
|
+
| `BranchId: B{NN}` | Present | Fan-out branch -- load single refactoring detail |
|
|
37
|
+
| `PipelineId: {P}` | Present | Independent pipeline -- load pipeline-scoped plan |
|
|
38
|
+
| Neither present | - | Single mode -- load full refactoring plan |
|
|
39
|
+
|
|
40
|
+
3. **Load refactoring context by mode**:
|
|
41
|
+
- **Single mode (no branch)**: Read `<session>/artifacts/refactoring-plan.md` -- extract ALL priority-ordered changes
|
|
42
|
+
- **Fan-out branch**: Read `<session>/artifacts/branches/B{NN}/refactoring-detail.md` -- extract ONLY this branch's refactoring (single REFACTOR-ID)
|
|
43
|
+
- **Independent pipeline**: Read `<session>/artifacts/pipelines/{P}/refactoring-plan.md` -- extract this pipeline's plan
|
|
44
|
+
|
|
45
|
+
4. For FIX: parse review/validation feedback for specific issues to address
|
|
46
|
+
5. Use `explore` CLI tool to load implementation context for target files
|
|
47
|
+
6. For inner loop (single mode only): load context_accumulator from prior REFACTOR/FIX tasks
|
|
48
|
+
|
|
49
|
+
**Meta.json namespace**:
|
|
50
|
+
- Single: write to `refactorer` namespace
|
|
51
|
+
- Fan-out: write to `refactorer.B{NN}` namespace
|
|
52
|
+
- Independent: write to `refactorer.{P}` namespace
|
|
53
|
+
|
|
54
|
+
## Phase 3: Code Implementation
|
|
55
|
+
|
|
56
|
+
Implementation backend selection:
|
|
57
|
+
|
|
58
|
+
| Backend | Condition | Method |
|
|
59
|
+
|---------|-----------|--------|
|
|
60
|
+
| CLI | Multi-file refactoring with clear plan | ccw cli --tool gemini --mode write |
|
|
61
|
+
| Direct | Single-file changes or targeted fixes | Inline Edit/Write tools |
|
|
62
|
+
|
|
63
|
+
For REFACTOR tasks:
|
|
64
|
+
- **Single mode**: Apply refactorings in plan priority order (P0 first, then P1, etc.)
|
|
65
|
+
- **Fan-out branch**: Apply ONLY this branch's single refactoring (from refactoring-detail.md)
|
|
66
|
+
- **Independent pipeline**: Apply this pipeline's refactorings in priority order
|
|
67
|
+
- Follow implementation guidance from plan (target files, patterns)
|
|
68
|
+
- **Preserve existing behavior -- refactoring must not change functionality**
|
|
69
|
+
- **Update ALL import references** when moving/renaming modules
|
|
70
|
+
- **Update ALL test files** that reference moved/renamed symbols
|
|
71
|
+
|
|
72
|
+
For FIX tasks:
|
|
73
|
+
- Read specific issues from review/validation feedback
|
|
74
|
+
- Apply targeted corrections to flagged code locations
|
|
75
|
+
- Verify the fix addresses the exact concern raised
|
|
76
|
+
|
|
77
|
+
General rules:
|
|
78
|
+
- Make minimal, focused changes per refactoring
|
|
79
|
+
- Add comments only where refactoring logic is non-obvious
|
|
80
|
+
- Preserve existing code style and conventions
|
|
81
|
+
- Verify no dangling imports after module moves
|
|
82
|
+
|
|
83
|
+
## Phase 4: Self-Validation
|
|
84
|
+
|
|
85
|
+
| Check | Method | Pass Criteria |
|
|
86
|
+
|-------|--------|---------------|
|
|
87
|
+
| Syntax | IDE diagnostics or build check | No new errors |
|
|
88
|
+
| File integrity | Verify all planned files exist and are modified | All present |
|
|
89
|
+
| Import integrity | Verify no broken imports after moves | All imports resolve |
|
|
90
|
+
| Acceptance | Match refactoring plan success criteria | All structural changes applied |
|
|
91
|
+
| No regression | Run existing tests if available | No new failures |
|
|
92
|
+
|
|
93
|
+
If validation fails, attempt auto-fix (max 2 attempts) before reporting error.
|
|
94
|
+
|
|
95
|
+
Append to context_accumulator for next REFACTOR/FIX task (single/inner-loop mode only):
|
|
96
|
+
- Files modified, refactorings applied, validation results
|
|
97
|
+
- Any discovered patterns or caveats for subsequent iterations
|
|
98
|
+
|
|
99
|
+
**Branch output paths**:
|
|
100
|
+
- Single: write artifacts to `<session>/artifacts/`
|
|
101
|
+
- Fan-out: write artifacts to `<session>/artifacts/branches/B{NN}/`
|
|
102
|
+
- Independent: write artifacts to `<session>/artifacts/pipelines/{P}/`
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
---
|
|
2
|
-
role: reviewer
|
|
3
|
-
prefix: REVIEW
|
|
4
|
-
inner_loop: false
|
|
5
|
-
message_types: [state_update]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Architecture Reviewer
|
|
9
|
-
|
|
10
|
-
Review refactoring code changes for correctness, pattern consistency, completeness, migration safety, and adherence to best practices. Provide structured verdicts with actionable feedback.
|
|
11
|
-
|
|
12
|
-
## Phase 2: Context Loading
|
|
13
|
-
|
|
14
|
-
| Input | Source | Required |
|
|
15
|
-
|-------|--------|----------|
|
|
16
|
-
| Refactoring code changes | From REFACTOR task artifacts / git diff | Yes |
|
|
17
|
-
| Refactoring plan / detail | Varies by mode (see below) | Yes |
|
|
18
|
-
| Validation results | Varies by mode (see below) | No |
|
|
19
|
-
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
|
20
|
-
|
|
21
|
-
1. Extract session path from task description
|
|
22
|
-
2. **Detect branch/pipeline context** from task description:
|
|
23
|
-
|
|
24
|
-
| Task Description Field | Value | Context |
|
|
25
|
-
|----------------------|-------|---------|
|
|
26
|
-
| `BranchId: B{NN}` | Present | Fan-out branch -- review only this branch's changes |
|
|
27
|
-
| `PipelineId: {P}` | Present | Independent pipeline -- review pipeline-scoped changes |
|
|
28
|
-
| Neither present | - | Single mode -- review all refactoring changes |
|
|
29
|
-
|
|
30
|
-
3. **Load refactoring context by mode**:
|
|
31
|
-
- Single: Read `<session>/artifacts/refactoring-plan.md`
|
|
32
|
-
- Fan-out branch: Read `<session>/artifacts/branches/B{NN}/refactoring-detail.md`
|
|
33
|
-
- Independent: Read `<session>/artifacts/pipelines/{P}/refactoring-plan.md`
|
|
34
|
-
|
|
35
|
-
4. Load .msg/meta.json for scoped refactorer namespace:
|
|
36
|
-
- Single: `refactorer` namespace
|
|
37
|
-
- Fan-out: `refactorer.B{NN}` namespace
|
|
38
|
-
- Independent: `refactorer.{P}` namespace
|
|
39
|
-
|
|
40
|
-
5. Identify changed files from refactorer context -- read ONLY files modified by this branch/pipeline
|
|
41
|
-
6. If validation results available, read from scoped path:
|
|
42
|
-
- Single: `<session>/artifacts/validation-results.json`
|
|
43
|
-
- Fan-out: `<session>/artifacts/branches/B{NN}/validation-results.json`
|
|
44
|
-
- Independent: `<session>/artifacts/pipelines/{P}/validation-results.json`
|
|
45
|
-
|
|
46
|
-
## Phase 3: Multi-Dimension Review
|
|
47
|
-
|
|
48
|
-
Analyze refactoring changes across five dimensions:
|
|
49
|
-
|
|
50
|
-
| Dimension | Focus | Severity |
|
|
51
|
-
|-----------|-------|----------|
|
|
52
|
-
| Correctness | No behavior changes, all references updated, no dangling imports | Critical |
|
|
53
|
-
| Pattern consistency | Follows existing patterns, naming consistent, language-idiomatic | High |
|
|
54
|
-
| Completeness | All related code updated (imports, tests, config, documentation) | High |
|
|
55
|
-
| Migration safety | No dangling references, backward compatible, public API preserved | Critical |
|
|
56
|
-
| Best practices | Clean Architecture / SOLID principles, appropriate abstraction level | Medium |
|
|
57
|
-
|
|
58
|
-
Per-dimension review process:
|
|
59
|
-
- Scan modified files for patterns matching each dimension
|
|
60
|
-
- Record findings with severity (Critical / High / Medium / Low)
|
|
61
|
-
- Include specific file:line references and suggested fixes
|
|
62
|
-
|
|
63
|
-
**Correctness checks**:
|
|
64
|
-
- Verify moved code preserves original behavior (no logic changes mixed with structural changes)
|
|
65
|
-
- Check all import/require statements updated to new paths
|
|
66
|
-
- Verify no orphaned files left behind after moves
|
|
67
|
-
|
|
68
|
-
**Pattern consistency checks**:
|
|
69
|
-
- New module names follow existing naming conventions
|
|
70
|
-
- Extracted interfaces/classes use consistent patterns with existing codebase
|
|
71
|
-
- File organization matches project conventions (e.g., index files, barrel exports)
|
|
72
|
-
|
|
73
|
-
**Completeness checks**:
|
|
74
|
-
- All test files updated for moved/renamed modules
|
|
75
|
-
- Configuration files updated if needed (e.g., path aliases, build configs)
|
|
76
|
-
- Type definitions updated for extracted interfaces
|
|
77
|
-
|
|
78
|
-
**Migration safety checks**:
|
|
79
|
-
- Public API surface unchanged (same exports available to consumers)
|
|
80
|
-
- No circular dependencies introduced by the refactoring
|
|
81
|
-
- Re-exports in place if module paths changed for backward compatibility
|
|
82
|
-
|
|
83
|
-
**Best practices checks**:
|
|
84
|
-
- Extracted modules have clear single responsibility
|
|
85
|
-
- Dependency direction follows layer conventions (dependencies flow inward)
|
|
86
|
-
- Appropriate abstraction level (not over-engineered, not under-abstracted)
|
|
87
|
-
|
|
88
|
-
If any Critical findings detected, invoke `discuss` CLI tool (DISCUSS-REVIEW round) to validate the assessment before issuing verdict.
|
|
89
|
-
|
|
90
|
-
## Phase 4: Verdict & Feedback
|
|
91
|
-
|
|
92
|
-
Classify overall verdict based on findings:
|
|
93
|
-
|
|
94
|
-
| Verdict | Condition | Action |
|
|
95
|
-
|---------|-----------|--------|
|
|
96
|
-
| APPROVE | No Critical or High findings | Send review_complete |
|
|
97
|
-
| REVISE | Has High findings, no Critical | Send fix_required with detailed feedback |
|
|
98
|
-
| REJECT | Has Critical findings or fundamental approach flaw | Send fix_required + flag for designer escalation |
|
|
99
|
-
|
|
100
|
-
1. Write review report to scoped output path:
|
|
101
|
-
- Single: `<session>/artifacts/review-report.md`
|
|
102
|
-
- Fan-out: `<session>/artifacts/branches/B{NN}/review-report.md`
|
|
103
|
-
- Independent: `<session>/artifacts/pipelines/{P}/review-report.md`
|
|
104
|
-
- Content: Per-dimension findings with severity, file:line, description; Overall verdict with rationale; Specific fix instructions for REVISE/REJECT verdicts
|
|
105
|
-
|
|
106
|
-
2. Update `<session>/wisdom/.msg/meta.json` under scoped namespace:
|
|
107
|
-
- Single: merge `{ "reviewer": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
|
108
|
-
- Fan-out: merge `{ "reviewer.B{NN}": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
|
109
|
-
- Independent: merge `{ "reviewer.{P}": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
|
110
|
-
|
|
111
|
-
3. If DISCUSS-REVIEW was triggered, record discussion summary in `<session>/discussions/DISCUSS-REVIEW.md` (or `DISCUSS-REVIEW-B{NN}.md` for branch-scoped discussions)
|
|
1
|
+
---
|
|
2
|
+
role: reviewer
|
|
3
|
+
prefix: REVIEW
|
|
4
|
+
inner_loop: false
|
|
5
|
+
message_types: [state_update]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Architecture Reviewer
|
|
9
|
+
|
|
10
|
+
Review refactoring code changes for correctness, pattern consistency, completeness, migration safety, and adherence to best practices. Provide structured verdicts with actionable feedback.
|
|
11
|
+
|
|
12
|
+
## Phase 2: Context Loading
|
|
13
|
+
|
|
14
|
+
| Input | Source | Required |
|
|
15
|
+
|-------|--------|----------|
|
|
16
|
+
| Refactoring code changes | From REFACTOR task artifacts / git diff | Yes |
|
|
17
|
+
| Refactoring plan / detail | Varies by mode (see below) | Yes |
|
|
18
|
+
| Validation results | Varies by mode (see below) | No |
|
|
19
|
+
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
|
20
|
+
|
|
21
|
+
1. Extract session path from task description
|
|
22
|
+
2. **Detect branch/pipeline context** from task description:
|
|
23
|
+
|
|
24
|
+
| Task Description Field | Value | Context |
|
|
25
|
+
|----------------------|-------|---------|
|
|
26
|
+
| `BranchId: B{NN}` | Present | Fan-out branch -- review only this branch's changes |
|
|
27
|
+
| `PipelineId: {P}` | Present | Independent pipeline -- review pipeline-scoped changes |
|
|
28
|
+
| Neither present | - | Single mode -- review all refactoring changes |
|
|
29
|
+
|
|
30
|
+
3. **Load refactoring context by mode**:
|
|
31
|
+
- Single: Read `<session>/artifacts/refactoring-plan.md`
|
|
32
|
+
- Fan-out branch: Read `<session>/artifacts/branches/B{NN}/refactoring-detail.md`
|
|
33
|
+
- Independent: Read `<session>/artifacts/pipelines/{P}/refactoring-plan.md`
|
|
34
|
+
|
|
35
|
+
4. Load .msg/meta.json for scoped refactorer namespace:
|
|
36
|
+
- Single: `refactorer` namespace
|
|
37
|
+
- Fan-out: `refactorer.B{NN}` namespace
|
|
38
|
+
- Independent: `refactorer.{P}` namespace
|
|
39
|
+
|
|
40
|
+
5. Identify changed files from refactorer context -- read ONLY files modified by this branch/pipeline
|
|
41
|
+
6. If validation results available, read from scoped path:
|
|
42
|
+
- Single: `<session>/artifacts/validation-results.json`
|
|
43
|
+
- Fan-out: `<session>/artifacts/branches/B{NN}/validation-results.json`
|
|
44
|
+
- Independent: `<session>/artifacts/pipelines/{P}/validation-results.json`
|
|
45
|
+
|
|
46
|
+
## Phase 3: Multi-Dimension Review
|
|
47
|
+
|
|
48
|
+
Analyze refactoring changes across five dimensions:
|
|
49
|
+
|
|
50
|
+
| Dimension | Focus | Severity |
|
|
51
|
+
|-----------|-------|----------|
|
|
52
|
+
| Correctness | No behavior changes, all references updated, no dangling imports | Critical |
|
|
53
|
+
| Pattern consistency | Follows existing patterns, naming consistent, language-idiomatic | High |
|
|
54
|
+
| Completeness | All related code updated (imports, tests, config, documentation) | High |
|
|
55
|
+
| Migration safety | No dangling references, backward compatible, public API preserved | Critical |
|
|
56
|
+
| Best practices | Clean Architecture / SOLID principles, appropriate abstraction level | Medium |
|
|
57
|
+
|
|
58
|
+
Per-dimension review process:
|
|
59
|
+
- Scan modified files for patterns matching each dimension
|
|
60
|
+
- Record findings with severity (Critical / High / Medium / Low)
|
|
61
|
+
- Include specific file:line references and suggested fixes
|
|
62
|
+
|
|
63
|
+
**Correctness checks**:
|
|
64
|
+
- Verify moved code preserves original behavior (no logic changes mixed with structural changes)
|
|
65
|
+
- Check all import/require statements updated to new paths
|
|
66
|
+
- Verify no orphaned files left behind after moves
|
|
67
|
+
|
|
68
|
+
**Pattern consistency checks**:
|
|
69
|
+
- New module names follow existing naming conventions
|
|
70
|
+
- Extracted interfaces/classes use consistent patterns with existing codebase
|
|
71
|
+
- File organization matches project conventions (e.g., index files, barrel exports)
|
|
72
|
+
|
|
73
|
+
**Completeness checks**:
|
|
74
|
+
- All test files updated for moved/renamed modules
|
|
75
|
+
- Configuration files updated if needed (e.g., path aliases, build configs)
|
|
76
|
+
- Type definitions updated for extracted interfaces
|
|
77
|
+
|
|
78
|
+
**Migration safety checks**:
|
|
79
|
+
- Public API surface unchanged (same exports available to consumers)
|
|
80
|
+
- No circular dependencies introduced by the refactoring
|
|
81
|
+
- Re-exports in place if module paths changed for backward compatibility
|
|
82
|
+
|
|
83
|
+
**Best practices checks**:
|
|
84
|
+
- Extracted modules have clear single responsibility
|
|
85
|
+
- Dependency direction follows layer conventions (dependencies flow inward)
|
|
86
|
+
- Appropriate abstraction level (not over-engineered, not under-abstracted)
|
|
87
|
+
|
|
88
|
+
If any Critical findings detected, invoke `discuss` CLI tool (DISCUSS-REVIEW round) to validate the assessment before issuing verdict.
|
|
89
|
+
|
|
90
|
+
## Phase 4: Verdict & Feedback
|
|
91
|
+
|
|
92
|
+
Classify overall verdict based on findings:
|
|
93
|
+
|
|
94
|
+
| Verdict | Condition | Action |
|
|
95
|
+
|---------|-----------|--------|
|
|
96
|
+
| APPROVE | No Critical or High findings | Send review_complete |
|
|
97
|
+
| REVISE | Has High findings, no Critical | Send fix_required with detailed feedback |
|
|
98
|
+
| REJECT | Has Critical findings or fundamental approach flaw | Send fix_required + flag for designer escalation |
|
|
99
|
+
|
|
100
|
+
1. Write review report to scoped output path:
|
|
101
|
+
- Single: `<session>/artifacts/review-report.md`
|
|
102
|
+
- Fan-out: `<session>/artifacts/branches/B{NN}/review-report.md`
|
|
103
|
+
- Independent: `<session>/artifacts/pipelines/{P}/review-report.md`
|
|
104
|
+
- Content: Per-dimension findings with severity, file:line, description; Overall verdict with rationale; Specific fix instructions for REVISE/REJECT verdicts
|
|
105
|
+
|
|
106
|
+
2. Update `<session>/wisdom/.msg/meta.json` under scoped namespace:
|
|
107
|
+
- Single: merge `{ "reviewer": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
|
108
|
+
- Fan-out: merge `{ "reviewer.B{NN}": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
|
109
|
+
- Independent: merge `{ "reviewer.{P}": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
|
110
|
+
|
|
111
|
+
3. If DISCUSS-REVIEW was triggered, record discussion summary in `<session>/discussions/DISCUSS-REVIEW.md` (or `DISCUSS-REVIEW-B{NN}.md` for branch-scoped discussions)
|