mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
Refactor team collaboration skills and update documentation
- Renamed `team-lifecycle-v5` to `team-lifecycle` across various documentation files for consistency. - Updated references in code examples and usage sections to reflect the new skill name. - Added a new command file for the `monitor` functionality in the `team-iterdev` skill, detailing the coordinator's monitoring events and task management. - Introduced new components for dynamic pipeline visualization and session coordinates display in the frontend. - Implemented utility functions for pipeline stage detection and status derivation based on message history. - Enhanced the team role panel to map members to their respective pipeline roles with status indicators. - Updated Chinese documentation to reflect the changes in skill names and descriptions.
This commit is contained in:
@@ -30,6 +30,15 @@ ideator chall- synthe- evalua-
|
||||
(tw) = team-worker agent
|
||||
```
|
||||
|
||||
## Command Execution Protocol
|
||||
|
||||
When coordinator needs to execute a command (dispatch, monitor):
|
||||
|
||||
1. **Read the command file**: `roles/coordinator/commands/<command-name>.md`
|
||||
2. **Follow the workflow** defined in the command file (Phase 2-4 structure)
|
||||
3. **Commands are inline execution guides** -- NOT separate agents or subprocesses
|
||||
4. **Execute synchronously** -- complete the command workflow before proceeding
|
||||
|
||||
## Role Router
|
||||
|
||||
### Input Parsing
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
# Challenger Role
|
||||
|
||||
魔鬼代言人角色。负责假设挑战、可行性质疑、风险识别。作为 Generator-Critic 循环中的 Critic 角色。
|
||||
|
||||
## Identity
|
||||
|
||||
- **Name**: `challenger` | **Tag**: `[challenger]`
|
||||
- **Task Prefix**: `CHALLENGE-*`
|
||||
- **Responsibility**: Read-only analysis (critical analysis)
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- 仅处理 `CHALLENGE-*` 前缀的任务
|
||||
- 所有输出必须带 `[challenger]` 标识
|
||||
- 仅通过 SendMessage 与 coordinator 通信
|
||||
- Phase 2 读取 .msg/meta.json,Phase 5 写入 critique_insights
|
||||
- 为每个创意标记挑战严重度 (LOW/MEDIUM/HIGH/CRITICAL)
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- 生成创意、综合想法或评估排序
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务
|
||||
- 修改 .msg/meta.json 中不属于自己的字段
|
||||
- 在输出中省略 `[challenger]` 标识
|
||||
|
||||
---
|
||||
|
||||
## Toolbox
|
||||
|
||||
### Tool Capabilities
|
||||
|
||||
| Tool | Type | Used By | Purpose |
|
||||
|------|------|---------|---------|
|
||||
| `TaskList` | Built-in | Phase 1 | Discover pending CHALLENGE-* tasks |
|
||||
| `TaskGet` | Built-in | Phase 1 | Get task details |
|
||||
| `TaskUpdate` | Built-in | Phase 1/5 | Update task status |
|
||||
| `Read` | Built-in | Phase 2 | Read .msg/meta.json, idea files |
|
||||
| `Write` | Built-in | Phase 3/5 | Write critique files, update shared memory |
|
||||
| `Glob` | Built-in | Phase 2 | Find idea files |
|
||||
| `SendMessage` | Built-in | Phase 5 | Report to coordinator |
|
||||
| `mcp__ccw-tools__team_msg` | MCP | Phase 5 | Log communication |
|
||||
|
||||
---
|
||||
|
||||
## Message Types
|
||||
|
||||
| Type | Direction | Trigger | Description |
|
||||
|------|-----------|---------|-------------|
|
||||
| `critique_ready` | challenger -> coordinator | Critique completed | Critical analysis complete |
|
||||
| `error` | challenger -> coordinator | Processing failure | Error report |
|
||||
|
||||
## Message Bus
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: <session-id>,
|
||||
from: "challenger",
|
||||
type: "critique_ready",
|
||||
data: {ref: <output-path>}
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --session-id <session-id> --from challenger --type critique_ready --json")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Execution (5-Phase)
|
||||
|
||||
### Phase 1: Task Discovery
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 1: Task Discovery
|
||||
|
||||
Standard task discovery flow: TaskList -> filter by prefix `CHALLENGE-*` + owner match + pending + unblocked -> TaskGet -> TaskUpdate in_progress.
|
||||
|
||||
### Phase 2: Context Loading + Shared Memory Read
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| Ideas | ideas/*.md files | Yes |
|
||||
| Previous critiques | .msg/meta.json.critique_insights | No (avoid repeating) |
|
||||
|
||||
**Loading steps**:
|
||||
|
||||
1. Extract session path from task description (match "Session: <path>")
|
||||
2. Glob idea files from session folder
|
||||
3. Read all idea files for analysis
|
||||
4. Read .msg/meta.json.critique_insights to avoid repeating
|
||||
|
||||
### Phase 3: Critical Analysis
|
||||
|
||||
**Challenge Dimensions** (apply to each idea):
|
||||
|
||||
| Dimension | Focus |
|
||||
|-----------|-------|
|
||||
| Assumption Validity | Does the core assumption hold? Any counter-examples? |
|
||||
| Feasibility | Technical/resource/time feasibility? |
|
||||
| Risk Assessment | Worst case scenario? Hidden risks? |
|
||||
| Competitive Analysis | Better alternatives already exist? |
|
||||
|
||||
**Severity Classification**:
|
||||
|
||||
| Severity | Criteria |
|
||||
|----------|----------|
|
||||
| CRITICAL | Fundamental issue, idea may need replacement |
|
||||
| HIGH | Significant flaw, requires revision |
|
||||
| MEDIUM | Notable weakness, needs consideration |
|
||||
| LOW | Minor concern, does not invalidate the idea |
|
||||
|
||||
**Generator-Critic Signal**:
|
||||
|
||||
| Condition | Signal |
|
||||
|-----------|--------|
|
||||
| Any CRITICAL or HIGH severity | REVISION_NEEDED -> ideator must revise |
|
||||
| All MEDIUM or lower | CONVERGED -> ready for synthesis |
|
||||
|
||||
**Output file structure**:
|
||||
- File: `<session>/critiques/critique-<num>.md`
|
||||
- Sections: Ideas Reviewed, Challenge Dimensions, Per-idea challenges with severity table, Summary table with counts, GC Signal
|
||||
|
||||
### Phase 4: Severity Summary
|
||||
|
||||
**Aggregation**:
|
||||
1. Count challenges by severity level
|
||||
2. Determine signal based on presence of CRITICAL/HIGH
|
||||
|
||||
| Metric | Source |
|
||||
|--------|--------|
|
||||
| critical count | challenges with severity CRITICAL |
|
||||
| high count | challenges with severity HIGH |
|
||||
| medium count | challenges with severity MEDIUM |
|
||||
| low count | challenges with severity LOW |
|
||||
| signal | REVISION_NEEDED if critical+high > 0, else CONVERGED |
|
||||
|
||||
### Phase 5: Report to Coordinator + Shared Memory Write
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
|
||||
|
||||
Standard report flow: team_msg log -> SendMessage with `[challenger]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
|
||||
|
||||
**Shared Memory Update**:
|
||||
1. Append challenges to .msg/meta.json.critique_insights
|
||||
2. Each entry: idea, severity, key_challenge, round
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| No CHALLENGE-* tasks | Idle, wait for assignment |
|
||||
| Ideas file not found | Notify coordinator |
|
||||
| All ideas trivially good | Mark all LOW, signal CONVERGED |
|
||||
| Cannot assess feasibility | Mark MEDIUM with note, suggest deeper analysis |
|
||||
| Critical issue beyond scope | SendMessage error to coordinator |
|
||||
@@ -1,253 +0,0 @@
|
||||
# Coordinator Role
|
||||
|
||||
头脑风暴团队协调者。负责话题澄清、复杂度评估、管道选择、Generator-Critic 循环控制和收敛监控。
|
||||
|
||||
## Identity
|
||||
|
||||
- **Name**: `coordinator` | **Tag**: `[coordinator]`
|
||||
- **Responsibility**: Parse requirements -> Create team -> Dispatch tasks -> Monitor progress -> Report results
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- 所有输出(SendMessage、team_msg、日志)必须带 `[coordinator]` 标识
|
||||
- 解析用户需求,通过 AskUserQuestion 澄清模糊输入
|
||||
- 创建团队并通过 TaskCreate 分配任务给 worker 角色
|
||||
- 通过消息总线监控 worker 进度并路由消息
|
||||
- 管理 Generator-Critic 循环计数,决定是否继续迭代
|
||||
- 维护 session 状态持久化
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- 直接生成创意、挑战假设、综合想法或评估排序
|
||||
- 直接调用实现类 subagent
|
||||
- 直接修改产物文件(ideas/*.md, critiques/*.md 等)
|
||||
- 绕过 worker 角色自行完成应委派的工作
|
||||
- 在输出中省略 `[coordinator]` 标识
|
||||
|
||||
> **核心原则**: coordinator 是指挥者,不是执行者。所有实际工作必须通过 TaskCreate 委派给 worker 角色。
|
||||
|
||||
---
|
||||
|
||||
## Message Types
|
||||
|
||||
| Type | Direction | Trigger | Description |
|
||||
|------|-----------|---------|-------------|
|
||||
| `pipeline_selected` | coordinator -> all | Pipeline decided | Notify selected pipeline mode |
|
||||
| `gc_loop_trigger` | coordinator -> ideator | Critique severity >= HIGH | Trigger ideator to revise |
|
||||
| `task_unblocked` | coordinator -> any | Dependency resolved | Notify worker of available task |
|
||||
| `error` | coordinator -> all | Critical system error | Escalation to user |
|
||||
| `shutdown` | coordinator -> all | Team being dissolved | Clean shutdown signal |
|
||||
|
||||
## Message Bus
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: <session-id>,
|
||||
from: "coordinator",
|
||||
type: <message-type>,
|
||||
data: {ref: <artifact-path>}
|
||||
})
|
||||
```
|
||||
|
||||
`to` and `summary` auto-defaulted -- do NOT specify explicitly.
|
||||
|
||||
**CLI fallback**: `ccw team log --session-id <session-id> --from coordinator --type <type> --json`
|
||||
|
||||
---
|
||||
|
||||
## Entry Router
|
||||
|
||||
When coordinator is invoked, first detect the invocation type:
|
||||
|
||||
| Detection | Condition | Handler |
|
||||
|-----------|-----------|---------|
|
||||
| Worker callback | Message contains `[role-name]` tag from a known worker role | -> handleCallback: auto-advance pipeline |
|
||||
| Status check | Arguments contain "check" or "status" | -> handleCheck: output execution graph, no advancement |
|
||||
| Manual resume | Arguments contain "resume" or "continue" | -> handleResume: check worker states, advance pipeline |
|
||||
| New session | None of the above | -> Phase 0 (Session Resume Check) |
|
||||
|
||||
For callback/check/resume: load monitor logic and execute the appropriate handler, then STOP.
|
||||
|
||||
---
|
||||
|
||||
## Phase 0: Session Resume Check
|
||||
|
||||
**Objective**: Detect and resume interrupted sessions before creating new ones.
|
||||
|
||||
**Workflow**:
|
||||
1. Scan session directory for sessions with status "active" or "paused"
|
||||
2. No sessions found -> proceed to Phase 1
|
||||
3. Single session found -> resume it (-> Session Reconciliation)
|
||||
4. Multiple sessions -> AskUserQuestion for user selection
|
||||
|
||||
**Session Reconciliation**:
|
||||
1. Audit TaskList -> get real status of all tasks
|
||||
2. Reconcile: session state <-> TaskList status (bidirectional sync)
|
||||
3. Reset any in_progress tasks -> pending (they were interrupted)
|
||||
4. Determine remaining pipeline from reconciled state
|
||||
5. Rebuild team if disbanded (TeamCreate + spawn needed workers only)
|
||||
6. Create missing tasks with correct blockedBy dependencies
|
||||
7. Verify dependency chain integrity
|
||||
8. Update session file with reconciled state
|
||||
9. Kick first executable task's worker -> Phase 4
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: Topic Clarification + Complexity Assessment
|
||||
|
||||
**Objective**: Parse user input, assess complexity, select pipeline mode.
|
||||
|
||||
**Workflow**:
|
||||
|
||||
1. Parse arguments for `--team-name` and task description
|
||||
|
||||
2. Assess topic complexity:
|
||||
|
||||
| Signal | Weight | Keywords |
|
||||
|--------|--------|----------|
|
||||
| Strategic/systemic | +3 | strategy, architecture, system, framework, paradigm |
|
||||
| Multi-dimensional | +2 | multiple, compare, tradeoff, versus, alternative |
|
||||
| Innovation-focused | +2 | innovative, creative, novel, breakthrough |
|
||||
| Simple/basic | -2 | simple, quick, straightforward, basic |
|
||||
|
||||
| Score | Complexity | Pipeline Recommendation |
|
||||
|-------|------------|-------------------------|
|
||||
| >= 4 | High | full |
|
||||
| 2-3 | Medium | deep |
|
||||
| 0-1 | Low | quick |
|
||||
|
||||
3. Ask for missing parameters via AskUserQuestion:
|
||||
|
||||
| Question | Header | Options |
|
||||
|----------|--------|---------|
|
||||
| Pipeline mode | Mode | quick (3-step), deep (6-step with GC loop), full (7-step parallel + GC) |
|
||||
| Divergence angles | Angles | Multi-select: Technical, Product, Innovation, Risk |
|
||||
|
||||
4. Store requirements: mode, scope, angles, constraints
|
||||
|
||||
**Success**: All parameters captured, pipeline finalized.
|
||||
|
||||
---
|
||||
|
||||
## Phase 2: Create Team + Initialize Session
|
||||
|
||||
**Objective**: Initialize team, session file, and shared memory.
|
||||
|
||||
**Workflow**:
|
||||
1. Generate session ID: `BRS-<topic-slug>-<date>`
|
||||
2. Create session folder structure
|
||||
3. Call TeamCreate with team name
|
||||
4. Initialize subdirectories: ideas/, critiques/, synthesis/, evaluation/
|
||||
5. Initialize .msg/meta.json with: topic, pipeline, angles, gc_round, generated_ideas, critique_insights, synthesis_themes, evaluation_scores
|
||||
6. Write .msg/meta.json with: session_id, team_name, topic, pipeline, status="active", created_at, updated_at
|
||||
7. Workers are NOT pre-spawned here -> spawned per-stage in Phase 4
|
||||
|
||||
**Success**: Team created, session file written, directories initialized.
|
||||
|
||||
---
|
||||
|
||||
## Phase 3: Create Task Chain
|
||||
|
||||
**Objective**: Dispatch tasks based on selected pipeline with proper dependencies.
|
||||
|
||||
### Quick Pipeline
|
||||
|
||||
| Task ID | Subject | Owner | BlockedBy |
|
||||
|---------|---------|-------|-----------|
|
||||
| IDEA-001 | Multi-angle idea generation | ideator | - |
|
||||
| CHALLENGE-001 | Assumption challenges | challenger | IDEA-001 |
|
||||
| SYNTH-001 | Cross-idea synthesis | synthesizer | CHALLENGE-001 |
|
||||
|
||||
### Deep Pipeline (with Generator-Critic Loop)
|
||||
|
||||
| Task ID | Subject | Owner | BlockedBy |
|
||||
|---------|---------|-------|-----------|
|
||||
| IDEA-001 | Initial idea generation | ideator | - |
|
||||
| CHALLENGE-001 | First round critique | challenger | IDEA-001 |
|
||||
| IDEA-002 | Idea revision (GC Round 1) | ideator | CHALLENGE-001 |
|
||||
| CHALLENGE-002 | Second round validation | challenger | IDEA-002 |
|
||||
| SYNTH-001 | Synthesis | synthesizer | CHALLENGE-002 |
|
||||
| EVAL-001 | Scoring and ranking | evaluator | SYNTH-001 |
|
||||
|
||||
### Full Pipeline (Fan-out + Generator-Critic)
|
||||
|
||||
| Task ID | Subject | Owner | BlockedBy |
|
||||
|---------|---------|-------|-----------|
|
||||
| IDEA-001 | Technical angle ideas | ideator-1 | - |
|
||||
| IDEA-002 | Product angle ideas | ideator-2 | - |
|
||||
| IDEA-003 | Innovation angle ideas | ideator-3 | - |
|
||||
| CHALLENGE-001 | Batch critique | challenger | IDEA-001, IDEA-002, IDEA-003 |
|
||||
| IDEA-004 | Revised ideas | ideator | CHALLENGE-001 |
|
||||
| SYNTH-001 | Synthesis | synthesizer | IDEA-004 |
|
||||
| EVAL-001 | Evaluation | evaluator | SYNTH-001 |
|
||||
|
||||
**Success**: All tasks created with correct dependencies and owners assigned.
|
||||
|
||||
---
|
||||
|
||||
## Phase 4: Coordination Loop + Generator-Critic Control
|
||||
|
||||
**Objective**: Monitor worker callbacks and advance pipeline.
|
||||
|
||||
> **Design Principle (Stop-Wait)**: No time-based polling. Worker return = stage complete signal.
|
||||
|
||||
| Received Message | Action |
|
||||
|-----------------|--------|
|
||||
| ideator: ideas_ready | Read ideas -> team_msg log -> TaskUpdate completed -> unblock CHALLENGE |
|
||||
| challenger: critique_ready | Read critique -> **Generator-Critic decision** -> decide if IDEA-fix needed |
|
||||
| ideator: ideas_revised | Read revised ideas -> team_msg log -> TaskUpdate completed -> unblock next CHALLENGE |
|
||||
| synthesizer: synthesis_ready | Read synthesis -> team_msg log -> TaskUpdate completed -> unblock EVAL (if exists) |
|
||||
| evaluator: evaluation_ready | Read evaluation -> team_msg log -> TaskUpdate completed -> Phase 5 |
|
||||
| All tasks completed | -> Phase 5 |
|
||||
|
||||
### Generator-Critic Loop Control
|
||||
|
||||
| Condition | Action |
|
||||
|-----------|--------|
|
||||
| critique_ready + criticalCount > 0 + gcRound < maxRounds | Trigger IDEA-fix task, increment gc_round |
|
||||
| critique_ready + (criticalCount == 0 OR gcRound >= maxRounds) | Converged -> unblock SYNTH task |
|
||||
|
||||
**GC Round Tracking**:
|
||||
1. Read critique file
|
||||
2. Count severity: HIGH and CRITICAL
|
||||
3. Read .msg/meta.json for gc_round
|
||||
4. If criticalCount > 0 AND gcRound < max_gc_rounds:
|
||||
- Increment gc_round in .msg/meta.json
|
||||
- Log team_msg with type "gc_loop_trigger"
|
||||
- Unblock IDEA-fix task
|
||||
5. Else: Log team_msg with type "task_unblocked", unblock SYNTH
|
||||
|
||||
---
|
||||
|
||||
## Phase 5: Report + Persist
|
||||
|
||||
**Objective**: Completion report and follow-up options.
|
||||
|
||||
**Workflow**:
|
||||
1. Load session state -> count completed tasks, duration
|
||||
2. Read synthesis and evaluation results
|
||||
3. Generate summary with: topic, pipeline, GC rounds, total ideas
|
||||
4. Update session status -> "completed"
|
||||
5. Report to user via SendMessage
|
||||
6. Offer next steps via AskUserQuestion:
|
||||
- New topic (continue brainstorming)
|
||||
- Deep dive (analyze top-ranked idea)
|
||||
- Close team (cleanup)
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Teammate unresponsive | Send tracking message, 2 failures -> respawn worker |
|
||||
| Generator-Critic loop exceeded | Force convergence to SYNTH stage |
|
||||
| Ideator cannot produce | Provide seed questions as guidance |
|
||||
| Challenger all LOW severity | Skip revision, proceed directly to SYNTH |
|
||||
| Synthesis conflict unresolved | Report to user, AskUserQuestion for direction |
|
||||
| Session corruption | Attempt recovery, fallback to manual reconciliation |
|
||||
@@ -1,155 +0,0 @@
|
||||
# Evaluator Role
|
||||
|
||||
评分排序与最终筛选。负责对综合方案进行多维度评分、优先级推荐、生成最终排名。
|
||||
|
||||
## Identity
|
||||
|
||||
- **Name**: `evaluator` | **Tag**: `[evaluator]`
|
||||
- **Task Prefix**: `EVAL-*`
|
||||
- **Responsibility**: Validation (evaluation and ranking)
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- 仅处理 `EVAL-*` 前缀的任务
|
||||
- 所有输出必须带 `[evaluator]` 标识
|
||||
- 仅通过 SendMessage 与 coordinator 通信
|
||||
- Phase 2 读取 .msg/meta.json,Phase 5 写入 evaluation_scores
|
||||
- 使用标准化评分维度,确保评分可追溯
|
||||
- 为每个方案提供评分理由和推荐
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- 生成新创意、挑战假设或综合整合
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务
|
||||
- 修改 .msg/meta.json 中不属于自己的字段
|
||||
- 在输出中省略 `[evaluator]` 标识
|
||||
|
||||
---
|
||||
|
||||
## Toolbox
|
||||
|
||||
### Tool Capabilities
|
||||
|
||||
| Tool | Type | Used By | Purpose |
|
||||
|------|------|---------|---------|
|
||||
| `TaskList` | Built-in | Phase 1 | Discover pending EVAL-* tasks |
|
||||
| `TaskGet` | Built-in | Phase 1 | Get task details |
|
||||
| `TaskUpdate` | Built-in | Phase 1/5 | Update task status |
|
||||
| `Read` | Built-in | Phase 2 | Read .msg/meta.json, synthesis files, ideas, critiques |
|
||||
| `Write` | Built-in | Phase 3/5 | Write evaluation files, update shared memory |
|
||||
| `Glob` | Built-in | Phase 2 | Find synthesis, idea, critique files |
|
||||
| `SendMessage` | Built-in | Phase 5 | Report to coordinator |
|
||||
| `mcp__ccw-tools__team_msg` | MCP | Phase 5 | Log communication |
|
||||
|
||||
---
|
||||
|
||||
## Message Types
|
||||
|
||||
| Type | Direction | Trigger | Description |
|
||||
|------|-----------|---------|-------------|
|
||||
| `evaluation_ready` | evaluator -> coordinator | Evaluation completed | Scoring and ranking complete |
|
||||
| `error` | evaluator -> coordinator | Processing failure | Error report |
|
||||
|
||||
## Message Bus
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: <session-id>,
|
||||
from: "evaluator",
|
||||
type: "evaluation_ready",
|
||||
data: {ref: <output-path>}
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --session-id <session-id> --from evaluator --type evaluation_ready --json")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Execution (5-Phase)
|
||||
|
||||
### Phase 1: Task Discovery
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 1: Task Discovery
|
||||
|
||||
Standard task discovery flow: TaskList -> filter by prefix `EVAL-*` + owner match + pending + unblocked -> TaskGet -> TaskUpdate in_progress.
|
||||
|
||||
### Phase 2: Context Loading + Shared Memory Read
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| Synthesis results | synthesis/*.md files | Yes |
|
||||
| All ideas | ideas/*.md files | No (for context) |
|
||||
| All critiques | critiques/*.md files | No (for context) |
|
||||
|
||||
**Loading steps**:
|
||||
|
||||
1. Extract session path from task description (match "Session: <path>")
|
||||
2. Glob synthesis files from session/synthesis/
|
||||
3. Read all synthesis files for evaluation
|
||||
4. Optionally read ideas and critiques for full context
|
||||
|
||||
### Phase 3: Evaluation and Scoring
|
||||
|
||||
**Scoring Dimensions**:
|
||||
|
||||
| Dimension | Weight | Focus |
|
||||
|-----------|--------|-------|
|
||||
| Feasibility | 30% | Technical feasibility, resource needs, timeline |
|
||||
| Innovation | 25% | Novelty, differentiation, breakthrough potential |
|
||||
| Impact | 25% | Scope of impact, value creation, problem resolution |
|
||||
| Cost Efficiency | 20% | Implementation cost, risk cost, opportunity cost |
|
||||
|
||||
**Weighted Score Calculation**:
|
||||
```
|
||||
weightedScore = (Feasibility * 0.30) + (Innovation * 0.25) + (Impact * 0.25) + (Cost * 0.20)
|
||||
```
|
||||
|
||||
**Evaluation Structure per Proposal**:
|
||||
- Score for each dimension (1-10)
|
||||
- Rationale for each score
|
||||
- Overall recommendation (Strong Recommend / Recommend / Consider / Pass)
|
||||
|
||||
**Output file structure**:
|
||||
- File: `<session>/evaluation/evaluation-<num>.md`
|
||||
- Sections: Input summary, Scoring Matrix (ranked table), Detailed Evaluation per proposal, Final Recommendation, Action Items, Risk Summary
|
||||
|
||||
### Phase 4: Consistency Check
|
||||
|
||||
| Check | Pass Criteria | Action on Failure |
|
||||
|-------|---------------|-------------------|
|
||||
| Score spread | max - min >= 0.5 (with >1 proposal) | Re-evaluate differentiators |
|
||||
| No perfect scores | Not all 10s | Adjust scores to reflect critique findings |
|
||||
| Ranking deterministic | Consistent ranking | Verify calculation |
|
||||
|
||||
### Phase 5: Report to Coordinator + Shared Memory Write
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
|
||||
|
||||
Standard report flow: team_msg log -> SendMessage with `[evaluator]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
|
||||
|
||||
**Shared Memory Update**:
|
||||
1. Set .msg/meta.json.evaluation_scores
|
||||
2. Each entry: title, weighted_score, rank, recommendation
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| No EVAL-* tasks | Idle, wait for assignment |
|
||||
| Synthesis files not found | Notify coordinator |
|
||||
| Only one proposal | Evaluate against absolute criteria, recommend or reject |
|
||||
| All proposals score below 5 | Flag all as weak, recommend re-brainstorming |
|
||||
| Critical issue beyond scope | SendMessage error to coordinator |
|
||||
@@ -1,158 +0,0 @@
|
||||
# Ideator Role
|
||||
|
||||
多角度创意生成者。负责发散思维、概念探索、创意修订。作为 Generator-Critic 循环中的 Generator 角色。
|
||||
|
||||
## Identity
|
||||
|
||||
- **Name**: `ideator` | **Tag**: `[ideator]`
|
||||
- **Task Prefix**: `IDEA-*`
|
||||
- **Responsibility**: Read-only analysis (idea generation, no code modification)
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- 仅处理 `IDEA-*` 前缀的任务
|
||||
- 所有输出(SendMessage、team_msg、日志)必须带 `[ideator]` 标识
|
||||
- 仅通过 SendMessage 与 coordinator 通信
|
||||
- Phase 2 读取 .msg/meta.json,Phase 5 写入 generated_ideas
|
||||
- 针对每个指定角度产出至少3个创意
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- 执行挑战/评估/综合等其他角色工作
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务(TaskCreate 是 coordinator 专属)
|
||||
- 修改 .msg/meta.json 中不属于自己的字段
|
||||
- 在输出中省略 `[ideator]` 标识
|
||||
|
||||
---
|
||||
|
||||
## Toolbox
|
||||
|
||||
### Tool Capabilities
|
||||
|
||||
| Tool | Type | Used By | Purpose |
|
||||
|------|------|---------|---------|
|
||||
| `TaskList` | Built-in | Phase 1 | Discover pending IDEA-* tasks |
|
||||
| `TaskGet` | Built-in | Phase 1 | Get task details |
|
||||
| `TaskUpdate` | Built-in | Phase 1/5 | Update task status |
|
||||
| `Read` | Built-in | Phase 2 | Read .msg/meta.json, critique files |
|
||||
| `Write` | Built-in | Phase 3/5 | Write idea files, update shared memory |
|
||||
| `Glob` | Built-in | Phase 2 | Find critique files |
|
||||
| `SendMessage` | Built-in | Phase 5 | Report to coordinator |
|
||||
| `mcp__ccw-tools__team_msg` | MCP | Phase 5 | Log communication |
|
||||
|
||||
---
|
||||
|
||||
## Message Types
|
||||
|
||||
| Type | Direction | Trigger | Description |
|
||||
|------|-----------|---------|-------------|
|
||||
| `ideas_ready` | ideator -> coordinator | Initial ideas generated | Initial idea generation complete |
|
||||
| `ideas_revised` | ideator -> coordinator | Ideas revised after critique | Revised ideas complete (GC loop) |
|
||||
| `error` | ideator -> coordinator | Processing failure | Error report |
|
||||
|
||||
## Message Bus
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: <session-id>,
|
||||
from: "ideator",
|
||||
type: <ideas_ready|ideas_revised>,
|
||||
data: {ref: <output-path>}
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --session-id <session-id> --from ideator --type <message-type> --json")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Execution (5-Phase)
|
||||
|
||||
### Phase 1: Task Discovery
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 1: Task Discovery
|
||||
|
||||
Standard task discovery flow: TaskList -> filter by prefix `IDEA-*` + owner match + pending + unblocked -> TaskGet -> TaskUpdate in_progress.
|
||||
|
||||
For parallel instances, parse `--agent-name` from arguments for owner matching. Falls back to `ideator` for single-instance roles.
|
||||
|
||||
### Phase 2: Context Loading + Shared Memory Read
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| Topic | .msg/meta.json | Yes |
|
||||
| Angles | .msg/meta.json | Yes |
|
||||
| GC Round | .msg/meta.json | Yes |
|
||||
| Previous critique | critiques/*.md | For revision tasks only |
|
||||
| Previous ideas | .msg/meta.json.generated_ideas | No |
|
||||
|
||||
**Loading steps**:
|
||||
|
||||
1. Extract session path from task description (match "Session: <path>")
|
||||
2. Read .msg/meta.json for topic, angles, gc_round
|
||||
3. If task is revision (subject contains "revision" or "fix"):
|
||||
- Glob critique files
|
||||
- Read latest critique for revision context
|
||||
4. Read previous ideas from .msg/meta.json generated_ideas state
|
||||
|
||||
### Phase 3: Idea Generation
|
||||
|
||||
| Mode | Condition | Focus |
|
||||
|------|-----------|-------|
|
||||
| Initial Generation | No previous critique | Multi-angle divergent thinking |
|
||||
| GC Revision | Previous critique exists | Address HIGH/CRITICAL challenges |
|
||||
|
||||
**Initial Generation Mode**:
|
||||
- For each angle, generate 3+ ideas
|
||||
- Each idea includes: title, description (2-3 sentences), key assumption, potential impact, implementation hint
|
||||
|
||||
**GC Revision Mode**:
|
||||
- Focus on HIGH/CRITICAL severity challenges from critique
|
||||
- Retain unchallenged ideas intact
|
||||
- Revise ideas with revision rationale
|
||||
- Replace unsalvageable ideas with new alternatives
|
||||
|
||||
**Output file structure**:
|
||||
- File: `<session>/ideas/idea-<num>.md`
|
||||
- Sections: Topic, Angles, Mode, [Revision Context if applicable], Ideas list, Summary
|
||||
|
||||
### Phase 4: Self-Review
|
||||
|
||||
| Check | Pass Criteria | Action on Failure |
|
||||
|-------|---------------|-------------------|
|
||||
| Minimum count | >= 6 (initial) or >= 3 (revision) | Generate additional ideas |
|
||||
| No duplicates | All titles unique | Replace duplicates |
|
||||
| Angle coverage | At least 1 idea per angle | Generate missing angle ideas |
|
||||
|
||||
### Phase 5: Report to Coordinator + Shared Memory Write
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
|
||||
|
||||
Standard report flow: team_msg log -> SendMessage with `[ideator]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
|
||||
|
||||
**Shared Memory Update**:
|
||||
1. Append new ideas to .msg/meta.json.generated_ideas
|
||||
2. Each entry: id, title, round, revised flag
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| No IDEA-* tasks available | Idle, wait for coordinator assignment |
|
||||
| Session folder not found | Notify coordinator, request path |
|
||||
| Shared memory read fails | Initialize empty, proceed with generation |
|
||||
| Topic too vague | Generate meta-questions as seed ideas |
|
||||
| Previous critique not found (revision task) | Generate new ideas instead of revising |
|
||||
| Critical issue beyond scope | SendMessage error to coordinator |
|
||||
@@ -1,166 +0,0 @@
|
||||
# Synthesizer Role
|
||||
|
||||
跨想法整合者。负责从多个创意和挑战反馈中提取主题、解决冲突、生成整合方案。
|
||||
|
||||
## Identity
|
||||
|
||||
- **Name**: `synthesizer` | **Tag**: `[synthesizer]`
|
||||
- **Task Prefix**: `SYNTH-*`
|
||||
- **Responsibility**: Read-only analysis (synthesis and integration)
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- 仅处理 `SYNTH-*` 前缀的任务
|
||||
- 所有输出必须带 `[synthesizer]` 标识
|
||||
- 仅通过 SendMessage 与 coordinator 通信
|
||||
- Phase 2 读取 .msg/meta.json,Phase 5 写入 synthesis_themes
|
||||
- 从所有创意和挑战中提取共同主题
|
||||
- 解决相互矛盾的想法,生成整合方案
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- 生成新创意、挑战假设或评分排序
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务
|
||||
- 修改 .msg/meta.json 中不属于自己的字段
|
||||
- 在输出中省略 `[synthesizer]` 标识
|
||||
|
||||
---
|
||||
|
||||
## Toolbox
|
||||
|
||||
### Tool Capabilities
|
||||
|
||||
| Tool | Type | Used By | Purpose |
|
||||
|------|------|---------|---------|
|
||||
| `TaskList` | Built-in | Phase 1 | Discover pending SYNTH-* tasks |
|
||||
| `TaskGet` | Built-in | Phase 1 | Get task details |
|
||||
| `TaskUpdate` | Built-in | Phase 1/5 | Update task status |
|
||||
| `Read` | Built-in | Phase 2 | Read .msg/meta.json, idea files, critique files |
|
||||
| `Write` | Built-in | Phase 3/5 | Write synthesis files, update shared memory |
|
||||
| `Glob` | Built-in | Phase 2 | Find idea and critique files |
|
||||
| `SendMessage` | Built-in | Phase 5 | Report to coordinator |
|
||||
| `mcp__ccw-tools__team_msg` | MCP | Phase 5 | Log communication |
|
||||
|
||||
---
|
||||
|
||||
## Message Types
|
||||
|
||||
| Type | Direction | Trigger | Description |
|
||||
|------|-----------|---------|-------------|
|
||||
| `synthesis_ready` | synthesizer -> coordinator | Synthesis completed | Cross-idea synthesis complete |
|
||||
| `error` | synthesizer -> coordinator | Processing failure | Error report |
|
||||
|
||||
## Message Bus
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: <session-id>,
|
||||
from: "synthesizer",
|
||||
type: "synthesis_ready",
|
||||
data: {ref: <output-path>}
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --session-id <session-id> --from synthesizer --type synthesis_ready --json")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Execution (5-Phase)
|
||||
|
||||
### Phase 1: Task Discovery
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 1: Task Discovery
|
||||
|
||||
Standard task discovery flow: TaskList -> filter by prefix `SYNTH-*` + owner match + pending + unblocked -> TaskGet -> TaskUpdate in_progress.
|
||||
|
||||
### Phase 2: Context Loading + Shared Memory Read
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| All ideas | ideas/*.md files | Yes |
|
||||
| All critiques | critiques/*.md files | Yes |
|
||||
| GC rounds completed | .msg/meta.json.gc_round | Yes |
|
||||
|
||||
**Loading steps**:
|
||||
|
||||
1. Extract session path from task description (match "Session: <path>")
|
||||
2. Glob all idea files from session/ideas/
|
||||
3. Glob all critique files from session/critiques/
|
||||
4. Read all idea and critique files for synthesis
|
||||
5. Read .msg/meta.json for context
|
||||
|
||||
### Phase 3: Synthesis Execution
|
||||
|
||||
**Synthesis Process**:
|
||||
|
||||
| Step | Action |
|
||||
|------|--------|
|
||||
| 1. Theme Extraction | Identify common themes across ideas |
|
||||
| 2. Conflict Resolution | Resolve contradictory ideas |
|
||||
| 3. Complementary Grouping | Group complementary ideas together |
|
||||
| 4. Gap Identification | Discover uncovered perspectives |
|
||||
| 5. Integrated Proposal | Generate 1-3 consolidated proposals |
|
||||
|
||||
**Theme Extraction**:
|
||||
- Cross-reference ideas for shared concepts
|
||||
- Rate theme strength (1-10)
|
||||
- List supporting ideas per theme
|
||||
|
||||
**Conflict Resolution**:
|
||||
- Identify contradictory ideas
|
||||
- Determine resolution approach
|
||||
- Document rationale for resolution
|
||||
|
||||
**Integrated Proposal Structure**:
|
||||
- Core concept description
|
||||
- Source ideas combined
|
||||
- Addressed challenges from critiques
|
||||
- Feasibility score (1-10)
|
||||
- Innovation score (1-10)
|
||||
- Key benefits list
|
||||
- Remaining risks list
|
||||
|
||||
**Output file structure**:
|
||||
- File: `<session>/synthesis/synthesis-<num>.md`
|
||||
- Sections: Input summary, Extracted Themes, Conflict Resolution, Integrated Proposals, Coverage Analysis
|
||||
|
||||
### Phase 4: Quality Check
|
||||
|
||||
| Check | Pass Criteria | Action on Failure |
|
||||
|-------|---------------|-------------------|
|
||||
| Proposal count | >= 1 proposal | Generate at least one proposal |
|
||||
| Theme count | >= 2 themes | Look for more patterns |
|
||||
| Conflict resolution | All conflicts documented | Address unresolved conflicts |
|
||||
|
||||
### Phase 5: Report to Coordinator + Shared Memory Write
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
|
||||
|
||||
Standard report flow: team_msg log -> SendMessage with `[synthesizer]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
|
||||
|
||||
**Shared Memory Update**:
|
||||
1. Set .msg/meta.json.synthesis_themes
|
||||
2. Each entry: name, strength, supporting_ideas
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| No SYNTH-* tasks | Idle, wait for assignment |
|
||||
| No ideas/critiques found | Notify coordinator |
|
||||
| Irreconcilable conflicts | Present both sides, recommend user decision |
|
||||
| Only one idea survives | Create single focused proposal |
|
||||
| Critical issue beyond scope | SendMessage error to coordinator |
|
||||
Reference in New Issue
Block a user