Skip to content

Commit 3788ba1

Browse files
author
catlog22
committed
refactor: team-planex dual-version optimization with v5 architecture
Claude version: add coordinator role with Spawn-and-Stop beat model, replace role-routed planner/executor with team-worker agents using lightweight role-specs (~80-110 lines each). Codex version: inline planning into main flow, remove planner agent, spawn executors directly per issue without waiting. Both versions preserve 3 input types (Issue IDs / --text / --plan).
1 parent d14a710 commit 3788ba1

11 files changed

Lines changed: 918 additions & 1323 deletions

File tree

.claude/skills/team-planex/SKILL.md

Lines changed: 178 additions & 318 deletions
Large diffs are not rendered by default.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
prefix: EXEC
3+
inner_loop: true
4+
message_types:
5+
success: impl_complete
6+
error: impl_failed
7+
---
8+
9+
# Executor
10+
11+
Single-issue implementation agent. Loads solution from artifact file, routes to execution backend (Agent/Codex/Gemini), verifies with tests, commits, and reports completion.
12+
13+
## Phase 2: Task & Solution Loading
14+
15+
| Input | Source | Required |
16+
|-------|--------|----------|
17+
| Issue ID | Task description `Issue ID:` field | Yes |
18+
| Solution file | Task description `Solution file:` field | Yes |
19+
| Session folder | Task description `Session:` field | Yes |
20+
| Execution method | Task description `Execution method:` field | Yes |
21+
| Wisdom | `<session>/wisdom/` | No |
22+
23+
1. Extract issue ID, solution file path, session folder, execution method
24+
2. Load solution JSON from file (file-first)
25+
3. If file not found -> fallback: `ccw issue solution <issueId> --json`
26+
4. Load wisdom files for conventions and patterns
27+
5. Verify solution has required fields: title, tasks
28+
29+
## Phase 3: Implementation
30+
31+
### Backend Selection
32+
33+
| Method | Backend | Agent Type |
34+
|--------|---------|------------|
35+
| `agent` | code-developer subagent | Inline delegation |
36+
| `codex` | `ccw cli --tool codex --mode write` | Background CLI |
37+
| `gemini` | `ccw cli --tool gemini --mode write` | Background CLI |
38+
39+
### Agent Backend
40+
41+
```
42+
Task({
43+
subagent_type: "code-developer",
44+
description: "Implement <issue-title>",
45+
prompt: `Issue: <issueId>
46+
Title: <solution.title>
47+
Solution: <solution JSON>
48+
Implement all tasks from the solution plan.`,
49+
run_in_background: false
50+
})
51+
```
52+
53+
### CLI Backend (Codex/Gemini)
54+
55+
```bash
56+
ccw cli -p "Issue: <issueId>
57+
Title: <solution.title>
58+
Solution Plan: <solution JSON>
59+
Implement all tasks. Follow existing patterns. Run tests." \
60+
--tool <codex|gemini> --mode write
61+
```
62+
63+
Wait for CLI completion before proceeding.
64+
65+
## Phase 4: Verification + Commit
66+
67+
### Test Verification
68+
69+
| Check | Method | Pass Criteria |
70+
|-------|--------|---------------|
71+
| Tests | Detect and run project test command | All pass |
72+
| Syntax | IDE diagnostics or `tsc --noEmit` | No errors |
73+
74+
If tests fail: retry implementation once, then report `impl_failed`.
75+
76+
### Commit
77+
78+
```bash
79+
git add -A
80+
git commit -m "feat(<issueId>): <solution.title>"
81+
```
82+
83+
### Update Issue Status
84+
85+
```bash
86+
ccw issue update <issueId> --status completed
87+
```
88+
89+
### Report
90+
91+
Send `impl_complete` message to coordinator via team_msg + SendMessage:
92+
- summary: `[executor] Implemented <issueId>: <title>`
93+
94+
## Boundaries
95+
96+
| Allowed | Prohibited |
97+
|---------|-----------|
98+
| Load solution from file | Create or modify issues |
99+
| Implement via Agent/Codex/Gemini | Modify solution artifacts |
100+
| Run tests | Spawn additional agents |
101+
| git commit | Direct user interaction |
102+
| Update issue status | Create tasks for other roles |
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
prefix: PLAN
3+
inner_loop: true
4+
subagents: [issue-plan-agent]
5+
message_types:
6+
success: issue_ready
7+
error: error
8+
---
9+
10+
# Planner
11+
12+
Requirement decomposition → issue creation → solution design → EXEC-* task creation. Processes issues one at a time, creating executor tasks as solutions are completed.
13+
14+
## Phase 2: Context Loading
15+
16+
| Input | Source | Required |
17+
|-------|--------|----------|
18+
| Input type + raw input | Task description | Yes |
19+
| Session folder | Task description `Session:` field | Yes |
20+
| Execution method | Task description `Execution method:` field | Yes |
21+
| Wisdom | `<session>/wisdom/` | No |
22+
23+
1. Extract session path, input type, raw input, execution method from task description
24+
2. Load wisdom files if available
25+
3. Parse input to determine issue list:
26+
27+
| Detection | Condition | Action |
28+
|-----------|-----------|--------|
29+
| Issue IDs | `ISS-\d{8}-\d{6}` pattern | Use directly |
30+
| `--text '...'` | Flag in input | Create issue(s) via `ccw issue create` |
31+
| `--plan <path>` | Flag in input | Read file, parse phases, batch create issues |
32+
33+
## Phase 3: Issue Processing Loop
34+
35+
For each issue, execute in sequence:
36+
37+
### 3a. Generate Solution
38+
39+
Delegate to `issue-plan-agent` subagent:
40+
41+
```
42+
Task({
43+
subagent_type: "issue-plan-agent",
44+
description: "Plan issue <issueId>",
45+
prompt: `issue_ids: ["<issueId>"]
46+
project_root: "<project-root>"
47+
Generate solution for this issue. Auto-bind single solution.`,
48+
run_in_background: false
49+
})
50+
```
51+
52+
### 3b. Write Solution Artifact
53+
54+
Write solution JSON to: `<session>/artifacts/solutions/<issueId>.json`
55+
56+
```json
57+
{
58+
"session_id": "<session-id>",
59+
"issue_id": "<issueId>",
60+
"solution": <solution-from-agent>,
61+
"planned_at": "<ISO timestamp>"
62+
}
63+
```
64+
65+
### 3c. Check Conflicts
66+
67+
Extract `files_touched` from solution. Compare against prior solutions in session.
68+
Overlapping files -> log warning to `wisdom/issues.md`, continue.
69+
70+
### 3d. Create EXEC-* Task
71+
72+
```
73+
TaskCreate({
74+
subject: "EXEC-00N: Implement <issue-title>",
75+
description: `Implement solution for issue <issueId>.
76+
77+
Issue ID: <issueId>
78+
Solution file: <session>/artifacts/solutions/<issueId>.json
79+
Session: <session>
80+
Execution method: <method>
81+
82+
InnerLoop: true`,
83+
activeForm: "Implementing <issue-title>"
84+
})
85+
```
86+
87+
### 3e. Signal issue_ready
88+
89+
Send message via team_msg + SendMessage to coordinator:
90+
- type: `issue_ready`
91+
- summary: `[planner] Solution ready for <issueId>`
92+
93+
### 3f. Continue Loop
94+
95+
Process next issue. Do NOT wait for executor.
96+
97+
## Phase 4: Completion Signal
98+
99+
After all issues processed:
100+
1. Send `all_planned` message to coordinator via team_msg + SendMessage
101+
2. Summary: total issues planned, EXEC-* tasks created
102+
103+
## Boundaries
104+
105+
| Allowed | Prohibited |
106+
|---------|-----------|
107+
| Parse input, create issues | Write/modify business code |
108+
| Generate solutions (issue-plan-agent) | Run tests |
109+
| Write solution artifacts | git commit |
110+
| Create EXEC-* tasks | Call code-developer |
111+
| Conflict checking | Direct user interaction |
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Command: dispatch
2+
3+
## Purpose
4+
5+
Create the initial task chain for team-planex pipeline. Creates PLAN-001 for planner. EXEC-* tasks are NOT pre-created — planner creates them at runtime per issue.
6+
7+
## Phase 2: Context Loading
8+
9+
| Input | Source | Required |
10+
|-------|--------|----------|
11+
| Input type | Phase 1 requirements | Yes |
12+
| Raw input | Phase 1 requirements | Yes |
13+
| Session folder | Phase 2 session init | Yes |
14+
| Execution method | Phase 1 requirements | Yes |
15+
16+
## Phase 3: Task Chain Creation
17+
18+
### Task Creation
19+
20+
Create a single PLAN-001 task for the planner:
21+
22+
```
23+
TaskCreate({
24+
subject: "PLAN-001: Requirement decomposition and solution design",
25+
description: `Decompose requirements into issues and generate solutions.
26+
27+
Input type: <issues|text|plan>
28+
Input: <raw-input>
29+
Session: <session-folder>
30+
Execution method: <agent|codex|gemini>
31+
32+
## Instructions
33+
1. Parse input to get issue list
34+
2. For each issue: call issue-plan-agent → write solution artifact
35+
3. After each solution: create EXEC-* task (owner: executor) with solution_file path
36+
4. After all issues: send all_planned signal
37+
38+
InnerLoop: true`,
39+
activeForm: "Planning requirements"
40+
})
41+
```
42+
43+
### EXEC-* Task Template (for planner reference)
44+
45+
Planner creates EXEC-* tasks at runtime using this template:
46+
47+
```
48+
TaskCreate({
49+
subject: "EXEC-00N: Implement <issue-title>",
50+
description: `Implement solution for issue <issueId>.
51+
52+
Issue ID: <issueId>
53+
Solution file: <session-folder>/artifacts/solutions/<issueId>.json
54+
Session: <session-folder>
55+
Execution method: <agent|codex|gemini>
56+
57+
InnerLoop: true`,
58+
activeForm: "Implementing <issue-title>"
59+
})
60+
```
61+
62+
### Add Command Task Template
63+
64+
When coordinator handles `add` command, create additional PLAN tasks:
65+
66+
```
67+
TaskCreate({
68+
subject: "PLAN-00N: Additional requirement decomposition",
69+
description: `Additional requirements to decompose.
70+
71+
Input type: <issues|text|plan>
72+
Input: <new-input>
73+
Session: <session-folder>
74+
Execution method: <execution-method>
75+
76+
InnerLoop: true`,
77+
activeForm: "Planning additional requirements"
78+
})
79+
```
80+
81+
## Phase 4: Validation
82+
83+
| Check | Criteria |
84+
|-------|----------|
85+
| PLAN-001 created | TaskList shows PLAN-001 |
86+
| Description complete | Contains Input, Session, Execution method |
87+
| No orphans | All tasks have valid owner |

0 commit comments

Comments
 (0)