claude-code-workflow 7.2.3 → 7.2.4
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/.claude/agents/team-worker.md +2 -2
- package/.claude/skills/team-arch-opt/SKILL.md +1 -1
- package/.claude/skills/team-arch-opt/roles/coordinator/commands/monitor.md +1 -1
- package/.claude/skills/team-arch-opt/specs/team-config.json +1 -1
- package/.claude/skills/team-brainstorm/SKILL.md +2 -2
- package/.claude/skills/team-brainstorm/roles/coordinator/commands/monitor.md +1 -1
- package/.claude/skills/team-designer/SKILL.md +2 -2
- package/.claude/skills/team-designer/phases/03-content-generation.md +2 -2
- package/.claude/skills/team-edict/SKILL.md +1 -1
- package/.claude/skills/team-edict/role-specs/xingbu.md +1 -1
- package/.claude/skills/team-edict/roles/coordinator/role.md +4 -4
- package/.claude/skills/team-frontend/SKILL.md +1 -1
- package/.claude/skills/team-frontend/roles/coordinator/commands/monitor.md +1 -1
- package/.claude/skills/team-frontend-debug/SKILL.md +1 -1
- package/.claude/skills/team-frontend-debug/roles/coordinator/commands/dispatch.md +11 -11
- package/.claude/skills/team-issue/SKILL.md +2 -2
- package/.claude/skills/team-issue/roles/coordinator/commands/monitor.md +2 -2
- package/.claude/skills/team-iterdev/SKILL.md +1 -1
- package/.claude/skills/team-iterdev/roles/coordinator/commands/monitor.md +1 -1
- package/.claude/skills/team-lifecycle-v4/SKILL.md +2 -2
- package/.claude/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +2 -2
- package/.claude/skills/team-perf-opt/SKILL.md +1 -1
- package/.claude/skills/team-perf-opt/roles/coordinator/commands/monitor.md +1 -1
- package/.claude/skills/team-perf-opt/roles/coordinator/role.md +1 -1
- package/.claude/skills/team-perf-opt/specs/team-config.json +1 -1
- package/.claude/skills/team-planex/SKILL.md +1 -1
- package/.claude/skills/team-planex/roles/coordinator/commands/monitor.md +1 -1
- package/.claude/skills/team-quality-assurance/SKILL.md +1 -1
- package/.claude/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +1 -1
- package/.claude/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +3 -3
- package/.claude/skills/team-review/SKILL.md +1 -1
- package/.claude/skills/team-review/roles/coordinator/commands/dispatch.md +1 -1
- package/.claude/skills/team-review/roles/coordinator/commands/monitor.md +4 -4
- package/.claude/skills/team-roadmap-dev/SKILL.md +1 -1
- package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +4 -4
- package/.claude/skills/team-roadmap-dev/specs/pipelines.md +3 -3
- package/.claude/skills/team-roadmap-dev/specs/team-config.json +1 -1
- package/.claude/skills/team-tech-debt/SKILL.md +1 -1
- package/.claude/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
- package/.claude/skills/team-testing/SKILL.md +1 -1
- package/.claude/skills/team-testing/roles/coordinator/commands/dispatch.md +1 -1
- package/.claude/skills/team-testing/roles/coordinator/commands/monitor.md +7 -7
- package/.claude/skills/team-uidesign/SKILL.md +1 -1
- package/.claude/skills/team-uidesign/roles/coordinator/commands/monitor.md +1 -1
- package/.claude/skills/team-ultra-analyze/SKILL.md +1 -1
- package/.claude/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +5 -5
- package/.claude/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
- package/.claude/skills/team-ux-improve/SKILL.md +1 -1
- package/.claude/skills/team-ux-improve/roles/coordinator/commands/monitor.md +1 -1
- package/.claude/skills/team-ux-improve/roles/coordinator/role.md +2 -2
- package/.claude/skills/team-ux-improve/specs/pipelines.md +1 -1
- package/.claude/skills/team-ux-improve/specs/team-config.json +1 -1
- package/.codex/skills/team-arch-opt/SKILL.md +38 -0
- package/.codex/skills/team-arch-opt/instructions/agent-instruction.md +114 -114
- package/.codex/skills/team-brainstorm/SKILL.md +725 -687
- package/.codex/skills/team-coordinate/SKILL.md +38 -0
- package/.codex/skills/team-designer/SKILL.md +691 -653
- package/.codex/skills/team-designer/schemas/tasks-schema.md +180 -180
- package/.codex/skills/team-edict/SKILL.md +781 -742
- package/.codex/skills/team-edict/agents/aggregator.md +246 -246
- package/.codex/skills/team-edict/agents/qa-verifier.md +274 -274
- package/.codex/skills/team-edict/agents/shangshu-dispatcher.md +247 -247
- package/.codex/skills/team-edict/agents/zhongshu-planner.md +198 -198
- package/.codex/skills/team-edict/instructions/agent-instruction.md +177 -177
- package/.codex/skills/team-executor/SKILL.md +38 -0
- package/.codex/skills/team-frontend/SKILL.md +38 -0
- package/.codex/skills/team-frontend-debug/SKILL.md +38 -0
- package/.codex/skills/team-issue/SKILL.md +740 -702
- package/.codex/skills/team-iterdev/SKILL.md +826 -788
- package/.codex/skills/team-lifecycle/SKILL.md +38 -0
- package/.codex/skills/team-lifecycle/agents/analyst.md +6 -6
- package/.codex/skills/team-lifecycle/agents/discuss-agent.md +1 -1
- package/.codex/skills/team-lifecycle/agents/explore-agent.md +3 -3
- package/.codex/skills/team-lifecycle/agents/writer.md +3 -3
- package/.codex/skills/team-lifecycle/phases/01-requirement-clarification.md +1 -1
- package/.codex/skills/team-lifecycle/phases/02-team-initialization.md +1 -1
- package/.codex/skills/team-lifecycle/phases/03-task-chain-creation.md +1 -1
- package/.codex/skills/team-lifecycle/phases/04-pipeline-coordination.md +1 -1
- package/.codex/skills/team-lifecycle/phases/05-completion-report.md +1 -1
- package/.codex/skills/team-lifecycle-v4/SKILL.md +775 -737
- package/.codex/skills/team-perf-opt/SKILL.md +38 -0
- package/.codex/skills/team-perf-opt/instructions/agent-instruction.md +122 -122
- package/.codex/skills/team-planex/SKILL.md +38 -0
- package/.codex/skills/team-planex-v2/SKILL.md +39 -1
- package/.codex/skills/team-quality-assurance/SKILL.md +38 -0
- package/.codex/skills/team-review/SKILL.md +38 -0
- package/.codex/skills/team-roadmap-dev/SKILL.md +38 -0
- package/.codex/skills/team-tech-debt/SKILL.md +38 -0
- package/.codex/skills/team-testing/SKILL.md +38 -0
- package/.codex/skills/team-uidesign/SKILL.md +38 -0
- package/.codex/skills/team-ultra-analyze/SKILL.md +787 -749
- package/.codex/skills/team-ux-improve/SKILL.md +38 -0
- package/ccw/dist/tools/smart-search.d.ts +23 -0
- package/ccw/dist/tools/smart-search.d.ts.map +1 -1
- package/ccw/dist/tools/smart-search.js +41 -10
- package/ccw/dist/tools/smart-search.js.map +1 -1
- package/codex-lens/src/codexlens/config.py +32 -0
- package/codex-lens/src/codexlens/storage/index_tree.py +101 -33
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ EXPECTED: <deliverable path> + <quality criteria>
|
|
|
31
31
|
CONSTRAINTS: <scope limits, focus areas>
|
|
32
32
|
---
|
|
33
33
|
InnerLoop: <true|false>
|
|
34
|
-
RoleSpec:
|
|
34
|
+
RoleSpec: ~ or <project>/.claude/skills/team-testing/roles/<role>/role.md
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## Pipeline Task Registry
|
|
@@ -25,10 +25,10 @@ Event-driven pipeline coordination. Beat model: coordinator wake -> process -> s
|
|
|
25
25
|
|
|
26
26
|
| Prefix | Role | Role Spec | inner_loop |
|
|
27
27
|
|--------|------|-----------|------------|
|
|
28
|
-
| STRATEGY-* | strategist |
|
|
29
|
-
| TESTGEN-* | generator |
|
|
30
|
-
| TESTRUN-* | executor |
|
|
31
|
-
| TESTANA-* | analyst |
|
|
28
|
+
| STRATEGY-* | strategist | `~ or <project>/.claude/skills/team-testing/roles/strategist/role.md` | false |
|
|
29
|
+
| TESTGEN-* | generator | `~ or <project>/.claude/skills/team-testing/roles/generator/role.md` | true |
|
|
30
|
+
| TESTRUN-* | executor | `~ or <project>/.claude/skills/team-testing/roles/executor/role.md` | true |
|
|
31
|
+
| TESTANA-* | analyst | `~ or <project>/.claude/skills/team-testing/roles/analyst/role.md` | false |
|
|
32
32
|
|
|
33
33
|
## handleCallback
|
|
34
34
|
|
|
@@ -68,7 +68,7 @@ EXPECTED: Revised test files in <session>/tests/<layer>/
|
|
|
68
68
|
CONSTRAINTS: Only modify test files
|
|
69
69
|
---
|
|
70
70
|
InnerLoop: true
|
|
71
|
-
RoleSpec:
|
|
71
|
+
RoleSpec: ~ or <project>/.claude/skills/team-testing/roles/generator/role.md"
|
|
72
72
|
})
|
|
73
73
|
TaskCreate({
|
|
74
74
|
subject: "TESTRUN-<layer>-fix-<round>: Re-execute <layer> (GC #<round>)",
|
|
@@ -80,7 +80,7 @@ CONTEXT:
|
|
|
80
80
|
EXPECTED: <session>/results/run-<N>-gc.json
|
|
81
81
|
---
|
|
82
82
|
InnerLoop: true
|
|
83
|
-
RoleSpec:
|
|
83
|
+
RoleSpec: ~ or <project>/.claude/skills/team-testing/roles/executor/role.md",
|
|
84
84
|
blockedBy: ["TESTGEN-<layer>-fix-<round>"]
|
|
85
85
|
})
|
|
86
86
|
```
|
|
@@ -150,7 +150,7 @@ Agent({
|
|
|
150
150
|
run_in_background: true,
|
|
151
151
|
prompt: `## Role Assignment
|
|
152
152
|
role: <role>
|
|
153
|
-
role_spec:
|
|
153
|
+
role_spec: ~ or <project>/.claude/skills/team-testing/roles/<role>/role.md
|
|
154
154
|
session: <session-folder>
|
|
155
155
|
session_id: <session-id>
|
|
156
156
|
team_name: testing
|
|
@@ -67,7 +67,7 @@ Agent({
|
|
|
67
67
|
run_in_background: true,
|
|
68
68
|
prompt: `## Role Assignment
|
|
69
69
|
role: <role>
|
|
70
|
-
role_spec:
|
|
70
|
+
role_spec: ~ or <project>/.claude/skills/team-uidesign/roles/<role>/role.md
|
|
71
71
|
session: <session-folder>
|
|
72
72
|
session_id: <session-id>
|
|
73
73
|
team_name: uidesign
|
|
@@ -127,7 +127,7 @@ Agent({
|
|
|
127
127
|
run_in_background: true,
|
|
128
128
|
prompt: `## Role Assignment
|
|
129
129
|
role: <role>
|
|
130
|
-
role_spec:
|
|
130
|
+
role_spec: ~ or <project>/.claude/skills/team-uidesign/roles/<role>/role.md
|
|
131
131
|
session: <session-folder>
|
|
132
132
|
session_id: <session-id>
|
|
133
133
|
team_name: uidesign
|
|
@@ -75,7 +75,7 @@ Agent({
|
|
|
75
75
|
run_in_background: true,
|
|
76
76
|
prompt: `## Role Assignment
|
|
77
77
|
role: <role>
|
|
78
|
-
role_spec:
|
|
78
|
+
role_spec: ~ or <project>/.claude/skills/team-ultra-analyze/roles/<role>/role.md
|
|
79
79
|
session: <session-folder>
|
|
80
80
|
session_id: <session-id>
|
|
81
81
|
team_name: ultra-analyze
|
|
@@ -211,10 +211,10 @@ Find and spawn the next ready tasks.
|
|
|
211
211
|
|
|
212
212
|
| Task Prefix | Role | Role Spec |
|
|
213
213
|
|-------------|------|-----------|
|
|
214
|
-
| `EXPLORE-*` | explorer |
|
|
215
|
-
| `ANALYZE-*` | analyst |
|
|
216
|
-
| `DISCUSS-*` | discussant |
|
|
217
|
-
| `SYNTH-*` | synthesizer |
|
|
214
|
+
| `EXPLORE-*` | explorer | `~ or <project>/.claude/skills/team-ultra-analyze/role-specs/explorer.md` |
|
|
215
|
+
| `ANALYZE-*` | analyst | `~ or <project>/.claude/skills/team-ultra-analyze/role-specs/analyst.md` |
|
|
216
|
+
| `DISCUSS-*` | discussant | `~ or <project>/.claude/skills/team-ultra-analyze/role-specs/discussant.md` |
|
|
217
|
+
| `SYNTH-*` | synthesizer | `~ or <project>/.claude/skills/team-ultra-analyze/role-specs/synthesizer.md` |
|
|
218
218
|
|
|
219
219
|
3. Spawn team-worker for each ready task:
|
|
220
220
|
|
|
@@ -227,7 +227,7 @@ Agent({
|
|
|
227
227
|
run_in_background: true,
|
|
228
228
|
prompt: `## Role Assignment
|
|
229
229
|
role: <role>
|
|
230
|
-
role_spec:
|
|
230
|
+
role_spec: ~ or <project>/.claude/skills/team-ultra-analyze/role-specs/<role>.md
|
|
231
231
|
session: <session-folder>
|
|
232
232
|
session_id: <session-id>
|
|
233
233
|
team_name: ultra-analyze
|
|
@@ -152,7 +152,7 @@ Execute `commands/dispatch.md` inline (Command Execution Protocol):
|
|
|
152
152
|
### Initial Spawn
|
|
153
153
|
|
|
154
154
|
Find first unblocked tasks and spawn their workers. Use SKILL.md Worker Spawn Template with:
|
|
155
|
-
- `role_spec:
|
|
155
|
+
- `role_spec: ~ or <project>/.claude/skills/team-ultra-analyze/roles/<role>/role.md`
|
|
156
156
|
- `team_name: ultra-analyze`
|
|
157
157
|
- `inner_loop: false`
|
|
158
158
|
|
|
@@ -76,7 +76,7 @@ Agent({
|
|
|
76
76
|
run_in_background: true,
|
|
77
77
|
prompt: `## Role Assignment
|
|
78
78
|
role: <role>
|
|
79
|
-
role_spec:
|
|
79
|
+
role_spec: ~ or <project>/.claude/skills/team-ux-improve/roles/<role>/role.md
|
|
80
80
|
session: <session-folder>
|
|
81
81
|
session_id: <session-id>
|
|
82
82
|
team_name: ux-improve
|
|
@@ -102,7 +102,7 @@ Agent({
|
|
|
102
102
|
run_in_background: true,
|
|
103
103
|
prompt: `## Role Assignment
|
|
104
104
|
role: <role>
|
|
105
|
-
role_spec:
|
|
105
|
+
role_spec: ~ or <project>/.claude/skills/team-ux-improve/roles/<role>/role.md
|
|
106
106
|
session: <session-folder>
|
|
107
107
|
session_id: <session-id>
|
|
108
108
|
team_name: ux-improve
|
|
@@ -76,7 +76,7 @@ TEXT-LEVEL ONLY. No source code reading.
|
|
|
76
76
|
├── explorations/
|
|
77
77
|
└── wisdom/contributions/
|
|
78
78
|
```
|
|
79
|
-
3. **Wisdom Initialization**: Copy
|
|
79
|
+
3. **Wisdom Initialization**: Copy `~ or <project>/.claude/skills/team-ux-improve/wisdom/` to `<session>/wisdom/`
|
|
80
80
|
4. Initialize `.msg/meta.json` via team_msg state_update with pipeline metadata
|
|
81
81
|
5. TeamCreate(team_name="ux-improve")
|
|
82
82
|
6. Do NOT spawn workers yet - deferred to Phase 4
|
|
@@ -110,7 +110,7 @@ Delegate to `commands/monitor.md#handleSpawnNext`:
|
|
|
110
110
|
|
|
111
111
|
3. **Wisdom Consolidation**: Check `<session>/wisdom/contributions/` for worker contributions
|
|
112
112
|
- If contributions exist -> AskUserQuestion to merge to permanent wisdom
|
|
113
|
-
- If approved -> copy to
|
|
113
|
+
- If approved -> copy to `~ or <project>/.claude/skills/team-ux-improve/wisdom/`
|
|
114
114
|
|
|
115
115
|
4. Calculate: completed_tasks, total_issues_found, issues_fixed, test_pass_rate
|
|
116
116
|
5. Output pipeline summary with [coordinator] prefix
|
|
@@ -44,7 +44,7 @@ UX improvement pipeline modes and task registry.
|
|
|
44
44
|
|
|
45
45
|
## Wisdom System
|
|
46
46
|
|
|
47
|
-
Workers contribute learnings to `<session>/wisdom/contributions/`. On pipeline completion, coordinator asks user to merge approved contributions to permanent wisdom at
|
|
47
|
+
Workers contribute learnings to `<session>/wisdom/contributions/`. On pipeline completion, coordinator asks user to merge approved contributions to permanent wisdom at `~ or <project>/.claude/skills/team-ux-improve/wisdom/`.
|
|
48
48
|
|
|
49
49
|
| Directory | Purpose |
|
|
50
50
|
|-----------|---------|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"team_display_name": "UX Improve",
|
|
5
5
|
"team_purpose": "Systematically discover and fix UI/UX interaction issues including unresponsive buttons, missing feedback, and state refresh problems",
|
|
6
6
|
"skill_name": "team-ux-improve",
|
|
7
|
-
"skill_path": "
|
|
7
|
+
"skill_path": "~ or <project>/.claude/skills/team-ux-improve/",
|
|
8
8
|
"worker_agent": "team-worker",
|
|
9
9
|
"pipeline_type": "Standard",
|
|
10
10
|
"completion_action": "interactive",
|
|
@@ -658,3 +658,41 @@ All agents (csv-wave and interactive) share a single `discoveries.ndjson` file f
|
|
|
658
658
|
8. **Max 3 Fix Cycles**: Review-fix cycle capped at 3 iterations; escalate to user after
|
|
659
659
|
9. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
|
|
660
660
|
10. **DO NOT STOP**: Continuous execution until all waves complete or all remaining tasks are skipped
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
---
|
|
664
|
+
|
|
665
|
+
## Coordinator Role Constraints (Main Agent)
|
|
666
|
+
|
|
667
|
+
**CRITICAL**: The coordinator (main agent executing this skill) is responsible for **orchestration only**, NOT implementation.
|
|
668
|
+
|
|
669
|
+
15. **Coordinator Does NOT Execute Code**: The main agent MUST NOT write, modify, or implement any code directly. All implementation work is delegated to spawned team agents. The coordinator only:
|
|
670
|
+
- Spawns agents with task assignments
|
|
671
|
+
- Waits for agent callbacks
|
|
672
|
+
- Merges results and coordinates workflow
|
|
673
|
+
- Manages workflow transitions between phases
|
|
674
|
+
|
|
675
|
+
16. **Patient Waiting is Mandatory**: Agent execution takes significant time (typically 10-30 minutes per phase, sometimes longer). The coordinator MUST:
|
|
676
|
+
- Wait patiently for `wait()` calls to complete
|
|
677
|
+
- NOT skip workflow steps due to perceived delays
|
|
678
|
+
- NOT assume agents have failed just because they're taking time
|
|
679
|
+
- Trust the timeout mechanisms defined in the skill
|
|
680
|
+
|
|
681
|
+
17. **Use send_input for Clarification**: When agents need guidance or appear stuck, the coordinator MUST:
|
|
682
|
+
- Use `send_input()` to ask questions or provide clarification
|
|
683
|
+
- NOT skip the agent or move to next phase prematurely
|
|
684
|
+
- Give agents opportunity to respond before escalating
|
|
685
|
+
- Example: `send_input({ id: agent_id, message: "Please provide status update or clarify blockers" })`
|
|
686
|
+
|
|
687
|
+
18. **No Workflow Shortcuts**: The coordinator MUST NOT:
|
|
688
|
+
- Skip phases or stages defined in the workflow
|
|
689
|
+
- Bypass required approval or review steps
|
|
690
|
+
- Execute dependent tasks before prerequisites complete
|
|
691
|
+
- Assume task completion without explicit agent callback
|
|
692
|
+
- Make up or fabricate agent results
|
|
693
|
+
|
|
694
|
+
19. **Respect Long-Running Processes**: This is a complex multi-agent workflow that requires patience:
|
|
695
|
+
- Total execution time may range from 30-90 minutes or longer
|
|
696
|
+
- Each phase may take 10-30 minutes depending on complexity
|
|
697
|
+
- The coordinator must remain active and attentive throughout the entire process
|
|
698
|
+
- Do not terminate or skip steps due to time concerns
|
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
## TASK ASSIGNMENT
|
|
2
|
-
|
|
3
|
-
### MANDATORY FIRST STEPS
|
|
4
|
-
1. Read shared discoveries: {session_folder}/discoveries.ndjson (if exists, skip if not)
|
|
5
|
-
2. Read project context: .workflow/project-tech.json (if exists)
|
|
6
|
-
3. Read task schema:
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Your Task
|
|
11
|
-
|
|
12
|
-
**Task ID**: {id}
|
|
13
|
-
**Title**: {title}
|
|
14
|
-
**Description**: {description}
|
|
15
|
-
**Role**: {role}
|
|
16
|
-
**Issue Type**: {issue_type}
|
|
17
|
-
**Priority**: {priority}
|
|
18
|
-
**Target Files**: {target_files}
|
|
19
|
-
|
|
20
|
-
### Previous Tasks' Findings (Context)
|
|
21
|
-
{prev_context}
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Execution Protocol
|
|
26
|
-
|
|
27
|
-
1. **Read discoveries**: Load {session_folder}/discoveries.ndjson for shared exploration findings
|
|
28
|
-
2. **Use context**: Apply previous tasks' findings from prev_context above
|
|
29
|
-
3. **Execute by role**:
|
|
30
|
-
|
|
31
|
-
**If role = analyzer**:
|
|
32
|
-
- Scan codebase for architecture issues within target scope
|
|
33
|
-
- Build import/require graph, detect circular dependencies
|
|
34
|
-
- Identify God Classes (>500 LOC, >10 public methods)
|
|
35
|
-
- Calculate coupling (fan-in/fan-out) and cohesion metrics
|
|
36
|
-
- Detect dead code, dead exports, layering violations
|
|
37
|
-
- Collect quantified baseline metrics
|
|
38
|
-
- Rank top 3-7 issues by severity (Critical/High/Medium)
|
|
39
|
-
- Write `{session_folder}/artifacts/architecture-baseline.json` (metrics)
|
|
40
|
-
- Write `{session_folder}/artifacts/architecture-report.md` (ranked issues)
|
|
41
|
-
|
|
42
|
-
**If role = designer**:
|
|
43
|
-
- Read architecture report and baseline from {session_folder}/artifacts/
|
|
44
|
-
- For each issue, select refactoring strategy by type:
|
|
45
|
-
- CYCLE: interface extraction, dependency inversion, mediator
|
|
46
|
-
- GOD_CLASS: SRP decomposition, extract class/module
|
|
47
|
-
- COUPLING: introduce interface/abstraction, DI, events
|
|
48
|
-
- DUPLICATION: extract shared utility/base class
|
|
49
|
-
- LAYER_VIOLATION: move to correct layer, add facade
|
|
50
|
-
- DEAD_CODE: safe removal with reference verification
|
|
51
|
-
- API_BLOAT: privatize internals, barrel file cleanup
|
|
52
|
-
- Prioritize by impact/effort: P0 (high impact+low effort) to P3 (low impact or high effort)
|
|
53
|
-
- Assign unique REFACTOR-IDs (REFACTOR-001, 002, ...) with non-overlapping file targets
|
|
54
|
-
- Write `{session_folder}/artifacts/refactoring-plan.md`
|
|
55
|
-
|
|
56
|
-
**If role = refactorer**:
|
|
57
|
-
- Read refactoring plan from {session_folder}/artifacts/refactoring-plan.md
|
|
58
|
-
- Apply refactorings in priority order (P0 first)
|
|
59
|
-
- Preserve existing behavior -- refactoring must not change functionality
|
|
60
|
-
- Update ALL import references when moving/renaming modules
|
|
61
|
-
- Update ALL test files referencing moved/renamed symbols
|
|
62
|
-
- Verify no dangling imports after module moves
|
|
63
|
-
|
|
64
|
-
**If role = validator**:
|
|
65
|
-
- Read baseline from {session_folder}/artifacts/architecture-baseline.json
|
|
66
|
-
- Read plan from {session_folder}/artifacts/refactoring-plan.md
|
|
67
|
-
- Build validation: compile/type-check, zero new errors
|
|
68
|
-
- Test validation: run test suite, no new failures
|
|
69
|
-
- Metric validation: coupling improved or neutral, no new cycles
|
|
70
|
-
- API validation: public signatures preserved, no dangling references
|
|
71
|
-
- Write `{session_folder}/artifacts/validation-results.json`
|
|
72
|
-
- Set verdict: PASS / WARN / FAIL
|
|
73
|
-
|
|
74
|
-
**If role = reviewer**:
|
|
75
|
-
- Read plan from {session_folder}/artifacts/refactoring-plan.md
|
|
76
|
-
- Review changed files across 5 dimensions:
|
|
77
|
-
- Correctness: no behavior changes, all references updated
|
|
78
|
-
- Pattern consistency: follows existing conventions
|
|
79
|
-
- Completeness: imports, tests, configs all updated
|
|
80
|
-
- Migration safety: no dangling refs, backward compatible
|
|
81
|
-
- Best practices: SOLID, appropriate abstraction
|
|
82
|
-
- Write `{session_folder}/artifacts/review-report.md`
|
|
83
|
-
- Set verdict: APPROVE / REVISE / REJECT
|
|
84
|
-
|
|
85
|
-
4. **Share discoveries**: Append exploration findings to shared board:
|
|
86
|
-
```bash
|
|
87
|
-
echo '{"ts":"<ISO8601>","worker":"{id}","type":"<type>","data":{...}}' >> {session_folder}/discoveries.ndjson
|
|
88
|
-
```
|
|
89
|
-
5. **Report result**: Return JSON via report_agent_job_result
|
|
90
|
-
|
|
91
|
-
### Discovery Types to Share
|
|
92
|
-
- `cycle_found`: `{modules, depth, description}` -- Circular dependency detected
|
|
93
|
-
- `god_class_found`: `{file, loc, methods, description}` -- God Class identified
|
|
94
|
-
- `coupling_issue`: `{module, fan_in, fan_out, description}` -- High coupling
|
|
95
|
-
- `dead_code_found`: `{file, type, description}` -- Dead code found
|
|
96
|
-
- `layer_violation`: `{from, to, description}` -- Layering violation
|
|
97
|
-
- `file_modified`: `{file, change, lines_added}` -- File change recorded
|
|
98
|
-
- `pattern_found`: `{pattern_name, location, description}` -- Pattern identified
|
|
99
|
-
- `metric_measured`: `{metric, value, unit, module}` -- Metric measured
|
|
100
|
-
- `artifact_produced`: `{name, path, producer, type}` -- Deliverable created
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Output (report_agent_job_result)
|
|
105
|
-
|
|
106
|
-
Return JSON:
|
|
107
|
-
{
|
|
108
|
-
"id": "{id}",
|
|
109
|
-
"status": "completed" | "failed",
|
|
110
|
-
"findings": "Key discoveries and implementation notes (max 500 chars)",
|
|
111
|
-
"verdict": "PASS|WARN|FAIL|APPROVE|REVISE|REJECT or empty",
|
|
112
|
-
"artifacts_produced": "semicolon-separated artifact paths",
|
|
113
|
-
"error": ""
|
|
114
|
-
}
|
|
1
|
+
## TASK ASSIGNMENT
|
|
2
|
+
|
|
3
|
+
### MANDATORY FIRST STEPS
|
|
4
|
+
1. Read shared discoveries: {session_folder}/discoveries.ndjson (if exists, skip if not)
|
|
5
|
+
2. Read project context: .workflow/project-tech.json (if exists)
|
|
6
|
+
3. Read task schema: ~ or <project>/.codex/skills/team-arch-opt/schemas/tasks-schema.md
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Your Task
|
|
11
|
+
|
|
12
|
+
**Task ID**: {id}
|
|
13
|
+
**Title**: {title}
|
|
14
|
+
**Description**: {description}
|
|
15
|
+
**Role**: {role}
|
|
16
|
+
**Issue Type**: {issue_type}
|
|
17
|
+
**Priority**: {priority}
|
|
18
|
+
**Target Files**: {target_files}
|
|
19
|
+
|
|
20
|
+
### Previous Tasks' Findings (Context)
|
|
21
|
+
{prev_context}
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Execution Protocol
|
|
26
|
+
|
|
27
|
+
1. **Read discoveries**: Load {session_folder}/discoveries.ndjson for shared exploration findings
|
|
28
|
+
2. **Use context**: Apply previous tasks' findings from prev_context above
|
|
29
|
+
3. **Execute by role**:
|
|
30
|
+
|
|
31
|
+
**If role = analyzer**:
|
|
32
|
+
- Scan codebase for architecture issues within target scope
|
|
33
|
+
- Build import/require graph, detect circular dependencies
|
|
34
|
+
- Identify God Classes (>500 LOC, >10 public methods)
|
|
35
|
+
- Calculate coupling (fan-in/fan-out) and cohesion metrics
|
|
36
|
+
- Detect dead code, dead exports, layering violations
|
|
37
|
+
- Collect quantified baseline metrics
|
|
38
|
+
- Rank top 3-7 issues by severity (Critical/High/Medium)
|
|
39
|
+
- Write `{session_folder}/artifacts/architecture-baseline.json` (metrics)
|
|
40
|
+
- Write `{session_folder}/artifacts/architecture-report.md` (ranked issues)
|
|
41
|
+
|
|
42
|
+
**If role = designer**:
|
|
43
|
+
- Read architecture report and baseline from {session_folder}/artifacts/
|
|
44
|
+
- For each issue, select refactoring strategy by type:
|
|
45
|
+
- CYCLE: interface extraction, dependency inversion, mediator
|
|
46
|
+
- GOD_CLASS: SRP decomposition, extract class/module
|
|
47
|
+
- COUPLING: introduce interface/abstraction, DI, events
|
|
48
|
+
- DUPLICATION: extract shared utility/base class
|
|
49
|
+
- LAYER_VIOLATION: move to correct layer, add facade
|
|
50
|
+
- DEAD_CODE: safe removal with reference verification
|
|
51
|
+
- API_BLOAT: privatize internals, barrel file cleanup
|
|
52
|
+
- Prioritize by impact/effort: P0 (high impact+low effort) to P3 (low impact or high effort)
|
|
53
|
+
- Assign unique REFACTOR-IDs (REFACTOR-001, 002, ...) with non-overlapping file targets
|
|
54
|
+
- Write `{session_folder}/artifacts/refactoring-plan.md`
|
|
55
|
+
|
|
56
|
+
**If role = refactorer**:
|
|
57
|
+
- Read refactoring plan from {session_folder}/artifacts/refactoring-plan.md
|
|
58
|
+
- Apply refactorings in priority order (P0 first)
|
|
59
|
+
- Preserve existing behavior -- refactoring must not change functionality
|
|
60
|
+
- Update ALL import references when moving/renaming modules
|
|
61
|
+
- Update ALL test files referencing moved/renamed symbols
|
|
62
|
+
- Verify no dangling imports after module moves
|
|
63
|
+
|
|
64
|
+
**If role = validator**:
|
|
65
|
+
- Read baseline from {session_folder}/artifacts/architecture-baseline.json
|
|
66
|
+
- Read plan from {session_folder}/artifacts/refactoring-plan.md
|
|
67
|
+
- Build validation: compile/type-check, zero new errors
|
|
68
|
+
- Test validation: run test suite, no new failures
|
|
69
|
+
- Metric validation: coupling improved or neutral, no new cycles
|
|
70
|
+
- API validation: public signatures preserved, no dangling references
|
|
71
|
+
- Write `{session_folder}/artifacts/validation-results.json`
|
|
72
|
+
- Set verdict: PASS / WARN / FAIL
|
|
73
|
+
|
|
74
|
+
**If role = reviewer**:
|
|
75
|
+
- Read plan from {session_folder}/artifacts/refactoring-plan.md
|
|
76
|
+
- Review changed files across 5 dimensions:
|
|
77
|
+
- Correctness: no behavior changes, all references updated
|
|
78
|
+
- Pattern consistency: follows existing conventions
|
|
79
|
+
- Completeness: imports, tests, configs all updated
|
|
80
|
+
- Migration safety: no dangling refs, backward compatible
|
|
81
|
+
- Best practices: SOLID, appropriate abstraction
|
|
82
|
+
- Write `{session_folder}/artifacts/review-report.md`
|
|
83
|
+
- Set verdict: APPROVE / REVISE / REJECT
|
|
84
|
+
|
|
85
|
+
4. **Share discoveries**: Append exploration findings to shared board:
|
|
86
|
+
```bash
|
|
87
|
+
echo '{"ts":"<ISO8601>","worker":"{id}","type":"<type>","data":{...}}' >> {session_folder}/discoveries.ndjson
|
|
88
|
+
```
|
|
89
|
+
5. **Report result**: Return JSON via report_agent_job_result
|
|
90
|
+
|
|
91
|
+
### Discovery Types to Share
|
|
92
|
+
- `cycle_found`: `{modules, depth, description}` -- Circular dependency detected
|
|
93
|
+
- `god_class_found`: `{file, loc, methods, description}` -- God Class identified
|
|
94
|
+
- `coupling_issue`: `{module, fan_in, fan_out, description}` -- High coupling
|
|
95
|
+
- `dead_code_found`: `{file, type, description}` -- Dead code found
|
|
96
|
+
- `layer_violation`: `{from, to, description}` -- Layering violation
|
|
97
|
+
- `file_modified`: `{file, change, lines_added}` -- File change recorded
|
|
98
|
+
- `pattern_found`: `{pattern_name, location, description}` -- Pattern identified
|
|
99
|
+
- `metric_measured`: `{metric, value, unit, module}` -- Metric measured
|
|
100
|
+
- `artifact_produced`: `{name, path, producer, type}` -- Deliverable created
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Output (report_agent_job_result)
|
|
105
|
+
|
|
106
|
+
Return JSON:
|
|
107
|
+
{
|
|
108
|
+
"id": "{id}",
|
|
109
|
+
"status": "completed" | "failed",
|
|
110
|
+
"findings": "Key discoveries and implementation notes (max 500 chars)",
|
|
111
|
+
"verdict": "PASS|WARN|FAIL|APPROVE|REVISE|REJECT or empty",
|
|
112
|
+
"artifacts_produced": "semicolon-separated artifact paths",
|
|
113
|
+
"error": ""
|
|
114
|
+
}
|