diff --git a/.claude/skills/team-brainstorm/SKILL.md b/.claude/skills/team-brainstorm/SKILL.md index 74c8c934..eb1f5b33 100644 --- a/.claude/skills/team-brainstorm/SKILL.md +++ b/.claude/skills/team-brainstorm/SKILL.md @@ -101,8 +101,9 @@ Every worker executes the same task discovery flow on startup: Standard reporting flow after task completion: 1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message - - Parameters: operation="log", team="brainstorm", from=, to="coordinator", type=, summary="[] ", ref= - - **CLI fallback**: When MCP unavailable → `ccw team log --team brainstorm --from --to coordinator --type --summary "[] ..." --json` + - Parameters: operation="log", team=****, from=, to="coordinator", type=, summary="[] ", ref= + - **CLI fallback**: When MCP unavailable → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` + - **Note**: `team` must be session ID (e.g., `BRS-xxx-date`), NOT team name. Extract from `Session:` field in task description. 2. **SendMessage**: Send result to coordinator (content and summary both prefixed with `[]`) 3. **TaskUpdate**: Mark task completed 4. **Loop**: Return to Phase 1 to check next task @@ -142,9 +143,11 @@ All outputs must carry `[role_name]` prefix in both SendMessage content/summary Every SendMessage **before**, must call `mcp__ccw-tools__team_msg` to log: -**Parameters**: operation="log", team="brainstorm", from=, to="coordinator", type=, summary="[] ", ref= +**Parameters**: operation="log", team=****, from=, to="coordinator", type=, summary="[] ", ref= -**CLI fallback**: When MCP unavailable → `ccw team log --team brainstorm --from --to coordinator --type --summary "[] ..." --json` +**CLI fallback**: When MCP unavailable → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` + +**Note**: `team` must be session ID (e.g., `BRS-xxx-date`), NOT team name. Extract from `Session:` field in task description. **Message types by role**: diff --git a/.claude/skills/team-brainstorm/roles/challenger.md b/.claude/skills/team-brainstorm/roles/challenger.md index 46d5f73f..8e9984cc 100644 --- a/.claude/skills/team-brainstorm/roles/challenger.md +++ b/.claude/skills/team-brainstorm/roles/challenger.md @@ -59,7 +59,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: ****, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field. from: "challenger", to: "coordinator", type: "critique_ready", @@ -71,7 +71,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from challenger --to coordinator --type critique_ready --summary \"[challenger] Critique complete\" --ref --json") +Bash("ccw team log --team --from challenger --to coordinator --type critique_ready --summary \"[challenger] Critique complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-brainstorm/roles/coordinator.md b/.claude/skills/team-brainstorm/roles/coordinator.md index f2573157..239a3556 100644 --- a/.claude/skills/team-brainstorm/roles/coordinator.md +++ b/.claude/skills/team-brainstorm/roles/coordinator.md @@ -47,7 +47,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: ****, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field. from: "coordinator", to: , type: , @@ -59,7 +59,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from coordinator --to --type --summary \"[coordinator] complete\" --ref --json") +Bash("ccw team log --team --from coordinator --to --type --summary \"[coordinator] complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-brainstorm/roles/evaluator.md b/.claude/skills/team-brainstorm/roles/evaluator.md index c8d878c0..a007a9f9 100644 --- a/.claude/skills/team-brainstorm/roles/evaluator.md +++ b/.claude/skills/team-brainstorm/roles/evaluator.md @@ -60,7 +60,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: ****, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field. from: "evaluator", to: "coordinator", type: "evaluation_ready", @@ -72,7 +72,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from evaluator --to coordinator --type evaluation_ready --summary \"[evaluator] Evaluation complete\" --ref --json") +Bash("ccw team log --team --from evaluator --to coordinator --type evaluation_ready --summary \"[evaluator] Evaluation complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-brainstorm/roles/ideator.md b/.claude/skills/team-brainstorm/roles/ideator.md index c48ea1dd..52a29006 100644 --- a/.claude/skills/team-brainstorm/roles/ideator.md +++ b/.claude/skills/team-brainstorm/roles/ideator.md @@ -60,7 +60,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: ****, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field. from: "ideator", to: "coordinator", type: , @@ -72,7 +72,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from ideator --to coordinator --type --summary \"[ideator] ideas complete\" --ref --json") +Bash("ccw team log --team --from ideator --to coordinator --type --summary \"[ideator] ideas complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-brainstorm/roles/synthesizer.md b/.claude/skills/team-brainstorm/roles/synthesizer.md index 7e8c746f..4e8ccaef 100644 --- a/.claude/skills/team-brainstorm/roles/synthesizer.md +++ b/.claude/skills/team-brainstorm/roles/synthesizer.md @@ -60,7 +60,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: ****, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field. from: "synthesizer", to: "coordinator", type: "synthesis_ready", @@ -72,7 +72,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from synthesizer --to coordinator --type synthesis_ready --summary \"[synthesizer] Synthesis complete\" --ref --json") +Bash("ccw team log --team --from synthesizer --to coordinator --type synthesis_ready --summary \"[synthesizer] Synthesis complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-coordinate/SKILL.md b/.claude/skills/team-coordinate/SKILL.md index fb2d2b4e..4ca7a688 100644 --- a/.claude/skills/team-coordinate/SKILL.md +++ b/.claude/skills/team-coordinate/SKILL.md @@ -66,8 +66,10 @@ Only coordinator is statically registered. All other roles are dynamic, stored i 1. Extract `--role` and `--session` from arguments 2. If no `--role` -> route to coordinator (Orchestration Mode) 3. If `--role=coordinator` -> Read built-in `roles/coordinator/role.md` -> Execute its phases -4. If `--role=` -> Read `/roles/.md` -> Execute its phases -5. If session path not provided -> auto-discover from `.workflow/.team/TC-*/team-session.json` +4. If `--role=`: + - **`--session` is REQUIRED** for dynamic roles. Error if not provided. + - Read `/roles/.md` -> Execute its phases + - If role file not found at path -> Error with expected path ### Orchestration Mode @@ -118,8 +120,9 @@ Each worker on startup executes the same task discovery flow: Task completion with optional fast-advance to skip coordinator round-trip: 1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message - - Params: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref= - - **CLI fallback**: When MCP unavailable -> `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` + - Params: operation="log", team=****, from=, to="coordinator", type=, summary="[] ", ref= + - **`team` must be session ID** (e.g., `TC-my-project-2026-02-27`), NOT team name. Extract from task description `Session:` field -> take folder name. + - **CLI fallback**: `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` 2. **TaskUpdate**: Mark task completed 3. **Fast-Advance Check**: - Call `TaskList()`, find pending tasks whose blockedBy are ALL completed @@ -309,13 +312,13 @@ Session: - All output prefixed with [] tag - Only communicate with coordinator - Do not use TaskCreate to create tasks for other roles -- Before each SendMessage, call mcp__ccw-tools__team_msg to log +- Before each SendMessage, call mcp__ccw-tools__team_msg to log (team= from Session field, NOT team name) - After task completion, check for fast-advance opportunity (see SKILL.md Phase 5) ## Workflow 1. Call Skill -> get role definition and execution logic 2. Follow role.md 5-Phase flow -3. team_msg + SendMessage results to coordinator +3. team_msg(team=) + SendMessage results to coordinator 4. TaskUpdate completed -> check next task or fast-advance` }) ``` @@ -351,7 +354,7 @@ Only SendMessage to coordinator when: - All output prefixed with [] tag - Only communicate with coordinator - Do not use TaskCreate to create tasks for other roles -- Before each SendMessage, call mcp__ccw-tools__team_msg to log +- Before each SendMessage, call mcp__ccw-tools__team_msg to log (team= from Session field, NOT team name) - Use subagent calls for heavy work, retain summaries in context` }) ``` @@ -438,5 +441,5 @@ Coordinator supports `--resume` / `--continue` for interrupted sessions: | Discuss subagent fails | Role proceeds without discuss, logs warning | | Explore cache corrupt | Clear cache, re-explore | | Fast-advance spawns wrong task | Coordinator reconciles on next callback | -| Session path not provided | Auto-discover from `.workflow/.team/TC-*/team-session.json` | +| Session path not provided (dynamic role) | Error: `--session` is required for dynamic roles. Coordinator must always pass `--session=` when spawning workers. | | capability_gap reported | Coordinator generates new role via handleAdapt | diff --git a/.claude/skills/team-coordinate/roles/coordinator/commands/monitor.md b/.claude/skills/team-coordinate/roles/coordinator/commands/monitor.md index 9b45cf05..9f4cd977 100644 --- a/.claude/skills/team-coordinate/roles/coordinator/commands/monitor.md +++ b/.claude/skills/team-coordinate/roles/coordinator/commands/monitor.md @@ -132,7 +132,7 @@ Ready tasks found? | +- YES -> SKIP spawn (existing worker will pick it up via inner loop) | +- NO -> normal spawn below +- TaskUpdate -> in_progress - +- team_msg log -> task_unblocked + +- team_msg log -> task_unblocked (team=, NOT team name) +- Spawn worker (see spawn tool call below) +- Add to session.active_workers Update session file -> output summary -> STOP diff --git a/.claude/skills/team-coordinate/specs/role-template.md b/.claude/skills/team-coordinate/specs/role-template.md index 6b7fb7be..1fbd3716 100644 --- a/.claude/skills/team-coordinate/specs/role-template.md +++ b/.claude/skills/team-coordinate/specs/role-template.md @@ -66,7 +66,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: , from: "", to: "coordinator", type: , @@ -75,10 +75,12 @@ mcp__ccw-tools__team_msg({ }) ``` +**`team` must be session ID** (e.g., `TC-my-project-2026-02-27`), NOT team name. Extract from task description `Session:` field -> take folder name. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from --to coordinator --type --summary \"[] complete\" --ref --json") +Bash("ccw team log --team --from --to coordinator --type --summary \"[] complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-executor/SKILL.md b/.claude/skills/team-executor/SKILL.md new file mode 100644 index 00000000..2c108a28 --- /dev/null +++ b/.claude/skills/team-executor/SKILL.md @@ -0,0 +1,372 @@ +--- +name: team-executor +description: Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution. No analysis, no role generation -- only loads and executes. Session path required. Triggers on "team executor". +allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Task(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*) +--- + +# Team Executor + +Lightweight session execution skill: load session -> reconcile state -> spawn workers -> execute -> deliver. **No analysis, no role generation** -- only executes existing team-coordinate sessions. + +## Architecture + +``` ++---------------------------------------------------+ +| Skill(skill="team-executor") | +| args="--session=" [REQUIRED] | +| args="--role=" (for worker dispatch) | ++-------------------+-------------------------------+ + | Session Validation + +---- --session valid? ----+ + | NO | YES + v v + Error immediately Role Router + (no session) | + +-------+-------+ + | --role present? + | | + YES | | NO + v | v + Route to | Orchestration Mode + session | -> executor + role.md | +``` + +--- + +## Session Validation (BEFORE routing) + +**CRITICAL**: Session validation MUST occur before any role routing. + +### Parse Arguments + +Extract from `$ARGUMENTS`: +- `--session=`: Path to team-coordinate session folder (REQUIRED) +- `--role=`: Role to dispatch (optional, defaults to orchestration mode) + +### Validation Steps + +1. **Check `--session` provided**: + - If missing -> **ERROR**: "Session required. Usage: --session=" + - Do NOT proceed + +2. **Validate session structure** (see specs/session-schema.md): + - Directory exists at path + - `team-session.json` exists and valid JSON + - `task-analysis.json` exists and valid JSON + - `roles/` directory has at least one `.md` file + - Each role in `team-session.json#roles` has corresponding `.md` file in `roles/` + +3. **Validation failure**: + - Report specific missing component + - Suggest re-running team-coordinate or checking path + - Do NOT proceed + +### Validation Checklist + +``` +Session Validation Checklist: +[ ] --session argument provided +[ ] Directory exists at path +[ ] team-session.json exists and parses +[ ] task-analysis.json exists and parses +[ ] roles/ directory has >= 1 .md files +[ ] All session.roles[] have corresponding roles/.md +``` + +--- + +## Role Router + +### Dispatch Logic + +| Scenario | Action | +|----------|--------| +| No `--session` | **ERROR** immediately | +| `--session` invalid | **ERROR** with specific reason | +| No `--role` | Orchestration Mode -> executor | +| `--role=executor` | Read built-in `roles/executor/role.md` | +| `--role=` | Read `/roles/.md` | + +### Orchestration Mode + +When invoked without `--role`, executor auto-starts. + +**Invocation**: `Skill(skill="team-executor", args="--session=")` + +**Lifecycle**: +``` +Validate session + -> executor Phase 0: Reconcile state (reset interrupted, detect orphans) + -> executor Phase 1: Spawn first batch workers (background) -> STOP + -> Worker executes -> SendMessage callback -> executor advances next step + -> Loop until pipeline complete -> Phase 2 report +``` + +**User Commands** (wake paused executor): + +| Command | Action | +|---------|--------| +| `check` / `status` | Output execution status graph, no advancement | +| `resume` / `continue` | Check worker states, advance next step | + +--- + +## Role Registry + +| Role | File | Type | +|------|------|------| +| executor | [roles/executor/role.md](roles/executor/role.md) | built-in orchestrator | +| (dynamic) | `/roles/.md` | loaded from session | + +> **COMPACT PROTECTION**: Role files are execution documents. After context compression, role instructions become summaries only -- **MUST immediately `Read` the role.md to reload before continuing**. Never execute any Phase based on summaries. + +--- + +## Shared Infrastructure + +The following templates apply to all worker roles. Each loaded role.md follows the same structure. + +### Worker Phase 1: Task Discovery (all workers shared) + +Each worker on startup executes the same task discovery flow: + +1. Call `TaskList()` to get all tasks +2. Filter: subject matches this role's prefix + owner is this role + status is pending + blockedBy is empty +3. No tasks -> idle wait +4. Has tasks -> `TaskGet` for details -> `TaskUpdate` mark in_progress + +**Resume Artifact Check** (prevent duplicate output after resume): +- Check if this task's output artifacts already exist +- Artifacts complete -> skip to Phase 5 report completion +- Artifacts incomplete or missing -> normal Phase 2-4 execution + +### Worker Phase 5: Report + Fast-Advance (all workers shared) + +Task completion with optional fast-advance to skip executor round-trip: + +1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message + - Params: operation="log", team=****, from=, to="executor", type=, summary="[] ", ref= + - **`team` must be session ID** (e.g., `TC-my-project-2026-02-27`), NOT team name. Extract from task description `Session:` field -> take folder name. + - **CLI fallback**: `ccw team log --team --from --to executor --type --summary "[] ..." --json` +2. **TaskUpdate**: Mark task completed +3. **Fast-Advance Check**: + - Call `TaskList()`, find pending tasks whose blockedBy are ALL completed + - If exactly 1 ready task AND its owner matches a simple successor pattern -> **spawn it directly** (skip executor) + - Otherwise -> **SendMessage** to executor for orchestration +4. **Loop**: Back to Phase 1 to check for next task + +**Fast-Advance Rules**: + +| Condition | Action | +|-----------|--------| +| Same-prefix successor (Inner Loop role) | Do not spawn, main agent inner loop (Phase 5-L) | +| 1 ready task, simple linear successor, different prefix | Spawn directly via Task(run_in_background: true) | +| Multiple ready tasks (parallel window) | SendMessage to executor (needs orchestration) | +| No ready tasks + others running | SendMessage to executor (status update) | +| No ready tasks + nothing running | SendMessage to executor (pipeline may be complete) | + +**Fast-advance failure recovery**: If a fast-advanced task fails, the executor detects it as an orphaned in_progress task on next `resume`/`check` and resets it to pending for re-spawn. Self-healing. See [monitor.md](roles/executor/commands/monitor.md). + +### Worker Inner Loop (roles with multiple same-prefix serial tasks) + +When a role has **2+ serial same-prefix tasks**, it loops internally instead of spawning new agents: + +**Inner Loop flow**: + +``` +Phase 1: Discover task (first time) + | + +- Found task -> Phase 2-3: Load context + Execute work + | | + | v + | Phase 4: Validation (+ optional Inline Discuss) + | | + | v + | Phase 5-L: Loop Completion + | | + | +- TaskUpdate completed + | +- team_msg log + | +- Accumulate summary to context_accumulator + | | + | +- More same-prefix tasks? + | | +- YES -> back to Phase 1 (inner loop) + | | +- NO -> Phase 5-F: Final Report + | | + | +- Interrupt conditions? + | +- consensus_blocked HIGH -> SendMessage -> STOP + | +- Errors >= 3 -> SendMessage -> STOP + | + +- Phase 5-F: Final Report + +- SendMessage (all task summaries) + +- STOP +``` + +**Phase 5-L vs Phase 5-F**: + +| Step | Phase 5-L (looping) | Phase 5-F (final) | +|------|---------------------|-------------------| +| TaskUpdate completed | YES | YES | +| team_msg log | YES | YES | +| Accumulate summary | YES | - | +| SendMessage to executor | NO | YES (all tasks summary) | +| Fast-Advance to next prefix | - | YES (check cross-prefix successors) | + +### Wisdom Accumulation (all roles) + +Cross-task knowledge accumulation. Loaded from session at startup. + +**Directory**: +``` +/wisdom/ ++-- learnings.md # Patterns and insights ++-- decisions.md # Design and strategy decisions ++-- issues.md # Known risks and issues +``` + +**Worker load** (Phase 2): Extract `Session: ` from task description, read wisdom files. +**Worker contribute** (Phase 4/5): Write discoveries to corresponding wisdom files. + +### Role Isolation Rules + +| Allowed | Prohibited | +|---------|-----------| +| Process own prefix tasks | Process other role's prefix tasks | +| SendMessage to executor | Directly communicate with other workers | +| Use tools appropriate to responsibility | Create tasks for other roles | +| Fast-advance simple successors | Spawn parallel worker batches | +| Report capability_gap to executor | Attempt work outside scope | + +Executor additionally prohibited: directly write/modify deliverable artifacts, call implementation subagents directly, directly execute analysis/test/review, generate new roles. + +--- + +## Cadence Control + +**Beat model**: Event-driven, each beat = executor wake -> process -> spawn -> STOP. + +``` +Beat Cycle (single beat) +====================================================================== + Event Executor Workers +---------------------------------------------------------------------- + callback/resume --> +- handleCallback -+ + | mark completed | + | check pipeline | + +- handleSpawnNext -+ + | find ready tasks | + | spawn workers ---+--> [Worker A] Phase 1-5 + | (parallel OK) --+--> [Worker B] Phase 1-5 + +- STOP (idle) -----+ | + | + callback <-----------------------------------------+ + (next beat) SendMessage + TaskUpdate(completed) +====================================================================== + + Fast-Advance (skips executor for simple linear successors) +====================================================================== + [Worker A] Phase 5 complete + +- 1 ready task? simple successor? --> spawn Worker B directly + +- complex case? --> SendMessage to executor +====================================================================== +``` + +--- + +## Executor Spawn Template + +### Standard Worker (single-task role) + +``` +Task({ + subagent_type: "general-purpose", + description: "Spawn worker", + team_name: , + name: "", + run_in_background: true, + prompt: `You are team "" . + +## Primary Instruction +All your work MUST be executed by calling Skill to get role definition: +Skill(skill="team-executor", args="--role= --session=") + +Current requirement: +Session: + +## Role Guidelines +- Only process -* tasks, do not execute other role work +- All output prefixed with [] tag +- Only communicate with executor +- Do not use TaskCreate to create tasks for other roles +- Before each SendMessage, call mcp__ccw-tools__team_msg to log (team= from Session field, NOT team name) +- After task completion, check for fast-advance opportunity (see SKILL.md Phase 5) + +## Workflow +1. Call Skill -> get role definition and execution logic +2. Follow role.md 5-Phase flow +3. team_msg(team=) + SendMessage results to executor +4. TaskUpdate completed -> check next task or fast-advance` +}) +``` + +### Inner Loop Worker (multi-task role) + +``` +Task({ + subagent_type: "general-purpose", + description: "Spawn worker (inner loop)", + team_name: , + name: "", + run_in_background: true, + prompt: `You are team "" . + +## Primary Instruction +All your work MUST be executed by calling Skill to get role definition: +Skill(skill="team-executor", args="--role= --session=") + +Current requirement: +Session: + +## Inner Loop Mode +You will handle ALL -* tasks in this session, not just the first one. +After completing each task, loop back to find the next -* task. +Only SendMessage to executor when: +- All -* tasks are done +- A consensus_blocked HIGH occurs +- Errors accumulate (>= 3) + +## Role Guidelines +- Only process -* tasks, do not execute other role work +- All output prefixed with [] tag +- Only communicate with executor +- Do not use TaskCreate to create tasks for other roles +- Before each SendMessage, call mcp__ccw-tools__team_msg to log (team= from Session field, NOT team name) +- Use subagent calls for heavy work, retain summaries in context` +}) +``` + +--- + +## Integration with team-coordinate + +| Scenario | Skill | +|----------|-------| +| New task, no session | team-coordinate | +| Existing session, resume execution | **team-executor** | +| Session needs new roles | team-coordinate (with --resume) | +| Pure execution, no analysis | **team-executor** | + +--- + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| No --session provided | ERROR immediately with usage message | +| Session directory not found | ERROR with path, suggest checking path | +| team-session.json missing | ERROR, session incomplete, suggest re-run team-coordinate | +| task-analysis.json missing | ERROR, session incomplete, suggest re-run team-coordinate | +| No roles in session | ERROR, session incomplete, suggest re-run team-coordinate | +| Role file not found | ERROR with expected path | +| capability_gap reported | Warn only, cannot generate new roles (see monitor.md handleAdapt) | +| Fast-advance spawns wrong task | Executor reconciles on next callback | diff --git a/.claude/skills/team-executor/roles/executor/commands/monitor.md b/.claude/skills/team-executor/roles/executor/commands/monitor.md new file mode 100644 index 00000000..ddccd6e9 --- /dev/null +++ b/.claude/skills/team-executor/roles/executor/commands/monitor.md @@ -0,0 +1,277 @@ +# Command: monitor + +## Purpose + +Event-driven pipeline coordination with Spawn-and-Stop pattern for team-executor. Adapted from team-coordinate monitor.md -- role names are read from `team-session.json#roles` instead of hardcoded. **handleAdapt is LIMITED**: only warns, cannot generate new roles. + +## Constants + +| Constant | Value | Description | +|----------|-------|-------------| +| SPAWN_MODE | background | All workers spawned via `Task(run_in_background: true)` | +| ONE_STEP_PER_INVOCATION | true | Executor does one operation then STOPS | +| FAST_ADVANCE_AWARE | true | Workers may skip executor for simple linear successors | +| ROLE_GENERATION | disabled | handleAdapt cannot generate new roles | + +## Phase 2: Context Loading + +| Input | Source | Required | +|-------|--------|----------| +| Session file | `/team-session.json` | Yes | +| Task list | `TaskList()` | Yes | +| Active workers | session.active_workers[] | Yes | +| Role registry | session.roles[] | Yes | + +**Dynamic role resolution**: Known worker roles are loaded from `session.roles[].name`. This is the same pattern as team-coordinate. + +## Phase 3: Handler Routing + +### Wake-up Source Detection + +Parse `$ARGUMENTS` to determine handler: + +| Priority | Condition | Handler | +|----------|-----------|---------| +| 1 | Message contains `[]` from session roles | handleCallback | +| 2 | Contains "capability_gap" | handleAdapt | +| 3 | Contains "check" or "status" | handleCheck | +| 4 | Contains "resume", "continue", or "next" | handleResume | +| 5 | None of the above (initial spawn after dispatch) | handleSpawnNext | + +--- + +### Handler: handleCallback + +Worker completed a task. Verify completion, update state, auto-advance. + +``` +Receive callback from [] + +- Find matching active worker by role (from session.roles) + +- Is this a progress update (not final)? (Inner Loop intermediate task completion) + | +- YES -> Update session state, do NOT remove from active_workers -> STOP + +- Task status = completed? + | +- YES -> remove from active_workers -> update session + | | +- -> handleSpawnNext + | +- NO -> progress message, do not advance -> STOP + +- No matching worker found + +- Scan all active workers for completed tasks + +- Found completed -> process each -> handleSpawnNext + +- None completed -> STOP +``` + +**Fast-advance note**: A worker may have already spawned its successor via fast-advance. When processing a callback: +1. Check if the expected next task is already `in_progress` (fast-advanced) +2. If yes -> skip spawning that task, update active_workers to include the fast-advanced worker +3. If no -> normal handleSpawnNext + +--- + +### Handler: handleCheck + +Read-only status report. No pipeline advancement. + +**Output format**: + +``` +[executor] Pipeline Status +[executor] Progress: / (%) + +[executor] Execution Graph: + + + done=completed >>>=running o=pending .=not created + +[executor] Active Workers: + > () - running [inner-loop: N/M tasks done] + +[executor] Ready to spawn: +[executor] Commands: 'resume' to advance | 'check' to refresh +``` + +**Icon mapping**: completed=done, in_progress=>>>, pending=o, not created=. + +**Graph rendering**: Read dependency_graph from task-analysis.json, render each node with status icon. Show parallel branches side-by-side. + +Then STOP. + +--- + +### Handler: handleResume + +Check active worker completion, process results, advance pipeline. + +``` +Load active_workers from session + +- No active workers -> handleSpawnNext + +- Has active workers -> check each: + +- status = completed -> mark done, log + +- status = in_progress -> still running, log + +- other status -> worker failure -> reset to pending + After processing: + +- Some completed -> handleSpawnNext + +- All still running -> report status -> STOP + +- All failed -> handleSpawnNext (retry) +``` + +--- + +### Handler: handleSpawnNext + +Find all ready tasks, spawn workers in background, update session, STOP. + +``` +Collect task states from TaskList() + +- completedSubjects: status = completed + +- inProgressSubjects: status = in_progress + +- readySubjects: pending + all blockedBy in completedSubjects + +Ready tasks found? + +- NONE + work in progress -> report waiting -> STOP + +- NONE + nothing in progress -> PIPELINE_COMPLETE -> Phase 2 + +- HAS ready tasks -> for each: + +- Is task owner an Inner Loop role AND that role already has an active_worker? + | +- YES -> SKIP spawn (existing worker will pick it up via inner loop) + | +- NO -> normal spawn below + +- TaskUpdate -> in_progress + +- team_msg log -> task_unblocked (team=, NOT team name) + +- Spawn worker (see spawn tool call below) + +- Add to session.active_workers + Update session file -> output summary -> STOP +``` + +**Spawn worker tool call** (one per ready task): + +``` +Task({ + subagent_type: "general-purpose", + description: "Spawn worker for ", + team_name: , + name: "", + run_in_background: true, + prompt: "" +}) +``` + +--- + +### Handler: handleAdapt (LIMITED) + +Handle mid-pipeline capability gap discovery. **UNLIKE team-coordinate, executor CANNOT generate new roles.** + +``` +Receive capability_gap from [] + +- Log via team_msg (type: warning) + +- Report to user: + "Capability gap detected: + + team-executor cannot generate new roles. + Options: + 1. Continue with existing roles (worker will skip gap work) + 2. Re-run team-coordinate with --resume= to extend session + 3. Manually add role to /roles/ and retry" + +- Extract: gap_description, requesting_role, suggested_capability + +- Validate gap is genuine: + +- Check existing roles in session.roles -> does any role cover this? + | +- YES -> redirect: SendMessage to that role's owner -> STOP + | +- NO -> genuine gap, report to user (cannot fix) + +- Do NOT generate new role + +- Continue execution with existing roles +``` + +**Key difference from team-coordinate**: +| Aspect | team-coordinate | team-executor | +|--------|-----------------|---------------| +| handleAdapt | Generates new role, creates tasks, spawns worker | Only warns, cannot fix | +| Recovery | Automatic | Manual (re-run team-coordinate) | + +--- + +### Worker Failure Handling + +When a worker has unexpected status (not completed, not in_progress): + +1. Reset task -> pending via TaskUpdate +2. Log via team_msg (type: error) +3. Report to user: task reset, will retry on next resume + +### Fast-Advance Failure Recovery + +When executor detects a fast-advanced task has failed (task in_progress but no callback and worker gone): + +``` +handleCallback / handleResume detects: + +- Task is in_progress (was fast-advanced by predecessor) + +- No active_worker entry for this task + +- Original fast-advancing worker has already completed and exited + +- Resolution: + 1. TaskUpdate -> reset task to pending + 2. Remove stale active_worker entry (if any) + 3. Log via team_msg (type: error, summary: "Fast-advanced task failed, resetting for retry") + 4. -> handleSpawnNext (will re-spawn the task normally) +``` + +**Detection in handleResume**: + +``` +For each in_progress task in TaskList(): + +- Has matching active_worker? -> normal, skip + +- No matching active_worker? -> orphaned (likely fast-advance failure) + +- Check creation time: if > 5 minutes with no progress callback + +- Reset to pending -> handleSpawnNext +``` + +**Prevention**: Fast-advance failures are self-healing. The executor reconciles orphaned tasks on every `resume`/`check` cycle. + +### Consensus-Blocked Handling + +When a worker reports `consensus_blocked` in its callback: + +``` +handleCallback receives message with consensus_blocked flag + +- Extract: divergence_severity, blocked_round, action_recommendation + +- Route by severity: + | + +- severity = HIGH + | +- Create REVISION task: + | +- Same role, same doc type, incremented suffix (e.g., DRAFT-001-R1) + | +- Description includes: divergence details + action items from discuss + | +- blockedBy: none (immediate execution) + | +- Max 1 revision per task (DRAFT-001 -> DRAFT-001-R1, no R2) + | +- If already revised once -> PAUSE, escalate to user + | +- Update session: mark task as "revised", log revision chain + | + +- severity = MEDIUM + | +- Proceed with warning: include divergence in next task's context + | +- Log action items to wisdom/issues.md + | +- Normal handleSpawnNext + | + +- severity = LOW + +- Proceed normally: treat as consensus_reached with notes + +- Normal handleSpawnNext +``` + +## Phase 4: Validation + +| Check | Criteria | +|-------|----------| +| Session state consistent | active_workers matches TaskList in_progress tasks | +| No orphaned tasks | Every in_progress task has an active_worker entry | +| Dynamic roles valid | All task owners exist in session.roles | +| Completion detection | readySubjects=0 + inProgressSubjects=0 -> PIPELINE_COMPLETE | +| Fast-advance tracking | Detect tasks already in_progress via fast-advance, sync to active_workers | +| Fast-advance orphan check | in_progress tasks without active_worker entry -> reset to pending | + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| Session file not found | Error, suggest re-run team-coordinate | +| Worker callback from unknown role | Log info, scan for other completions | +| All workers still running on resume | Report status, suggest check later | +| Pipeline stall (no ready, no running) | Check for missing tasks, report to user | +| Fast-advance conflict | Executor reconciles, no duplicate spawns | +| Fast-advance task orphaned | Reset to pending, re-spawn via handleSpawnNext | +| Dynamic role file not found | Error, cannot proceed without role definition | +| capability_gap from role | WARN only, cannot generate new roles | +| consensus_blocked HIGH | Create revision task (max 1) or pause for user | +| consensus_blocked MEDIUM | Proceed with warning, log to wisdom/issues.md | diff --git a/.claude/skills/team-executor/roles/executor/role.md b/.claude/skills/team-executor/roles/executor/role.md new file mode 100644 index 00000000..afaf9729 --- /dev/null +++ b/.claude/skills/team-executor/roles/executor/role.md @@ -0,0 +1,202 @@ +# Executor Role + +Orchestrate the team-executor workflow: session validation, state reconciliation, worker dispatch, progress monitoring, session state. The sole built-in role -- all worker roles are loaded from the session. + +## Identity + +- **Name**: `executor` | **Tag**: `[executor]` +- **Responsibility**: Validate session -> Reconcile state -> Create team -> Dispatch tasks -> Monitor progress -> Report results + +## Boundaries + +### MUST +- Validate session structure before any execution +- Reconcile session state with TaskList on startup +- Reset in_progress tasks to pending (interrupted tasks) +- Detect fast-advance orphans and reset to pending +- Spawn worker subagents in background +- Monitor progress via worker callbacks and route messages +- Maintain session state persistence (team-session.json) +- Handle capability_gap reports with warning only (cannot generate roles) + +### MUST NOT +- Execute task work directly (delegate to workers) +- Modify task output artifacts (workers own their deliverables) +- Call implementation subagents (code-developer, etc.) directly +- Generate new roles (use existing session roles only) +- Skip session validation +- Override consensus_blocked HIGH without user confirmation + +> **Core principle**: executor is the orchestrator, not the executor. All actual work is delegated to session-defined worker roles. Unlike team-coordinate coordinator, executor CANNOT generate new roles. + +--- + +## Entry Router + +When executor is invoked, first detect the invocation type: + +| Detection | Condition | Handler | +|-----------|-----------|---------| +| Worker callback | Message contains `[role-name]` from session roles | -> handleCallback | +| Status check | Arguments contain "check" or "status" | -> handleCheck | +| Manual resume | Arguments contain "resume" or "continue" | -> handleResume | +| Capability gap | Message contains "capability_gap" | -> handleAdapt | +| New execution | None of above | -> Phase 0 | + +For callback/check/resume/adapt: load `commands/monitor.md` and execute the appropriate handler, then STOP. + +--- + +## Phase 0: Session Validation + State Reconciliation + +**Objective**: Validate session structure and reconcile session state with actual task status. + +**Workflow**: + +### Step 1: Session Validation + +Validate session structure (see SKILL.md Session Validation): +- [ ] Directory exists at session path +- [ ] `team-session.json` exists and parses +- [ ] `task-analysis.json` exists and parses +- [ ] `roles/` directory has >= 1 .md files +- [ ] All roles in team-session.json#roles have corresponding .md files + +If validation fails -> ERROR with specific reason -> STOP + +### Step 2: Load Session State + +```javascript +session = Read(/team-session.json) +taskAnalysis = Read(/task-analysis.json) +``` + +### Step 3: Reconcile with TaskList + +``` +Call TaskList() -> get real status of all tasks +Compare with session.completed_tasks: + +- Tasks in TaskList.completed but not in session -> add to session.completed_tasks + +- Tasks in session.completed_tasks but not TaskList.completed -> remove from session.completed_tasks (anomaly, log warning) + +- Tasks in TaskList.in_progress -> candidate for reset +``` + +### Step 4: Reset Interrupted Tasks + +``` +For each task in TaskList.in_progress: + +- Reset to pending via TaskUpdate + +- Log via team_msg (type: warning, summary: "Task reset from interrupted state") +``` + +### Step 5: Detect Fast-Advance Orphans + +``` +For each task in TaskList.in_progress: + +- Check if has matching active_worker entry + +- No matching active_worker + created > 5 minutes ago -> orphan + +- Reset to pending via TaskUpdate + +- Log via team_msg (type: error, summary: "Fast-advance orphan reset") +``` + +### Step 6: Create Missing Tasks (if needed) + +``` +For each task in task-analysis.json#tasks: + +- Check if exists in TaskList + +- Not exists -> create via TaskCreate with correct blockedBy +``` + +### Step 7: Update Session File + +``` +Write updated team-session.json with: + +- reconciled completed_tasks + +- cleared active_workers (will be rebuilt on spawn) + +- status = "active" +``` + +### Step 8: Team Setup + +``` +Check if team exists (via TaskList with team_name filter) + +- Not exists -> TeamCreate with team_name from session + +- Exists -> continue with existing team +``` + +**Success**: Session validated, state reconciled, team ready -> Phase 1 + +--- + +## Phase 1: Spawn-and-Stop + +**Objective**: Spawn first batch of ready workers in background, then STOP. + +**Design**: Spawn-and-Stop + Callback pattern, with worker fast-advance. +- Spawn workers with `Task(run_in_background: true)` -> immediately return +- Worker completes -> may fast-advance to next task OR SendMessage callback -> auto-advance +- User can use "check" / "resume" to manually advance +- Executor does one operation per invocation, then STOPS + +**Workflow**: +1. Load `commands/monitor.md` +2. Find tasks with: status=pending, blockedBy all resolved, owner assigned +3. For each ready task -> spawn worker (see SKILL.md Executor Spawn Template) + - Use Standard Worker template for single-task roles + - Use Inner Loop Worker template for multi-task roles +4. Output status summary with execution graph +5. STOP + +**Pipeline advancement** driven by three wake sources: +- Worker callback (automatic) -> Entry Router -> handleCallback +- User "check" -> handleCheck (status only) +- User "resume" -> handleResume (advance) + +--- + +## Phase 2: Report + Next Steps + +**Objective**: Completion report and follow-up options. + +**Workflow**: +1. Load session state -> count completed tasks, duration +2. List all deliverables with output paths in `/artifacts/` +3. Include discussion summaries (if inline discuss was used) +4. Summarize wisdom accumulated during execution +5. Update session status -> "completed" +6. Offer next steps: exit / view artifacts / extend with additional tasks + +**Output format**: + +``` +[executor] ============================================ +[executor] TASK COMPLETE +[executor] +[executor] Deliverables: +[executor] - () +[executor] - () +[executor] +[executor] Pipeline: / tasks +[executor] Roles: +[executor] Duration: +[executor] +[executor] Session: +[executor] ============================================ +``` + +--- + +## Error Handling + +| Error | Resolution | +|-------|------------| +| Session validation fails | ERROR with specific reason, suggest re-run team-coordinate | +| Task timeout | Log, mark failed, ask user to retry or skip | +| Worker crash | Respawn worker, reassign task | +| Session corruption | Attempt recovery, fallback to manual reconciliation | +| capability_gap reported | handleAdapt: WARN only, cannot generate new roles | +| All workers still running on resume | Report status, suggest check later | +| Pipeline stall (no ready, no running) | Check for missing tasks, report to user | +| Fast-advance conflict | Executor reconciles, no duplicate spawns | +| Fast-advance task orphaned | Reset to pending, re-spawn via handleSpawnNext | +| Role file not found | ERROR, cannot proceed without role definition | diff --git a/.claude/skills/team-executor/specs/session-schema.md b/.claude/skills/team-executor/specs/session-schema.md new file mode 100644 index 00000000..b1f047ee --- /dev/null +++ b/.claude/skills/team-executor/specs/session-schema.md @@ -0,0 +1,227 @@ +# Session Schema + +Required session structure for team-executor. All components MUST exist for valid execution. + +## Directory Structure + +``` +/ ++-- team-session.json # Session state + dynamic role registry (REQUIRED) ++-- task-analysis.json # Task analysis output: capabilities, dependency graph (REQUIRED) ++-- roles/ # Dynamic role definitions (REQUIRED, >= 1 .md file) +| +-- .md +| +-- .md ++-- artifacts/ # All MD deliverables from workers +| +-- .md ++-- shared-memory.json # Cross-role state store ++-- wisdom/ # Cross-task knowledge +| +-- learnings.md +| +-- decisions.md +| +-- issues.md ++-- explorations/ # Shared explore cache +| +-- cache-index.json +| +-- explore-.json ++-- discussions/ # Inline discuss records +| +-- .md ++-- .msg/ # Team message bus logs +``` + +## Validation Checklist + +team-executor validates the following before execution: + +### Required Components + +| Component | Validation | Error Message | +|-----------|------------|---------------| +| `--session` argument | Must be provided | "Session required. Usage: --session=" | +| Directory | Must exist at path | "Session directory not found: " | +| `team-session.json` | Must exist and parse as JSON | "Invalid session: team-session.json missing or corrupt" | +| `task-analysis.json` | Must exist and parse as JSON | "Invalid session: task-analysis.json missing or corrupt" | +| `roles/` directory | Must exist and contain >= 1 .md file | "Invalid session: no role files in roles/" | +| Role file mapping | Each role in team-session.json#roles must have .md file | "Role file not found: roles/.md" | + +### Validation Algorithm + +``` +1. Parse --session= from arguments + +- Not provided -> ERROR: "Session required. Usage: --session=" + +2. Check directory exists + +- Not exists -> ERROR: "Session directory not found: " + +3. Check team-session.json + +- Not exists -> ERROR: "Invalid session: team-session.json missing" + +- Parse error -> ERROR: "Invalid session: team-session.json corrupt" + +4. Check task-analysis.json + +- Not exists -> ERROR: "Invalid session: task-analysis.json missing" + +- Parse error -> ERROR: "Invalid session: task-analysis.json corrupt" + +5. Check roles/ directory + +- Not exists -> ERROR: "Invalid session: roles/ directory missing" + +- No .md files -> ERROR: "Invalid session: no role files in roles/" + +6. Check role file mapping + +- For each role in team-session.json#roles: + +- Check roles/.md exists + +- Not exists -> ERROR: "Role file not found: roles/.md" + +7. All checks pass -> proceed to Phase 0 +``` + +--- + +## team-session.json Schema + +```json +{ + "session_id": "TC--", + "task_description": "", + "status": "active | paused | completed", + "team_name": "", + "roles": [ + { + "name": "", + "prefix": "", + "responsibility_type": "", + "inner_loop": false, + "role_file": "roles/.md" + } + ], + "pipeline": { + "dependency_graph": {}, + "tasks_total": 0, + "tasks_completed": 0 + }, + "active_workers": [], + "completed_tasks": [], + "created_at": "" +} +``` + +### Required Fields + +| Field | Type | Description | +|-------|------|-------------| +| `session_id` | string | Unique session identifier (e.g., "TC-auth-feature-2026-02-27") | +| `task_description` | string | Original task description from user | +| `status` | string | One of: "active", "paused", "completed" | +| `team_name` | string | Team name for Task tool | +| `roles` | array | List of role definitions | +| `roles[].name` | string | Role name (must match .md filename) | +| `roles[].prefix` | string | Task prefix for this role (e.g., "SPEC", "IMPL") | +| `roles[].role_file` | string | Relative path to role file | + +### Optional Fields + +| Field | Type | Description | +|-------|------|-------------| +| `pipeline` | object | Pipeline metadata | +| `active_workers` | array | Currently running workers | +| `completed_tasks` | array | List of completed task IDs | +| `created_at` | string | ISO timestamp | + +--- + +## task-analysis.json Schema + +```json +{ + "capabilities": [ + { + "name": "", + "description": "", + "artifact_type": "" + } + ], + "dependency_graph": { + "": { + "depends_on": [""], + "role": "" + } + }, + "roles": [ + { + "name": "", + "prefix": "", + "responsibility_type": "", + "inner_loop": false + } + ], + "tasks": [ + { + "id": "", + "subject": "", + "owner": "", + "blockedBy": [""] + } + ], + "complexity_score": 0 +} +``` + +### Required Fields + +| Field | Type | Description | +|-------|------|-------------| +| `capabilities` | array | Detected capabilities | +| `dependency_graph` | object | Task dependency DAG | +| `roles` | array | Role definitions | +| `tasks` | array | Task definitions | + +--- + +## Role File Schema + +Each role file in `roles/.md` must follow the structure defined in `team-coordinate/specs/role-template.md`. + +### Minimum Required Sections + +| Section | Description | +|---------|-------------| +| `# Role: ` | Header with role name | +| `## Identity` | Name, tag, prefix, responsibility | +| `## Boundaries` | MUST and MUST NOT rules | +| `## Execution (5-Phase)` | Phase 1-5 workflow | + +### Validation + +Role files are not validated for structure, only for existence. If a role file is malformed, the worker will fail at runtime. + +--- + +## Example Valid Session + +``` +.workflow/.team/TC-auth-feature-2026-02-27/ ++-- team-session.json # Valid JSON with session metadata ++-- task-analysis.json # Valid JSON with dependency graph ++-- roles/ +| +-- spec-writer.md # Role file for SPEC-* tasks +| +-- implementer.md # Role file for IMPL-* tasks +| +-- tester.md # Role file for TEST-* tasks ++-- artifacts/ # (may be empty) ++-- shared-memory.json # Valid JSON (may be {}) ++-- wisdom/ +| +-- learnings.md +| +-- decisions.md +| +-- issues.md ++-- explorations/ +| +-- cache-index.json ++-- discussions/ # (may be empty) ++-- .msg/ # (may be empty) +``` + +--- + +## Recovery from Invalid Sessions + +If session validation fails: + +1. **Missing team-session.json**: Re-run team-coordinate with original task +2. **Missing task-analysis.json**: Re-run team-coordinate with --resume +3. **Missing role files**: Re-run team-coordinate with --resume +4. **Corrupt JSON**: Manual inspection or re-run team-coordinate + +**team-executor cannot fix invalid sessions** -- it can only report errors and suggest recovery steps. diff --git a/.claude/skills/team-frontend/SKILL.md b/.claude/skills/team-frontend/SKILL.md index 0620cd1e..3ea82f3a 100644 --- a/.claude/skills/team-frontend/SKILL.md +++ b/.claude/skills/team-frontend/SKILL.md @@ -126,8 +126,9 @@ Every worker executes the same task discovery flow on startup: Standard reporting flow after task completion: 1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message - - Parameters: operation="log", team="frontend", from=, to="coordinator", type=, summary="[] ", ref= - - **CLI fallback**: When MCP unavailable -> `ccw team log --team frontend --from --to coordinator --type --summary "[] ..." --json` + - Parameters: operation="log", team=****, from=, to="coordinator", type=, summary="[] ", ref= + - **CLI fallback**: When MCP unavailable -> `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` + - **Note**: `team` must be session ID (e.g., `FES-xxx-date`), NOT team name. Extract from `Session:` field in task description. 2. **SendMessage**: Send result to coordinator (content and summary both prefixed with `[]`) 3. **TaskUpdate**: Mark task completed 4. **Loop**: Return to Phase 1 to check next task diff --git a/.claude/skills/team-frontend/roles/analyst/role.md b/.claude/skills/team-frontend/roles/analyst/role.md index 313147d4..944f8634 100644 --- a/.claude/skills/team-frontend/roles/analyst/role.md +++ b/.claude/skills/team-frontend/roles/analyst/role.md @@ -64,7 +64,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "frontend", + team: ****, // MUST be session ID (e.g., FES-xxx-date), NOT team name. Extract from Session: field. from: "analyst", to: "coordinator", type: , @@ -76,7 +76,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team frontend --from analyst --to coordinator --type --summary \"[analyst] ...\" --ref --json") +Bash("ccw team log --team --from analyst --to coordinator --type --summary \"[analyst] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-frontend/roles/architect/role.md b/.claude/skills/team-frontend/roles/architect/role.md index 2ab4cd11..457ba2f2 100644 --- a/.claude/skills/team-frontend/roles/architect/role.md +++ b/.claude/skills/team-frontend/roles/architect/role.md @@ -62,7 +62,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "frontend", + team: ****, // MUST be session ID (e.g., FES-xxx-date), NOT team name. Extract from Session: field. from: "architect", to: "coordinator", type: , @@ -74,7 +74,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team frontend --from architect --to coordinator --type --summary \"[architect] ...\" --ref --json") +Bash("ccw team log --team --from architect --to coordinator --type --summary \"[architect] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-frontend/roles/coordinator/role.md b/.claude/skills/team-frontend/roles/coordinator/role.md index cec372fa..4f949dc3 100644 --- a/.claude/skills/team-frontend/roles/coordinator/role.md +++ b/.claude/skills/team-frontend/roles/coordinator/role.md @@ -60,7 +60,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "frontend", + team: ****, // MUST be session ID (e.g., FES-xxx-date), NOT team name. Extract from Session: field. from: "coordinator", to: , type: , @@ -72,7 +72,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team frontend --from coordinator --to --type --summary \"[coordinator] ...\" --ref --json") +Bash("ccw team log --team --from coordinator --to --type --summary \"[coordinator] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-frontend/roles/developer/role.md b/.claude/skills/team-frontend/roles/developer/role.md index 355512eb..a4fa71dd 100644 --- a/.claude/skills/team-frontend/roles/developer/role.md +++ b/.claude/skills/team-frontend/roles/developer/role.md @@ -62,7 +62,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "frontend", + team: ****, // MUST be session ID (e.g., FES-xxx-date), NOT team name. Extract from Session: field. from: "developer", to: "coordinator", type: , @@ -74,7 +74,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team frontend --from developer --to coordinator --type --summary \"[developer] ...\" --ref --json") +Bash("ccw team log --team --from developer --to coordinator --type --summary \"[developer] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-frontend/roles/qa/role.md b/.claude/skills/team-frontend/roles/qa/role.md index 51e7d0ff..475e92a7 100644 --- a/.claude/skills/team-frontend/roles/qa/role.md +++ b/.claude/skills/team-frontend/roles/qa/role.md @@ -62,7 +62,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "frontend", + team: ****, // MUST be session ID (e.g., FES-xxx-date), NOT team name. Extract from Session: field. from: "qa", to: "coordinator", type: , @@ -74,7 +74,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team frontend --from qa --to coordinator --type --summary \"[qa] ...\" --ref --json") +Bash("ccw team log --team --from qa --to coordinator --type --summary \"[qa] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-issue/SKILL.md b/.claude/skills/team-issue/SKILL.md index b1cd541a..2d0a3bcb 100644 --- a/.claude/skills/team-issue/SKILL.md +++ b/.claude/skills/team-issue/SKILL.md @@ -116,8 +116,9 @@ Every worker executes the same task discovery flow on startup: Standard reporting flow after task completion: 1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message - - Parameters: operation="log", team="issue", from=, to="coordinator", type=, summary="[] ", ref= - - **CLI fallback**: When MCP unavailable → `ccw team log --team issue --from --to coordinator --type --summary "[] ..." --json` + - Parameters: operation="log", team=****, from=, to="coordinator", type=, summary="[] ", ref= + - **CLI fallback**: When MCP unavailable → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` + - **Note**: `team` must be session ID (e.g., `ISS-xxx-date`), NOT team name. Extract from `Session:` field in task description. 2. **SendMessage**: Send result to coordinator (content and summary both prefixed with `[]`) 3. **TaskUpdate**: Mark task completed 4. **Loop**: Return to Phase 1 to check next task @@ -157,9 +158,11 @@ All outputs must carry `[role_name]` prefix in both SendMessage content/summary Every SendMessage **before**, must call `mcp__ccw-tools__team_msg` to log: -**Parameters**: operation="log", team="issue", from=, to="coordinator", type=, summary="[] ", ref= +**Parameters**: operation="log", team=****, from=, to="coordinator", type=, summary="[] ", ref= -**CLI fallback**: When MCP unavailable → `ccw team log --team issue --from --to coordinator --type --summary "[] ..." --json` +**CLI fallback**: When MCP unavailable → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` + +**Note**: `team` must be session ID (e.g., `ISS-xxx-date`), NOT team name. Extract from `Session:` field in task description. **Message types by role**: diff --git a/.claude/skills/team-issue/roles/coordinator.md b/.claude/skills/team-issue/roles/coordinator.md index 3e57696e..fe87c99a 100644 --- a/.claude/skills/team-issue/roles/coordinator.md +++ b/.claude/skills/team-issue/roles/coordinator.md @@ -74,7 +74,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "issue", + team: ****, // MUST be session ID (e.g., ISS-xxx-date), NOT team name. Extract from Session: field. from: "coordinator", to: "", type: , @@ -86,7 +86,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team issue --from coordinator --to --type --summary \"[coordinator] ...\" --json") +Bash("ccw team log --team --from coordinator --to --type --summary \"[coordinator] ...\" --json") ``` --- diff --git a/.claude/skills/team-issue/roles/explorer.md b/.claude/skills/team-issue/roles/explorer.md index 71e397b8..2853bc41 100644 --- a/.claude/skills/team-issue/roles/explorer.md +++ b/.claude/skills/team-issue/roles/explorer.md @@ -63,7 +63,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "issue", + team: ****, // MUST be session ID (e.g., ISS-xxx-date), NOT team name. Extract from Session: field. from: "explorer", to: "coordinator", type: , @@ -75,7 +75,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team issue --from explorer --to coordinator --type --summary \"[explorer] ...\" --ref --json") +Bash("ccw team log --team --from explorer --to coordinator --type --summary \"[explorer] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-issue/roles/implementer.md b/.claude/skills/team-issue/roles/implementer.md index 2188fc00..5e7e6e5a 100644 --- a/.claude/skills/team-issue/roles/implementer.md +++ b/.claude/skills/team-issue/roles/implementer.md @@ -72,7 +72,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "issue", + team: ****, // MUST be session ID (e.g., ISS-xxx-date), NOT team name. Extract from Session: field. from: "implementer", to: "coordinator", type: , @@ -84,7 +84,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team issue --from implementer --to coordinator --type --summary \"[implementer] ...\" --ref --json") +Bash("ccw team log --team --from implementer --to coordinator --type --summary \"[implementer] ...\" --ref --json") ``` --- @@ -264,7 +264,7 @@ Bash(" 2>&1 || echo \"TEST_FAILED\"") ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "issue", from: "implementer", to: "coordinator", + operation: "log", team: ****, from: "implementer", to: "coordinator", // MUST be session ID, NOT team name type: "impl_failed", summary: "[implementer] Tests failing for after implementation (via )" }) diff --git a/.claude/skills/team-issue/roles/integrator.md b/.claude/skills/team-issue/roles/integrator.md index 82aa7cc8..625e0e4b 100644 --- a/.claude/skills/team-issue/roles/integrator.md +++ b/.claude/skills/team-issue/roles/integrator.md @@ -62,7 +62,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "issue", + team: ****, // MUST be session ID (e.g., ISS-xxx-date), NOT team name. Extract from Session: field. from: "integrator", to: "coordinator", type: , @@ -74,7 +74,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team issue --from integrator --to coordinator --type --summary \"[integrator] ...\" --ref --json") +Bash("ccw team log --team --from integrator --to coordinator --type --summary \"[integrator] ...\" --ref --json") ``` --- @@ -116,7 +116,7 @@ Bash("ccw issue solutions --json") ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "issue", from: "integrator", to: "coordinator", + operation: "log", team: ****, from: "integrator", to: "coordinator", // MUST be session ID, NOT team name type: "error", summary: "[integrator] Unbound issues: - cannot form queue" }) @@ -192,7 +192,7 @@ Read(".workflow/issues/queue/execution-queue.json") ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "issue", from: "integrator", to: "coordinator", + operation: "log", team: ****, from: "integrator", to: "coordinator", // MUST be session ID, NOT team name type: "conflict_found", summary: "[integrator] unresolved conflicts in queue" }) diff --git a/.claude/skills/team-issue/roles/planner.md b/.claude/skills/team-issue/roles/planner.md index 98a84516..23df2e35 100644 --- a/.claude/skills/team-issue/roles/planner.md +++ b/.claude/skills/team-issue/roles/planner.md @@ -62,7 +62,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "issue", + team: ****, // MUST be session ID (e.g., ISS-xxx-date), NOT team name. Extract from Session: field. from: "planner", to: "coordinator", type: , @@ -74,7 +74,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team issue --from planner --to coordinator --type --summary \"[planner] ...\" --ref --json") +Bash("ccw team log --team --from planner --to coordinator --type --summary \"[planner] ...\" --ref --json") ``` --- @@ -159,7 +159,7 @@ Design an ALTERNATIVE approach that addresses the reviewer's concerns. ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "issue", from: "planner", to: "coordinator", + operation: "log", team: ****, from: "planner", to: "coordinator", // MUST be session ID, NOT team name type: "solution_ready", summary: "[planner] Solution bound to ( tasks)" }) @@ -175,7 +175,7 @@ SendMessage({ ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "issue", from: "planner", to: "coordinator", + operation: "log", team: ****, from: "planner", to: "coordinator", // MUST be session ID, NOT team name type: "multi_solution", summary: "[planner] solutions for , user selection needed" }) diff --git a/.claude/skills/team-issue/roles/reviewer.md b/.claude/skills/team-issue/roles/reviewer.md index 96351c32..232223ac 100644 --- a/.claude/skills/team-issue/roles/reviewer.md +++ b/.claude/skills/team-issue/roles/reviewer.md @@ -65,7 +65,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "issue", + team: ****, // MUST be session ID (e.g., ISS-xxx-date), NOT team name. Extract from Session: field. from: "reviewer", to: "coordinator", type: , @@ -77,7 +77,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team issue --from reviewer --to coordinator --type --summary \"[reviewer] ...\" --ref --json") +Bash("ccw team log --team --from reviewer --to coordinator --type --summary \"[reviewer] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-iterdev/SKILL.md b/.claude/skills/team-iterdev/SKILL.md index 81cabbf6..c734acf6 100644 --- a/.claude/skills/team-iterdev/SKILL.md +++ b/.claude/skills/team-iterdev/SKILL.md @@ -98,8 +98,9 @@ Each worker executes the same task discovery flow on startup: Standard report flow after task completion: 1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message - - Parameters: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref= - - **CLI fallback**: When MCP unavailable -> `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` + - Parameters: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref= + - **NOTE**: `team` must be **session ID** (e.g., `TID-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + - **CLI fallback**: When MCP unavailable -> `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` 2. **SendMessage**: Send result to coordinator (content and summary both with `[]` prefix) 3. **TaskUpdate**: Mark task completed 4. **Loop**: Return to Phase 1 to check next task @@ -116,9 +117,11 @@ Standard report flow after task completion: ### Message Bus -Call `mcp__ccw-tools__team_msg` with: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref="" +Call `mcp__ccw-tools__team_msg` with: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref="" -**CLI Fallback**: `ccw team log --team "" --from "" --to "coordinator" --type "" --summary "" --json` +**NOTE**: `team` must be **session ID** (e.g., `TID-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + +**CLI Fallback**: `ccw team log --team "" --from "" --to "coordinator" --type "" --summary "" --json` | Role | Message Types | |------|---------------| diff --git a/.claude/skills/team-iterdev/roles/architect.md b/.claude/skills/team-iterdev/roles/architect.md index 98a58bdf..89b30a8b 100644 --- a/.claude/skills/team-iterdev/roles/architect.md +++ b/.claude/skills/team-iterdev/roles/architect.md @@ -53,10 +53,12 @@ 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: "iterdev", + team: , // e.g., "TID-project-2026-02-27", NOT "iterdev" from: "architect", to: "coordinator", type: , @@ -68,7 +70,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team iterdev --from architect --to coordinator --type --summary \"[architect] DESIGN complete\" --ref --json") +Bash("ccw team log --team --from architect --to coordinator --type --summary \"[architect] DESIGN complete\" --ref --json") ``` --- @@ -222,7 +224,7 @@ Write(/shared-memory.json, JSON.stringify(sharedMemory, null, 2) ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "iterdev", from: "architect", to: "coordinator", + operation: "log", team: , from: "architect", to: "coordinator", // team = session ID, e.g., "TID-project-2026-02-27" type: "design_ready", summary: "[architect] Design complete: components, tasks", ref: diff --git a/.claude/skills/team-iterdev/roles/coordinator.md b/.claude/skills/team-iterdev/roles/coordinator.md index 59ede9ef..37273043 100644 --- a/.claude/skills/team-iterdev/roles/coordinator.md +++ b/.claude/skills/team-iterdev/roles/coordinator.md @@ -381,10 +381,12 @@ 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: "iterdev", + team: , // e.g., "TID-project-2026-02-27", NOT "iterdev" from: "coordinator", to: "all", type: , @@ -396,7 +398,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team iterdev --from coordinator --to all --type --summary \"[coordinator] ...\" --ref --json") +Bash("ccw team log --team --from coordinator --to all --type --summary \"[coordinator] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-iterdev/roles/developer.md b/.claude/skills/team-iterdev/roles/developer.md index 8f93e913..578565d3 100644 --- a/.claude/skills/team-iterdev/roles/developer.md +++ b/.claude/skills/team-iterdev/roles/developer.md @@ -56,10 +56,12 @@ 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: "iterdev", + team: , // e.g., "TID-project-2026-02-27", NOT "iterdev" from: "developer", to: "coordinator", type: , @@ -71,7 +73,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team iterdev --from developer --to coordinator --type --summary \"[developer] DEV complete\" --ref --json") +Bash("ccw team log --team --from developer --to coordinator --type --summary \"[developer] DEV complete\" --ref --json") ``` --- @@ -232,7 +234,7 @@ Write(/shared-memory.json, JSON.stringify(sharedMemory, null, 2) ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "iterdev", from: "developer", to: "coordinator", + operation: "log", team: , from: "developer", to: "coordinator", // team = session ID, e.g., "TID-project-2026-02-27" type: "dev_complete", summary: "[developer] complete: files changed", ref: diff --git a/.claude/skills/team-iterdev/roles/reviewer.md b/.claude/skills/team-iterdev/roles/reviewer.md index 9136b443..210cc959 100644 --- a/.claude/skills/team-iterdev/roles/reviewer.md +++ b/.claude/skills/team-iterdev/roles/reviewer.md @@ -55,10 +55,12 @@ 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: "iterdev", + team: , // e.g., "TID-project-2026-02-27", NOT "iterdev" from: "reviewer", to: "coordinator", type: , @@ -70,7 +72,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team iterdev --from reviewer --to coordinator --type --summary \"[reviewer] REVIEW complete\" --ref --json") +Bash("ccw team log --team --from reviewer --to coordinator --type --summary \"[reviewer] REVIEW complete\" --ref --json") ``` --- @@ -258,7 +260,7 @@ Write(/shared-memory.json, JSON.stringify(sharedMemory, null, 2) ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "iterdev", from: "reviewer", to: "coordinator", + operation: "log", team: , from: "reviewer", to: "coordinator", // team = session ID, e.g., "TID-project-2026-02-27" type: , summary: "[reviewer] Review : score=/10, C/H", ref: diff --git a/.claude/skills/team-iterdev/roles/tester.md b/.claude/skills/team-iterdev/roles/tester.md index 535dd66d..b44a57dc 100644 --- a/.claude/skills/team-iterdev/roles/tester.md +++ b/.claude/skills/team-iterdev/roles/tester.md @@ -54,10 +54,12 @@ 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: "iterdev", + team: , // e.g., "TID-project-2026-02-27", NOT "iterdev" from: "tester", to: "coordinator", type: , @@ -69,7 +71,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team iterdev --from tester --to coordinator --type --summary \"[tester] VERIFY complete\" --ref --json") +Bash("ccw team log --team --from tester --to coordinator --type --summary \"[tester] VERIFY complete\" --ref --json") ``` --- @@ -210,7 +212,7 @@ Write(/shared-memory.json, JSON.stringify(sharedMemory, null, 2) ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "iterdev", from: "tester", to: "coordinator", + operation: "log", team: , from: "tester", to: "coordinator", // team = session ID, e.g., "TID-project-2026-02-27" type: , summary: "[tester] : pass_rate=%, iterations=", ref: diff --git a/.claude/skills/team-lifecycle-v3/SKILL.md b/.claude/skills/team-lifecycle-v3/SKILL.md index 189b0fae..619a1aaa 100644 --- a/.claude/skills/team-lifecycle-v3/SKILL.md +++ b/.claude/skills/team-lifecycle-v3/SKILL.md @@ -113,8 +113,9 @@ When invoked without `--role`, coordinator auto-starts. User just provides task 任务完成后的标准报告流程: 1. **Message Bus**: 调用 `mcp__ccw-tools__team_msg` 记录消息 - - 参数: operation="log", team=, from=, to="coordinator", type=<消息类型>, summary="[] <摘要>", ref=<产物路径> - - **CLI fallback**: 当 MCP 不可用时 → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` + - 参数: operation="log", team=, from=, to="coordinator", type=<消息类型>, summary="[] <摘要>", ref=<产物路径> + - **注意**: `team` 必须是 **session ID** (如 `TLS-project-2026-02-27`), 不是 team name. 从任务描述的 `Session:` 字段提取. + - **CLI fallback**: 当 MCP 不可用时 → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` 2. **SendMessage**: 发送结果给 coordinator (content 和 summary 都带 `[]` 前缀) 3. **TaskUpdate**: 标记任务 completed 4. **Loop**: 回到 Phase 1 检查下一个任务 diff --git a/.claude/skills/team-lifecycle-v5/role-specs/analyst.md b/.claude/skills/team-lifecycle-v5/role-specs/analyst.md new file mode 100644 index 00000000..4da013a8 --- /dev/null +++ b/.claude/skills/team-lifecycle-v5/role-specs/analyst.md @@ -0,0 +1,93 @@ +--- +role: analyst +prefix: RESEARCH +inner_loop: false +discuss_rounds: [DISCUSS-001] +subagents: [explore, discuss] +message_types: + success: research_ready + progress: research_progress + error: error +--- + +# Analyst — Phase 2-4 + +## Phase 2: Seed Analysis + +**Objective**: Extract structured seed information from the topic/idea. + +1. Extract session folder from task description (`Session: `) +2. Parse topic from task description (first non-metadata line) +3. If topic starts with `@` or ends with `.md`/`.txt` → Read the referenced file as topic content +4. Run Gemini CLI seed analysis: + +``` +Bash({ + command: `ccw cli -p "PURPOSE: Analyze topic and extract structured seed information. +TASK: * Extract problem statement * Identify target users * Determine domain context +* List constraints and assumptions * Identify 3-5 exploration dimensions * Assess complexity +TOPIC: +MODE: analysis +EXPECTED: JSON with: problem_statement, target_users[], domain, constraints[], exploration_dimensions[], complexity_assessment" --tool gemini --mode analysis`, + run_in_background: true +}) +``` + +5. Wait for CLI result, parse seed analysis JSON + +## Phase 3: Codebase Exploration (conditional) + +**Objective**: Gather codebase context if an existing project is detected. + +| Condition | Action | +|-----------|--------| +| package.json / Cargo.toml / pyproject.toml / go.mod exists | Explore codebase | +| No project files | Skip → codebase context = null | + +**When project detected**: Call explore subagent with `angle: general`, `keywords: `. + +``` +Task({ + subagent_type: "cli-explore-agent", + run_in_background: false, + description: "Explore general context", + prompt: "Explore codebase for: \nFocus angle: general\nKeywords: \nSession folder: \n..." +}) +``` + +Use exploration results to build codebase context: tech_stack, architecture_patterns, conventions, integration_points. + +## Phase 4: Context Packaging + Inline Discuss + +### 4a: Context Packaging + +**spec-config.json** → `/spec/spec-config.json`: +- session_id, topic, status="research_complete", complexity, depth, focus_areas, mode="interactive" + +**discovery-context.json** → `/spec/discovery-context.json`: +- session_id, phase=1, seed_analysis (all fields), codebase_context (or null), recommendations + +**design-intelligence.json** → `/analysis/design-intelligence.json` (UI mode only): +- Produced when frontend keywords detected in seed_analysis +- Fields: industry, style_direction, ux_patterns, color_strategy, typography, component_patterns + +### 4b: Inline Discuss (DISCUSS-001) + +Call discuss subagent with: +- Artifact: `/spec/discovery-context.json` +- Round: DISCUSS-001 +- Perspectives: product, risk, coverage + +Handle discuss verdict per team-worker consensus handling protocol. + +**Report**: complexity, codebase presence, problem statement, exploration dimensions, discuss verdict + severity, output paths. + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| Gemini CLI failure | Fallback to direct Claude analysis | +| Codebase detection failed | Continue as new project | +| Topic too vague | Report with clarification questions | +| Explore subagent fails | Continue without codebase context | +| Discuss subagent fails | Proceed without discuss, log warning | diff --git a/.claude/skills/team-lifecycle-v5/role-specs/architect.md b/.claude/skills/team-lifecycle-v5/role-specs/architect.md new file mode 100644 index 00000000..ab06df4c --- /dev/null +++ b/.claude/skills/team-lifecycle-v5/role-specs/architect.md @@ -0,0 +1,76 @@ +--- +role: architect +prefix: ARCH +inner_loop: false +discuss_rounds: [] +subagents: [explore] +message_types: + success: arch_ready + concern: arch_concern + error: error +--- + +# Architect — Phase 2-4 + +## Consultation Modes + +| Task Pattern | Mode | Focus | +|-------------|------|-------| +| ARCH-SPEC-* | spec-review | Review architecture docs | +| ARCH-PLAN-* | plan-review | Review plan soundness | +| ARCH-CODE-* | code-review | Assess code change impact | +| ARCH-CONSULT-* | consult | Answer architecture questions | +| ARCH-FEASIBILITY-* | feasibility | Technical feasibility | + +## Phase 2: Context Loading + +**Common**: session folder, wisdom, project-tech.json, explorations + +**Mode-specific**: + +| Mode | Additional Context | +|------|-------------------| +| spec-review | architecture/_index.md, ADR-*.md | +| plan-review | plan/plan.json | +| code-review | git diff, changed files | +| consult | Question from task description | +| feasibility | Requirements + codebase | + +## Phase 3: Assessment + +Analyze using mode-specific criteria. Output: mode, verdict (APPROVE/CONCERN/BLOCK), dimensions[], concerns[], recommendations[]. + +For complex questions → Gemini CLI with architecture review rule: + +``` +Bash({ + command: `ccw cli -p "..." --tool gemini --mode analysis --rule analysis-review-architecture`, + run_in_background: true +}) +``` + +## Phase 4: Report + +Output to `/architecture/arch-.json`. Contribute decisions to wisdom/decisions.md. + +**Frontend project outputs** (when frontend tech stack detected): +- `/architecture/design-tokens.json` — color, spacing, typography, shadow tokens +- `/architecture/component-specs/*.md` — per-component design spec + +**Report**: mode, verdict, concern count, recommendations, output path(s). + +### Coordinator Integration + +| Timing | Task | +|--------|------| +| After DRAFT-003 | ARCH-SPEC-001: architecture doc review | +| After PLAN-001 | ARCH-PLAN-001: plan architecture review | +| On-demand | ARCH-CONSULT-001: architecture consultation | + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| Docs not found | Assess from available context | +| CLI timeout | Partial assessment | +| Insufficient context | Request explorer via coordinator | diff --git a/.claude/skills/team-lifecycle-v5/role-specs/executor.md b/.claude/skills/team-lifecycle-v5/role-specs/executor.md new file mode 100644 index 00000000..8c70e6aa --- /dev/null +++ b/.claude/skills/team-lifecycle-v5/role-specs/executor.md @@ -0,0 +1,67 @@ +--- +role: executor +prefix: IMPL +inner_loop: true +discuss_rounds: [] +subagents: [] +message_types: + success: impl_complete + progress: impl_progress + error: error +--- + +# Executor — Phase 2-4 + +## Phase 2: Task & Plan Loading + +**Objective**: Load plan and determine execution strategy. + +1. Load plan.json and .task/TASK-*.json from `/plan/` + +**Backend selection** (priority order): + +| Priority | Source | Method | +|----------|--------|--------| +| 1 | Task metadata | task.metadata.executor field | +| 2 | Plan default | "Execution Backend:" in plan | +| 3 | Auto-select | Simple (< 200 chars, no refactor) → agent; Complex → codex | + +**Code review selection**: + +| Priority | Source | Method | +|----------|--------|--------| +| 1 | Task metadata | task.metadata.code_review field | +| 2 | Plan default | "Code Review:" in plan | +| 3 | Auto-select | Critical keywords (auth, security, payment) → enabled | + +## Phase 3: Code Implementation + +**Objective**: Execute implementation across batches. + +**Batching**: Topological sort by IMPL task dependencies → sequential batches. + +| Backend | Invocation | Use Case | +|---------|-----------|----------| +| agent | `Task({ subagent_type: "code-developer", run_in_background: false })` | Simple, direct edits | +| codex | `ccw cli --tool codex --mode write` (background) | Complex, architecture | +| gemini | `ccw cli --tool gemini --mode write` (background) | Analysis-heavy | + +## Phase 4: Self-Validation + +| Step | Method | Pass Criteria | +|------|--------|--------------| +| Syntax check | `tsc --noEmit` (30s) | Exit code 0 | +| Acceptance criteria | Match criteria keywords vs implementation | All addressed | +| Test detection | Find .test.ts/.spec.ts for modified files | Tests identified | +| Code review (optional) | gemini analysis or codex review | No blocking issues | + +**Report**: task ID, status, files modified, validation results, backend used. + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| Syntax errors | Retry with error context (max 3) | +| Missing dependencies | Request from coordinator | +| Backend unavailable | Fallback to agent | +| Circular dependencies | Abort, report graph | diff --git a/.claude/skills/team-lifecycle-v5/role-specs/fe-developer.md b/.claude/skills/team-lifecycle-v5/role-specs/fe-developer.md new file mode 100644 index 00000000..1cdfeee5 --- /dev/null +++ b/.claude/skills/team-lifecycle-v5/role-specs/fe-developer.md @@ -0,0 +1,79 @@ +--- +role: fe-developer +prefix: DEV-FE +inner_loop: false +discuss_rounds: [] +subagents: [] +message_types: + success: dev_fe_complete + progress: dev_fe_progress + error: error +--- + +# FE Developer — Phase 2-4 + +## Phase 2: Context Loading + +**Inputs to load**: +- Plan: `/plan/plan.json` +- Design tokens: `/architecture/design-tokens.json` (optional) +- Design intelligence: `/analysis/design-intelligence.json` (optional) +- Component specs: `/architecture/component-specs/*.md` (optional) +- Shared memory, wisdom + +**Tech stack detection**: + +| Signal | Framework | Styling | +|--------|-----------|---------| +| react/react-dom in deps | react | - | +| vue in deps | vue | - | +| next in deps | nextjs | - | +| tailwindcss in deps | - | tailwind | +| @shadcn/ui in deps | - | shadcn | + +## Phase 3: Frontend Implementation + +**Step 1**: Generate design token CSS (if tokens available) +- Convert design-tokens.json → CSS custom properties (`:root { --color-*, --space-*, --text-* }`) +- Include dark mode overrides via `@media (prefers-color-scheme: dark)` +- Write to `src/styles/tokens.css` + +**Step 2**: Implement components + +| Task Size | Strategy | +|-----------|----------| +| Simple (<= 3 files, single component) | `Task({ subagent_type: "code-developer", run_in_background: false })` | +| Complex (system, multi-component) | `ccw cli --tool gemini --mode write` (background) | + +**Coding standards** (include in agent/CLI prompt): +- Use design token CSS variables, never hardcode colors/spacing +- Interactive elements: cursor: pointer +- Transitions: 150-300ms +- Text contrast: minimum 4.5:1 +- Include focus-visible styles +- Support prefers-reduced-motion +- Responsive: mobile-first +- No emoji as functional icons + +## Phase 4: Self-Validation + +| Check | What | +|-------|------| +| hardcoded-color | No #hex outside tokens.css | +| cursor-pointer | Interactive elements have cursor: pointer | +| focus-styles | Interactive elements have focus styles | +| responsive | Has responsive breakpoints | +| reduced-motion | Animations respect prefers-reduced-motion | +| emoji-icon | No emoji as functional icons | + +Contribute to wisdom/conventions.md. Update shared-memory.json with component inventory. + +**Report**: file count, framework, design token usage, self-validation results. + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| Design tokens not found | Use project defaults | +| Tech stack undetected | Default HTML + CSS | +| Subagent failure | Fallback to CLI write mode | diff --git a/.claude/skills/team-lifecycle-v5/role-specs/fe-qa.md b/.claude/skills/team-lifecycle-v5/role-specs/fe-qa.md new file mode 100644 index 00000000..b28d1c8a --- /dev/null +++ b/.claude/skills/team-lifecycle-v5/role-specs/fe-qa.md @@ -0,0 +1,79 @@ +--- +role: fe-qa +prefix: QA-FE +inner_loop: false +discuss_rounds: [] +subagents: [] +message_types: + success: qa_fe_passed + result: qa_fe_result + fix: fix_required + error: error +--- + +# FE QA — Phase 2-4 + +## Review Dimensions + +| Dimension | Weight | Focus | +|-----------|--------|-------| +| Code Quality | 25% | TypeScript types, component structure, error handling | +| Accessibility | 25% | Semantic HTML, ARIA, keyboard nav, contrast, focus-visible | +| Design Compliance | 20% | Token usage, no hardcoded colors, no emoji icons | +| UX Best Practices | 15% | Loading/error/empty states, cursor-pointer, responsive | +| Pre-Delivery | 15% | No console.log, dark mode, i18n readiness | + +## Phase 2: Context Loading + +**Inputs**: design tokens, design intelligence, shared memory, previous QA results (for GC round tracking), changed frontend files via git diff. + +Determine GC round from previous QA results count. Max 2 rounds. + +## Phase 3: 5-Dimension Review + +For each changed frontend file, check against all 5 dimensions. Score each dimension 0-10, deducting for issues found. + +**Scoring deductions**: + +| Severity | Deduction | +|----------|-----------| +| High | -2 to -3 | +| Medium | -1 to -1.5 | +| Low | -0.5 | + +**Overall score** = weighted sum of dimension scores. + +**Verdict routing**: + +| Condition | Verdict | +|-----------|---------| +| Score >= 8 AND no critical issues | PASS | +| GC round >= max AND score >= 6 | PASS_WITH_WARNINGS | +| GC round >= max AND score < 6 | FAIL | +| Otherwise | NEEDS_FIX | + +## Phase 4: Report + +Write audit to `/qa/audit-fe--r.json`. Update wisdom and shared memory. + +**Report**: round, verdict, overall score, dimension scores, critical issues with Do/Don't format, action required (if NEEDS_FIX). + +### Generator-Critic Loop + +Orchestrated by coordinator: +``` +Round 1: DEV-FE-001 → QA-FE-001 + if NEEDS_FIX → coordinator creates DEV-FE-002 + QA-FE-002 +Round 2: DEV-FE-002 → QA-FE-002 + if still NEEDS_FIX → PASS_WITH_WARNINGS or FAIL (max 2) +``` + +**Convergence**: score >= 8 AND critical_count = 0 + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| No changed files | Report empty, score N/A | +| Design tokens not found | Skip design compliance, adjust weights | +| Max GC rounds exceeded | Force verdict | diff --git a/.claude/skills/team-lifecycle-v5/role-specs/planner.md b/.claude/skills/team-lifecycle-v5/role-specs/planner.md new file mode 100644 index 00000000..0ae696fd --- /dev/null +++ b/.claude/skills/team-lifecycle-v5/role-specs/planner.md @@ -0,0 +1,98 @@ +--- +role: planner +prefix: PLAN +inner_loop: true +discuss_rounds: [] +subagents: [explore] +message_types: + success: plan_ready + revision: plan_revision + error: error +--- + +# Planner — Phase 2-4 + +## Phase 1.5: Load Spec Context (Full-Lifecycle) + +If `/spec/` exists → load requirements/_index.md, architecture/_index.md, epics/_index.md, spec-config.json. Otherwise → impl-only mode. + +**Check shared explorations**: Read `/explorations/cache-index.json` to see if analyst already cached useful explorations. Reuse rather than re-explore. + +## Phase 2: Multi-Angle Exploration + +**Objective**: Explore codebase to inform planning. + +**Complexity routing**: + +| Complexity | Criteria | Strategy | +|------------|----------|----------| +| Low | < 200 chars, no refactor/architecture keywords | ACE semantic search only | +| Medium | 200-500 chars or moderate scope | 2-3 angle explore subagent | +| High | > 500 chars, refactor/architecture, multi-module | 3-5 angle explore subagent | + +For each angle, call explore subagent (cache-aware — check cache-index.json before each call): + +``` +Task({ + subagent_type: "cli-explore-agent", + run_in_background: false, + description: "Explore ", + prompt: "Explore codebase for: \nFocus angle: \nKeywords: \nSession folder: \n..." +}) +``` + +## Phase 3: Plan Generation + +**Objective**: Generate structured implementation plan. + +| Complexity | Strategy | +|------------|----------| +| Low | Direct planning → single TASK-001 with plan.json | +| Medium/High | cli-lite-planning-agent with exploration results | + +**Agent call** (Medium/High): + +``` +Task({ + subagent_type: "cli-lite-planning-agent", + run_in_background: false, + description: "Generate implementation plan", + prompt: "Generate plan. +Output: /plan.json + /.task/TASK-*.json +Schema: cat ~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json +Task: +Explorations: +Complexity: +Requirements: 2-7 tasks with id, title, files[].change, convergence.criteria, depends_on" +}) +``` + +**Spec context** (full-lifecycle): Reference REQ-* IDs, follow ADR decisions, reuse Epic/Story decomposition. + +## Phase 4: Submit for Approval + +1. Read plan.json and TASK-*.json +2. Report to coordinator: complexity, task count, task list, approach, plan location +3. Wait for response: approved → complete; revision → update and resubmit + +**Session files**: +``` +/explorations/ (shared cache) ++-- cache-index.json ++-- explore-.json + +/plan/ ++-- explorations-manifest.json ++-- plan.json ++-- .task/TASK-*.json +``` + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| Exploration agent failure | Plan from description only | +| Planning agent failure | Fallback to direct planning | +| Plan rejected 3+ times | Notify coordinator, suggest alternative | +| Schema not found | Use basic structure | +| Cache index corrupt | Clear cache, re-explore all angles | diff --git a/.claude/skills/team-lifecycle-v5/role-specs/reviewer.md b/.claude/skills/team-lifecycle-v5/role-specs/reviewer.md new file mode 100644 index 00000000..82090783 --- /dev/null +++ b/.claude/skills/team-lifecycle-v5/role-specs/reviewer.md @@ -0,0 +1,94 @@ +--- +role: reviewer +prefix: REVIEW +additional_prefixes: [QUALITY, IMPROVE] +inner_loop: false +discuss_rounds: [DISCUSS-006] +subagents: [discuss] +message_types: + success_review: review_result + success_quality: quality_result + fix: fix_required + error: error +--- + +# Reviewer — Phase 2-4 + +## Phase 2: Mode Detection + +| Task Prefix | Mode | Dimensions | Inline Discuss | +|-------------|------|-----------|---------------| +| REVIEW-* | Code Review | quality, security, architecture, requirements | None | +| QUALITY-* | Spec Quality | completeness, consistency, traceability, depth, coverage | DISCUSS-006 | +| IMPROVE-* | Spec Quality (recheck) | Same as QUALITY | DISCUSS-006 | + +## Phase 3: Review Execution + +### Code Review (REVIEW-*) + +**Inputs**: Plan file, git diff, modified files, test results (if available) + +**4 dimensions**: + +| Dimension | Critical Issues | +|-----------|----------------| +| Quality | Empty catch, any in public APIs, @ts-ignore, console.log | +| Security | Hardcoded secrets, SQL injection, eval/exec, innerHTML | +| Architecture | Circular deps, parent imports >2 levels, files >500 lines | +| Requirements | Missing core functionality, incomplete acceptance criteria | + +### Spec Quality (QUALITY-* / IMPROVE-*) + +**Inputs**: All spec docs in session folder, quality gate config + +**5 dimensions**: + +| Dimension | Weight | Focus | +|-----------|--------|-------| +| Completeness | 25% | All sections present with substance | +| Consistency | 20% | Terminology, format, references | +| Traceability | 25% | Goals -> Reqs -> Arch -> Stories chain | +| Depth | 20% | AC testable, ADRs justified, stories estimable | +| Coverage | 10% | Original requirements mapped | + +**Quality gate**: + +| Gate | Criteria | +|------|----------| +| PASS | Score >= 80% AND coverage >= 70% | +| REVIEW | Score 60-79% OR coverage 50-69% | +| FAIL | Score < 60% OR coverage < 50% | + +**Artifacts**: readiness-report.md + spec-summary.md + +## Phase 4: Verdict + Inline Discuss + +### Code Review Verdict + +| Verdict | Criteria | +|---------|----------| +| BLOCK | Critical issues present | +| CONDITIONAL | High/medium only | +| APPROVE | Low or none | + +### Spec Quality Inline Discuss (DISCUSS-006) + +After generating readiness-report.md, call discuss subagent: +- Artifact: `/spec/readiness-report.md` +- Round: DISCUSS-006 +- Perspectives: product, technical, quality, risk, coverage (all 5) + +Handle discuss verdict per team-worker consensus handling protocol. + +> **Note**: DISCUSS-006 HIGH always triggers user pause (final sign-off gate), regardless of revision count. + +**Report**: mode, verdict/gate, dimension scores, discuss verdict (QUALITY only), output paths. + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| Missing context | Request from coordinator | +| Invalid mode | Abort with error | +| Analysis failure | Retry, then fallback template | +| Discuss subagent fails | Proceed without final discuss, log warning | diff --git a/.claude/skills/team-lifecycle-v5/role-specs/tester.md b/.claude/skills/team-lifecycle-v5/role-specs/tester.md new file mode 100644 index 00000000..3b60e434 --- /dev/null +++ b/.claude/skills/team-lifecycle-v5/role-specs/tester.md @@ -0,0 +1,76 @@ +--- +role: tester +prefix: TEST +inner_loop: false +discuss_rounds: [] +subagents: [] +message_types: + success: test_result + fix: fix_required + error: error +--- + +# Tester — Phase 2-4 + +## Phase 2: Framework Detection & Test Discovery + +**Framework detection** (priority order): + +| Priority | Method | Frameworks | +|----------|--------|-----------| +| 1 | package.json devDependencies | vitest, jest, mocha, pytest | +| 2 | package.json scripts.test | vitest, jest, mocha, pytest | +| 3 | Config files | vitest.config.*, jest.config.*, pytest.ini | + +**Affected test discovery** from executor's modified files: +- Search variants: `.test.ts`, `.spec.ts`, `tests/.test.ts`, `__tests__/.test.ts` + +## Phase 3: Test Execution & Fix Cycle + +**Config**: MAX_ITERATIONS=10, PASS_RATE_TARGET=95%, AFFECTED_TESTS_FIRST=true + +1. Run affected tests → parse results +2. Pass rate met → run full suite +3. Failures → select strategy → fix → re-run → repeat + +**Strategy selection**: + +| Condition | Strategy | Behavior | +|-----------|----------|----------| +| Iteration <= 3 or pass >= 80% | Conservative | Fix one critical failure at a time | +| Critical failures < 5 | Surgical | Fix specific pattern everywhere | +| Pass < 50% or iteration > 7 | Aggressive | Fix all failures in batch | + +**Test commands**: + +| Framework | Affected | Full Suite | +|-----------|---------|------------| +| vitest | `vitest run ` | `vitest run` | +| jest | `jest --no-coverage` | `jest --no-coverage` | +| pytest | `pytest -v` | `pytest -v` | + +## Phase 4: Result Analysis + +**Failure classification**: + +| Severity | Patterns | +|----------|----------| +| Critical | SyntaxError, cannot find module, undefined | +| High | Assertion failures, toBe/toEqual | +| Medium | Timeout, async errors | +| Low | Warnings, deprecations | + +**Report routing**: + +| Condition | Type | +|-----------|------| +| Pass rate >= target | test_result (success) | +| Pass rate < target after max iterations | fix_required | + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| Framework not detected | Prompt user | +| No tests found | Report to coordinator | +| Infinite fix loop | Abort after MAX_ITERATIONS | diff --git a/.claude/skills/team-lifecycle-v5/role-specs/writer.md b/.claude/skills/team-lifecycle-v5/role-specs/writer.md new file mode 100644 index 00000000..6e1975ad --- /dev/null +++ b/.claude/skills/team-lifecycle-v5/role-specs/writer.md @@ -0,0 +1,126 @@ +--- +role: writer +prefix: DRAFT +inner_loop: true +discuss_rounds: [DISCUSS-002, DISCUSS-003, DISCUSS-004, DISCUSS-005] +subagents: [discuss, doc-generation] +message_types: + success: draft_ready + revision: draft_revision + error: error +--- + +# Writer — Phase 2-4 + +## Phase 2: Context Loading + +**Objective**: Load all required inputs for document generation. + +### Document type routing + +| Task Subject Contains | Doc Type | Template | Prior Discussion Input | +|----------------------|----------|----------|----------------------| +| Product Brief | product-brief | templates/product-brief.md | discussions/DISCUSS-001-discussion.md | +| Requirements / PRD | requirements | templates/requirements-prd.md | discussions/DISCUSS-002-discussion.md | +| Architecture | architecture | templates/architecture-doc.md | discussions/DISCUSS-003-discussion.md | +| Epics | epics | templates/epics-template.md | discussions/DISCUSS-004-discussion.md | + +### Inline discuss mapping + +| Doc Type | Inline Discuss Round | Perspectives | +|----------|---------------------|-------------| +| product-brief | DISCUSS-002 | product, technical, quality, coverage | +| requirements | DISCUSS-003 | quality, product, coverage | +| architecture | DISCUSS-004 | technical, risk | +| epics | DISCUSS-005 | product, technical, quality, coverage | + +### Progressive dependency loading + +| Doc Type | Requires | +|----------|----------| +| product-brief | discovery-context.json | +| requirements | + product-brief.md | +| architecture | + requirements/_index.md | +| epics | + architecture/_index.md | + +**Prior decisions from accumulator**: Pass context_accumulator summaries as "Prior Decisions" to subagent. + +| Input | Source | Required | +|-------|--------|----------| +| Document standards | `../../specs/document-standards.md` (relative to SKILL) | Yes | +| Template | From routing table | Yes | +| Spec config | `/spec/spec-config.json` | Yes | +| Discovery context | `/spec/discovery-context.json` | Yes | +| Discussion feedback | `/discussions/` | If exists | +| Prior decisions | context_accumulator (in-memory) | If prior tasks exist | + +## Phase 3: Subagent Document Generation + +**Objective**: Delegate document generation to doc-generation subagent. + +Do NOT execute CLI calls in main agent. Delegate to subagent: + +``` +Task({ + subagent_type: "universal-executor", + run_in_background: false, + description: "Generate document", + prompt: ` + +## Task +- Document type: +- Session folder: +- Template: + +## Context +- Spec config: +- Discovery context: +- Prior discussion feedback: +- Prior decisions (from writer accumulator): + + +## Expected Output +Return JSON: +{ + "artifact_path": "", + "summary": "<100-200 char summary>", + "key_decisions": ["", ...], + "sections_generated": ["", ...], + "warnings": [""] +}` +}) +``` + +Main agent receives only the JSON summary. Document is written to disk by subagent. + +## Phase 4: Self-Validation + Inline Discuss + +### 4a: Self-Validation + +| Check | What to Verify | +|-------|---------------| +| has_frontmatter | Starts with YAML frontmatter | +| sections_complete | All template sections present | +| cross_references | session_id included | +| discussion_integrated | Reflects prior round feedback (if exists) | + +### 4b: Inline Discuss + +Call discuss subagent for this task's discuss round: +- Artifact: `` (the generated document) +- Round: `` from mapping table +- Perspectives: from mapping table + +Handle discuss verdict per team-worker consensus handling protocol. + +**Report**: doc type, validation status, discuss verdict + severity, average rating, summary, output path. + +## Error Handling + +| Scenario | Resolution | +|----------|------------| +| Subagent failure | Retry once with alternative subagent_type. Still fails → log error, continue next task | +| Discuss subagent fails | Skip discuss, log warning | +| Cumulative 3 task failures | SendMessage to coordinator, STOP | +| Prior doc not found | Notify coordinator, request prerequisite | +| Discussion contradicts prior docs | Note conflict, flag for coordinator | diff --git a/.claude/skills/team-planex/SKILL.md b/.claude/skills/team-planex/SKILL.md index c852316a..970feb99 100644 --- a/.claude/skills/team-planex/SKILL.md +++ b/.claude/skills/team-planex/SKILL.md @@ -100,8 +100,9 @@ Optional flags: `--team` (default: "planex"), `--exec` (execution method), `-y`/ 每次 SendMessage 前,先调用 `mcp__ccw-tools__team_msg` 记录: -- 参数: operation="log", team=``, from=``, to=``, type=``, summary="[``] ``", ref=`` -- **CLI fallback**: 当 MCP 不可用时 -> `ccw team log --team --from --to --type --summary "[] ..." --json` +- 参数: operation="log", team=``, from=``, to=``, type=``, summary="[``] ``", ref=`` +- **注意**: `team` 必须是 **session ID** (如 `PEX-project-2026-02-27`), 不是 team name. 从任务描述的 `Session:` 字段提取. +- **CLI fallback**: 当 MCP 不可用时 -> `ccw team log --team --from --to --type --summary "[] ..." --json` **Message types by role**: diff --git a/.claude/skills/team-planex/roles/executor.md b/.claude/skills/team-planex/roles/executor.md index 6d2321ba..2282e85a 100644 --- a/.claude/skills/team-planex/roles/executor.md +++ b/.claude/skills/team-planex/roles/executor.md @@ -71,10 +71,12 @@ Load solution -> Route to backend (Agent/Codex/Gemini) based on execution_method Before every SendMessage, log via `mcp__ccw-tools__team_msg`: +**NOTE**: `team` must be **session ID** (e.g., `PEX-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "planex", + team: , // e.g., "PEX-project-2026-02-27", NOT "planex" from: "executor", to: "planner", type: , @@ -86,7 +88,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team planex --from executor --to planner --type --summary \"[executor] complete\" --ref --json") +Bash("ccw team log --team --from executor --to planner --type --summary \"[executor] complete\" --ref --json") ``` --- @@ -281,7 +283,7 @@ Bash("ccw issue update --status completed") ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "planex", + team: , // e.g., "PEX-project-2026-02-27", NOT "planex" from: "executor", to: "planner", type: "impl_complete", @@ -320,7 +322,7 @@ Query for next `EXEC-*` task with owner=executor, status=pending, blockedBy empt ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "planex", + team: , // e.g., "PEX-project-2026-02-27", NOT "planex" from: "executor", to: "planner", type: "wave_done", diff --git a/.claude/skills/team-planex/roles/planner.md b/.claude/skills/team-planex/roles/planner.md index a367f08c..8e6d55ce 100644 --- a/.claude/skills/team-planex/roles/planner.md +++ b/.claude/skills/team-planex/roles/planner.md @@ -66,10 +66,12 @@ Demand decomposition -> Issue creation -> Solution design -> Conflict check -> E Before every SendMessage, log via `mcp__ccw-tools__team_msg`: +**NOTE**: `team` must be **session ID** (e.g., `PEX-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "planex", + team: , // e.g., "PEX-project-2026-02-27", NOT "planex" from: "planner", to: "executor", type: , @@ -81,7 +83,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team planex --from planner --to executor --type --summary \"[planner] complete\" --ref --json") +Bash("ccw team log --team --from planner --to executor --type --summary \"[planner] complete\" --ref --json") ``` --- @@ -248,7 +250,7 @@ Perform conflict detection using files_touched overlap analysis. ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "planex", from: "planner", to: "executor", + operation: "log", team: , from: "planner", to: "executor", // team = session ID type: "wave_ready", summary: "[planner] Wave fully dispatched: issues" }) @@ -269,7 +271,7 @@ SendMessage({ ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "planex", + team: , // e.g., "PEX-project-2026-02-27", NOT "planex" from: "planner", to: "executor", type: "all_planned", diff --git a/.claude/skills/team-quality-assurance/SKILL.md b/.claude/skills/team-quality-assurance/SKILL.md index 9b1a72d1..3dd256ce 100644 --- a/.claude/skills/team-quality-assurance/SKILL.md +++ b/.claude/skills/team-quality-assurance/SKILL.md @@ -135,8 +135,9 @@ Every worker executes the same task discovery flow on startup: Standard reporting flow after task completion: 1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message - - Parameters: operation="log", team="quality-assurance", from=, to="coordinator", type=, summary="[] ", ref= - - **CLI fallback**: When MCP unavailable -> `ccw team log --team quality-assurance --from --to coordinator --type --summary "[] ..." --json` + - Parameters: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref= + - **NOTE**: `team` must be **session ID** (e.g., `TQA-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + - **CLI fallback**: When MCP unavailable -> `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` 2. **SendMessage**: Send result to coordinator (content and summary both prefixed with `[]`) 3. **TaskUpdate**: Mark task completed 4. **Loop**: Return to Phase 1 to check next task diff --git a/.claude/skills/team-quality-assurance/roles/analyst/role.md b/.claude/skills/team-quality-assurance/roles/analyst/role.md index f8bed2bf..9d73a233 100644 --- a/.claude/skills/team-quality-assurance/roles/analyst/role.md +++ b/.claude/skills/team-quality-assurance/roles/analyst/role.md @@ -56,10 +56,12 @@ Quality analyst. Analyze defect patterns, coverage gaps, test effectiveness, and Before every SendMessage, log via `mcp__ccw-tools__team_msg`: +**NOTE**: `team` must be **session ID** (e.g., `TQA-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "quality-assurance", + team: , // e.g., "TQA-project-2026-02-27", NOT "quality-assurance" from: "analyst", to: "coordinator", type: , @@ -71,7 +73,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team quality-assurance --from analyst --to coordinator --type --summary \"[analyst] analysis complete\" --ref --json") +Bash("ccw team log --team --from analyst --to coordinator --type --summary \"[analyst] analysis complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md b/.claude/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md index 7fd92279..e79e1f55 100644 --- a/.claude/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +++ b/.claude/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md @@ -2,6 +2,8 @@ > 任务链创建与依赖管理。根据 QA 模式创建 pipeline 任务链并分配给 worker 角色。 +**NOTE**: `teamName` variable must be **session ID** (e.g., `TQA-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + ## When to Use - Phase 3 of Coordinator diff --git a/.claude/skills/team-quality-assurance/roles/coordinator/commands/monitor.md b/.claude/skills/team-quality-assurance/roles/coordinator/commands/monitor.md index ced4a2c9..2f01b23b 100644 --- a/.claude/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +++ b/.claude/skills/team-quality-assurance/roles/coordinator/commands/monitor.md @@ -2,6 +2,8 @@ > 阶段驱动的协调循环。按 pipeline 阶段顺序等待 worker 完成,路由消息,触发 GC 循环,执行质量门控。 +**NOTE**: `teamName` variable must be **session ID** (e.g., `TQA-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + ## When to Use - Phase 4 of Coordinator diff --git a/.claude/skills/team-quality-assurance/roles/executor/role.md b/.claude/skills/team-quality-assurance/roles/executor/role.md index cc61ecf0..aa06cfb7 100644 --- a/.claude/skills/team-quality-assurance/roles/executor/role.md +++ b/.claude/skills/team-quality-assurance/roles/executor/role.md @@ -57,10 +57,12 @@ Test executor. Run test suites, collect coverage data, and perform automatic fix Before every SendMessage, log via `mcp__ccw-tools__team_msg`: +**NOTE**: `team` must be **session ID** (e.g., `TQA-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "quality-assurance", + team: , // e.g., "TQA-project-2026-02-27", NOT "quality-assurance" from: "executor", to: "coordinator", type: , @@ -73,7 +75,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team quality-assurance --from executor --to coordinator --type --summary \"[executor] test execution complete\" --ref --json") +Bash("ccw team log --team --from executor --to coordinator --type --summary \"[executor] test execution complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-quality-assurance/roles/generator/role.md b/.claude/skills/team-quality-assurance/roles/generator/role.md index fadac3f1..c0abd2c4 100644 --- a/.claude/skills/team-quality-assurance/roles/generator/role.md +++ b/.claude/skills/team-quality-assurance/roles/generator/role.md @@ -57,10 +57,12 @@ Test case generator. Generate test code according to strategist's strategy and l Before every SendMessage, log via `mcp__ccw-tools__team_msg`: +**NOTE**: `team` must be **session ID** (e.g., `TQA-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "quality-assurance", + team: , // e.g., "TQA-project-2026-02-27", NOT "quality-assurance" from: "generator", to: "coordinator", type: , @@ -72,7 +74,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team quality-assurance --from generator --to coordinator --type --summary \"[generator] test generation complete\" --ref --json") +Bash("ccw team log --team --from generator --to coordinator --type --summary \"[generator] test generation complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-quality-assurance/roles/strategist/role.md b/.claude/skills/team-quality-assurance/roles/strategist/role.md index 3ae03b81..e4542f08 100644 --- a/.claude/skills/team-quality-assurance/roles/strategist/role.md +++ b/.claude/skills/team-quality-assurance/roles/strategist/role.md @@ -55,10 +55,12 @@ Test strategist. Analyze change scope, determine test layers (L1-L3), define cov Before every SendMessage, log via `mcp__ccw-tools__team_msg`: +**NOTE**: `team` must be **session ID** (e.g., `TQA-project-2026-02-27`), NOT team name. Extract from `Session:` field in task description. + ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "quality-assurance", + team: , // e.g., "TQA-project-2026-02-27", NOT "quality-assurance" from: "strategist", to: "coordinator", type: , @@ -70,7 +72,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team quality-assurance --from strategist --to coordinator --type --summary \"[strategist] QASTRAT complete\" --ref --json") +Bash("ccw team log --team --from strategist --to coordinator --type --summary \"[strategist] QASTRAT complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-review/roles/coordinator/commands/monitor.md b/.claude/skills/team-review/roles/coordinator/commands/monitor.md index 9a5b26a2..69448021 100644 --- a/.claude/skills/team-review/roles/coordinator/commands/monitor.md +++ b/.claude/skills/team-review/roles/coordinator/commands/monitor.md @@ -55,7 +55,7 @@ for (const stageTask of pipelineTasks) { if (!workerConfig) { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., RC-xxx-date), NOT team name, from: "coordinator", to: "user", type: "error", summary: `[coordinator] Unknown stage prefix: ${stagePrefix}, skipping` }) @@ -66,7 +66,7 @@ for (const stageTask of pipelineTasks) { TaskUpdate({ taskId: stageTask.id, status: 'in_progress' }) mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., RC-xxx-date), NOT team name, from: "coordinator", to: workerConfig.role, type: "stage_transition", summary: `[coordinator] Starting stage: ${stageTask.subject} -> ${workerConfig.role}` }) @@ -86,7 +86,7 @@ for (const stageTask of pipelineTasks) { if (action === 'skip') continue } else { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., RC-xxx-date), NOT team name, from: "coordinator", to: "user", type: "stage_transition", summary: `[coordinator] Stage complete: ${stageTask.subject}` }) @@ -96,7 +96,7 @@ for (const stageTask of pipelineTasks) { if (stagePrefix === 'SCAN') { const mem = JSON.parse(Read(`${sessionFolder}/shared-memory.json`)) if ((mem.findings_count || 0) === 0) { - mcp__ccw-tools__team_msg({ operation: "log", team: teamName, from: "coordinator", + mcp__ccw-tools__team_msg({ operation: "log", team: sessionId // MUST be session ID (e.g., RC-xxx-date), NOT team name, from: "coordinator", to: "user", type: "pipeline_complete", summary: `[coordinator] 0 findings. Code is clean. Skipping review/fix.` }) for (const r of pipelineTasks.slice(pipelineTasks.indexOf(stageTask) + 1)) @@ -163,7 +163,7 @@ function buildWorkerArgs(stageTask, workerConfig) { ```javascript function handleStageFailure(stageTask, taskState, workerConfig, autoYes) { if (autoYes) { - mcp__ccw-tools__team_msg({ operation: "log", team: teamName, from: "coordinator", + mcp__ccw-tools__team_msg({ operation: "log", team: sessionId // MUST be session ID (e.g., RC-xxx-date), NOT team name, from: "coordinator", to: "user", type: "error", summary: `[coordinator] [auto] ${stageTask.subject} incomplete, skipping` }) TaskUpdate({ taskId: stageTask.id, status: 'deleted' }) @@ -191,7 +191,7 @@ function handleStageFailure(stageTask, taskState, workerConfig, autoYes) { TaskUpdate({ taskId: stageTask.id, status: 'deleted' }) return 'skip' } else { - mcp__ccw-tools__team_msg({ operation: "log", team: teamName, from: "coordinator", + mcp__ccw-tools__team_msg({ operation: "log", team: sessionId // MUST be session ID (e.g., RC-xxx-date), NOT team name, from: "coordinator", to: "user", type: "error", summary: `[coordinator] User aborted at: ${stageTask.subject}` }) return 'abort' diff --git a/.claude/skills/team-review/roles/coordinator/role.md b/.claude/skills/team-review/roles/coordinator/role.md index 18554881..1c29b0ec 100644 --- a/.claude/skills/team-review/roles/coordinator/role.md +++ b/.claude/skills/team-review/roles/coordinator/role.md @@ -86,7 +86,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "team-review", + team: , // MUST be session ID (e.g., RC-xxx-date), NOT team name. Extract from Session: field in task description. from: "coordinator", to: "user", type: "dispatch_ready", @@ -97,7 +97,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team team-review --from coordinator --to user --type dispatch_ready --summary \"[coordinator] Task chain created\" --json") +Bash("ccw team log --team --from coordinator --to user --type dispatch_ready --summary \"[coordinator] Task chain created\" --json") ``` --- diff --git a/.claude/skills/team-review/roles/fixer/role.md b/.claude/skills/team-review/roles/fixer/role.md index ebc4a92b..6b73fff4 100644 --- a/.claude/skills/team-review/roles/fixer/role.md +++ b/.claude/skills/team-review/roles/fixer/role.md @@ -67,7 +67,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "team-review", + team: , // MUST be session ID (e.g., RC-xxx-date), NOT team name. Extract from Session: field in task description. from: "fixer", to: "coordinator", type: "fix_complete", @@ -79,7 +79,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team team-review --from fixer --to coordinator --type fix_complete --summary \"[fixer] Fix complete\" --ref --json") +Bash("ccw team log --team --from fixer --to coordinator --type fix_complete --summary \"[fixer] Fix complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-review/roles/reviewer/role.md b/.claude/skills/team-review/roles/reviewer/role.md index 8c34a3ab..2bfe1cdb 100644 --- a/.claude/skills/team-review/roles/reviewer/role.md +++ b/.claude/skills/team-review/roles/reviewer/role.md @@ -66,7 +66,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "team-review", + team: , // MUST be session ID (e.g., RC-xxx-date), NOT team name. Extract from Session: field in task description. from: "reviewer", to: "coordinator", type: "review_complete", @@ -78,7 +78,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team team-review --from reviewer --to coordinator --type review_complete --summary \"[reviewer] Review complete\" --ref --json") +Bash("ccw team log --team --from reviewer --to coordinator --type review_complete --summary \"[reviewer] Review complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-review/roles/scanner/role.md b/.claude/skills/team-review/roles/scanner/role.md index 864e31de..f0e684fe 100644 --- a/.claude/skills/team-review/roles/scanner/role.md +++ b/.claude/skills/team-review/roles/scanner/role.md @@ -67,7 +67,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "team-review", + team: , // MUST be session ID (e.g., RC-xxx-date), NOT team name. Extract from Session: field in task description. from: "scanner", to: "coordinator", type: "scan_complete", @@ -79,7 +79,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team team-review --from scanner --to coordinator --type scan_complete --summary \"[scanner] Scan complete\" --ref --json") +Bash("ccw team log --team --from scanner --to coordinator --type scan_complete --summary \"[scanner] Scan complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-roadmap-dev/roles/coordinator/commands/dispatch.md b/.claude/skills/team-roadmap-dev/roles/coordinator/commands/dispatch.md index 97d9324c..98f62100 100644 --- a/.claude/skills/team-roadmap-dev/roles/coordinator/commands/dispatch.md +++ b/.claude/skills/team-roadmap-dev/roles/coordinator/commands/dispatch.md @@ -147,7 +147,7 @@ Edit(`${sessionFolder}/state.md`, { ```javascript mcp__ccw-tools__team_msg({ - operation: "log", team: "roadmap-dev", + operation: "log", team: sessionId, // MUST be session ID (e.g., RD-xxx-date), NOT team name from: "coordinator", to: "all", type: "phase_started", summary: `[coordinator] Phase ${phaseNumber} dispatched: PLAN-${phaseNumber}01 → EXEC-${phaseNumber}01 → VERIFY-${phaseNumber}01`, diff --git a/.claude/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md b/.claude/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md index 6ee6df4f..d3ce0b41 100644 --- a/.claude/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +++ b/.claude/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md @@ -268,7 +268,7 @@ function triggerGapClosure(phase, iteration, gaps, sessionFolder) { // Log gap closure initiation mcp__ccw-tools__team_msg({ - operation: "log", team: "roadmap-dev", + operation: "log", team: sessionId // MUST be session ID (e.g., RD-xxx-date), NOT team name, from: "coordinator", to: "planner", type: "gap_closure", summary: `[coordinator] Gap closure iteration ${iteration} for phase ${phase}: ${gaps.length} gaps`, @@ -334,7 +334,7 @@ function updateStatePhaseComplete(phase, sessionFolder) { ```javascript // All phases done -- return control to coordinator Phase 5 (Report + Persist) mcp__ccw-tools__team_msg({ - operation: "log", team: "roadmap-dev", + operation: "log", team: sessionId // MUST be session ID (e.g., RD-xxx-date), NOT team name, from: "coordinator", to: "all", type: "project_complete", summary: `[coordinator] All ${totalPhases} phases complete.`, diff --git a/.claude/skills/team-roadmap-dev/roles/coordinator/role.md b/.claude/skills/team-roadmap-dev/roles/coordinator/role.md index bfd7cb40..0739d878 100644 --- a/.claude/skills/team-roadmap-dev/roles/coordinator/role.md +++ b/.claude/skills/team-roadmap-dev/roles/coordinator/role.md @@ -92,7 +92,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "roadmap-dev", + team: , // MUST be session ID (e.g., RD-xxx-date), NOT team name. Extract from Session: field in task description. from: "coordinator", to: , type: , @@ -104,7 +104,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team roadmap-dev --from coordinator --to --type --summary \"[coordinator] \" --json") +Bash("ccw team log --team --from coordinator --to --type --summary \"[coordinator] \" --json") ``` --- diff --git a/.claude/skills/team-roadmap-dev/roles/executor/role.md b/.claude/skills/team-roadmap-dev/roles/executor/role.md index 70a621dc..1add3059 100644 --- a/.claude/skills/team-roadmap-dev/roles/executor/role.md +++ b/.claude/skills/team-roadmap-dev/roles/executor/role.md @@ -69,7 +69,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "roadmap-dev", + team: , // MUST be session ID (e.g., RD-xxx-date), NOT team name. Extract from Session: field in task description. from: "executor", to: "coordinator", type: , @@ -81,7 +81,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team roadmap-dev --from executor --to coordinator --type --summary \"[executor] \" --ref --json") +Bash("ccw team log --team --from executor --to coordinator --type --summary \"[executor] \" --ref --json") ``` --- diff --git a/.claude/skills/team-roadmap-dev/roles/planner/role.md b/.claude/skills/team-roadmap-dev/roles/planner/role.md index da161cc1..def9093f 100644 --- a/.claude/skills/team-roadmap-dev/roles/planner/role.md +++ b/.claude/skills/team-roadmap-dev/roles/planner/role.md @@ -71,7 +71,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "roadmap-dev", + team: , // MUST be session ID (e.g., RD-xxx-date), NOT team name. Extract from Session: field in task description. from: "planner", to: "coordinator", type: , @@ -83,7 +83,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team roadmap-dev --from planner --to coordinator --type --summary \"[planner] \" --ref --json") +Bash("ccw team log --team --from planner --to coordinator --type --summary \"[planner] \" --ref --json") ``` --- diff --git a/.claude/skills/team-roadmap-dev/roles/verifier/role.md b/.claude/skills/team-roadmap-dev/roles/verifier/role.md index fa1f3de1..81336eb0 100644 --- a/.claude/skills/team-roadmap-dev/roles/verifier/role.md +++ b/.claude/skills/team-roadmap-dev/roles/verifier/role.md @@ -70,7 +70,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "roadmap-dev", + team: , // MUST be session ID (e.g., RD-xxx-date), NOT team name. Extract from Session: field in task description. from: "verifier", to: "coordinator", type: , @@ -82,7 +82,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team roadmap-dev --from verifier --to coordinator --type --summary \"[verifier] \" --ref --json") +Bash("ccw team log --team --from verifier --to coordinator --type --summary \"[verifier] \" --ref --json") ``` --- diff --git a/.claude/skills/team-tech-debt/roles/assessor/role.md b/.claude/skills/team-tech-debt/roles/assessor/role.md index 81b04aca..d3d80bdf 100644 --- a/.claude/skills/team-tech-debt/roles/assessor/role.md +++ b/.claude/skills/team-tech-debt/roles/assessor/role.md @@ -58,7 +58,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: , // MUST be session ID (e.g., TD-xxx-date), NOT team name. Extract from Session: field in task description. from: "assessor", to: "coordinator", type: , @@ -70,7 +70,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from assessor --to coordinator --type --summary \"[assessor] ...\" --ref --json") +Bash("ccw team log --team --from assessor --to coordinator --type --summary \"[assessor] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-tech-debt/roles/coordinator/commands/dispatch.md b/.claude/skills/team-tech-debt/roles/coordinator/commands/dispatch.md index ab2f6eec..74359a6a 100644 --- a/.claude/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +++ b/.claude/skills/team-tech-debt/roles/coordinator/commands/dispatch.md @@ -102,7 +102,7 @@ const chainValid = chainTasks.length === pipeline.length if (!chainValid) { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId, from: "coordinator", // team must be session ID (e.g., TD-xxx-date), NOT team name to: "user", type: "error", summary: `[coordinator] 任务链创建不完整: ${chainTasks.length}/${pipeline.length}` }) diff --git a/.claude/skills/team-tech-debt/roles/coordinator/commands/monitor.md b/.claude/skills/team-tech-debt/roles/coordinator/commands/monitor.md index bd980037..d4c8bdfc 100644 --- a/.claude/skills/team-tech-debt/roles/coordinator/commands/monitor.md +++ b/.claude/skills/team-tech-debt/roles/coordinator/commands/monitor.md @@ -76,7 +76,7 @@ for (const stageTask of pipelineTasks) { if (!workerConfig) { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "error", summary: `[coordinator] 未知阶段前缀: ${stagePrefix},跳过` }) @@ -87,7 +87,7 @@ for (const stageTask of pipelineTasks) { TaskUpdate({ taskId: stageTask.id, status: 'in_progress' }) mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: workerConfig.role, type: "task_unblocked", summary: `[coordinator] 启动阶段: ${stageTask.subject} → ${workerConfig.role}` }) @@ -111,7 +111,7 @@ for (const stageTask of pipelineTasks) { handleStageFailure(stageTask, taskState, workerConfig, autoYes) } else { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "quality_gate", summary: `[coordinator] 阶段完成: ${stageTask.subject}` }) @@ -127,7 +127,7 @@ for (const stageTask of pipelineTasks) { } mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "plan_approval", summary: `[coordinator] 治理方案已生成,等待审批` }) @@ -166,7 +166,7 @@ for (const stageTask of pipelineTasks) { continue // 跳到下一阶段(即刚插入的修订任务) } else if (planDecision === "终止") { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "shutdown", summary: `[coordinator] 用户终止流水线(方案审批阶段)` }) @@ -194,7 +194,7 @@ for (const stageTask of pipelineTasks) { worktreeCreated = true mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "worktree_created", summary: `[coordinator] Worktree 已创建: ${worktreePath} (branch: ${branchName})` }) @@ -266,7 +266,7 @@ ${worktreeSection} function handleStageFailure(stageTask, taskState, workerConfig, autoYes) { if (autoYes) { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "error", summary: `[coordinator] [auto] 阶段 ${stageTask.subject} 未完成 (status=${taskState.status}),自动跳过` }) @@ -309,7 +309,7 @@ function handleStageFailure(stageTask, taskState, workerConfig, autoYes) { return 'skip' } else { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "shutdown", summary: `[coordinator] 用户终止流水线,当前阶段: ${stageTask.subject}` }) @@ -333,7 +333,7 @@ function evaluateValidationResult(sessionFolder) { else if (!improved) status = 'CONDITIONAL' mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "quality_gate", summary: `[coordinator] 质量门控: ${status} (债务分 ${debtBefore} → ${debtAfter}, 回归 ${regressions})` }) @@ -387,7 +387,7 @@ EOF )"`) mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "pr_created", summary: `[coordinator] PR 已创建: branch ${branch}` }) @@ -396,7 +396,7 @@ EOF Bash(`git worktree remove "${wtPath}" 2>/dev/null || true`) } else if (finalSharedMemory.worktree && !finalSharedMemory.validation_results?.passed) { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId // MUST be session ID (e.g., TD-xxx-date), NOT team name, from: "coordinator", to: "user", type: "quality_gate", summary: `[coordinator] 验证未通过,worktree 保留于 ${finalSharedMemory.worktree.path},请手动检查` }) diff --git a/.claude/skills/team-tech-debt/roles/coordinator/role.md b/.claude/skills/team-tech-debt/roles/coordinator/role.md index 0500b8f3..b6fa1f7f 100644 --- a/.claude/skills/team-tech-debt/roles/coordinator/role.md +++ b/.claude/skills/team-tech-debt/roles/coordinator/role.md @@ -86,7 +86,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: , // MUST be session ID (e.g., TD-xxx-date), NOT team name. Extract from Session: field in task description. from: "coordinator", to: "user", type: , @@ -98,7 +98,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from coordinator --to user --type --summary \"[coordinator] ...\" --json") +Bash("ccw team log --team --from coordinator --to user --type --summary \"[coordinator] ...\" --json") ``` --- diff --git a/.claude/skills/team-tech-debt/roles/executor/role.md b/.claude/skills/team-tech-debt/roles/executor/role.md index fa8fcb34..d12f3961 100644 --- a/.claude/skills/team-tech-debt/roles/executor/role.md +++ b/.claude/skills/team-tech-debt/roles/executor/role.md @@ -61,7 +61,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: , // MUST be session ID (e.g., TD-xxx-date), NOT team name. Extract from Session: field in task description. from: "executor", to: "coordinator", type: , @@ -73,7 +73,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from executor --to coordinator --type --summary \"[executor] ...\" --ref --json") +Bash("ccw team log --team --from executor --to coordinator --type --summary \"[executor] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-tech-debt/roles/planner/role.md b/.claude/skills/team-tech-debt/roles/planner/role.md index 9e186fec..2c0ba993 100644 --- a/.claude/skills/team-tech-debt/roles/planner/role.md +++ b/.claude/skills/team-tech-debt/roles/planner/role.md @@ -58,7 +58,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: , // MUST be session ID (e.g., TD-xxx-date), NOT team name. Extract from Session: field in task description. from: "planner", to: "coordinator", type: , @@ -70,7 +70,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from planner --to coordinator --type --summary \"[planner] ...\" --ref --json") +Bash("ccw team log --team --from planner --to coordinator --type --summary \"[planner] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-tech-debt/roles/scanner/role.md b/.claude/skills/team-tech-debt/roles/scanner/role.md index a2889066..c0224c3e 100644 --- a/.claude/skills/team-tech-debt/roles/scanner/role.md +++ b/.claude/skills/team-tech-debt/roles/scanner/role.md @@ -58,7 +58,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: , // MUST be session ID (e.g., TD-xxx-date), NOT team name. Extract from Session: field in task description. from: "scanner", to: "coordinator", type: , @@ -70,7 +70,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from scanner --to coordinator --type --summary \"[scanner] ...\" --ref --json") +Bash("ccw team log --team --from scanner --to coordinator --type --summary \"[scanner] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-tech-debt/roles/validator/role.md b/.claude/skills/team-tech-debt/roles/validator/role.md index c628b220..03e79bf2 100644 --- a/.claude/skills/team-tech-debt/roles/validator/role.md +++ b/.claude/skills/team-tech-debt/roles/validator/role.md @@ -59,7 +59,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: , + team: , // MUST be session ID (e.g., TD-xxx-date), NOT team name. Extract from Session: field in task description. from: "validator", to: "coordinator", type: , @@ -71,7 +71,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team --from validator --to coordinator --type --summary \"[validator] ...\" --ref --json") +Bash("ccw team log --team --from validator --to coordinator --type --summary \"[validator] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-testing/SKILL.md b/.claude/skills/team-testing/SKILL.md index 8e7af05b..54d56f9b 100644 --- a/.claude/skills/team-testing/SKILL.md +++ b/.claude/skills/team-testing/SKILL.md @@ -102,7 +102,7 @@ Standard reporting flow after task completion: 1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message - Parameters: operation="log", team="testing", from=, to="coordinator", type=, summary="[] ", ref= - - **CLI fallback**: When MCP unavailable → `ccw team log --team testing --from --to coordinator --type --summary "[] ..." --json` + - **CLI fallback**: When MCP unavailable → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` // team must be session ID 2. **SendMessage**: Send result to coordinator (content and summary both prefixed with `[]`) 3. **TaskUpdate**: Mark task completed 4. **Loop**: Return to Phase 1 to check next task @@ -142,9 +142,11 @@ All outputs must carry `[role_name]` prefix in both SendMessage content/summary Every SendMessage **before**, must call `mcp__ccw-tools__team_msg` to log: -**Parameters**: operation="log", team="testing", from=, to="coordinator", type=, summary="[] ", ref= +**Parameters**: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref= -**CLI fallback**: When MCP unavailable → `ccw team log --team testing --from --to coordinator --type --summary "[] ..." --json` +> **CRITICAL**: `team` must be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description. + +**CLI fallback**: When MCP unavailable → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` **Message types by role**: diff --git a/.claude/skills/team-testing/roles/analyst.md b/.claude/skills/team-testing/roles/analyst.md index 24458a8b..ae5fd6ce 100644 --- a/.claude/skills/team-testing/roles/analyst.md +++ b/.claude/skills/team-testing/roles/analyst.md @@ -57,7 +57,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "testing", + team: , // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description. from: "analyst", to: "coordinator", type: , @@ -69,7 +69,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team testing --from analyst --to coordinator --type --summary \"[analyst] ...\" --ref --json") +Bash("ccw team log --team --from analyst --to coordinator --type --summary \"[analyst] ...\" --ref --json") ``` --- @@ -215,7 +215,7 @@ Write("/shared-memory.json", ) ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "testing", from: "analyst", to: "coordinator", + operation: "log", team: // MUST be session ID, NOT team name, from: "analyst", to: "coordinator", type: "analysis_ready", summary: "[analyst] Quality report: score /10, defect patterns, coverage gaps", ref: "/analysis/quality-report.md" diff --git a/.claude/skills/team-testing/roles/coordinator.md b/.claude/skills/team-testing/roles/coordinator.md index c80d8ae9..c30ef0da 100644 --- a/.claude/skills/team-testing/roles/coordinator.md +++ b/.claude/skills/team-testing/roles/coordinator.md @@ -237,7 +237,9 @@ When receiving `tests_failed` or `coverage_report`: **GC Loop trigger message**: ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "testing", from: "coordinator", to: "generator", + operation: "log", + team: , // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description. + from: "coordinator", to: "generator", type: "gc_loop_trigger", summary: "[coordinator] GC round : coverage % < target %, revise tests" }) diff --git a/.claude/skills/team-testing/roles/executor.md b/.claude/skills/team-testing/roles/executor.md index 83926bf8..6ed8ee53 100644 --- a/.claude/skills/team-testing/roles/executor.md +++ b/.claude/skills/team-testing/roles/executor.md @@ -62,7 +62,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "testing", + team: , // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description. from: "executor", to: "coordinator", type: , @@ -74,7 +74,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team testing --from executor --to coordinator --type --summary \"[executor] ...\" --ref --json") +Bash("ccw team log --team --from executor --to coordinator --type --summary \"[executor] ...\" --ref --json") ``` --- @@ -248,7 +248,7 @@ Write("/shared-memory.json", ) ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "testing", from: "executor", to: "coordinator", + operation: "log", team: // MUST be session ID, NOT team name, from: "executor", to: "coordinator", type: , summary: "[executor] : pass=%, coverage=% (target: %), iterations=", ref: "/results/run-.json" diff --git a/.claude/skills/team-testing/roles/generator.md b/.claude/skills/team-testing/roles/generator.md index caa3a24e..7f4263d2 100644 --- a/.claude/skills/team-testing/roles/generator.md +++ b/.claude/skills/team-testing/roles/generator.md @@ -62,7 +62,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "testing", + team: , // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description. from: "generator", to: "coordinator", type: , @@ -74,7 +74,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team testing --from generator --to coordinator --type --summary \"[generator] ...\" --ref --json") +Bash("ccw team log --team --from generator --to coordinator --type --summary \"[generator] ...\" --ref --json") ``` --- @@ -232,7 +232,7 @@ Write("/shared-memory.json", ) ``` mcp__ccw-tools__team_msg({ - operation: "log", team: "testing", from: "generator", to: "coordinator", + operation: "log", team: // MUST be session ID, NOT team name, from: "generator", to: "coordinator", type: , summary: "[generator] test files", ref: "/tests//" diff --git a/.claude/skills/team-testing/roles/strategist.md b/.claude/skills/team-testing/roles/strategist.md index fd2aff77..1453e919 100644 --- a/.claude/skills/team-testing/roles/strategist.md +++ b/.claude/skills/team-testing/roles/strategist.md @@ -58,7 +58,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "testing", + team: , // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description. from: "strategist", to: "coordinator", type: , @@ -70,7 +70,7 @@ mcp__ccw-tools__team_msg({ **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team testing --from strategist --to coordinator --type --summary \"[strategist] ...\" --ref --json") +Bash("ccw team log --team --from strategist --to coordinator --type --summary \"[strategist] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-uidesign/SKILL.md b/.claude/skills/team-uidesign/SKILL.md index a12b16fc..e54b3f76 100644 --- a/.claude/skills/team-uidesign/SKILL.md +++ b/.claude/skills/team-uidesign/SKILL.md @@ -101,8 +101,9 @@ Every worker executes the same task discovery flow on startup: Standard reporting flow after task completion: 1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message - - Parameters: operation="log", team="uidesign", from=, to="coordinator", type=, summary="[] ", ref= - - **CLI fallback**: When MCP unavailable → `ccw team log --team uidesign --from --to coordinator --type --summary "[] ..." --json` + - Parameters: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref= + - **Note**: `team` must be session ID (e.g., `UDS-xxx-date`), NOT team name. Extract from `Session:` field in task description. + - **CLI fallback**: When MCP unavailable → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` 2. **SendMessage**: Send result to coordinator (content and summary both prefixed with `[]`) 3. **TaskUpdate**: Mark task completed 4. **Loop**: Return to Phase 1 to check next task @@ -142,9 +143,11 @@ All outputs must carry `[role_name]` prefix in both SendMessage content/summary Every SendMessage **before**, must call `mcp__ccw-tools__team_msg` to log: -**Parameters**: operation="log", team="uidesign", from=, to="coordinator", type=, summary="[] ", ref= +**Parameters**: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref= -**CLI fallback**: When MCP unavailable → `ccw team log --team uidesign --from --to coordinator --type --summary "[] ..." --json` +> **Note**: `team` must be session ID (e.g., `UDS-xxx-date`), NOT team name. Extract from `Session:` field in task description. + +**CLI fallback**: When MCP unavailable → `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` **Message types by role**: diff --git a/.claude/skills/team-uidesign/roles/designer.md b/.claude/skills/team-uidesign/roles/designer.md index bc7448ee..c4289725 100644 --- a/.claude/skills/team-uidesign/roles/designer.md +++ b/.claude/skills/team-uidesign/roles/designer.md @@ -59,7 +59,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "uidesign", + team: , from: "designer", to: "coordinator", type: , @@ -68,10 +68,12 @@ mcp__ccw-tools__team_msg({ }) ``` +> **Note**: `team` must be session ID (e.g., `UDS-xxx-date`), NOT team name. Extract from `Session:` field in task description. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team uidesign --from designer --to coordinator --type --summary \"[designer] DESIGN complete\" --ref --json") +Bash("ccw team log --team --from designer --to coordinator --type --summary \"[designer] DESIGN complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-uidesign/roles/implementer.md b/.claude/skills/team-uidesign/roles/implementer.md index cdad408c..48d17dea 100644 --- a/.claude/skills/team-uidesign/roles/implementer.md +++ b/.claude/skills/team-uidesign/roles/implementer.md @@ -61,7 +61,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "uidesign", + team: , from: "implementer", to: "coordinator", type: , @@ -70,10 +70,12 @@ mcp__ccw-tools__team_msg({ }) ``` +> **Note**: `team` must be session ID (e.g., `UDS-xxx-date`), NOT team name. Extract from `Session:` field in task description. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team uidesign --from implementer --to coordinator --type --summary \"[implementer] BUILD complete\" --ref --json") +Bash("ccw team log --team --from implementer --to coordinator --type --summary \"[implementer] BUILD complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-uidesign/roles/researcher.md b/.claude/skills/team-uidesign/roles/researcher.md index 3b80926a..2153718d 100644 --- a/.claude/skills/team-uidesign/roles/researcher.md +++ b/.claude/skills/team-uidesign/roles/researcher.md @@ -59,7 +59,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "uidesign", + team: , from: "researcher", to: "coordinator", type: , @@ -68,10 +68,12 @@ mcp__ccw-tools__team_msg({ }) ``` +> **Note**: `team` must be session ID (e.g., `UDS-xxx-date`), NOT team name. Extract from `Session:` field in task description. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team uidesign --from researcher --to coordinator --type --summary \"[researcher] RESEARCH complete\" --ref --json") +Bash("ccw team log --team --from researcher --to coordinator --type --summary \"[researcher] RESEARCH complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-uidesign/roles/reviewer.md b/.claude/skills/team-uidesign/roles/reviewer.md index 98c34bdc..ddfc3742 100644 --- a/.claude/skills/team-uidesign/roles/reviewer.md +++ b/.claude/skills/team-uidesign/roles/reviewer.md @@ -58,7 +58,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "uidesign", + team: , from: "reviewer", to: "coordinator", type: , @@ -67,10 +67,12 @@ mcp__ccw-tools__team_msg({ }) ``` +> **Note**: `team` must be session ID (e.g., `UDS-xxx-date`), NOT team name. Extract from `Session:` field in task description. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team uidesign --from reviewer --to coordinator --type --summary \"[reviewer] AUDIT complete\" --ref --json") +Bash("ccw team log --team --from reviewer --to coordinator --type --summary \"[reviewer] AUDIT complete\" --ref --json") ``` --- diff --git a/.claude/skills/team-ultra-analyze/SKILL.md b/.claude/skills/team-ultra-analyze/SKILL.md index 8f558ef3..e1c59360 100644 --- a/.claude/skills/team-ultra-analyze/SKILL.md +++ b/.claude/skills/team-ultra-analyze/SKILL.md @@ -130,8 +130,9 @@ Each worker executes the same task discovery flow on startup: Standard report flow after task completion: 1. **Message Bus**: Call `mcp__ccw-tools__team_msg` to log message - - Parameters: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref= - - **CLI fallback**: When MCP unavailable -> `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` + - Parameters: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref= + - **Note**: `team` must be session ID (e.g., `UAN-xxx-date`), NOT team name. Extract from `Session:` field in task description. + - **CLI fallback**: When MCP unavailable -> `ccw team log --team --from --to coordinator --type --summary "[] ..." --json` 2. **SendMessage**: Send result to coordinator (both content and summary prefixed with `[]`) 3. **TaskUpdate**: Mark task completed 4. **Loop**: Return to Phase 1 to check for next task @@ -179,7 +180,9 @@ On startup, read the file. After completing work, update own field and write bac ### Message Bus (All Roles) -All roles log messages before sending via SendMessage. Call `mcp__ccw-tools__team_msg` with: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref=. +All roles log messages before sending via SendMessage. Call `mcp__ccw-tools__team_msg` with: operation="log", team=, from=, to="coordinator", type=, summary="[] ", ref=. + +> **Note**: `team` must be session ID (e.g., `UAN-xxx-date`), NOT team name. Extract from `Session:` field in task description. | Role | Types | |------|-------| @@ -189,7 +192,9 @@ All roles log messages before sending via SendMessage. Call `mcp__ccw-tools__tea | discussant | `discussion_processed`, `error` | | synthesizer | `synthesis_ready`, `error` | -**CLI fallback**: When MCP unavailable -> `ccw team log --team "" --from "" --to "coordinator" --type "" --summary "" --json` +**CLI fallback**: When MCP unavailable -> `ccw team log --team "" --from "" --to "coordinator" --type "" --summary "" --json` + +> **Note**: `team` must be session ID (e.g., `UAN-xxx-date`), NOT team name. --- diff --git a/.claude/skills/team-ultra-analyze/roles/analyst/role.md b/.claude/skills/team-ultra-analyze/roles/analyst/role.md index 96fbeff6..be2d8464 100644 --- a/.claude/skills/team-ultra-analyze/roles/analyst/role.md +++ b/.claude/skills/team-ultra-analyze/roles/analyst/role.md @@ -72,7 +72,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "ultra-analyze", + team: , from: "analyst", to: "coordinator", type: "analysis_ready", @@ -81,10 +81,12 @@ mcp__ccw-tools__team_msg({ }) ``` +> **Note**: `team` must be session ID (e.g., `UAN-xxx-date`), NOT team name. Extract from `Session:` field in task description. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team ultra-analyze --from analyst --to coordinator --type analysis_ready --summary \"[analyst] ...\" --ref --json") +Bash("ccw team log --team --from analyst --to coordinator --type analysis_ready --summary \"[analyst] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-ultra-analyze/roles/coordinator/commands/dispatch.md b/.claude/skills/team-ultra-analyze/roles/coordinator/commands/dispatch.md index 0c48534a..78429fbb 100644 --- a/.claude/skills/team-ultra-analyze/roles/coordinator/commands/dispatch.md +++ b/.claude/skills/team-ultra-analyze/roles/coordinator/commands/dispatch.md @@ -153,7 +153,7 @@ const chainValid = chainTasks.length === pipeline.length if (!chainValid) { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId, from: "coordinator", to: "user", type: "error", summary: `[coordinator] 任务链创建不完整: ${chainTasks.length}/${pipeline.length}` }) diff --git a/.claude/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md b/.claude/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md index ec1ab85c..a81674f9 100644 --- a/.claude/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +++ b/.claude/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md @@ -102,7 +102,7 @@ for (const stageTask of preDiscussionTasks) { TaskUpdate({ taskId: stageTask.id, status: 'in_progress' }) mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId, from: "coordinator", to: workerConfig.role, type: "task_unblocked", summary: `[coordinator] 启动阶段: ${stageTask.subject} → ${workerConfig.role}` }) @@ -142,7 +142,7 @@ Skill(skill="team-ultra-analyze", args="${workerConfig.skillArgs}") handleStageTimeout(stageTask, 0, autoYes) } else { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId, from: "coordinator", to: "user", type: "quality_gate", summary: `[coordinator] 阶段完成: ${stageTask.subject}` }) @@ -356,7 +356,7 @@ ${data.updated_understanding || '(Updated by discussant)'} function handleStageTimeout(stageTask, _unused, autoYes) { if (autoYes) { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId, from: "coordinator", to: "user", type: "error", summary: `[coordinator] [auto] 阶段 ${stageTask.subject} worker 返回但未完成,自动跳过` }) @@ -382,7 +382,7 @@ function handleStageTimeout(stageTask, _unused, autoYes) { TaskUpdate({ taskId: stageTask.id, status: 'deleted' }) } else if (answer === "终止流水线") { mcp__ccw-tools__team_msg({ - operation: "log", team: teamName, from: "coordinator", + operation: "log", team: sessionId, from: "coordinator", to: "user", type: "shutdown", summary: `[coordinator] 用户终止流水线,当前阶段: ${stageTask.subject}` }) diff --git a/.claude/skills/team-ultra-analyze/roles/coordinator/role.md b/.claude/skills/team-ultra-analyze/roles/coordinator/role.md index 366d38b4..e73e775d 100644 --- a/.claude/skills/team-ultra-analyze/roles/coordinator/role.md +++ b/.claude/skills/team-ultra-analyze/roles/coordinator/role.md @@ -70,7 +70,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "ultra-analyze", + team: , from: "coordinator", to: "", type: "", @@ -79,10 +79,12 @@ mcp__ccw-tools__team_msg({ }) ``` +> **Note**: `team` must be session ID (e.g., `UAN-xxx-date`), NOT team name. Extract from `Session:` field in task description. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team ultra-analyze --from coordinator --to --type --summary \"[coordinator] ...\" --ref --json") +Bash("ccw team log --team --from coordinator --to --type --summary \"[coordinator] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-ultra-analyze/roles/discussant/role.md b/.claude/skills/team-ultra-analyze/roles/discussant/role.md index bd98cdfa..0c9d5d47 100644 --- a/.claude/skills/team-ultra-analyze/roles/discussant/role.md +++ b/.claude/skills/team-ultra-analyze/roles/discussant/role.md @@ -71,7 +71,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "ultra-analyze", + team: , from: "discussant", to: "coordinator", type: "discussion_processed", @@ -80,10 +80,12 @@ mcp__ccw-tools__team_msg({ }) ``` +> **Note**: `team` must be session ID (e.g., `UAN-xxx-date`), NOT team name. Extract from `Session:` field in task description. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team ultra-analyze --from discussant --to coordinator --type discussion_processed --summary \"[discussant] ...\" --ref --json") +Bash("ccw team log --team --from discussant --to coordinator --type discussion_processed --summary \"[discussant] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-ultra-analyze/roles/explorer/role.md b/.claude/skills/team-ultra-analyze/roles/explorer/role.md index 96aa9d22..bb29c9d6 100644 --- a/.claude/skills/team-ultra-analyze/roles/explorer/role.md +++ b/.claude/skills/team-ultra-analyze/roles/explorer/role.md @@ -64,7 +64,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "ultra-analyze", + team: , from: "explorer", to: "coordinator", type: "exploration_ready", @@ -73,10 +73,12 @@ mcp__ccw-tools__team_msg({ }) ``` +> **Note**: `team` must be session ID (e.g., `UAN-xxx-date`), NOT team name. Extract from `Session:` field in task description. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team ultra-analyze --from explorer --to coordinator --type exploration_ready --summary \"[explorer] ...\" --ref --json") +Bash("ccw team log --team --from explorer --to coordinator --type exploration_ready --summary \"[explorer] ...\" --ref --json") ``` --- diff --git a/.claude/skills/team-ultra-analyze/roles/synthesizer/role.md b/.claude/skills/team-ultra-analyze/roles/synthesizer/role.md index 640049bd..a98cac23 100644 --- a/.claude/skills/team-ultra-analyze/roles/synthesizer/role.md +++ b/.claude/skills/team-ultra-analyze/roles/synthesizer/role.md @@ -65,7 +65,7 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`: ``` mcp__ccw-tools__team_msg({ operation: "log", - team: "ultra-analyze", + team: , from: "synthesizer", to: "coordinator", type: "synthesis_ready", @@ -74,10 +74,12 @@ mcp__ccw-tools__team_msg({ }) ``` +> **Note**: `team` must be session ID (e.g., `UAN-xxx-date`), NOT team name. Extract from `Session:` field in task description. + **CLI fallback** (when MCP unavailable): ``` -Bash("ccw team log --team ultra-analyze --from synthesizer --to coordinator --type synthesis_ready --summary \"[synthesizer] ...\" --ref --json") +Bash("ccw team log --team --from synthesizer --to coordinator --type synthesis_ready --summary \"[synthesizer] ...\" --ref --json") ``` ---