mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
feat: Add coordinator commands and role specifications for UI design team
- Implemented the 'monitor' command for coordinator role to handle monitoring events, task completion, and pipeline management. - Created role specifications for the coordinator, detailing responsibilities, command execution protocols, and session management. - Added role specifications for the analyst, discussant, explorer, and synthesizer in the ultra-analyze skill, defining their context loading, analysis, and synthesis processes.
This commit is contained in:
@@ -14,7 +14,7 @@ Technical architect. Responsible for technical design, task decomposition, and a
|
||||
|
||||
- Only process `DESIGN-*` prefixed tasks
|
||||
- All output must carry `[architect]` identifier
|
||||
- Phase 2: Read shared-memory.json, Phase 5: Write architecture_decisions
|
||||
- Phase 2: Read .msg/meta.json, Phase 5: Write architecture_decisions
|
||||
- Work strictly within technical design responsibility scope
|
||||
|
||||
### MUST NOT
|
||||
@@ -53,24 +53,21 @@ Technical architect. Responsible for technical design, task decomposition, and a
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
**NOTE**: `team` must be **session ID** (e.g., `TID-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description.
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: <session-id>, // e.g., "TID-project-2026-02-27", NOT "iterdev"
|
||||
session_id: <session-id>,
|
||||
from: "architect",
|
||||
to: "coordinator",
|
||||
type: <message-type>,
|
||||
summary: "[architect] DESIGN complete: <task-subject>",
|
||||
ref: <design-path>
|
||||
data: { ref: <design-path> }
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from architect --to coordinator --type <message-type> --summary \"[architect] DESIGN complete\" --ref <design-path> --json")
|
||||
Bash("ccw team log --session-id <session-id> --from architect --type <message-type> --json")
|
||||
```
|
||||
|
||||
---
|
||||
@@ -90,17 +87,17 @@ Standard task discovery flow: TaskList -> filter by prefix `DESIGN-*` + owner ma
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session path | Task description (Session: <path>) | Yes |
|
||||
| Shared memory | <session-folder>/shared-memory.json | Yes |
|
||||
| Shared memory | <session-folder>/.msg/meta.json | Yes |
|
||||
| Codebase | Project files | Yes |
|
||||
| Wisdom | <session-folder>/wisdom/ | No |
|
||||
|
||||
**Loading steps**:
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Read shared-memory.json for context
|
||||
2. Read .msg/meta.json for context
|
||||
|
||||
```
|
||||
Read(<session-folder>/shared-memory.json)
|
||||
Read(<session-folder>/.msg/meta.json)
|
||||
```
|
||||
|
||||
3. Multi-angle codebase exploration via cli-explore-agent:
|
||||
@@ -217,17 +214,16 @@ sharedMemory.architecture_decisions.push({
|
||||
components: <component-names>,
|
||||
task_count: <count>
|
||||
})
|
||||
Write(<session-folder>/shared-memory.json, JSON.stringify(sharedMemory, null, 2))
|
||||
Write(<session-folder>/.msg/meta.json, JSON.stringify(sharedMemory, null, 2))
|
||||
```
|
||||
|
||||
2. **Log and send message**:
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log", team: <session-id>, from: "architect", to: "coordinator", // team = session ID, e.g., "TID-project-2026-02-27"
|
||||
operation: "log", session_id: <session-id>, from: "architect",
|
||||
type: "design_ready",
|
||||
summary: "[architect] Design complete: <count> components, <task-count> tasks",
|
||||
ref: <design-path>
|
||||
data: { ref: <design-path> }
|
||||
})
|
||||
|
||||
SendMessage({
|
||||
@@ -238,7 +234,6 @@ SendMessage({
|
||||
**Tasks**: <task-count>
|
||||
**Design**: <design-path>
|
||||
**Breakdown**: <breakdown-path>`,
|
||||
summary: "[architect] Design: <task-count> tasks"
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Orchestrate the IterDev workflow: Sprint planning, backlog management, task ledg
|
||||
- All output must carry `[coordinator]` identifier
|
||||
- Maintain task-ledger.json for real-time progress
|
||||
- Manage developer<->reviewer GC loop (max 3 rounds)
|
||||
- Record learning to shared-memory.json at Sprint end
|
||||
- Record learning to .msg/meta.json at Sprint end
|
||||
- Detect and coordinate task conflicts
|
||||
- Manage shared resource locks (resource_locks)
|
||||
- Record rollback points and support emergency rollback
|
||||
@@ -55,7 +55,7 @@ For callback/check/resume: load monitor logic and execute the appropriate handle
|
||||
|
||||
**Workflow**:
|
||||
|
||||
1. Scan `.workflow/.team/IDS-*/team-session.json` for sessions with status "active" or "paused"
|
||||
1. Scan `.workflow/.team/IDS-*/.msg/meta.json` for sessions with status "active" or "paused"
|
||||
2. No sessions found -> proceed to Phase 1
|
||||
3. Single session found -> resume it (-> Session Reconciliation)
|
||||
4. Multiple sessions -> AskUserQuestion for user selection
|
||||
@@ -142,7 +142,7 @@ AskUserQuestion({
|
||||
}
|
||||
```
|
||||
|
||||
7. Initialize shared-memory.json:
|
||||
7. Initialize .msg/meta.json:
|
||||
|
||||
```
|
||||
{
|
||||
@@ -227,7 +227,7 @@ Subsequent sprints created dynamically after Sprint N completes.
|
||||
|
||||
When receiving `review_revision` or `review_critical`:
|
||||
|
||||
1. Read shared-memory.json -> get gc_round
|
||||
1. Read .msg/meta.json -> get gc_round
|
||||
2. If gc_round < max_gc_rounds (3):
|
||||
- Increment gc_round
|
||||
- Create DEV-fix task with review feedback
|
||||
@@ -247,7 +247,7 @@ When receiving `review_revision` or `review_critical`:
|
||||
**Workflow**:
|
||||
|
||||
1. Load session state -> count completed tasks, duration
|
||||
2. Record sprint learning to shared-memory.json
|
||||
2. Record sprint learning to .msg/meta.json
|
||||
3. List deliverables with output paths
|
||||
4. Update session status -> "completed"
|
||||
5. Offer next steps via AskUserQuestion
|
||||
@@ -262,7 +262,7 @@ Concurrency control for shared resources. Prevents multiple workers from modifyi
|
||||
|
||||
| Action | Trigger Condition | Behavior |
|
||||
|--------|-------------------|----------|
|
||||
| Acquire lock | Worker requests exclusive access | Check resource_locks in shared-memory.json. If unlocked, record lock with task ID, timestamp, holder. Log resource_locked. Return success. |
|
||||
| Acquire lock | Worker requests exclusive access | Check resource_locks via team_msg(type='state_update'). If unlocked, record lock with task ID, timestamp, holder. Log resource_locked. Return success. |
|
||||
| Deny lock | Resource already locked | Return failure with current holder's task ID. Log resource_contention. Worker must wait. |
|
||||
| Release lock | Worker completes task | Remove lock entry. Log resource_unlocked. |
|
||||
| Force release | Lock held beyond timeout (5 min) | Force-remove lock entry. Notify holder. Log warning. |
|
||||
@@ -381,24 +381,21 @@ Identifies, tracks, and prioritizes technical debt.
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
**NOTE**: `team` must be **session ID** (e.g., `TID-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description.
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: <session-id>, // e.g., "TID-project-2026-02-27", NOT "iterdev"
|
||||
session_id: <session-id>,
|
||||
from: "coordinator",
|
||||
to: "all",
|
||||
type: <message-type>,
|
||||
summary: "[coordinator] <summary>",
|
||||
ref: <artifact-path>
|
||||
data: { ref: <artifact-path> }
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from coordinator --to all --type <message-type> --summary \"[coordinator] ...\" --ref <artifact-path> --json")
|
||||
Bash("ccw team log --session-id <session-id> --from coordinator --type <message-type> --json")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
# Command: Dispatch
|
||||
|
||||
Create the iterative development task chain with correct dependencies and structured task descriptions.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| User requirement | From coordinator Phase 1 | Yes |
|
||||
| Session folder | From coordinator Phase 2 | Yes |
|
||||
| Pipeline definition | From SKILL.md Pipeline Definitions | Yes |
|
||||
| Pipeline mode | From session.json `pipeline` | Yes |
|
||||
|
||||
1. Load user requirement and scope from session.json
|
||||
2. Load pipeline stage definitions from SKILL.md Task Metadata Registry
|
||||
3. Read `pipeline` mode from session.json (patch / sprint / multi-sprint)
|
||||
|
||||
## Phase 3: Task Chain Creation
|
||||
|
||||
### Task Description Template
|
||||
|
||||
Every task description uses structured format for clarity:
|
||||
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "<TASK-ID>",
|
||||
owner: "<role>",
|
||||
description: "PURPOSE: <what this task achieves> | Success: <measurable completion criteria>
|
||||
TASK:
|
||||
- <step 1: specific action>
|
||||
- <step 2: specific action>
|
||||
- <step 3: specific action>
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <task-scope>
|
||||
- Upstream artifacts: <artifact-1>, <artifact-2>
|
||||
- Shared memory: <session>/.msg/meta.json
|
||||
EXPECTED: <deliverable path> + <quality criteria>
|
||||
CONSTRAINTS: <scope limits, focus areas>
|
||||
---
|
||||
InnerLoop: <true|false>",
|
||||
blockedBy: [<dependency-list>],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
### Mode Router
|
||||
|
||||
| Mode | Action |
|
||||
|------|--------|
|
||||
| `patch` | Create DEV-001 + VERIFY-001 |
|
||||
| `sprint` | Create DESIGN-001 + DEV-001 + VERIFY-001 + REVIEW-001 |
|
||||
| `multi-sprint` | Create Sprint 1 chain, subsequent sprints created dynamically |
|
||||
|
||||
---
|
||||
|
||||
### Patch Pipeline
|
||||
|
||||
**DEV-001** (developer):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "DEV-001",
|
||||
owner: "developer",
|
||||
description: "PURPOSE: Implement fix | Success: Fix applied, syntax clean
|
||||
TASK:
|
||||
- Load target files and understand context
|
||||
- Apply fix changes
|
||||
- Validate syntax
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <task-scope>
|
||||
- Shared memory: <session>/.msg/meta.json
|
||||
EXPECTED: Modified source files + <session>/code/dev-log.md | Syntax clean
|
||||
CONSTRAINTS: Minimal changes | Preserve existing behavior
|
||||
---
|
||||
InnerLoop: true",
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
**VERIFY-001** (tester):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "VERIFY-001",
|
||||
owner: "tester",
|
||||
description: "PURPOSE: Verify fix correctness | Success: Tests pass, no regressions
|
||||
TASK:
|
||||
- Detect test framework
|
||||
- Run targeted tests for changed files
|
||||
- Run regression test suite
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <task-scope>
|
||||
- Upstream artifacts: code/dev-log.md
|
||||
- Shared memory: <session>/.msg/meta.json
|
||||
EXPECTED: <session>/verify/verify-001.json | Pass rate >= 95%
|
||||
CONSTRAINTS: Focus on changed files | Report any regressions
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["DEV-001"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Sprint Pipeline
|
||||
|
||||
**DESIGN-001** (architect):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "DESIGN-001",
|
||||
owner: "architect",
|
||||
description: "PURPOSE: Technical design and task breakdown | Success: Design document + task breakdown ready
|
||||
TASK:
|
||||
- Explore codebase for patterns and dependencies
|
||||
- Create component design with integration points
|
||||
- Break down into implementable tasks with acceptance criteria
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <task-scope>
|
||||
- Shared memory: <session>/.msg/meta.json
|
||||
EXPECTED: <session>/design/design-001.md + <session>/design/task-breakdown.json | Components defined, tasks actionable
|
||||
CONSTRAINTS: Focus on <task-scope> | Risk assessment required
|
||||
---
|
||||
InnerLoop: false",
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
**DEV-001** (developer):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "DEV-001",
|
||||
owner: "developer",
|
||||
description: "PURPOSE: Implement design | Success: All design tasks implemented, syntax clean
|
||||
TASK:
|
||||
- Load design and task breakdown
|
||||
- Implement tasks in execution order
|
||||
- Validate syntax after changes
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <task-scope>
|
||||
- Upstream artifacts: design/design-001.md, design/task-breakdown.json
|
||||
- Shared memory: <session>/.msg/meta.json
|
||||
EXPECTED: Modified source files + <session>/code/dev-log.md | Syntax clean, all tasks done
|
||||
CONSTRAINTS: Follow design | Preserve existing behavior | Follow code conventions
|
||||
---
|
||||
InnerLoop: true",
|
||||
blockedBy: ["DESIGN-001"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
**VERIFY-001** (tester, parallel with REVIEW-001):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "VERIFY-001",
|
||||
owner: "tester",
|
||||
description: "PURPOSE: Verify implementation | Success: Tests pass, no regressions
|
||||
TASK:
|
||||
- Detect test framework
|
||||
- Run tests for changed files
|
||||
- Run regression test suite
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <task-scope>
|
||||
- Upstream artifacts: code/dev-log.md
|
||||
- Shared memory: <session>/.msg/meta.json
|
||||
EXPECTED: <session>/verify/verify-001.json | Pass rate >= 95%
|
||||
CONSTRAINTS: Focus on changed files | Report regressions
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["DEV-001"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
**REVIEW-001** (reviewer, parallel with VERIFY-001):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "REVIEW-001",
|
||||
owner: "reviewer",
|
||||
description: "PURPOSE: Code review for correctness and quality | Success: All dimensions reviewed, verdict issued
|
||||
TASK:
|
||||
- Load changed files and design document
|
||||
- Review across 4 dimensions: correctness, completeness, maintainability, security
|
||||
- Score quality (1-10) and issue verdict
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <task-scope>
|
||||
- Upstream artifacts: design/design-001.md, code/dev-log.md
|
||||
- Shared memory: <session>/.msg/meta.json
|
||||
EXPECTED: <session>/review/review-001.md | Per-dimension findings with severity
|
||||
CONSTRAINTS: Focus on implementation changes | Provide file:line references
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["DEV-001"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Multi-Sprint Pipeline
|
||||
|
||||
Sprint 1: DESIGN-001 -> DEV-001 -> DEV-002(incremental) -> VERIFY-001 -> DEV-fix -> REVIEW-001
|
||||
|
||||
Create Sprint 1 tasks using sprint templates above, plus:
|
||||
|
||||
**DEV-002** (developer, incremental):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "DEV-002",
|
||||
owner: "developer",
|
||||
description: "PURPOSE: Incremental implementation | Success: Remaining tasks implemented
|
||||
TASK:
|
||||
- Load remaining tasks from breakdown
|
||||
- Implement incrementally
|
||||
- Validate syntax
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <task-scope>
|
||||
- Upstream artifacts: design/task-breakdown.json, code/dev-log.md
|
||||
- Shared memory: <session>/.msg/meta.json
|
||||
EXPECTED: Modified source files + updated dev-log.md
|
||||
CONSTRAINTS: Incremental delivery | Follow existing patterns
|
||||
---
|
||||
InnerLoop: true",
|
||||
blockedBy: ["DEV-001"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
Subsequent sprints created dynamically after Sprint N completes.
|
||||
|
||||
## Phase 4: Validation
|
||||
|
||||
Verify task chain integrity:
|
||||
|
||||
| Check | Method | Expected |
|
||||
|-------|--------|----------|
|
||||
| Task count correct | TaskList count | patch: 2, sprint: 4, multi: 5+ |
|
||||
| Dependencies correct | Trace blockedBy graph | Acyclic, correct ordering |
|
||||
| No circular dependencies | Trace full graph | Acyclic |
|
||||
| Structured descriptions | Each has PURPOSE/TASK/CONTEXT/EXPECTED | All present |
|
||||
|
||||
If validation fails, fix the specific task and re-validate.
|
||||
269
.claude/skills/team-iterdev/roles/coordinator/role.md
Normal file
269
.claude/skills/team-iterdev/roles/coordinator/role.md
Normal file
@@ -0,0 +1,269 @@
|
||||
# Coordinator - Iterative Development Team
|
||||
|
||||
**Role**: coordinator
|
||||
**Type**: Orchestrator
|
||||
**Team**: iterdev
|
||||
|
||||
Orchestrates the iterative development pipeline: sprint planning, task ledger maintenance, Generator-Critic loop control (developer<->reviewer, max 3 rounds), cross-sprint learning, and pipeline advancement.
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- Use `team-worker` agent type for all worker spawns (NOT `general-purpose`)
|
||||
- Follow Command Execution Protocol for dispatch and monitor commands
|
||||
- Respect pipeline stage dependencies (blockedBy)
|
||||
- Stop after spawning workers -- wait for callbacks
|
||||
- Handle developer<->reviewer GC loop (max 3 rounds)
|
||||
- Maintain task-ledger.json for real-time progress
|
||||
- Execute completion action in Phase 5
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- Implement domain logic (designing, coding, testing, reviewing) -- workers handle this
|
||||
- Spawn workers without creating tasks first
|
||||
- Write source code directly
|
||||
- Force-advance pipeline past failed review/validation
|
||||
- Modify task outputs (workers own their deliverables)
|
||||
|
||||
---
|
||||
|
||||
## Command Execution Protocol
|
||||
|
||||
When coordinator needs to execute a command (dispatch, monitor):
|
||||
|
||||
1. **Read the command file**: `roles/coordinator/commands/<command-name>.md`
|
||||
2. **Follow the workflow** defined in the command file (Phase 2-4 structure)
|
||||
3. **Commands are inline execution guides** -- NOT separate agents or subprocesses
|
||||
4. **Execute synchronously** -- complete the command workflow before proceeding
|
||||
|
||||
Example:
|
||||
```
|
||||
Phase 3 needs task dispatch
|
||||
-> Read roles/coordinator/commands/dispatch.md
|
||||
-> Execute Phase 2 (Context Loading)
|
||||
-> Execute Phase 3 (Task Chain Creation)
|
||||
-> Execute Phase 4 (Validation)
|
||||
-> Continue to Phase 4
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Entry Router
|
||||
|
||||
When coordinator is invoked, detect invocation type:
|
||||
|
||||
| Detection | Condition | Handler |
|
||||
|-----------|-----------|---------|
|
||||
| Worker callback | Message contains role tag [architect], [developer], [tester], [reviewer] | -> handleCallback |
|
||||
| Status check | Arguments contain "check" or "status" | -> handleCheck |
|
||||
| Manual resume | Arguments contain "resume" or "continue" | -> handleResume |
|
||||
| Pipeline complete | All tasks have status "completed" | -> handleComplete |
|
||||
| Interrupted session | Active/paused session exists | -> Phase 0 (Resume Check) |
|
||||
| New session | None of above | -> Phase 1 (Requirement Clarification) |
|
||||
|
||||
For callback/check/resume/complete: load `commands/monitor.md` and execute matched handler, then STOP.
|
||||
|
||||
### Router Implementation
|
||||
|
||||
1. **Load session context** (if exists):
|
||||
- Scan `.workflow/.team/IDS-*/.msg/meta.json` for active/paused sessions
|
||||
- If found, extract session folder path, status, and pipeline mode
|
||||
|
||||
2. **Parse $ARGUMENTS** for detection keywords:
|
||||
- Check for role name tags in message content
|
||||
- Check for "check", "status", "resume", "continue" keywords
|
||||
|
||||
3. **Route to handler**:
|
||||
- For monitor handlers: Read `commands/monitor.md`, execute matched handler, STOP
|
||||
- For Phase 0: Execute Session Resume Check below
|
||||
- For Phase 1: Execute Requirement Clarification below
|
||||
|
||||
---
|
||||
|
||||
## Phase 0: Session Resume Check
|
||||
|
||||
Triggered when an active/paused session is detected on coordinator entry.
|
||||
|
||||
1. Load session.json from detected session folder
|
||||
2. Audit task list: `TaskList()`
|
||||
3. Reconcile session state vs task status:
|
||||
|
||||
| Task Status | Session Expects | Action |
|
||||
|-------------|----------------|--------|
|
||||
| in_progress | Should be running | Reset to pending (worker was interrupted) |
|
||||
| completed | Already tracked | Skip |
|
||||
| pending + unblocked | Ready to run | Include in spawn list |
|
||||
|
||||
4. Rebuild team if not active: `TeamCreate({ team_name: "iterdev" })`
|
||||
5. Spawn workers for ready tasks -> Phase 4 coordination loop
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: Requirement Clarification
|
||||
|
||||
1. Parse user task description from $ARGUMENTS
|
||||
2. Assess complexity for pipeline selection:
|
||||
|
||||
| Signal | Weight |
|
||||
|--------|--------|
|
||||
| Changed files > 10 | +3 |
|
||||
| Changed files 3-10 | +2 |
|
||||
| Structural change (refactor, architect, restructure) | +3 |
|
||||
| Cross-cutting (multiple, across, cross) | +2 |
|
||||
| Simple fix (fix, bug, typo, patch) | -2 |
|
||||
|
||||
| Score | Pipeline |
|
||||
|-------|----------|
|
||||
| >= 5 | multi-sprint |
|
||||
| 2-4 | sprint |
|
||||
| 0-1 | patch |
|
||||
|
||||
3. Ask for missing parameters via AskUserQuestion (mode selection)
|
||||
4. Record requirement with scope, pipeline mode
|
||||
|
||||
---
|
||||
|
||||
## Phase 2: Session & Team Setup
|
||||
|
||||
1. Generate session ID: `IDS-{slug}-{YYYY-MM-DD}`
|
||||
2. Create session folder structure:
|
||||
|
||||
```
|
||||
Bash("mkdir -p .workflow/.team/<session-id>/design .workflow/.team/<session-id>/code .workflow/.team/<session-id>/verify .workflow/.team/<session-id>/review .workflow/.team/<session-id>/wisdom")
|
||||
```
|
||||
|
||||
3. Create team: `TeamCreate({ team_name: "iterdev" })`
|
||||
4. Initialize wisdom directory (learnings.md, decisions.md, conventions.md, issues.md)
|
||||
5. Write session.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "active",
|
||||
"team_name": "iterdev",
|
||||
"requirement": "<requirement>",
|
||||
"pipeline": "<patch|sprint|multi-sprint>",
|
||||
"timestamp": "<ISO-8601>",
|
||||
"gc_round": 0,
|
||||
"max_gc_rounds": 3,
|
||||
"fix_cycles": {}
|
||||
}
|
||||
```
|
||||
|
||||
6. Initialize task-ledger.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"sprint_id": "sprint-1",
|
||||
"sprint_goal": "<task-description>",
|
||||
"pipeline": "<selected-pipeline>",
|
||||
"tasks": [],
|
||||
"metrics": { "total": 0, "completed": 0, "in_progress": 0, "blocked": 0, "velocity": 0 }
|
||||
}
|
||||
```
|
||||
|
||||
7. Initialize .msg/meta.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"session_id": "<session-id>",
|
||||
"requirement": "<requirement>",
|
||||
"pipeline": "<pipeline>",
|
||||
"architecture_decisions": [],
|
||||
"implementation_context": [],
|
||||
"review_feedback_trends": [],
|
||||
"gc_round": 0,
|
||||
"max_gc_rounds": 3,
|
||||
"sprint_history": []
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Phase 3: Task Chain Creation
|
||||
|
||||
Execute `commands/dispatch.md` inline (Command Execution Protocol):
|
||||
|
||||
1. Read `roles/coordinator/commands/dispatch.md`
|
||||
2. Follow dispatch Phase 2 (context loading) -> Phase 3 (task chain creation) -> Phase 4 (validation)
|
||||
3. Result: all pipeline tasks created with correct blockedBy dependencies
|
||||
|
||||
---
|
||||
|
||||
## Phase 4: Spawn & Coordination Loop
|
||||
|
||||
### Initial Spawn
|
||||
|
||||
Find first unblocked task and spawn its worker:
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker",
|
||||
team_name: "iterdev",
|
||||
name: "<role>",
|
||||
run_in_background: true,
|
||||
prompt: `## Role Assignment
|
||||
role: <role>
|
||||
role_spec: .claude/skills/team-iterdev/role-specs/<role>.md
|
||||
session: <session-folder>
|
||||
session_id: <session-id>
|
||||
team_name: iterdev
|
||||
requirement: <task-description>
|
||||
inner_loop: <true|false>
|
||||
|
||||
Read role_spec file to load Phase 2-4 domain instructions.
|
||||
Execute built-in Phase 1 (task discovery) -> role-spec Phase 2-4 -> built-in Phase 5 (report).`
|
||||
})
|
||||
```
|
||||
|
||||
**STOP** after spawning. Wait for worker callback.
|
||||
|
||||
### Coordination (via monitor.md handlers)
|
||||
|
||||
All subsequent coordination is handled by `commands/monitor.md` handlers triggered by worker callbacks:
|
||||
|
||||
- handleCallback -> mark task done -> check pipeline -> handleSpawnNext
|
||||
- handleSpawnNext -> find ready tasks -> spawn team-worker agents -> STOP
|
||||
- handleComplete -> all done -> Phase 5
|
||||
|
||||
---
|
||||
|
||||
## Phase 5: Report + Completion Action
|
||||
|
||||
1. Load session state -> count completed tasks, calculate duration
|
||||
2. Record sprint learning to .msg/meta.json sprint_history
|
||||
3. List deliverables:
|
||||
|
||||
| Deliverable | Path |
|
||||
|-------------|------|
|
||||
| Design Document | <session>/design/design-001.md |
|
||||
| Task Breakdown | <session>/design/task-breakdown.json |
|
||||
| Dev Log | <session>/code/dev-log.md |
|
||||
| Verification Results | <session>/verify/verify-001.json |
|
||||
| Review Report | <session>/review/review-001.md |
|
||||
|
||||
4. **Completion Action** (interactive):
|
||||
|
||||
```
|
||||
AskUserQuestion({
|
||||
questions: [{
|
||||
question: "Team pipeline complete. What would you like to do?",
|
||||
header: "Completion",
|
||||
multiSelect: false,
|
||||
options: [
|
||||
{ label: "Archive & Clean (Recommended)", description: "Archive session, clean up tasks and team resources" },
|
||||
{ label: "Keep Active", description: "Keep session active for follow-up work or inspection" },
|
||||
{ label: "Export Results", description: "Export deliverables to a specified location, then clean" }
|
||||
]
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
5. Handle user choice:
|
||||
|
||||
| Choice | Steps |
|
||||
|--------|-------|
|
||||
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete("iterdev") -> output final summary |
|
||||
| Keep Active | Update session status="paused" -> output: "Session paused. Resume with: Skill(skill='team-iterdev', args='resume')" |
|
||||
| Export Results | AskUserQuestion for target directory -> copy all artifacts -> Archive & Clean flow |
|
||||
@@ -14,7 +14,7 @@ Code implementer. Responsible for implementing code according to design, increme
|
||||
|
||||
- Only process `DEV-*` prefixed tasks
|
||||
- All output must carry `[developer]` identifier
|
||||
- Phase 2: Read shared-memory.json + design, Phase 5: Write implementation_context
|
||||
- Phase 2: Read .msg/meta.json + design, Phase 5: Write implementation_context
|
||||
- For fix tasks (DEV-fix-*): Reference review feedback
|
||||
- Work strictly within code implementation responsibility scope
|
||||
|
||||
@@ -56,24 +56,21 @@ Code implementer. Responsible for implementing code according to design, increme
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
**NOTE**: `team` must be **session ID** (e.g., `TID-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description.
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: <session-id>, // e.g., "TID-project-2026-02-27", NOT "iterdev"
|
||||
session_id: <session-id>,
|
||||
from: "developer",
|
||||
to: "coordinator",
|
||||
type: <message-type>,
|
||||
summary: "[developer] DEV complete: <task-subject>",
|
||||
ref: <dev-log-path>
|
||||
data: { ref: <dev-log-path> }
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from developer --to coordinator --type <message-type> --summary \"[developer] DEV complete\" --ref <dev-log-path> --json")
|
||||
Bash("ccw team log --session-id <session-id> --from developer --type <message-type> --json")
|
||||
```
|
||||
|
||||
---
|
||||
@@ -93,7 +90,7 @@ Standard task discovery flow: TaskList -> filter by prefix `DEV-*` + owner match
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session path | Task description (Session: <path>) | Yes |
|
||||
| Shared memory | <session-folder>/shared-memory.json | Yes |
|
||||
| Shared memory | <session-folder>/.msg/meta.json | Yes |
|
||||
| Design document | <session-folder>/design/design-001.md | For non-fix tasks |
|
||||
| Task breakdown | <session-folder>/design/task-breakdown.json | For non-fix tasks |
|
||||
| Review feedback | <session-folder>/review/*.md | For fix tasks |
|
||||
@@ -102,10 +99,10 @@ Standard task discovery flow: TaskList -> filter by prefix `DEV-*` + owner match
|
||||
**Loading steps**:
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Read shared-memory.json
|
||||
2. Read .msg/meta.json
|
||||
|
||||
```
|
||||
Read(<session-folder>/shared-memory.json)
|
||||
Read(<session-folder>/.msg/meta.json)
|
||||
```
|
||||
|
||||
3. Check if this is a fix task (GC loop):
|
||||
@@ -227,17 +224,16 @@ sharedMemory.implementation_context.push({
|
||||
is_fix: <is-fix-task>,
|
||||
syntax_clean: <has-syntax-errors>
|
||||
})
|
||||
Write(<session-folder>/shared-memory.json, JSON.stringify(sharedMemory, null, 2))
|
||||
Write(<session-folder>/.msg/meta.json, JSON.stringify(sharedMemory, null, 2))
|
||||
```
|
||||
|
||||
2. **Log and send message**:
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log", team: <session-id>, from: "developer", to: "coordinator", // team = session ID, e.g., "TID-project-2026-02-27"
|
||||
operation: "log", session_id: <session-id>, from: "developer",
|
||||
type: "dev_complete",
|
||||
summary: "[developer] <Fix|Implementation> complete: <file-count> files changed",
|
||||
ref: <dev-log-path>
|
||||
data: { ref: <dev-log-path> }
|
||||
})
|
||||
|
||||
SendMessage({
|
||||
@@ -252,7 +248,6 @@ SendMessage({
|
||||
### Files
|
||||
- <file-1>
|
||||
- <file-2>`,
|
||||
summary: "[developer] <file-count> files <fixed|implemented>"
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Code reviewer. Responsible for multi-dimensional review, quality scoring, and im
|
||||
|
||||
- Only process `REVIEW-*` prefixed tasks
|
||||
- All output must carry `[reviewer]` identifier
|
||||
- Phase 2: Read shared-memory.json + design, Phase 5: Write review_feedback_trends
|
||||
- Phase 2: Read .msg/meta.json + design, Phase 5: Write review_feedback_trends
|
||||
- Mark each issue with severity (CRITICAL/HIGH/MEDIUM/LOW)
|
||||
- Provide quality score (1-10)
|
||||
- Work strictly within code review responsibility scope
|
||||
@@ -55,24 +55,21 @@ Code reviewer. Responsible for multi-dimensional review, quality scoring, and im
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
**NOTE**: `team` must be **session ID** (e.g., `TID-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description.
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: <session-id>, // e.g., "TID-project-2026-02-27", NOT "iterdev"
|
||||
session_id: <session-id>,
|
||||
from: "reviewer",
|
||||
to: "coordinator",
|
||||
type: <message-type>,
|
||||
summary: "[reviewer] REVIEW complete: <task-subject>",
|
||||
ref: <review-path>
|
||||
data: { ref: <review-path> }
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from reviewer --to coordinator --type <message-type> --summary \"[reviewer] REVIEW complete\" --ref <review-path> --json")
|
||||
Bash("ccw team log --session-id <session-id> --from reviewer --type <message-type> --json")
|
||||
```
|
||||
|
||||
---
|
||||
@@ -92,7 +89,7 @@ Standard task discovery flow: TaskList -> filter by prefix `REVIEW-*` + owner ma
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session path | Task description (Session: <path>) | Yes |
|
||||
| Shared memory | <session-folder>/shared-memory.json | Yes |
|
||||
| Shared memory | <session-folder>/.msg/meta.json | Yes |
|
||||
| Design document | <session-folder>/design/design-001.md | For requirements alignment |
|
||||
| Changed files | Git diff | Yes |
|
||||
| Wisdom | <session-folder>/wisdom/ | No |
|
||||
@@ -100,10 +97,10 @@ Standard task discovery flow: TaskList -> filter by prefix `REVIEW-*` + owner ma
|
||||
**Loading steps**:
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Read shared-memory.json
|
||||
2. Read .msg/meta.json
|
||||
|
||||
```
|
||||
Read(<session-folder>/shared-memory.json)
|
||||
Read(<session-folder>/.msg/meta.json)
|
||||
```
|
||||
|
||||
3. Read design document for requirements alignment:
|
||||
@@ -245,7 +242,7 @@ sharedMemory.review_feedback_trends.push({
|
||||
dimensions: <dimension-list>,
|
||||
gc_round: sharedMemory.gc_round || 0
|
||||
})
|
||||
Write(<session-folder>/shared-memory.json, JSON.stringify(sharedMemory, null, 2))
|
||||
Write(<session-folder>/.msg/meta.json, JSON.stringify(sharedMemory, null, 2))
|
||||
```
|
||||
|
||||
2. **Determine message type**:
|
||||
@@ -260,10 +257,9 @@ Write(<session-folder>/shared-memory.json, JSON.stringify(sharedMemory, null, 2)
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log", team: <session-id>, from: "reviewer", to: "coordinator", // team = session ID, e.g., "TID-project-2026-02-27"
|
||||
operation: "log", session_id: <session-id>, from: "reviewer",
|
||||
type: <message-type>,
|
||||
summary: "[reviewer] Review <message-type>: score=<score>/10, <critical-count>C/<high-count>H",
|
||||
ref: <review-path>
|
||||
data: { ref: <review-path> }
|
||||
})
|
||||
|
||||
SendMessage({
|
||||
@@ -279,7 +275,6 @@ SendMessage({
|
||||
### Top Issues
|
||||
- **[CRITICAL/HIGH]** <title> (<file>:<line>)
|
||||
...`,
|
||||
summary: "[reviewer] <message-type>: <score>/10"
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Test validator. Responsible for test execution, fix cycles, and regression detec
|
||||
|
||||
- Only process `VERIFY-*` prefixed tasks
|
||||
- All output must carry `[tester]` identifier
|
||||
- Phase 2: Read shared-memory.json, Phase 5: Write test_patterns
|
||||
- Phase 2: Read .msg/meta.json, Phase 5: Write test_patterns
|
||||
- Work strictly within test validation responsibility scope
|
||||
|
||||
### MUST NOT
|
||||
@@ -54,24 +54,21 @@ Test validator. Responsible for test execution, fix cycles, and regression detec
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
**NOTE**: `team` must be **session ID** (e.g., `TID-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description.
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: <session-id>, // e.g., "TID-project-2026-02-27", NOT "iterdev"
|
||||
session_id: <session-id>,
|
||||
from: "tester",
|
||||
to: "coordinator",
|
||||
type: <message-type>,
|
||||
summary: "[tester] VERIFY complete: <task-subject>",
|
||||
ref: <verify-path>
|
||||
data: { ref: <verify-path> }
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from tester --to coordinator --type <message-type> --summary \"[tester] VERIFY complete\" --ref <verify-path> --json")
|
||||
Bash("ccw team log --session-id <session-id> --from tester --type <message-type> --json")
|
||||
```
|
||||
|
||||
---
|
||||
@@ -91,17 +88,17 @@ Standard task discovery flow: TaskList -> filter by prefix `VERIFY-*` + owner ma
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session path | Task description (Session: <path>) | Yes |
|
||||
| Shared memory | <session-folder>/shared-memory.json | Yes |
|
||||
| Shared memory | <session-folder>/.msg/meta.json | Yes |
|
||||
| Changed files | Git diff | Yes |
|
||||
| Wisdom | <session-folder>/wisdom/ | No |
|
||||
|
||||
**Detection steps**:
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Read shared-memory.json
|
||||
2. Read .msg/meta.json
|
||||
|
||||
```
|
||||
Read(<session-folder>/shared-memory.json)
|
||||
Read(<session-folder>/.msg/meta.json)
|
||||
```
|
||||
|
||||
3. Get changed files:
|
||||
@@ -197,7 +194,7 @@ sharedMemory.test_patterns = sharedMemory.test_patterns || []
|
||||
if (passRate >= 0.95) {
|
||||
sharedMemory.test_patterns.push(`verify-<num>: passed in <iterations> iterations`)
|
||||
}
|
||||
Write(<session-folder>/shared-memory.json, JSON.stringify(sharedMemory, null, 2))
|
||||
Write(<session-folder>/.msg/meta.json, JSON.stringify(sharedMemory, null, 2))
|
||||
```
|
||||
|
||||
2. **Determine message type**:
|
||||
@@ -212,10 +209,9 @@ Write(<session-folder>/shared-memory.json, JSON.stringify(sharedMemory, null, 2)
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log", team: <session-id>, from: "tester", to: "coordinator", // team = session ID, e.g., "TID-project-2026-02-27"
|
||||
operation: "log", session_id: <session-id>, from: "tester",
|
||||
type: <message-type>,
|
||||
summary: "[tester] <message-type>: pass_rate=<rate>%, iterations=<count>",
|
||||
ref: <verify-path>
|
||||
data: { ref: <verify-path> }
|
||||
})
|
||||
|
||||
SendMessage({
|
||||
@@ -226,7 +222,6 @@ SendMessage({
|
||||
**Iterations**: <count>/<MAX>
|
||||
**Regression**: <passed/failed>
|
||||
**Status**: <PASSED/NEEDS FIX>`,
|
||||
summary: "[tester] <PASSED/FAILED>: <rate>%"
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user