mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
feat: Add coordinator commands and role specifications for UI design team
- Implemented the 'monitor' command for coordinator role to handle monitoring events, task completion, and pipeline management. - Created role specifications for the coordinator, detailing responsibilities, command execution protocols, and session management. - Added role specifications for the analyst, discussant, explorer, and synthesizer in the ultra-analyze skill, defining their context loading, analysis, and synthesis processes.
This commit is contained in:
@@ -11,23 +11,23 @@ Unified team skill: multi-angle brainstorming via Generator-Critic loops, shared
|
||||
## Architecture
|
||||
|
||||
```
|
||||
┌───────────────────────────────────────────────────┐
|
||||
│ Skill(skill="team-brainstorm") │
|
||||
│ args="<topic>" or args="--role=xxx" │
|
||||
└───────────────────┬───────────────────────────────┘
|
||||
│ Role Router
|
||||
┌──── --role present? ────┐
|
||||
│ NO │ YES
|
||||
↓ ↓
|
||||
Orchestration Mode Role Dispatch
|
||||
(auto → coordinator) (route to role.md)
|
||||
│
|
||||
┌────┴────┬───────────┬───────────┬───────────┐
|
||||
↓ ↓ ↓ ↓ ↓
|
||||
┌──────────┐┌─────────┐┌──────────┐┌──────────┐┌─────────┐
|
||||
│coordinator││ ideator ││challenger││synthesizer││evaluator│
|
||||
│ ││ IDEA-* ││CHALLENGE-*││ SYNTH-* ││ EVAL-* │
|
||||
└──────────┘└─────────┘└──────────┘└──────────┘└─────────┘
|
||||
+---------------------------------------------------+
|
||||
| Skill(skill="team-brainstorm") |
|
||||
| args="<topic-description>" |
|
||||
+-------------------+-------------------------------+
|
||||
|
|
||||
Orchestration Mode (auto -> coordinator)
|
||||
|
|
||||
Coordinator (inline)
|
||||
Phase 0-5 orchestration
|
||||
|
|
||||
+-------+-------+-------+-------+
|
||||
v v v v
|
||||
[tw] [tw] [tw] [tw]
|
||||
ideator chall- synthe- evalua-
|
||||
enger sizer tor
|
||||
|
||||
(tw) = team-worker agent
|
||||
```
|
||||
|
||||
## Role Router
|
||||
@@ -38,13 +38,13 @@ Parse `$ARGUMENTS` to extract `--role`. If absent → Orchestration Mode (auto r
|
||||
|
||||
### Role Registry
|
||||
|
||||
| Role | File | Task Prefix | Type | Compact |
|
||||
|------|------|-------------|------|---------|
|
||||
| coordinator | [roles/coordinator.md](roles/coordinator.md) | (none) | orchestrator | **⚠️ 压缩后必须重读** |
|
||||
| ideator | [roles/ideator.md](roles/ideator.md) | IDEA-* | pipeline | 压缩后必须重读 |
|
||||
| challenger | [roles/challenger.md](roles/challenger.md) | CHALLENGE-* | pipeline | 压缩后必须重读 |
|
||||
| synthesizer | [roles/synthesizer.md](roles/synthesizer.md) | SYNTH-* | pipeline | 压缩后必须重读 |
|
||||
| evaluator | [roles/evaluator.md](roles/evaluator.md) | EVAL-* | pipeline | 压缩后必须重读 |
|
||||
| Role | Spec | Task Prefix | Inner Loop |
|
||||
|------|------|-------------|------------|
|
||||
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | (none) | - |
|
||||
| ideator | [role-specs/ideator.md](role-specs/ideator.md) | IDEA-* | false |
|
||||
| challenger | [role-specs/challenger.md](role-specs/challenger.md) | CHALLENGE-* | false |
|
||||
| synthesizer | [role-specs/synthesizer.md](role-specs/synthesizer.md) | SYNTH-* | false |
|
||||
| evaluator | [role-specs/evaluator.md](role-specs/evaluator.md) | EVAL-* | false |
|
||||
|
||||
> **⚠️ COMPACT PROTECTION**: 角色文件是执行文档,不是参考资料。当 context compression 发生后,角色指令仅剩摘要时,**必须立即 `Read` 对应 role.md 重新加载后再继续执行**。不得基于摘要执行任何 Phase。
|
||||
|
||||
@@ -101,10 +101,10 @@ 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=**<session-id>**, from=<role>, to="coordinator", type=<message-type>, summary="[<role>] <summary>", ref=<artifact-path>
|
||||
- **CLI fallback**: When MCP unavailable → `ccw team log --team <session-id> --from <role> --to coordinator --type <type> --summary "[<role>] ..." --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 `[<role>]`)
|
||||
- Parameters: operation="log", session_id=<session-id>, from=<role>, 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 <role> --type <type> --json`
|
||||
2. **SendMessage**: Send result to coordinator
|
||||
3. **TaskUpdate**: Mark task completed
|
||||
4. **Loop**: Return to Phase 1 to check next task
|
||||
|
||||
@@ -130,7 +130,7 @@ Cross-task knowledge accumulation. Coordinator creates `wisdom/` directory at se
|
||||
|---------|-----------|
|
||||
| Process tasks with own prefix | Process tasks with other role prefixes |
|
||||
| SendMessage to coordinator | Communicate directly with other workers |
|
||||
| Read/write shared-memory.json (own fields) | Create tasks for other roles |
|
||||
| Share state via team_msg(type="state_update") | Create tasks for other roles |
|
||||
| Delegate to commands/ files | Modify resources outside own responsibility |
|
||||
|
||||
Coordinator additional restrictions: Do not generate ideas directly, do not evaluate/challenge ideas, do not execute analysis/synthesis, do not bypass workers.
|
||||
@@ -143,11 +143,12 @@ 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=**<session-id>**, from=<role>, to="coordinator", type=<message-type>, summary="[<role>] <summary>", ref=<artifact-path>
|
||||
**Parameters**: operation="log", session_id=<session-id>, from=<role>, type=<message-type>, data={ref: "<artifact-path>"}
|
||||
|
||||
**CLI fallback**: When MCP unavailable → `ccw team log --team <session-id> --from <role> --to coordinator --type <type> --summary "[<role>] ..." --json`
|
||||
`to` and `summary` auto-defaulted -- do NOT specify explicitly.
|
||||
|
||||
**CLI fallback**: `ccw team log --session-id <session-id> --from <role> --type <type> --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**:
|
||||
|
||||
@@ -159,12 +160,12 @@ Every SendMessage **before**, must call `mcp__ccw-tools__team_msg` to log:
|
||||
| synthesizer | `synthesis_ready`, `error` |
|
||||
| evaluator | `evaluation_ready`, `error` |
|
||||
|
||||
### Shared Memory
|
||||
### Shared State
|
||||
|
||||
All roles read in Phase 2 and write in Phase 5 to `shared-memory.json`:
|
||||
Cross-role state is shared via `team_msg(type="state_update")` messages, persisted in `.msg/meta.json`:
|
||||
|
||||
| Role | Field |
|
||||
|------|-------|
|
||||
| Role | State Key |
|
||||
|------|-----------|
|
||||
| ideator | `generated_ideas` |
|
||||
| challenger | `critique_insights` |
|
||||
| synthesizer | `synthesis_themes` |
|
||||
@@ -176,7 +177,7 @@ All roles read in Phase 2 and write in Phase 5 to `shared-memory.json`:
|
||||
|---------|-------|
|
||||
| Team name | brainstorm |
|
||||
| Session directory | `.workflow/.team/BRS-<slug>-<date>/` |
|
||||
| Shared memory | `shared-memory.json` in session dir |
|
||||
| Message store | `.msg/messages.jsonl` + `.msg/meta.json` in session dir |
|
||||
|
||||
---
|
||||
|
||||
@@ -291,79 +292,61 @@ Beat 1 2 3-4 5 6
|
||||
|
||||
## Coordinator Spawn Template
|
||||
|
||||
When coordinator spawns workers, use background mode (Spawn-and-Stop).
|
||||
### v5 Worker Spawn (all roles)
|
||||
|
||||
**Standard spawn** (single agent per role): For Quick/Deep pipeline, spawn one ideator. Challenger, synthesizer, and evaluator are always single agents.
|
||||
|
||||
**Parallel spawn** (Full pipeline): For Full pipeline with N idea angles, spawn N ideator agents in parallel (`ideator-1`, `ideator-2`, ...) with `run_in_background: true`. Each parallel ideator only processes tasks where owner matches its agent name. After all parallel ideators complete, proceed with single challenger for batch critique.
|
||||
|
||||
**Spawn template**:
|
||||
When coordinator spawns workers, use `team-worker` agent with role-spec path:
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "general-purpose",
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker",
|
||||
team_name: "brainstorm",
|
||||
name: "<role>",
|
||||
run_in_background: true,
|
||||
prompt: `You are team "brainstorm" <ROLE>.
|
||||
prompt: `## Role Assignment
|
||||
role: <role>
|
||||
role_spec: .claude/skills/team-brainstorm/role-specs/<role>.md
|
||||
session: <session-folder>
|
||||
session_id: <session-id>
|
||||
team_name: brainstorm
|
||||
requirement: <topic-description>
|
||||
inner_loop: <true|false>
|
||||
|
||||
## Primary Directive
|
||||
All your work must be executed through Skill to load role definition:
|
||||
Skill(skill="team-brainstorm", args="--role=<role>")
|
||||
|
||||
Current topic: <topic-description>
|
||||
Session: <session-folder>
|
||||
|
||||
## Role Guidelines
|
||||
- Only process <PREFIX>-* tasks, do not execute other role work
|
||||
- All output prefixed with [<role>] identifier
|
||||
- Only communicate with coordinator
|
||||
- Do not use TaskCreate for other roles
|
||||
- Call mcp__ccw-tools__team_msg before every SendMessage
|
||||
|
||||
## Workflow
|
||||
1. Call Skill -> load role definition and execution logic
|
||||
2. Follow role.md 5-Phase flow
|
||||
3. team_msg + SendMessage results to coordinator
|
||||
4. TaskUpdate completed -> check next task`
|
||||
Read role_spec file to load Phase 2-4 domain instructions.
|
||||
Execute built-in Phase 1 (task discovery) -> role-spec Phase 2-4 -> built-in Phase 5 (report).`
|
||||
})
|
||||
```
|
||||
|
||||
**All roles** (ideator, challenger, synthesizer, evaluator): Set `inner_loop: false`.
|
||||
|
||||
**Parallel ideator spawn** (Full pipeline with N angles):
|
||||
|
||||
> When Full pipeline has N parallel IDEA tasks assigned to ideator role, spawn N distinct agents named `ideator-1`, `ideator-2`, etc. Each agent only processes tasks where owner matches its agent name.
|
||||
> When Full pipeline has N parallel IDEA tasks assigned to ideator role, spawn N distinct team-worker agents named `ideator-1`, `ideator-2`, etc. Each agent only processes tasks where owner matches its agent name.
|
||||
|
||||
| Condition | Action |
|
||||
|-----------|--------|
|
||||
| Full pipeline with N idea angles (N > 1) | Spawn N agents: `ideator-1`, `ideator-2`, ... `ideator-N` with `run_in_background: true` |
|
||||
| Quick/Deep pipeline (single ideator) | Standard spawn: single `ideator` agent |
|
||||
| Full pipeline with N idea angles (N > 1) | Spawn N team-worker agents: `ideator-1`, `ideator-2`, ... `ideator-N` with `run_in_background: true` |
|
||||
| Quick/Deep pipeline (single ideator) | Standard spawn: single `ideator` team-worker agent |
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "general-purpose",
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn ideator-<N> worker",
|
||||
team_name: "brainstorm",
|
||||
name: "ideator-<N>",
|
||||
run_in_background: true,
|
||||
prompt: `You are team "brainstorm" IDEATOR (ideator-<N>).
|
||||
Your agent name is "ideator-<N>", use this name for task discovery owner matching.
|
||||
prompt: `## Role Assignment
|
||||
role: ideator
|
||||
role_spec: .claude/skills/team-brainstorm/role-specs/ideator.md
|
||||
session: <session-folder>
|
||||
session_id: <session-id>
|
||||
team_name: brainstorm
|
||||
requirement: <topic-description>
|
||||
agent_name: ideator-<N>
|
||||
inner_loop: false
|
||||
|
||||
## Primary Directive
|
||||
Skill(skill="team-brainstorm", args="--role=ideator --agent-name=ideator-<N>")
|
||||
|
||||
Current topic: <topic-description>
|
||||
Session: <session-folder>
|
||||
|
||||
## Role Guidelines
|
||||
- Only process tasks where owner === "ideator-<N>" with IDEA-* prefix
|
||||
- All output prefixed with [ideator] identifier
|
||||
|
||||
## Workflow
|
||||
1. TaskList -> find tasks where owner === "ideator-<N>" with IDEA-* prefix
|
||||
2. Skill -> execute role definition
|
||||
3. team_msg + SendMessage results to coordinator
|
||||
4. TaskUpdate completed -> check next task`
|
||||
Read role_spec file to load Phase 2-4 domain instructions.
|
||||
Execute built-in Phase 1 (task discovery, owner=ideator-<N>) -> role-spec Phase 2-4 -> built-in Phase 5 (report).`
|
||||
})
|
||||
```
|
||||
|
||||
@@ -371,12 +354,40 @@ Session: <session-folder>
|
||||
|
||||
---
|
||||
|
||||
## Completion Action
|
||||
|
||||
When the pipeline completes (all tasks done, coordinator Phase 5):
|
||||
|
||||
```
|
||||
AskUserQuestion({
|
||||
questions: [{
|
||||
question: "Brainstorm pipeline complete. What would you like to do?",
|
||||
header: "Completion",
|
||||
multiSelect: false,
|
||||
options: [
|
||||
{ label: "Archive & Clean (Recommended)", description: "Archive session, clean up tasks and team resources" },
|
||||
{ label: "Keep Active", description: "Keep session active for follow-up work or inspection" },
|
||||
{ label: "Export Results", description: "Export deliverables to a specified location, then clean" }
|
||||
]
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
| Choice | Action |
|
||||
|--------|--------|
|
||||
| Archive & Clean | Update session status="completed" -> TeamDelete(brainstorm) -> output final summary |
|
||||
| Keep Active | Update session status="paused" -> output resume instructions: `Skill(skill="team-brainstorm", args="resume")` |
|
||||
| Export Results | AskUserQuestion for target path -> copy deliverables -> Archive & Clean |
|
||||
|
||||
---
|
||||
|
||||
## Unified Session Directory
|
||||
|
||||
```
|
||||
.workflow/.team/BRS-<slug>-<YYYY-MM-DD>/
|
||||
├── team-session.json # Session state
|
||||
├── shared-memory.json # Cumulative: generated_ideas / critique_insights / synthesis_themes / evaluation_scores
|
||||
├── .msg/
|
||||
│ ├── messages.jsonl # Message bus log
|
||||
│ └── meta.json # Session state + cross-role state
|
||||
├── wisdom/ # Cross-task knowledge
|
||||
│ ├── learnings.md
|
||||
│ ├── decisions.md
|
||||
|
||||
63
.claude/skills/team-brainstorm/role-specs/challenger.md
Normal file
63
.claude/skills/team-brainstorm/role-specs/challenger.md
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
prefix: CHALLENGE
|
||||
inner_loop: false
|
||||
subagents: []
|
||||
message_types:
|
||||
success: critique_ready
|
||||
error: error
|
||||
---
|
||||
|
||||
# Challenger
|
||||
|
||||
Devil's advocate role. Assumption challenging, feasibility questioning, risk identification. Acts as the Critic in the Generator-Critic loop.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| Ideas | <session>/ideas/*.md files | Yes |
|
||||
| Previous critiques | <session>/.msg/meta.json critique_insights | No |
|
||||
|
||||
1. Extract session path from task description (match "Session: <path>")
|
||||
2. Glob idea files from <session>/ideas/
|
||||
3. Read all idea files for analysis
|
||||
4. Read .msg/meta.json critique_insights to avoid repeating past challenges
|
||||
|
||||
## Phase 3: Critical Analysis
|
||||
|
||||
**Challenge Dimensions** (apply to each idea):
|
||||
|
||||
| Dimension | Focus |
|
||||
|-----------|-------|
|
||||
| Assumption Validity | Does the core assumption hold? 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 |
|
||||
| All MEDIUM or lower | CONVERGED |
|
||||
|
||||
**Output**: Write to `<session>/critiques/critique-<num>.md`
|
||||
- Sections: Ideas Reviewed, Per-idea challenges with severity, Summary table with counts, GC Signal
|
||||
|
||||
## Phase 4: Severity Summary
|
||||
|
||||
1. Count challenges by severity level
|
||||
2. Determine signal: REVISION_NEEDED if critical+high > 0, else CONVERGED
|
||||
3. Update shared state:
|
||||
- Append challenges to .msg/meta.json critique_insights
|
||||
- Each entry: idea, severity, key_challenge, round
|
||||
58
.claude/skills/team-brainstorm/role-specs/evaluator.md
Normal file
58
.claude/skills/team-brainstorm/role-specs/evaluator.md
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
prefix: EVAL
|
||||
inner_loop: false
|
||||
subagents: []
|
||||
message_types:
|
||||
success: evaluation_ready
|
||||
error: error
|
||||
---
|
||||
|
||||
# Evaluator
|
||||
|
||||
Scoring, ranking, and final selection. Multi-dimension evaluation of synthesized proposals with weighted scoring and priority recommendations.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| Synthesis results | <session>/synthesis/*.md files | Yes |
|
||||
| All ideas | <session>/ideas/*.md files | No (for context) |
|
||||
| All critiques | <session>/critiques/*.md files | No (for context) |
|
||||
|
||||
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**: `(Feasibility * 0.30) + (Innovation * 0.25) + (Impact * 0.25) + (Cost * 0.20)`
|
||||
|
||||
**Per-Proposal Evaluation**:
|
||||
- Score each dimension (1-10) with rationale
|
||||
- Overall recommendation: Strong Recommend / Recommend / Consider / Pass
|
||||
|
||||
**Output**: Write to `<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 to reflect critique findings |
|
||||
| Ranking deterministic | Consistent ranking | Verify calculation |
|
||||
|
||||
After passing checks, update shared state:
|
||||
- Set .msg/meta.json evaluation_scores
|
||||
- Each entry: title, weighted_score, rank, recommendation
|
||||
71
.claude/skills/team-brainstorm/role-specs/ideator.md
Normal file
71
.claude/skills/team-brainstorm/role-specs/ideator.md
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
prefix: IDEA
|
||||
inner_loop: false
|
||||
subagents: []
|
||||
message_types:
|
||||
success: ideas_ready
|
||||
error: error
|
||||
---
|
||||
|
||||
# Ideator
|
||||
|
||||
Multi-angle idea generator. Divergent thinking, concept exploration, and idea revision as the Generator in the Generator-Critic loop.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| Topic | <session>/.msg/meta.json | Yes |
|
||||
| Angles | <session>/.msg/meta.json | Yes |
|
||||
| GC Round | <session>/.msg/meta.json | Yes |
|
||||
| Previous critique | <session>/critiques/*.md | For revision tasks only |
|
||||
| Previous ideas | <session>/.msg/meta.json generated_ideas | No |
|
||||
|
||||
1. Extract session path from task description (match "Session: <path>")
|
||||
2. Read .msg/meta.json for topic, angles, gc_round
|
||||
3. Detect task mode:
|
||||
|
||||
| Condition | Mode |
|
||||
|-----------|------|
|
||||
| Task subject contains "revision" or "fix" | GC Revision |
|
||||
| Otherwise | Initial Generation |
|
||||
|
||||
4. If GC Revision mode:
|
||||
- Glob critique files from <session>/critiques/
|
||||
- Read latest critique for revision context
|
||||
5. Read previous ideas from .msg/meta.json generated_ideas state
|
||||
|
||||
## Phase 3: Idea Generation
|
||||
|
||||
### Mode Router
|
||||
|
||||
| Mode | Focus |
|
||||
|------|-------|
|
||||
| Initial Generation | Multi-angle divergent thinking, no prior critique |
|
||||
| GC Revision | Address HIGH/CRITICAL challenges from critique |
|
||||
|
||||
**Initial Generation**:
|
||||
- For each angle, generate 3+ ideas
|
||||
- Each idea: title, description (2-3 sentences), key assumption, potential impact, implementation hint
|
||||
|
||||
**GC Revision**:
|
||||
- Focus on HIGH/CRITICAL severity challenges from critique
|
||||
- Retain unchallenged ideas intact
|
||||
- Revise ideas with revision rationale
|
||||
- Replace unsalvageable ideas with new alternatives
|
||||
|
||||
**Output**: Write to `<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 |
|
||||
|
||||
After passing checks, update shared state:
|
||||
- Append new ideas to .msg/meta.json generated_ideas
|
||||
- Each entry: id, title, round, revised flag
|
||||
59
.claude/skills/team-brainstorm/role-specs/synthesizer.md
Normal file
59
.claude/skills/team-brainstorm/role-specs/synthesizer.md
Normal file
@@ -0,0 +1,59 @@
|
||||
---
|
||||
prefix: SYNTH
|
||||
inner_loop: false
|
||||
subagents: []
|
||||
message_types:
|
||||
success: synthesis_ready
|
||||
error: error
|
||||
---
|
||||
|
||||
# Synthesizer
|
||||
|
||||
Cross-idea integrator. Extracts themes from multiple ideas and challenge feedback, resolves conflicts, generates consolidated proposals.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| All ideas | <session>/ideas/*.md files | Yes |
|
||||
| All critiques | <session>/critiques/*.md files | Yes |
|
||||
| GC rounds completed | <session>/.msg/meta.json gc_round | Yes |
|
||||
|
||||
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 (topic, gc_round, generated_ideas, critique_insights)
|
||||
|
||||
## Phase 3: Synthesis Execution
|
||||
|
||||
| Step | Action |
|
||||
|------|--------|
|
||||
| 1. Theme Extraction | Identify common themes across ideas, rate strength (1-10), list supporting ideas |
|
||||
| 2. Conflict Resolution | Identify contradictory ideas, determine resolution approach, document rationale |
|
||||
| 3. Complementary Grouping | Group complementary ideas together |
|
||||
| 4. Gap Identification | Discover uncovered perspectives |
|
||||
| 5. Integrated Proposal | Generate 1-3 consolidated proposals |
|
||||
|
||||
**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**: Write to `<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 |
|
||||
|
||||
After passing checks, update shared state:
|
||||
- Set .msg/meta.json synthesis_themes
|
||||
- Each entry: name, strength, supporting_ideas
|
||||
@@ -15,7 +15,7 @@
|
||||
- 仅处理 `CHALLENGE-*` 前缀的任务
|
||||
- 所有输出必须带 `[challenger]` 标识
|
||||
- 仅通过 SendMessage 与 coordinator 通信
|
||||
- Phase 2 读取 shared-memory.json,Phase 5 写入 critique_insights
|
||||
- Phase 2 读取 .msg/meta.json,Phase 5 写入 critique_insights
|
||||
- 为每个创意标记挑战严重度 (LOW/MEDIUM/HIGH/CRITICAL)
|
||||
|
||||
### MUST NOT
|
||||
@@ -23,7 +23,7 @@
|
||||
- 生成创意、综合想法或评估排序
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务
|
||||
- 修改 shared-memory.json 中不属于自己的字段
|
||||
- 修改 .msg/meta.json 中不属于自己的字段
|
||||
- 在输出中省略 `[challenger]` 标识
|
||||
|
||||
---
|
||||
@@ -37,7 +37,7 @@
|
||||
| `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 shared-memory.json, idea files |
|
||||
| `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 |
|
||||
@@ -59,19 +59,17 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
session_id: <session-id>,
|
||||
from: "challenger",
|
||||
to: "coordinator",
|
||||
type: "critique_ready",
|
||||
summary: "[challenger] Critique complete: <critical>C/<high>H/<medium>M/<low>L -- Signal: <signal>",
|
||||
ref: <output-path>
|
||||
data: {ref: <output-path>}
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from challenger --to coordinator --type critique_ready --summary \"[challenger] Critique complete\" --ref <output-path> --json")
|
||||
Bash("ccw team log --session-id <session-id> --from challenger --type critique_ready --json")
|
||||
```
|
||||
|
||||
---
|
||||
@@ -90,14 +88,14 @@ Standard task discovery flow: TaskList -> filter by prefix `CHALLENGE-*` + owner
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| Ideas | ideas/*.md files | Yes |
|
||||
| Previous critiques | shared-memory.json.critique_insights | No (avoid repeating) |
|
||||
| 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 shared-memory.json.critique_insights to avoid repeating
|
||||
4. Read .msg/meta.json.critique_insights to avoid repeating
|
||||
|
||||
### Phase 3: Critical Analysis
|
||||
|
||||
@@ -151,7 +149,7 @@ Standard task discovery flow: TaskList -> filter by prefix `CHALLENGE-*` + owner
|
||||
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 shared-memory.json.critique_insights
|
||||
1. Append challenges to .msg/meta.json.critique_insights
|
||||
2. Each entry: idea, severity, key_challenge, round
|
||||
|
||||
---
|
||||
|
||||
@@ -47,20 +47,16 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
session_id: <session-id>,
|
||||
from: "coordinator",
|
||||
to: <recipient>,
|
||||
type: <message-type>,
|
||||
summary: "[coordinator] <action> complete: <subject>",
|
||||
ref: <artifact-path>
|
||||
data: {ref: <artifact-path>}
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
`to` and `summary` auto-defaulted -- do NOT specify explicitly.
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from coordinator --to <recipient> --type <message-type> --summary \"[coordinator] <action> complete\" --ref <artifact-path> --json")
|
||||
```
|
||||
**CLI fallback**: `ccw team log --session-id <session-id> --from coordinator --type <type> --json`
|
||||
|
||||
---
|
||||
|
||||
@@ -147,8 +143,8 @@ For callback/check/resume: load monitor logic and execute the appropriate handle
|
||||
2. Create session folder structure
|
||||
3. Call TeamCreate with team name
|
||||
4. Initialize subdirectories: ideas/, critiques/, synthesis/, evaluation/
|
||||
5. Initialize shared-memory.json with: topic, pipeline, angles, gc_round, generated_ideas, critique_insights, synthesis_themes, evaluation_scores
|
||||
6. Write team-session.json with: session_id, team_name, topic, pipeline, status="active", created_at, updated_at
|
||||
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.
|
||||
@@ -219,9 +215,9 @@ For callback/check/resume: load monitor logic and execute the appropriate handle
|
||||
**GC Round Tracking**:
|
||||
1. Read critique file
|
||||
2. Count severity: HIGH and CRITICAL
|
||||
3. Read shared-memory.json for gc_round
|
||||
3. Read .msg/meta.json for gc_round
|
||||
4. If criticalCount > 0 AND gcRound < max_gc_rounds:
|
||||
- Increment gc_round in shared-memory.json
|
||||
- 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
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
# Command: Dispatch
|
||||
|
||||
Create the brainstorm task chain with correct dependencies and structured task descriptions based on selected pipeline mode.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| User topic | From coordinator Phase 1 | Yes |
|
||||
| Session folder | From coordinator Phase 2 | Yes |
|
||||
| Pipeline mode | From session.json pipeline | Yes |
|
||||
| Angles | From session.json angles | Yes |
|
||||
|
||||
1. Load topic, pipeline mode, and angles from session.json
|
||||
2. Determine task chain from pipeline mode
|
||||
|
||||
## Phase 3: Task Chain Creation
|
||||
|
||||
### Task Description Template
|
||||
|
||||
Every task description uses structured format:
|
||||
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "<TASK-ID>",
|
||||
owner: "<role>",
|
||||
description: "PURPOSE: <what this task achieves> | Success: <completion criteria>
|
||||
TASK:
|
||||
- <step 1>
|
||||
- <step 2>
|
||||
- <step 3>
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Topic: <topic>
|
||||
- Angles: <angle-list>
|
||||
- Upstream artifacts: <artifact-list>
|
||||
EXPECTED: <deliverable path> + <quality criteria>
|
||||
CONSTRAINTS: <scope limits>
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: [<dependency-list>],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
### Pipeline Router
|
||||
|
||||
| Mode | Action |
|
||||
|------|--------|
|
||||
| quick | Create 3 tasks (IDEA -> CHALLENGE -> SYNTH) |
|
||||
| deep | Create 6 tasks (IDEA -> CHALLENGE -> IDEA-fix -> CHALLENGE-2 -> SYNTH -> EVAL) |
|
||||
| full | Create 7 tasks (3 parallel IDEAs -> CHALLENGE -> IDEA-fix -> SYNTH -> EVAL) |
|
||||
|
||||
---
|
||||
|
||||
### Quick Pipeline
|
||||
|
||||
**IDEA-001** (ideator):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "IDEA-001",
|
||||
owner: "ideator",
|
||||
description: "PURPOSE: Generate multi-angle ideas for brainstorm topic | Success: >= 6 unique ideas across all angles
|
||||
TASK:
|
||||
- Read topic and angles from session context
|
||||
- Generate 3+ ideas per angle with title, description, assumption, impact
|
||||
- Self-review for coverage and uniqueness
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Topic: <topic>
|
||||
- Angles: <angle-list>
|
||||
EXPECTED: <session>/ideas/idea-001.md with >= 6 ideas
|
||||
CONSTRAINTS: Divergent thinking only, no evaluation
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: [],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
**CHALLENGE-001** (challenger):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "CHALLENGE-001",
|
||||
owner: "challenger",
|
||||
description: "PURPOSE: Challenge assumptions and assess feasibility of generated ideas | Success: Each idea rated by severity
|
||||
TASK:
|
||||
- Read all idea files from ideas/ directory
|
||||
- Challenge each idea across 4 dimensions (assumption, feasibility, risk, competition)
|
||||
- Assign severity (CRITICAL/HIGH/MEDIUM/LOW) per idea
|
||||
- Determine GC signal (REVISION_NEEDED or CONVERGED)
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Upstream artifacts: ideas/idea-001.md
|
||||
EXPECTED: <session>/critiques/critique-001.md with severity table and GC signal
|
||||
CONSTRAINTS: Critical analysis only, do not generate alternative ideas
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["IDEA-001"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
**SYNTH-001** (synthesizer):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "SYNTH-001",
|
||||
owner: "synthesizer",
|
||||
description: "PURPOSE: Synthesize ideas and critiques into integrated proposals | Success: >= 1 consolidated proposal
|
||||
TASK:
|
||||
- Read all ideas and critiques
|
||||
- Extract themes, resolve conflicts, group complementary ideas
|
||||
- Generate 1-3 integrated proposals with feasibility and innovation scores
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Upstream artifacts: ideas/*.md, critiques/*.md
|
||||
EXPECTED: <session>/synthesis/synthesis-001.md with proposals
|
||||
CONSTRAINTS: Integration and synthesis only, no new ideas
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["CHALLENGE-001"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
### Deep Pipeline
|
||||
|
||||
Creates all 6 tasks. First 2 same as Quick, then:
|
||||
|
||||
**IDEA-002** (ideator, GC revision):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "IDEA-002",
|
||||
owner: "ideator",
|
||||
description: "PURPOSE: Revise ideas based on critique feedback (GC Round 1) | Success: HIGH/CRITICAL challenges addressed
|
||||
TASK:
|
||||
- Read critique feedback from critiques/
|
||||
- Revise challenged ideas, replace unsalvageable ones
|
||||
- Retain unchallenged ideas intact
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Upstream artifacts: critiques/critique-001.md
|
||||
EXPECTED: <session>/ideas/idea-002.md with revised ideas
|
||||
CONSTRAINTS: Address critique only, focused revision
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["CHALLENGE-001"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
**CHALLENGE-002** (challenger, round 2):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "CHALLENGE-002",
|
||||
owner: "challenger",
|
||||
description: "PURPOSE: Validate revised ideas (GC Round 2) | Success: Severity assessment of revised ideas
|
||||
TASK:
|
||||
- Read revised idea files
|
||||
- Re-evaluate previously challenged ideas
|
||||
- Assess new replacement ideas
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Upstream artifacts: ideas/idea-002.md
|
||||
EXPECTED: <session>/critiques/critique-002.md
|
||||
CONSTRAINTS: Focus on revised/new ideas
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["IDEA-002"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
**SYNTH-001** blocked by CHALLENGE-002. **EVAL-001** blocked by SYNTH-001:
|
||||
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "EVAL-001",
|
||||
owner: "evaluator",
|
||||
description: "PURPOSE: Score and rank synthesized proposals | Success: Ranked list with weighted scores
|
||||
TASK:
|
||||
- Read synthesis results
|
||||
- Score each proposal across 4 dimensions (Feasibility 30%, Innovation 25%, Impact 25%, Cost 20%)
|
||||
- Generate final ranking and recommendation
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Upstream artifacts: synthesis/synthesis-001.md
|
||||
EXPECTED: <session>/evaluation/evaluation-001.md with scoring matrix
|
||||
CONSTRAINTS: Evaluation only, no new proposals
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["SYNTH-001"],
|
||||
status: "pending"
|
||||
})
|
||||
```
|
||||
|
||||
### Full Pipeline
|
||||
|
||||
Creates 7 tasks. Parallel ideators:
|
||||
|
||||
| Task | Owner | BlockedBy |
|
||||
|------|-------|-----------|
|
||||
| IDEA-001 | ideator-1 | (none) |
|
||||
| IDEA-002 | ideator-2 | (none) |
|
||||
| IDEA-003 | ideator-3 | (none) |
|
||||
| CHALLENGE-001 | challenger | IDEA-001, IDEA-002, IDEA-003 |
|
||||
| IDEA-004 | ideator | CHALLENGE-001 |
|
||||
| SYNTH-001 | synthesizer | IDEA-004 |
|
||||
| EVAL-001 | evaluator | SYNTH-001 |
|
||||
|
||||
Each parallel IDEA task scoped to a specific angle from the angles list.
|
||||
|
||||
## Phase 4: Validation
|
||||
|
||||
1. Verify all tasks created with `TaskList()`
|
||||
2. Check dependency chain integrity:
|
||||
- No circular dependencies
|
||||
- All blockedBy references exist
|
||||
- First task(s) have empty blockedBy
|
||||
3. Log task count and pipeline mode
|
||||
@@ -0,0 +1,165 @@
|
||||
# Command: Monitor
|
||||
|
||||
Handle all coordinator monitoring events: worker callbacks, status checks, pipeline advancement, Generator-Critic loop control, and completion.
|
||||
|
||||
## Constants
|
||||
|
||||
| Key | Value |
|
||||
|-----|-------|
|
||||
| SPAWN_MODE | background |
|
||||
| ONE_STEP_PER_INVOCATION | true |
|
||||
| WORKER_AGENT | team-worker |
|
||||
| MAX_GC_ROUNDS | 2 |
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session state | <session>/session.json | Yes |
|
||||
| Task list | TaskList() | Yes |
|
||||
| Trigger event | From Entry Router detection | Yes |
|
||||
| Meta state | <session>/.msg/meta.json | Yes |
|
||||
|
||||
1. Load session.json for current state, pipeline mode, gc_round
|
||||
2. Run TaskList() to get current task statuses
|
||||
3. Identify trigger event type from Entry Router
|
||||
|
||||
## Phase 3: Event Handlers
|
||||
|
||||
### handleCallback
|
||||
|
||||
Triggered when a worker sends completion message.
|
||||
|
||||
1. Parse message to identify role and task ID:
|
||||
|
||||
| Message Pattern | Role Detection |
|
||||
|----------------|---------------|
|
||||
| `[ideator]` or task ID `IDEA-*` | ideator |
|
||||
| `[challenger]` or task ID `CHALLENGE-*` | challenger |
|
||||
| `[synthesizer]` or task ID `SYNTH-*` | synthesizer |
|
||||
| `[evaluator]` or task ID `EVAL-*` | evaluator |
|
||||
|
||||
2. Mark task as completed:
|
||||
|
||||
```
|
||||
TaskUpdate({ taskId: "<task-id>", status: "completed" })
|
||||
```
|
||||
|
||||
3. Record completion in session state
|
||||
|
||||
4. **Generator-Critic check** (when challenger completes):
|
||||
- If completed task is CHALLENGE-* AND pipeline is deep or full:
|
||||
- Read critique file for GC signal
|
||||
- Read .msg/meta.json for gc_round
|
||||
|
||||
| GC Signal | gc_round < max | Action |
|
||||
|-----------|----------------|--------|
|
||||
| REVISION_NEEDED | Yes | Increment gc_round, unblock IDEA-fix task |
|
||||
| REVISION_NEEDED | No (>= max) | Force convergence, unblock SYNTH |
|
||||
| CONVERGED | - | Unblock SYNTH (skip remaining GC tasks) |
|
||||
|
||||
- Log team_msg with type "gc_loop_trigger" or "task_unblocked"
|
||||
- If skipping GC tasks, mark them as completed (skip)
|
||||
|
||||
5. Proceed to handleSpawnNext
|
||||
|
||||
### handleSpawnNext
|
||||
|
||||
Find and spawn the next ready tasks.
|
||||
|
||||
1. Scan task list for tasks where:
|
||||
- Status is "pending"
|
||||
- All blockedBy tasks have status "completed"
|
||||
|
||||
2. For each ready task, spawn team-worker:
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker for <task-id>",
|
||||
team_name: "brainstorm",
|
||||
name: "<role>",
|
||||
run_in_background: true,
|
||||
prompt: `## Role Assignment
|
||||
role: <role>
|
||||
role_spec: .claude/skills/team-brainstorm/role-specs/<role>.md
|
||||
session: <session-folder>
|
||||
session_id: <session-id>
|
||||
team_name: brainstorm
|
||||
requirement: <task-description>
|
||||
inner_loop: false
|
||||
|
||||
Read role_spec file to load Phase 2-4 domain instructions.
|
||||
Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
|
||||
})
|
||||
```
|
||||
|
||||
3. **Parallel spawn rules**:
|
||||
|
||||
| Pipeline | Scenario | Spawn Behavior |
|
||||
|----------|----------|---------------|
|
||||
| Quick | Single sequential | One worker at a time |
|
||||
| Deep | Sequential with GC | One worker at a time |
|
||||
| Full | IDEA-001/002/003 unblocked | Spawn ALL 3 ideator workers in parallel |
|
||||
| Full | Other stages | One worker at a time |
|
||||
|
||||
4. STOP after spawning -- wait for next callback
|
||||
|
||||
### handleCheck
|
||||
|
||||
Output current pipeline status. Do NOT advance pipeline.
|
||||
|
||||
```
|
||||
Pipeline Status (<pipeline-mode>):
|
||||
[DONE] IDEA-001 (ideator) -> ideas/idea-001.md
|
||||
[DONE] CHALLENGE-001 (challenger) -> critiques/critique-001.md
|
||||
[RUN] SYNTH-001 (synthesizer) -> synthesizing...
|
||||
[WAIT] EVAL-001 (evaluator) -> blocked by SYNTH-001
|
||||
|
||||
GC Rounds: <gc_round>/<max_gc_rounds>
|
||||
Session: <session-id>
|
||||
```
|
||||
|
||||
### handleResume
|
||||
|
||||
Resume pipeline after user pause or interruption.
|
||||
|
||||
1. Audit task list for inconsistencies:
|
||||
- Tasks stuck in "in_progress" -> reset to "pending"
|
||||
- Tasks with completed blockers but still "pending" -> include in spawn list
|
||||
2. Proceed to handleSpawnNext
|
||||
|
||||
### handleConsensus
|
||||
|
||||
Handle consensus_blocked signals.
|
||||
|
||||
| Severity | Action |
|
||||
|----------|--------|
|
||||
| HIGH | Pause pipeline, notify user with findings summary |
|
||||
| MEDIUM | Log finding, attempt to continue |
|
||||
| LOW | Log finding, continue pipeline |
|
||||
|
||||
### handleComplete
|
||||
|
||||
Triggered when all pipeline tasks are completed.
|
||||
|
||||
**Completion check by mode**:
|
||||
|
||||
| Mode | Completion Condition |
|
||||
|------|---------------------|
|
||||
| quick | All 3 tasks completed |
|
||||
| deep | All 6 tasks (+ any skipped GC tasks) completed |
|
||||
| full | All 7 tasks (+ any skipped GC tasks) completed |
|
||||
|
||||
1. Verify all tasks completed via TaskList()
|
||||
2. If any tasks not completed, return to handleSpawnNext
|
||||
3. If all completed, transition to coordinator Phase 5 (Report + Completion Action)
|
||||
|
||||
## Phase 4: State Persistence
|
||||
|
||||
After every handler execution:
|
||||
|
||||
1. Update session.json with current state (gc_round, last event, active tasks)
|
||||
2. Update .msg/meta.json gc_round if changed
|
||||
3. Verify task list consistency
|
||||
4. STOP and wait for next event
|
||||
317
.claude/skills/team-brainstorm/roles/coordinator/role.md
Normal file
317
.claude/skills/team-brainstorm/roles/coordinator/role.md
Normal file
@@ -0,0 +1,317 @@
|
||||
# Coordinator - Brainstorm Team
|
||||
|
||||
**Role**: coordinator
|
||||
**Type**: Orchestrator
|
||||
**Team**: brainstorm
|
||||
|
||||
Orchestrates the brainstorming pipeline: topic clarification, complexity assessment, pipeline selection, Generator-Critic loop control, and convergence monitoring. Spawns team-worker agents for all worker roles.
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- Use `team-worker` agent type for all worker spawns (NOT `general-purpose`)
|
||||
- Follow Command Execution Protocol for dispatch and monitor commands
|
||||
- Respect pipeline stage dependencies (blockedBy)
|
||||
- Stop after spawning workers -- wait for callbacks
|
||||
- Manage Generator-Critic loop count (max 2 rounds)
|
||||
- Execute completion action in Phase 5
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- Generate ideas, challenge assumptions, synthesize, or evaluate -- workers handle this
|
||||
- Spawn workers without creating tasks first
|
||||
- Force-advance pipeline past GC loop decisions
|
||||
- Modify artifact files (ideas/*.md, critiques/*.md, etc.) -- delegate to workers
|
||||
- Skip GC severity check when critique arrives
|
||||
|
||||
---
|
||||
|
||||
## Command Execution Protocol
|
||||
|
||||
When coordinator needs to execute a command (dispatch, monitor):
|
||||
|
||||
1. **Read the command file**: `roles/coordinator/commands/<command-name>.md`
|
||||
2. **Follow the workflow** defined in the command file (Phase 2-4 structure)
|
||||
3. **Commands are inline execution guides** -- NOT separate agents or subprocesses
|
||||
4. **Execute synchronously** -- complete the command workflow before proceeding
|
||||
|
||||
Example:
|
||||
```
|
||||
Phase 3 needs task dispatch
|
||||
-> Read roles/coordinator/commands/dispatch.md
|
||||
-> Execute Phase 2 (Context Loading)
|
||||
-> Execute Phase 3 (Task Chain Creation)
|
||||
-> Execute Phase 4 (Validation)
|
||||
-> Continue to Phase 4
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Entry Router
|
||||
|
||||
When coordinator is invoked, detect invocation type:
|
||||
|
||||
| Detection | Condition | Handler |
|
||||
|-----------|-----------|---------|
|
||||
| Worker callback | Message contains role tag [ideator], [challenger], [synthesizer], [evaluator] | -> handleCallback |
|
||||
| Consensus blocked | Message contains "consensus_blocked" | -> handleConsensus |
|
||||
| Status check | Arguments contain "check" or "status" | -> handleCheck |
|
||||
| Manual resume | Arguments contain "resume" or "continue" | -> handleResume |
|
||||
| Pipeline complete | All tasks have status "completed" | -> handleComplete |
|
||||
| Interrupted session | Active/paused session exists | -> Phase 0 (Resume Check) |
|
||||
| New session | None of above | -> Phase 1 (Topic Clarification) |
|
||||
|
||||
For callback/check/resume/complete: load `commands/monitor.md` and execute matched handler, then STOP.
|
||||
|
||||
### Router Implementation
|
||||
|
||||
1. **Load session context** (if exists):
|
||||
- Scan `.workflow/.team/BRS-*/.msg/meta.json` for active/paused sessions
|
||||
- If found, extract session folder path, status, and pipeline mode
|
||||
|
||||
2. **Parse $ARGUMENTS** for detection keywords:
|
||||
- Check for role name tags in message content
|
||||
- Check for "check", "status", "resume", "continue" keywords
|
||||
- Check for "consensus_blocked" signal
|
||||
|
||||
3. **Route to handler**:
|
||||
- For monitor handlers: Read `commands/monitor.md`, execute matched handler, STOP
|
||||
- For Phase 0: Execute Session Resume Check below
|
||||
- For Phase 1: Execute Topic Clarification below
|
||||
|
||||
---
|
||||
|
||||
## Phase 0: Session Resume Check
|
||||
|
||||
Triggered when an active/paused session is detected on coordinator entry.
|
||||
|
||||
1. Load session.json from detected session folder
|
||||
2. Audit task list:
|
||||
|
||||
```
|
||||
TaskList()
|
||||
```
|
||||
|
||||
3. Reconcile session state vs task status:
|
||||
|
||||
| Task Status | Session Expects | Action |
|
||||
|-------------|----------------|--------|
|
||||
| in_progress | Should be running | Reset to pending (worker was interrupted) |
|
||||
| completed | Already tracked | Skip |
|
||||
| pending + unblocked | Ready to run | Include in spawn list |
|
||||
|
||||
4. Rebuild team if not active:
|
||||
|
||||
```
|
||||
TeamCreate({ team_name: "brainstorm" })
|
||||
```
|
||||
|
||||
5. Spawn workers for ready tasks -> Phase 4 coordination loop
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: Topic Clarification + Complexity Assessment
|
||||
|
||||
1. Parse user task description from $ARGUMENTS
|
||||
2. Parse optional `--team-name` flag (default: "brainstorm")
|
||||
|
||||
3. 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 |
|
||||
|
||||
4. Ask for missing parameters:
|
||||
|
||||
```
|
||||
AskUserQuestion({
|
||||
questions: [{
|
||||
question: "Select brainstorming pipeline mode",
|
||||
header: "Mode",
|
||||
multiSelect: false,
|
||||
options: [
|
||||
{ label: "quick", description: "3-step: generate -> challenge -> synthesize" },
|
||||
{ label: "deep", description: "6-step with Generator-Critic loop" },
|
||||
{ label: "full", description: "7-step parallel ideation + GC + evaluation" }
|
||||
]
|
||||
}, {
|
||||
question: "Select divergence angles",
|
||||
header: "Angles",
|
||||
multiSelect: true,
|
||||
options: [
|
||||
{ label: "Technical" },
|
||||
{ label: "Product" },
|
||||
{ label: "Innovation" },
|
||||
{ label: "Risk" }
|
||||
]
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
5. Store requirements: mode, scope, angles, constraints
|
||||
|
||||
---
|
||||
|
||||
## Phase 2: Session & Team Setup
|
||||
|
||||
1. Generate session ID: `BRS-<topic-slug>-<date>`
|
||||
2. Create session folder structure:
|
||||
|
||||
```
|
||||
Bash("mkdir -p .workflow/.team/<session-id>/ideas .workflow/.team/<session-id>/critiques .workflow/.team/<session-id>/synthesis .workflow/.team/<session-id>/evaluation .workflow/.team/<session-id>/wisdom .workflow/.team/<session-id>/.msg")
|
||||
```
|
||||
|
||||
3. Write session.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "active",
|
||||
"team_name": "brainstorm",
|
||||
"topic": "<topic>",
|
||||
"pipeline": "<quick|deep|full>",
|
||||
"angles": ["<angle1>", "<angle2>"],
|
||||
"gc_round": 0,
|
||||
"max_gc_rounds": 2,
|
||||
"timestamp": "<ISO-8601>"
|
||||
}
|
||||
```
|
||||
|
||||
4. Initialize .msg/meta.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"session_id": "<session-id>",
|
||||
"team_name": "brainstorm",
|
||||
"topic": "<topic>",
|
||||
"pipeline": "<mode>",
|
||||
"angles": [],
|
||||
"gc_round": 0,
|
||||
"generated_ideas": [],
|
||||
"critique_insights": [],
|
||||
"synthesis_themes": [],
|
||||
"evaluation_scores": [],
|
||||
"status": "active"
|
||||
}
|
||||
```
|
||||
|
||||
5. Create team:
|
||||
|
||||
```
|
||||
TeamCreate({ team_name: "brainstorm" })
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Phase 3: Task Chain Creation
|
||||
|
||||
Execute `commands/dispatch.md` inline (Command Execution Protocol):
|
||||
|
||||
1. Read `roles/coordinator/commands/dispatch.md`
|
||||
2. Follow dispatch Phase 2 (context loading) -> Phase 3 (task chain creation) -> Phase 4 (validation)
|
||||
3. Result: all pipeline tasks created with correct blockedBy dependencies
|
||||
|
||||
---
|
||||
|
||||
## Phase 4: Spawn First Batch
|
||||
|
||||
Find first unblocked task(s) and spawn worker(s):
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn ideator worker",
|
||||
team_name: "brainstorm",
|
||||
name: "ideator",
|
||||
run_in_background: true,
|
||||
prompt: `## Role Assignment
|
||||
role: ideator
|
||||
role_spec: .claude/skills/team-brainstorm/role-specs/ideator.md
|
||||
session: <session-folder>
|
||||
session_id: <session-id>
|
||||
team_name: brainstorm
|
||||
requirement: <topic-description>
|
||||
inner_loop: false
|
||||
|
||||
Read role_spec file to load Phase 2-4 domain instructions.
|
||||
Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
|
||||
})
|
||||
```
|
||||
|
||||
For **Full pipeline** with parallel ideators, spawn N team-worker agents:
|
||||
|
||||
```
|
||||
// For each parallel IDEA task (IDEA-001, IDEA-002, IDEA-003)
|
||||
Task({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn ideator worker for IDEA-<N>",
|
||||
team_name: "brainstorm",
|
||||
name: "ideator-<N>",
|
||||
run_in_background: true,
|
||||
prompt: `## Role Assignment
|
||||
role: ideator
|
||||
role_spec: .claude/skills/team-brainstorm/role-specs/ideator.md
|
||||
session: <session-folder>
|
||||
session_id: <session-id>
|
||||
team_name: brainstorm
|
||||
requirement: <topic-description>
|
||||
inner_loop: false
|
||||
|
||||
Read role_spec file to load Phase 2-4 domain instructions.
|
||||
Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
|
||||
})
|
||||
```
|
||||
|
||||
**STOP** after spawning. Wait for worker callback.
|
||||
|
||||
All subsequent coordination handled by `commands/monitor.md` handlers.
|
||||
|
||||
---
|
||||
|
||||
## Phase 5: Report + Completion Action
|
||||
|
||||
1. Load session state -> count completed tasks, calculate duration
|
||||
2. List deliverables:
|
||||
|
||||
| Deliverable | Path |
|
||||
|-------------|------|
|
||||
| Ideas | <session>/ideas/*.md |
|
||||
| Critiques | <session>/critiques/*.md |
|
||||
| Synthesis | <session>/synthesis/*.md |
|
||||
| Evaluation | <session>/evaluation/*.md (deep/full only) |
|
||||
|
||||
3. Output pipeline summary: topic, pipeline mode, GC rounds, total ideas, key themes
|
||||
|
||||
4. **Completion Action** (interactive):
|
||||
|
||||
```
|
||||
AskUserQuestion({
|
||||
questions: [{
|
||||
question: "Brainstorm pipeline complete. What would you like to do?",
|
||||
header: "Completion",
|
||||
multiSelect: false,
|
||||
options: [
|
||||
{ label: "Archive & Clean (Recommended)", description: "Archive session, clean up tasks and team resources" },
|
||||
{ label: "Keep Active", description: "Keep session active for follow-up brainstorming" },
|
||||
{ label: "Export Results", description: "Export deliverables to a specified location, then clean" }
|
||||
]
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
5. Handle user choice:
|
||||
|
||||
| Choice | Steps |
|
||||
|--------|-------|
|
||||
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete("brainstorm") -> output final summary with artifact paths |
|
||||
| Keep Active | Update session status="paused" -> output: "Session paused. Resume with: Skill(skill='team-brainstorm', args='resume')" |
|
||||
| Export Results | AskUserQuestion for target directory -> copy all artifacts -> Archive & Clean flow |
|
||||
@@ -15,7 +15,7 @@
|
||||
- 仅处理 `EVAL-*` 前缀的任务
|
||||
- 所有输出必须带 `[evaluator]` 标识
|
||||
- 仅通过 SendMessage 与 coordinator 通信
|
||||
- Phase 2 读取 shared-memory.json,Phase 5 写入 evaluation_scores
|
||||
- Phase 2 读取 .msg/meta.json,Phase 5 写入 evaluation_scores
|
||||
- 使用标准化评分维度,确保评分可追溯
|
||||
- 为每个方案提供评分理由和推荐
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
- 生成新创意、挑战假设或综合整合
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务
|
||||
- 修改 shared-memory.json 中不属于自己的字段
|
||||
- 修改 .msg/meta.json 中不属于自己的字段
|
||||
- 在输出中省略 `[evaluator]` 标识
|
||||
|
||||
---
|
||||
@@ -38,7 +38,7 @@
|
||||
| `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 shared-memory.json, synthesis files, ideas, critiques |
|
||||
| `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 |
|
||||
@@ -60,19 +60,17 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
session_id: <session-id>,
|
||||
from: "evaluator",
|
||||
to: "coordinator",
|
||||
type: "evaluation_ready",
|
||||
summary: "[evaluator] Evaluation complete: Top pick \"<title>\" (<score>/10)",
|
||||
ref: <output-path>
|
||||
data: {ref: <output-path>}
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from evaluator --to coordinator --type evaluation_ready --summary \"[evaluator] Evaluation complete\" --ref <output-path> --json")
|
||||
Bash("ccw team log --session-id <session-id> --from evaluator --type evaluation_ready --json")
|
||||
```
|
||||
|
||||
---
|
||||
@@ -141,7 +139,7 @@ weightedScore = (Feasibility * 0.30) + (Innovation * 0.25) + (Impact * 0.25) + (
|
||||
Standard report flow: team_msg log -> SendMessage with `[evaluator]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
|
||||
|
||||
**Shared Memory Update**:
|
||||
1. Set shared-memory.json.evaluation_scores
|
||||
1. Set .msg/meta.json.evaluation_scores
|
||||
2. Each entry: title, weighted_score, rank, recommendation
|
||||
|
||||
---
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
- 仅处理 `IDEA-*` 前缀的任务
|
||||
- 所有输出(SendMessage、team_msg、日志)必须带 `[ideator]` 标识
|
||||
- 仅通过 SendMessage 与 coordinator 通信
|
||||
- Phase 2 读取 shared-memory.json,Phase 5 写入 generated_ideas
|
||||
- Phase 2 读取 .msg/meta.json,Phase 5 写入 generated_ideas
|
||||
- 针对每个指定角度产出至少3个创意
|
||||
|
||||
### MUST NOT
|
||||
@@ -23,7 +23,7 @@
|
||||
- 执行挑战/评估/综合等其他角色工作
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务(TaskCreate 是 coordinator 专属)
|
||||
- 修改 shared-memory.json 中不属于自己的字段
|
||||
- 修改 .msg/meta.json 中不属于自己的字段
|
||||
- 在输出中省略 `[ideator]` 标识
|
||||
|
||||
---
|
||||
@@ -37,7 +37,7 @@
|
||||
| `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 shared-memory.json, critique files |
|
||||
| `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 |
|
||||
@@ -60,19 +60,17 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
session_id: <session-id>,
|
||||
from: "ideator",
|
||||
to: "coordinator",
|
||||
type: <ideas_ready|ideas_revised>,
|
||||
summary: "[ideator] <Generated|Revised> <count> ideas (round <num>)",
|
||||
ref: <output-path>
|
||||
data: {ref: <output-path>}
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from ideator --to coordinator --type <message-type> --summary \"[ideator] ideas complete\" --ref <output-path> --json")
|
||||
Bash("ccw team log --session-id <session-id> --from ideator --type <message-type> --json")
|
||||
```
|
||||
|
||||
---
|
||||
@@ -92,20 +90,20 @@ For parallel instances, parse `--agent-name` from arguments for owner matching.
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| Topic | shared-memory.json | Yes |
|
||||
| Angles | shared-memory.json | Yes |
|
||||
| GC Round | shared-memory.json | 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 | shared-memory.json.generated_ideas | No |
|
||||
| Previous ideas | .msg/meta.json.generated_ideas | No |
|
||||
|
||||
**Loading steps**:
|
||||
|
||||
1. Extract session path from task description (match "Session: <path>")
|
||||
2. Read shared-memory.json for topic, angles, gc_round
|
||||
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 shared-memory.generated_ideas
|
||||
4. Read previous ideas from .msg/meta.json generated_ideas state
|
||||
|
||||
### Phase 3: Idea Generation
|
||||
|
||||
@@ -143,7 +141,7 @@ For parallel instances, parse `--agent-name` from arguments for owner matching.
|
||||
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 shared-memory.json.generated_ideas
|
||||
1. Append new ideas to .msg/meta.json.generated_ideas
|
||||
2. Each entry: id, title, round, revised flag
|
||||
|
||||
---
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
- 仅处理 `SYNTH-*` 前缀的任务
|
||||
- 所有输出必须带 `[synthesizer]` 标识
|
||||
- 仅通过 SendMessage 与 coordinator 通信
|
||||
- Phase 2 读取 shared-memory.json,Phase 5 写入 synthesis_themes
|
||||
- Phase 2 读取 .msg/meta.json,Phase 5 写入 synthesis_themes
|
||||
- 从所有创意和挑战中提取共同主题
|
||||
- 解决相互矛盾的想法,生成整合方案
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
- 生成新创意、挑战假设或评分排序
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务
|
||||
- 修改 shared-memory.json 中不属于自己的字段
|
||||
- 修改 .msg/meta.json 中不属于自己的字段
|
||||
- 在输出中省略 `[synthesizer]` 标识
|
||||
|
||||
---
|
||||
@@ -38,7 +38,7 @@
|
||||
| `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 shared-memory.json, idea files, critique files |
|
||||
| `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 |
|
||||
@@ -60,19 +60,17 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
session_id: <session-id>,
|
||||
from: "synthesizer",
|
||||
to: "coordinator",
|
||||
type: "synthesis_ready",
|
||||
summary: "[synthesizer] Synthesis complete: <themeCount> themes, <proposalCount> proposals",
|
||||
ref: <output-path>
|
||||
data: {ref: <output-path>}
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from synthesizer --to coordinator --type synthesis_ready --summary \"[synthesizer] Synthesis complete\" --ref <output-path> --json")
|
||||
Bash("ccw team log --session-id <session-id> --from synthesizer --type synthesis_ready --json")
|
||||
```
|
||||
|
||||
---
|
||||
@@ -92,7 +90,7 @@ Standard task discovery flow: TaskList -> filter by prefix `SYNTH-*` + owner mat
|
||||
| Session folder | Task description (Session: line) | Yes |
|
||||
| All ideas | ideas/*.md files | Yes |
|
||||
| All critiques | critiques/*.md files | Yes |
|
||||
| GC rounds completed | shared-memory.json.gc_round | Yes |
|
||||
| GC rounds completed | .msg/meta.json.gc_round | Yes |
|
||||
|
||||
**Loading steps**:
|
||||
|
||||
@@ -100,7 +98,7 @@ Standard task discovery flow: TaskList -> filter by prefix `SYNTH-*` + owner mat
|
||||
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 shared-memory.json for context
|
||||
5. Read .msg/meta.json for context
|
||||
|
||||
### Phase 3: Synthesis Execution
|
||||
|
||||
@@ -152,7 +150,7 @@ Standard task discovery flow: TaskList -> filter by prefix `SYNTH-*` + owner mat
|
||||
Standard report flow: team_msg log -> SendMessage with `[synthesizer]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
|
||||
|
||||
**Shared Memory Update**:
|
||||
1. Set shared-memory.json.synthesis_themes
|
||||
1. Set .msg/meta.json.synthesis_themes
|
||||
2. Each entry: name, strength, supporting_ideas
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user