mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-05 16:13:08 +08:00
Compare commits
30 Commits
copilot/fi
...
fix/assign
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6c7c14042 | ||
|
|
dc1dc87023 | ||
|
|
ed02874a99 | ||
|
|
60218f6bf3 | ||
|
|
6341ed43e1 | ||
|
|
1fb49c0e39 | ||
|
|
99a45e3136 | ||
|
|
bf057a927b | ||
|
|
bbdd1840de | ||
|
|
fd0c9efa4d | ||
|
|
fd847070d5 | ||
|
|
16bbfcd12a | ||
|
|
64e772f9b8 | ||
|
|
e9f8a72343 | ||
|
|
a82e45fcf1 | ||
|
|
ab9b8ecbc0 | ||
|
|
f389e3e6dd | ||
|
|
b203ada9c5 | ||
|
|
fb0f56bfc0 | ||
|
|
91fa594578 | ||
|
|
ffd5282932 | ||
|
|
5e96722c09 | ||
|
|
26bda9c634 | ||
|
|
a7ed0365f7 | ||
|
|
628578b2bb | ||
|
|
08564d487a | ||
|
|
747b509ec2 | ||
|
|
9cfd5c05fc | ||
|
|
25f766ef26 | ||
|
|
9613644fc4 |
@@ -16,8 +16,8 @@ Available CLI endpoints are dynamically defined by the config file
|
||||
- **File Modification**: @~/.ccw/workflows/file-modification.md
|
||||
|
||||
### Agent Calls
|
||||
- **Always use `run_in_background: false`** for Task tool agent calls: `Task({ subagent_type: "xxx", prompt: "...", run_in_background: false })` to ensure synchronous execution and immediate result visibility
|
||||
- **TaskOutput usage**: Only use `TaskOutput({ task_id: "xxx", block: false })` + sleep loop to poll completion status. NEVER read intermediate output during agent/CLI execution - wait for final result only
|
||||
- **Always use `run_in_background: false`** for Agent tool calls: `Agent({ subagent_type: "xxx", prompt: "...", run_in_background: false })` to ensure synchronous execution and immediate result visibility
|
||||
|
||||
|
||||
### CLI Tool Calls (ccw cli)
|
||||
- **Default**: CLI calls (`ccw cli`) default to background execution (`run_in_background: true`):
|
||||
@@ -27,7 +27,7 @@ Available CLI endpoints are dynamically defined by the config file
|
||||
run_in_background: true // Bash tool parameter, not ccw cli parameter
|
||||
})
|
||||
```
|
||||
- **CRITICAL — Agent-specific instructions ALWAYS override this default.** If an agent's definition file (`.claude/agents/*.md`) specifies `run_in_background: false`, that instruction takes highest priority. Subagents (Task tool agents) CANNOT receive hook callbacks, so they MUST use `run_in_background: false` for CLI calls that produce required results.
|
||||
- **CRITICAL — Agent-specific instructions ALWAYS override this default.** If an agent's definition file (`.claude/agents/*.md`) specifies `run_in_background: false`, that instruction takes highest priority. Subagents (Agent tool agents) CANNOT receive hook callbacks, so they MUST use `run_in_background: false` for CLI calls that produce required results.
|
||||
- **After CLI call (main conversation only)**: Stop output immediately - let CLI execute in background. **DO NOT use TaskOutput polling** - wait for hook callback to receive results
|
||||
|
||||
### CLI Analysis Calls
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
---
|
||||
name: team-worker
|
||||
description: |
|
||||
Unified worker agent for team-lifecycle-v5. Contains all shared team behavior
|
||||
Unified worker agent for team-lifecycle. Contains all shared team behavior
|
||||
(Phase 1 Task Discovery, Phase 5 Report + Fast-Advance, Message Bus, Consensus
|
||||
Handling, Inner Loop lifecycle). Loads role-specific Phase 2-4 logic from a
|
||||
role_spec markdown file passed in the prompt.
|
||||
|
||||
Examples:
|
||||
- Context: Coordinator spawns analyst worker
|
||||
user: "role: analyst\nrole_spec: .claude/skills/team-lifecycle-v5/role-specs/analyst.md\nsession: .workflow/.team/TLS-xxx"
|
||||
user: "role: analyst\nrole_spec: .claude/skills/team-lifecycle/role-specs/analyst.md\nsession: .workflow/.team/TLS-xxx"
|
||||
assistant: "Loading role spec, discovering RESEARCH-* tasks, executing Phase 2-4 domain logic"
|
||||
commentary: Agent parses prompt, loads role spec, runs built-in Phase 1 then role-specific Phase 2-4 then built-in Phase 5
|
||||
|
||||
- Context: Coordinator spawns writer worker with inner loop
|
||||
user: "role: writer\nrole_spec: .claude/skills/team-lifecycle-v5/role-specs/writer.md\ninner_loop: true"
|
||||
user: "role: writer\nrole_spec: .claude/skills/team-lifecycle/role-specs/writer.md\ninner_loop: true"
|
||||
assistant: "Loading role spec, processing all DRAFT-* tasks in inner loop"
|
||||
commentary: Agent detects inner_loop=true, loops Phase 1-5 for each same-prefix task
|
||||
color: green
|
||||
---
|
||||
|
||||
You are a **team-lifecycle-v5 worker agent**. You execute a specific role within a team pipeline. Your behavior is split into:
|
||||
You are a **team-lifecycle worker agent**. You execute a specific role within a team pipeline. Your behavior is split into:
|
||||
|
||||
- **Built-in phases** (Phase 1, Phase 5): Task discovery, reporting, fast-advance, inner loop — defined below.
|
||||
- **Role-specific phases** (Phase 2-4): Loaded from a role_spec markdown file.
|
||||
@@ -35,7 +35,7 @@ Parse the following fields from your prompt:
|
||||
| `role` | Yes | Role name (analyst, writer, planner, executor, tester, reviewer, architect, fe-developer, fe-qa) |
|
||||
| `role_spec` | Yes | Path to role-spec .md file containing Phase 2-4 instructions |
|
||||
| `session` | Yes | Session folder path (e.g., `.workflow/.team/TLS-xxx-2026-02-27`) |
|
||||
| `session_id` | Yes | Session ID (folder name, e.g., `TLS-xxx-2026-02-27`) |
|
||||
| `session_id` | Yes | Session ID (folder name, e.g., `TLS-xxx-2026-02-27`). Used directly as `session_id` param for all message bus operations |
|
||||
| `team_name` | Yes | Team name for SendMessage |
|
||||
| `requirement` | Yes | Original task/requirement description |
|
||||
| `inner_loop` | Yes | `true` or `false` — whether to loop through same-prefix tasks |
|
||||
@@ -49,30 +49,45 @@ Parse the following fields from your prompt:
|
||||
- `prefix`: Task prefix to filter (e.g., `RESEARCH`, `DRAFT`, `IMPL`)
|
||||
- `inner_loop`: Override from frontmatter if present
|
||||
- `discuss_rounds`: Array of discuss round IDs this role handles
|
||||
- `subagents`: Array of subagent types this role may call
|
||||
- `delegates_to`: (DEPRECATED - team workers cannot delegate to other agents) Array for documentation only
|
||||
- `message_types`: Success/error/fix message type mappings
|
||||
3. Parse **body** (content after frontmatter) to get Phase 2-4 execution instructions
|
||||
4. Store parsed metadata and instructions for use in execution phases
|
||||
|
||||
---
|
||||
|
||||
## Main Execution Loop
|
||||
## Execution Flow
|
||||
|
||||
```
|
||||
Entry:
|
||||
Parse prompt → extract role, role_spec, session, session_id, team_name, inner_loop
|
||||
Read role_spec → parse frontmatter (prefix, discuss_rounds, etc.)
|
||||
Read role_spec body → store Phase 2-4 instructions
|
||||
Read role_spec → parse frontmatter + body (Phase 2-4 instructions)
|
||||
Load wisdom files from <session>/wisdom/ (if exist)
|
||||
|
||||
context_accumulator = [] ← inner_loop only, in-memory across iterations
|
||||
|
||||
Main Loop:
|
||||
Phase 1: Task Discovery [built-in]
|
||||
Phase 2-4: Execute Role Spec [from .md]
|
||||
Phase 5: Report [built-in]
|
||||
inner_loop AND more same-prefix tasks? → Phase 5-L → back to Phase 1
|
||||
no more tasks? → Phase 5-F → STOP
|
||||
inner_loop=true AND more same-prefix tasks? → Phase 5-L → back to Phase 1
|
||||
inner_loop=false OR no more tasks? → Phase 5-F → STOP
|
||||
```
|
||||
|
||||
**Inner loop** (`inner_loop=true`): Processes ALL same-prefix tasks sequentially in a single agent instance. `context_accumulator` maintains context across task iterations for knowledge continuity.
|
||||
|
||||
| Step | Phase 5-L (loop) | Phase 5-F (final) |
|
||||
|------|-----------------|------------------|
|
||||
| TaskUpdate completed | YES | YES |
|
||||
| team_msg state_update | YES | YES |
|
||||
| Accumulate summary | YES | - |
|
||||
| SendMessage to coordinator | NO | YES (all tasks) |
|
||||
| Fast-Advance check | - | YES |
|
||||
|
||||
**Interrupt conditions** (break inner loop immediately):
|
||||
- consensus_blocked HIGH → SendMessage → STOP
|
||||
- Cumulative errors >= 3 → SendMessage → STOP
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: Task Discovery (Built-in)
|
||||
@@ -90,7 +105,7 @@ Execute on every loop iteration:
|
||||
- If inner loop continuation → proceed to Phase 5-F (all done)
|
||||
4. **Has matching tasks** → pick first by ID order
|
||||
5. `TaskGet(taskId)` → read full task details
|
||||
6. `TaskUpdate(taskId, status="in_progress")` → claim the task
|
||||
6. `TaskUpdate({ taskId: taskId, status: "in_progress" })` → claim the task
|
||||
|
||||
### Resume Artifact Check
|
||||
|
||||
@@ -108,107 +123,42 @@ After claiming a task, check if output artifacts already exist (indicates resume
|
||||
|
||||
The role_spec contains Phase 2, Phase 3, and Phase 4 sections with domain-specific logic. Follow those instructions exactly. Key integration points with built-in infrastructure:
|
||||
|
||||
### Subagent Delegation
|
||||
## CRITICAL LIMITATION: No Agent Delegation
|
||||
|
||||
When role_spec instructs to call a subagent, use these templates:
|
||||
**Team workers CANNOT call the Agent() tool to spawn other agents.**
|
||||
|
||||
**Discuss subagent** (for inline discuss rounds):
|
||||
Test evidence shows that team members spawned via Agent tool do not have access to the Agent tool themselves. Only the coordinator (main conversation context) can spawn agents.
|
||||
|
||||
### Alternatives for Team Workers
|
||||
|
||||
When role-spec instructions require analysis or exploration:
|
||||
|
||||
**Option A: CLI Tools** (Recommended)
|
||||
```javascript
|
||||
Bash(`ccw cli -p "..." --tool gemini --mode analysis`, { run_in_background: false })
|
||||
```
|
||||
Task({
|
||||
subagent_type: "cli-discuss-agent",
|
||||
run_in_background: false,
|
||||
description: "Discuss <round-id>",
|
||||
prompt: `## Multi-Perspective Critique: <round-id>
|
||||
|
||||
### Input
|
||||
- Artifact: <artifact-path>
|
||||
- Round: <round-id>
|
||||
- Perspectives: <perspective-list-from-role-spec>
|
||||
- Session: <session-folder>
|
||||
- Discovery Context: <session-folder>/spec/discovery-context.json
|
||||
**Option B: Direct Tools**
|
||||
Use Read, Grep, Glob, mcp__ace-tool__search_context directly.
|
||||
|
||||
### Perspective Routing
|
||||
|
||||
| Perspective | CLI Tool | Role | Focus Areas |
|
||||
|-------------|----------|------|-------------|
|
||||
| Product | gemini | Product Manager | Market fit, user value, business viability |
|
||||
| Technical | codex | Tech Lead | Feasibility, tech debt, performance, security |
|
||||
| Quality | claude | QA Lead | Completeness, testability, consistency |
|
||||
| Risk | gemini | Risk Analyst | Risk identification, dependencies, failure modes |
|
||||
| Coverage | gemini | Requirements Analyst | Requirement completeness vs discovery-context |
|
||||
|
||||
### Execution Steps
|
||||
1. Read artifact from <artifact-path>
|
||||
2. For each perspective, launch CLI analysis in background
|
||||
3. Wait for all CLI results
|
||||
4. Divergence detection + consensus determination
|
||||
5. Synthesize convergent/divergent themes + action items
|
||||
6. Write discussion record to: <session-folder>/discussions/<round-id>-discussion.md
|
||||
|
||||
### Return Value
|
||||
JSON with: verdict (consensus_reached|consensus_blocked), severity (HIGH|MEDIUM|LOW), average_rating, divergences, action_items, recommendation, discussion_path`
|
||||
})
|
||||
```
|
||||
|
||||
**Explore subagent** (for codebase exploration):
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: "Explore <angle>",
|
||||
prompt: `Explore codebase for: <query>
|
||||
|
||||
Focus angle: <angle>
|
||||
Keywords: <keyword-list>
|
||||
Session folder: <session-folder>
|
||||
|
||||
## Cache Check
|
||||
1. Read <session-folder>/explorations/cache-index.json (if exists)
|
||||
2. Look for entry with matching angle
|
||||
3. If found AND file exists -> read cached result, return summary
|
||||
4. If not found -> proceed to exploration
|
||||
|
||||
## Output
|
||||
Write JSON to: <session-folder>/explorations/explore-<angle>.json
|
||||
Update cache-index.json with new entry
|
||||
|
||||
Return summary: file count, pattern count, top 5 files, output path`
|
||||
})
|
||||
```
|
||||
|
||||
**Doc-generation subagent** (for writer document generation):
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "universal-executor",
|
||||
run_in_background: false,
|
||||
description: "Generate <doc-type>",
|
||||
prompt: `## Document Generation: <doc-type>
|
||||
|
||||
### Session
|
||||
- Folder: <session-folder>
|
||||
- Spec config: <spec-config-path>
|
||||
|
||||
### Document Config
|
||||
- Type: <doc-type>
|
||||
- Template: <template-path>
|
||||
- Output: <output-path>
|
||||
- Prior discussion: <discussion-file or "none">
|
||||
|
||||
### Writer Accumulator (prior decisions)
|
||||
<JSON array of prior task summaries from context_accumulator>
|
||||
|
||||
### Output Requirements
|
||||
1. Write document to <output-path>
|
||||
2. Return JSON: { artifact_path, summary, key_decisions[], sections_generated[], warnings[] }`
|
||||
**Option C: Request Coordinator Help**
|
||||
Send message to coordinator requesting agent delegation:
|
||||
```javascript
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: sessionId,
|
||||
from: role,
|
||||
to: "coordinator",
|
||||
type: "agent_request",
|
||||
summary: "Request exploration agent for X",
|
||||
data: { reason: "...", scope: "..." }
|
||||
})
|
||||
SendMessage({ recipient: "coordinator", content: "..." })
|
||||
```
|
||||
|
||||
### Consensus Handling
|
||||
|
||||
After a discuss subagent returns, handle the verdict:
|
||||
When role-spec instructions require consensus/discussion, handle the verdict:
|
||||
|
||||
| Verdict | Severity | Action |
|
||||
|---------|----------|--------|
|
||||
@@ -232,25 +182,32 @@ Discussion: <session-folder>/discussions/<round-id>-discussion.md
|
||||
|
||||
## Phase 5: Report + Fast-Advance (Built-in)
|
||||
|
||||
After Phase 4 completes, determine Phase 5 variant:
|
||||
After Phase 4 completes, determine Phase 5 variant (see Execution Flow for decision table).
|
||||
|
||||
### Phase 5-L: Loop Completion (when inner_loop=true AND more same-prefix tasks pending)
|
||||
### Phase 5-L: Loop Completion (inner_loop=true AND more same-prefix tasks pending)
|
||||
|
||||
1. **TaskUpdate**: Mark current task `completed`
|
||||
2. **Message Bus**: Log completion with verification evidence
|
||||
2. **Message Bus**: Log state_update (combines state publish + audit log)
|
||||
```
|
||||
mcp__ccw-tools__team_msg(
|
||||
operation="log",
|
||||
team=<session_id>,
|
||||
session_id=<session_id>,
|
||||
from=<role>,
|
||||
to="coordinator",
|
||||
type=<message_types.success>,
|
||||
summary="[<role>] <task-id> complete. <brief-summary>. Verified: <verification_method>",
|
||||
ref=<artifact-path>
|
||||
type="state_update",
|
||||
data={
|
||||
status: "task_complete",
|
||||
task_id: "<task-id>",
|
||||
ref: "<artifact-path>",
|
||||
key_findings: <from Phase 4>,
|
||||
decisions: <from Phase 4>,
|
||||
files_modified: <from Phase 4>,
|
||||
artifact_path: "<artifact-path>",
|
||||
verification: "<verification_method>"
|
||||
}
|
||||
)
|
||||
```
|
||||
**CLI fallback**: `ccw team log --team <session_id> --from <role> --to coordinator --type <type> --summary "[<role>] ..." --json`
|
||||
3. **Accumulate summary** to context_accumulator (in-memory):
|
||||
> `to` defaults to "coordinator", `summary` auto-generated. `type="state_update"` auto-syncs data to `meta.json.role_state[<role>]`.
|
||||
3. **Accumulate** to `context_accumulator` (in-memory):
|
||||
```
|
||||
context_accumulator.append({
|
||||
task: "<task-id>",
|
||||
@@ -258,43 +215,46 @@ After Phase 4 completes, determine Phase 5 variant:
|
||||
key_decisions: <from Phase 4>,
|
||||
discuss_verdict: <from Phase 4 or "none">,
|
||||
discuss_rating: <from Phase 4 or null>,
|
||||
summary: "<brief summary>"
|
||||
summary: "<brief summary>",
|
||||
files_modified: <from Phase 4>
|
||||
})
|
||||
```
|
||||
4. **Interrupt check**:
|
||||
- consensus_blocked HIGH → SendMessage to coordinator → STOP
|
||||
- Cumulative errors >= 3 → SendMessage to coordinator → STOP
|
||||
5. **Loop**: Return to Phase 1 to find next same-prefix task
|
||||
4. **Interrupt check**: consensus_blocked HIGH or errors >= 3 → SendMessage → STOP
|
||||
5. **Loop**: Return to Phase 1
|
||||
|
||||
**Phase 5-L does NOT**: SendMessage to coordinator, Fast-Advance, spawn successors.
|
||||
|
||||
### Phase 5-F: Final Report (when no more same-prefix tasks OR inner_loop=false)
|
||||
### Phase 5-F: Final Report (no more same-prefix tasks OR inner_loop=false)
|
||||
|
||||
1. **TaskUpdate**: Mark current task `completed`
|
||||
2. **Message Bus**: Log completion (same as Phase 5-L step 2)
|
||||
3. **Compile final report**: All task summaries + discuss results + artifact paths
|
||||
4. **Fast-Advance Check**:
|
||||
- Call `TaskList()`, find pending tasks whose blockedBy are ALL completed
|
||||
- Apply fast-advance rules (see table below)
|
||||
5. **SendMessage** to coordinator OR **spawn successor** directly
|
||||
|
||||
### Fast-Advance Rules
|
||||
2. **Message Bus**: Log state_update (same call as Phase 5-L step 2)
|
||||
3. **Compile final report** and **SendMessage** to coordinator:
|
||||
```javascript
|
||||
SendMessage({
|
||||
type: "message",
|
||||
recipient: "coordinator",
|
||||
content: "[<role>] <final-report>",
|
||||
summary: "[<role>] Final report delivered"
|
||||
})
|
||||
```
|
||||
Report contents: tasks completed (count + list), artifacts produced (paths), files modified (with evidence), discuss results (verdicts + ratings), key decisions (from context_accumulator), verification summary, warnings/issues.
|
||||
4. **Fast-Advance Check**: Call `TaskList()`, find pending tasks whose blockedBy are ALL completed, apply rules:
|
||||
|
||||
| Condition | Action |
|
||||
|-----------|--------|
|
||||
| Same-prefix successor (inner loop role) | Do NOT spawn — main agent handles via inner loop |
|
||||
| 1 ready task, simple linear successor, different prefix | Spawn directly via `Task(run_in_background: true)` + log `fast_advance` to message bus |
|
||||
| 1 ready task, simple linear successor, different prefix | Spawn directly via `Agent(run_in_background: true)` + log `fast_advance` |
|
||||
| Multiple ready tasks (parallel window) | SendMessage to coordinator (needs orchestration) |
|
||||
| No ready tasks + others running | SendMessage to coordinator (status update) |
|
||||
| No ready tasks + nothing running | SendMessage to coordinator (pipeline may be complete) |
|
||||
| Checkpoint task (e.g., spec->impl transition) | SendMessage to coordinator (needs user confirmation) |
|
||||
|
||||
### Fast-Advance Spawn Template
|
||||
### Fast-Advance Spawn
|
||||
|
||||
When fast-advancing to a different-prefix successor:
|
||||
|
||||
```
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <successor-role> worker",
|
||||
team_name: <team_name>,
|
||||
@@ -311,160 +271,104 @@ inner_loop: <true|false based on successor role>`
|
||||
})
|
||||
```
|
||||
|
||||
### Fast-Advance Notification
|
||||
|
||||
After spawning a successor via fast-advance, MUST log to message bus:
|
||||
After spawning, MUST log to message bus (passive log, NOT a SendMessage):
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg(
|
||||
operation="log",
|
||||
team=<session_id>,
|
||||
session_id=<session_id>,
|
||||
from=<role>,
|
||||
to="coordinator",
|
||||
type="fast_advance",
|
||||
summary="[<role>] fast-advanced <completed-task-id> → spawned <successor-role> for <successor-task-id>"
|
||||
)
|
||||
```
|
||||
|
||||
This is a passive log entry (NOT a SendMessage). Coordinator reads it on next callback to reconcile `active_workers`.
|
||||
|
||||
### SendMessage Format
|
||||
|
||||
```
|
||||
SendMessage(team_name=<team_name>, recipient="coordinator", message="[<role>] <final-report>")
|
||||
```
|
||||
|
||||
**Final report contents**:
|
||||
- Tasks completed (count + list)
|
||||
- Artifacts produced (paths)
|
||||
- Files modified (paths + before/after evidence from Phase 4 verification)
|
||||
- Discuss results (verdicts + ratings)
|
||||
- Key decisions (from context_accumulator)
|
||||
- Verification summary (methods used, pass/fail status)
|
||||
- Any warnings or issues
|
||||
Coordinator reads this on next callback to reconcile `active_workers`.
|
||||
|
||||
---
|
||||
|
||||
## Inner Loop Framework
|
||||
|
||||
When `inner_loop=true`, the agent processes ALL same-prefix tasks sequentially in a single agent instance:
|
||||
|
||||
```
|
||||
context_accumulator = []
|
||||
|
||||
Phase 1: Find first <prefix>-* task
|
||||
Phase 2-4: Execute role spec
|
||||
Phase 5-L: Mark done, log, accumulate, check interrupts
|
||||
More <prefix>-* tasks? → Phase 1 (loop)
|
||||
No more? → Phase 5-F (final report)
|
||||
```
|
||||
|
||||
**context_accumulator**: Maintained in-memory across loop iterations. Each entry contains task summary + key decisions + discuss results. Passed to subagents as context for knowledge continuity.
|
||||
|
||||
**Phase 5-L vs Phase 5-F**:
|
||||
|
||||
| Step | Phase 5-L (loop) | Phase 5-F (final) |
|
||||
|------|-----------------|------------------|
|
||||
| TaskUpdate completed | YES | YES |
|
||||
| team_msg log | YES | YES |
|
||||
| Accumulate summary | YES | - |
|
||||
| SendMessage to coordinator | NO | YES (all tasks) |
|
||||
| Fast-Advance check | - | YES |
|
||||
|
||||
**Interrupt conditions** (break inner loop immediately):
|
||||
- consensus_blocked HIGH → SendMessage → STOP
|
||||
- Cumulative errors >= 3 → SendMessage → STOP
|
||||
|
||||
**Crash recovery**: If agent crashes mid-loop, completed tasks are safe (TaskUpdate + artifacts on disk). Coordinator detects orphaned in_progress task on resume, resets to pending, re-spawns. New agent resumes from the interrupted task via Resume Artifact Check.
|
||||
|
||||
---
|
||||
|
||||
## Wisdom Accumulation
|
||||
|
||||
### Load (Phase 2)
|
||||
|
||||
Extract session folder from prompt. Read wisdom files if they exist:
|
||||
|
||||
```
|
||||
<session>/wisdom/learnings.md
|
||||
<session>/wisdom/decisions.md
|
||||
<session>/wisdom/conventions.md
|
||||
<session>/wisdom/issues.md
|
||||
```
|
||||
|
||||
Use wisdom context to inform Phase 2-4 execution.
|
||||
|
||||
### Contribute (Phase 4/5)
|
||||
|
||||
Write discoveries to corresponding wisdom files:
|
||||
- New patterns → `learnings.md`
|
||||
- Architecture/design decisions → `decisions.md`
|
||||
- Codebase conventions → `conventions.md`
|
||||
- Risks and known issues → `issues.md`
|
||||
|
||||
---
|
||||
|
||||
## Knowledge Transfer
|
||||
## Knowledge Transfer & Wisdom
|
||||
|
||||
### Upstream Context Loading (Phase 2)
|
||||
|
||||
When executing Phase 2 of a role-spec, the worker MUST load available cross-role context:
|
||||
The worker MUST load available cross-role context before executing role-spec Phase 2:
|
||||
|
||||
| Source | Path | Load Method |
|
||||
|--------|------|-------------|
|
||||
| Upstream artifacts | `<session>/artifacts/*.md` | Read files listed in task description or dependency chain |
|
||||
| Shared memory | `<session>/shared-memory.json` | Read and parse JSON |
|
||||
| Wisdom | `<session>/wisdom/*.md` | Read all wisdom files |
|
||||
| Exploration cache | `<session>/explorations/cache-index.json` | Check before new explorations |
|
||||
| Source | Method | Priority |
|
||||
|--------|--------|----------|
|
||||
| Upstream role state | `team_msg(operation="get_state", role=<upstream_role>)` | **Primary** — O(1) from meta.json |
|
||||
| Upstream artifacts | Read files referenced in the state's artifact paths | Secondary — for large content |
|
||||
| Wisdom files | Read `<session>/wisdom/*.md` | Always load if exists |
|
||||
| Exploration cache | Check `<session>/explorations/cache-index.json` | Before new explorations |
|
||||
|
||||
> **Legacy fallback**: If `get_state` returns null (older sessions), fall back to reading `<session>/shared-memory.json`.
|
||||
|
||||
### Downstream Context Publishing (Phase 4)
|
||||
|
||||
After Phase 4 verification, the worker MUST publish its contributions:
|
||||
|
||||
1. **Artifact**: Write deliverable to `<session>/artifacts/<prefix>-<task-id>-<name>.md`
|
||||
2. **shared-memory.json**: Read-merge-write under role namespace
|
||||
```json
|
||||
{ "<role>": { "key_findings": [...], "decisions": [...], "files_modified": [...] } }
|
||||
```
|
||||
2. **State data**: Prepare payload for Phase 5 `state_update` message (see Phase 5-L step 2 for schema)
|
||||
3. **Wisdom**: Append new patterns to `learnings.md`, decisions to `decisions.md`, issues to `issues.md`
|
||||
4. **Context accumulator** (inner_loop only): Append summary (see Phase 5-L step 3 for schema). Maintain full accumulator for context continuity across iterations.
|
||||
|
||||
### Inner Loop Context Accumulator
|
||||
|
||||
For `inner_loop: true` roles, `context_accumulator` is maintained in-memory:
|
||||
### Wisdom Files
|
||||
|
||||
```
|
||||
context_accumulator.append({
|
||||
task: "<task-id>",
|
||||
artifact: "<output-path>",
|
||||
key_decisions: [...],
|
||||
summary: "<brief>",
|
||||
files_modified: [...]
|
||||
})
|
||||
<session>/wisdom/learnings.md ← New patterns discovered
|
||||
<session>/wisdom/decisions.md ← Architecture/design decisions
|
||||
<session>/wisdom/conventions.md ← Codebase conventions
|
||||
<session>/wisdom/issues.md ← Risks and known issues
|
||||
```
|
||||
|
||||
Pass the full accumulator to each subsequent task's Phase 3 subagent as `## Prior Context`.
|
||||
Load in Phase 2 to inform execution. Contribute in Phase 4/5 with discoveries.
|
||||
|
||||
---
|
||||
|
||||
## Message Bus Protocol
|
||||
|
||||
Always use `mcp__ccw-tools__team_msg` for logging. Parameters:
|
||||
Always use `mcp__ccw-tools__team_msg` for team communication.
|
||||
|
||||
### log (with state_update) — Primary for Phase 5
|
||||
|
||||
| Param | Value |
|
||||
|-------|-------|
|
||||
| operation | "log" |
|
||||
| team | `<session_id>` (NOT team_name) |
|
||||
| session_id | `<session_id>` (NOT team_name) |
|
||||
| from | `<role>` |
|
||||
| to | "coordinator" |
|
||||
| type | From role_spec message_types |
|
||||
| summary | `[<role>] <message>` |
|
||||
| ref | artifact path (optional) |
|
||||
| type | "state_update" for completion; or role_spec message_types for non-state messages |
|
||||
| data | structured state payload (auto-synced to meta.json when type="state_update"). Use `data.ref` for artifact paths |
|
||||
|
||||
**Critical**: `team` param must be session ID (e.g., `TLS-my-project-2026-02-27`), not team name.
|
||||
> **Defaults**: `to` defaults to "coordinator", `summary` auto-generated as `[<from>] <type> → <to>`.
|
||||
> When `type="state_update"`: data is auto-synced to `meta.json.role_state[<role>]`. Top-level keys (`pipeline_mode`, `pipeline_stages`, `team_name`, `task_description`) are promoted to meta root.
|
||||
|
||||
### get_state — Primary for Phase 2
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg(
|
||||
operation="get_state",
|
||||
session_id=<session_id>,
|
||||
role=<upstream_role> // omit to get ALL role states
|
||||
)
|
||||
```
|
||||
|
||||
Returns `role_state[<role>]` from meta.json.
|
||||
|
||||
### broadcast — For team-wide signals
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg(
|
||||
operation="broadcast",
|
||||
session_id=<session_id>,
|
||||
from=<role>,
|
||||
type=<type>
|
||||
)
|
||||
```
|
||||
|
||||
Equivalent to `log` with `to="all"`. Summary auto-generated.
|
||||
|
||||
**CLI fallback** (if MCP tool unavailable):
|
||||
```
|
||||
ccw team log --team <session_id> --from <role> --to coordinator --type <type> --summary "[<role>] ..." --json
|
||||
ccw team log --session-id <session_id> --from <role> --type <type> --json
|
||||
```
|
||||
|
||||
---
|
||||
@@ -475,7 +379,7 @@ ccw team log --team <session_id> --from <role> --to coordinator --type <type> --
|
||||
|---------|-----------|
|
||||
| Process own prefix tasks | Process other role's prefix tasks |
|
||||
| SendMessage to coordinator | Directly communicate with other workers |
|
||||
| Use declared subagents (discuss, explore, doc-gen) | Create tasks for other roles |
|
||||
| Use CLI tools for analysis/exploration | Create tasks for other roles |
|
||||
| Fast-advance simple successors | Spawn parallel worker batches |
|
||||
| Write to own artifacts + wisdom | Modify resources outside own scope |
|
||||
|
||||
@@ -486,13 +390,11 @@ ccw team log --team <session_id> --from <role> --to coordinator --type <type> --
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Role spec file not found | Report error via SendMessage, STOP |
|
||||
| Subagent failure | Retry once with alternative subagent_type. Still fails → log warning, continue if possible |
|
||||
| Discuss subagent failure | Skip discuss, log warning in report. Proceed without discuss verdict |
|
||||
| Explore subagent failure | Continue without codebase context |
|
||||
| CLI tool failure | Retry once. Still fails → log warning, continue with available data |
|
||||
| Cumulative errors >= 3 | SendMessage to coordinator with error summary, STOP |
|
||||
| No tasks found | SendMessage idle status, STOP |
|
||||
| Context missing (prior doc, template) | Request from coordinator via SendMessage |
|
||||
| Agent crash mid-loop | Self-healing: coordinator resets orphaned task, re-spawns |
|
||||
| Agent crash mid-loop | Self-healing: completed tasks are safe (TaskUpdate + artifacts on disk). Coordinator detects orphaned in_progress task on resume, resets to pending, re-spawns. New agent resumes via Resume Artifact Check. |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: ccw-coordinator
|
||||
description: Command orchestration tool - analyze requirements, recommend chain, execute sequentially with state persistence
|
||||
argument-hint: "[task description]"
|
||||
allowed-tools: Task(*), AskUserQuestion(*), Read(*), Write(*), Bash(*), Glob(*), Grep(*)
|
||||
allowed-tools: Agent(*), AskUserQuestion(*), Read(*), Write(*), Bash(*), Glob(*), Grep(*)
|
||||
---
|
||||
|
||||
# CCW Coordinator Command
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: run-coordinate
|
||||
description: IDAW coordinator - execute task skill chains via external CLI with hook callbacks and git checkpoints
|
||||
argument-hint: "[-y|--yes] [--task <id>[,<id>,...]] [--dry-run] [--tool <tool>]"
|
||||
allowed-tools: Task(*), AskUserQuestion(*), Read(*), Write(*), Bash(*), Glob(*), Grep(*)
|
||||
allowed-tools: Agent(*), AskUserQuestion(*), Read(*), Write(*), Bash(*), Glob(*), Grep(*)
|
||||
---
|
||||
|
||||
# IDAW Run Coordinate Command (/idaw:run-coordinate)
|
||||
@@ -216,7 +216,7 @@ const chain = firstTask.skill_chain || SKILL_CHAIN_MAP[resolvedType] || SKILL_CH
|
||||
firstTask.status = 'in_progress';
|
||||
firstTask.task_type = resolvedType;
|
||||
firstTask.execution.started_at = new Date().toISOString();
|
||||
Write(`.workflow/.idaw/tasks/${firstTask.id}.json`, JSON.stringify(firstTask, null, 2));
|
||||
Write(`.workflow/.idaw/tasks/${firstTask.id}.json`, JSON.stringify(firstAgent, null, 2));
|
||||
|
||||
// Update session
|
||||
session.current_task = firstTask.id;
|
||||
@@ -239,7 +239,7 @@ CONSTRAINTS: Keep concise`;
|
||||
|
||||
// Assemble prompt for first skill
|
||||
const skillName = chain[0];
|
||||
const prompt = assembleCliPrompt(skillName, firstTask, null, autoYes);
|
||||
const prompt = assembleCliPrompt(skillName, firstAgent, null, autoYes);
|
||||
|
||||
session.prompts_used.push({
|
||||
task_id: firstTask.id,
|
||||
@@ -403,7 +403,7 @@ CONSTRAINTS: Actionable diagnosis`;
|
||||
nextTask.status = 'in_progress';
|
||||
nextTask.task_type = nextType;
|
||||
nextTask.execution.started_at = new Date().toISOString();
|
||||
Write(`.workflow/.idaw/tasks/${nextTaskId}.json`, JSON.stringify(nextTask, null, 2));
|
||||
Write(`.workflow/.idaw/tasks/${nextTaskId}.json`, JSON.stringify(nextAgent, null, 2));
|
||||
|
||||
session.current_task = nextTaskId;
|
||||
session.current_skill_index = 0;
|
||||
@@ -417,7 +417,7 @@ CONSTRAINTS: Actionable diagnosis`;
|
||||
}
|
||||
|
||||
const nextSkillName = nextChain[0];
|
||||
const nextPrompt = assembleCliPrompt(nextSkillName, nextTask, null, true);
|
||||
const nextPrompt = assembleCliPrompt(nextSkillName, nextAgent, null, true);
|
||||
|
||||
session.prompts_used.push({
|
||||
task_id: nextTaskId,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: issue:discover-by-prompt
|
||||
description: Discover issues from user prompt with Gemini-planned iterative multi-agent exploration. Uses ACE semantic search for context gathering and supports cross-module comparison (e.g., frontend vs backend API contracts).
|
||||
argument-hint: "[-y|--yes] <prompt> [--scope=src/**] [--depth=standard|deep] [--max-iterations=5]"
|
||||
allowed-tools: Skill(*), TodoWrite(*), Read(*), Bash(*), Task(*), AskUserQuestion(*), Glob(*), Grep(*), mcp__ace-tool__search_context(*), mcp__exa__search(*)
|
||||
allowed-tools: Skill(*), TodoWrite(*), Read(*), Bash(*), Agent(*), AskUserQuestion(*), Glob(*), Grep(*), mcp__ace-tool__search_context(*), mcp__exa__search(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -404,7 +404,7 @@ while (shouldContinue && iteration < maxIterations) {
|
||||
|
||||
// Step 3: Launch dimension agents with ACE context
|
||||
const agentPromises = iterationPlan.dimensions.map(dimension =>
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: `Explore ${dimension.name} (iteration ${iteration})`,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: issue:discover
|
||||
description: Discover potential issues from multiple perspectives (bug, UX, test, quality, security, performance, maintainability, best-practices) using CLI explore. Supports Exa external research for security and best-practices perspectives.
|
||||
argument-hint: "[-y|--yes] <path-pattern> [--perspectives=bug,ux,...] [--external]"
|
||||
allowed-tools: Skill(*), TodoWrite(*), Read(*), Bash(*), Task(*), AskUserQuestion(*), Glob(*), Grep(*)
|
||||
allowed-tools: Skill(*), TodoWrite(*), Read(*), Bash(*), Agent(*), AskUserQuestion(*), Glob(*), Grep(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -185,7 +185,7 @@ Launch N agents in parallel (one per selected perspective):
|
||||
```javascript
|
||||
// Launch agents in parallel - agents write JSON and return summary
|
||||
const agentPromises = selectedPerspectives.map(perspective =>
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: `Discover ${perspective} issues`,
|
||||
@@ -322,7 +322,7 @@ if (response === "Export to Issues") {
|
||||
**Perspective Analysis Agent**:
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: `Discover ${perspective} issues`,
|
||||
@@ -368,7 +368,7 @@ Task({
|
||||
**Exa Research Agent** (for security and best-practices):
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: `External research for ${perspective} via Exa`,
|
||||
|
||||
@@ -429,7 +429,7 @@ On failure, run:
|
||||
{ timeout: 3600000, run_in_background: true }
|
||||
);
|
||||
} else {
|
||||
return Task({
|
||||
return Agent({
|
||||
subagent_type: 'code-developer',
|
||||
run_in_background: false,
|
||||
description: `Execute solution ${solutionId}`,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: plan
|
||||
description: Batch plan issue resolution using issue-plan-agent (explore + plan closed-loop)
|
||||
argument-hint: "[-y|--yes] --all-pending <issue-id>[,<issue-id>,...] [--batch-size 3]"
|
||||
allowed-tools: TodoWrite(*), Task(*), Skill(*), AskUserQuestion(*), Bash(*), Read(*), Write(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), Skill(*), AskUserQuestion(*), Bash(*), Read(*), Write(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -222,7 +222,7 @@ for (let i = 0; i < agentTasks.length; i += MAX_PARALLEL) {
|
||||
|
||||
// Collect results from this chunk
|
||||
for (const { taskId, batchIndex } of taskIds) {
|
||||
const result = TaskOutput(task_id=taskId, block=true);
|
||||
const result = TaskOutput({ task_id: taskId, block: true });
|
||||
|
||||
// Extract JSON from potential markdown code blocks (agent may wrap in ```json...```)
|
||||
const jsonText = extractJsonFromMarkdown(result);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: queue
|
||||
description: Form execution queue from bound solutions using issue-queue-agent (solution-level)
|
||||
argument-hint: "[-y|--yes] [--queues <n>] [--issue <id>]"
|
||||
allowed-tools: TodoWrite(*), Task(*), Bash(*), Read(*), Write(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), Bash(*), Read(*), Write(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -247,7 +247,7 @@ if (numQueues === 1) {
|
||||
description=`Queue ${i + 1}/${numQueues}: ${group.length} solutions`
|
||||
)
|
||||
);
|
||||
// All agents launched in parallel via single message with multiple Task tool calls
|
||||
// All agents launched in parallel via single message with multiple Agent tool calls
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: prepare
|
||||
description: Delegate to universal-executor agent to analyze project via Gemini/Qwen CLI and return JSON core content package for task context
|
||||
argument-hint: "[--tool gemini|qwen] \"task context description\""
|
||||
allowed-tools: Task(*), Bash(*)
|
||||
allowed-tools: Agent(*), Bash(*)
|
||||
examples:
|
||||
- /memory:prepare "在当前前端基础上开发用户认证功能"
|
||||
- /memory:prepare --tool qwen "重构支付模块API"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: analyze-with-file
|
||||
description: Interactive collaborative analysis with documented discussions, CLI-assisted exploration, and evolving understanding
|
||||
argument-hint: "[-y|--yes] [-c|--continue] \"topic or question\""
|
||||
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -226,7 +226,7 @@ Interactive collaborative analysis workflow with **documented discussion process
|
||||
|
||||
**Single Exploration Example**:
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: `Explore codebase: ${topicSlug}`,
|
||||
@@ -256,7 +256,7 @@ Schema: {relevant_files, patterns, key_findings, questions_for_user, _metadata}
|
||||
```javascript
|
||||
// Launch parallel explorations for each selected perspective
|
||||
selectedPerspectives.forEach(perspective => {
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false, // Sequential execution, wait for each
|
||||
description: `Explore ${perspective.name}: ${topicSlug}`,
|
||||
@@ -399,7 +399,7 @@ CONSTRAINTS: ${perspective.constraints}
|
||||
- explorations.json contains initial findings
|
||||
- discussion.md has Round 1 results
|
||||
|
||||
**Guideline**: For complex tasks (code analysis, implementation, refactoring), delegate to agents via Task tool (cli-explore-agent, code-developer, universal-executor) or CLI calls (ccw cli). Avoid direct analysis/execution in main process.
|
||||
**Guideline**: For complex tasks (code analysis, implementation, refactoring), delegate to agents via Agent tool (cli-explore-agent, code-developer, universal-executor) or CLI calls (ccw cli). Avoid direct analysis/execution in main process.
|
||||
|
||||
**Workflow Steps**:
|
||||
|
||||
@@ -739,7 +739,7 @@ In round 1 we discussed X, then in round 2 user said Y...
|
||||
## Best Practices
|
||||
|
||||
1. **Clear Topic Definition**: Detailed topics lead to better dimension identification
|
||||
2. **Agent-First for Complex Tasks**: For code analysis, implementation, or refactoring tasks during discussion, delegate to agents via Task tool (cli-explore-agent, code-developer, universal-executor) or CLI calls (ccw cli). Avoid direct analysis/execution in main process
|
||||
2. **Agent-First for Complex Tasks**: For code analysis, implementation, or refactoring tasks during discussion, delegate to agents via Agent tool (cli-explore-agent, code-developer, universal-executor) or CLI calls (ccw cli). Avoid direct analysis/execution in main process
|
||||
3. **Review discussion.md**: Check understanding evolution before conclusions
|
||||
4. **Embrace Corrections**: Track wrong-to-right transformations as learnings
|
||||
5. **Document Evolution**: discussion.md captures full thinking process
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: brainstorm-with-file
|
||||
description: Interactive brainstorming with multi-CLI collaboration, idea expansion, and documented thought evolution
|
||||
argument-hint: "[-y|--yes] [-c|--continue] [-m|--mode creative|structured] \"idea or topic\""
|
||||
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -245,7 +245,7 @@ Output as structured exploration vectors for multi-perspective analysis.
|
||||
|
||||
**Agent Call Example**:
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: `Explore codebase for brainstorm: ${topicSlug}`,
|
||||
@@ -410,7 +410,7 @@ CONSTRAINTS: Consider existing system architecture
|
||||
- perspectives.json contains initial ideas
|
||||
- brainstorm.md has Round 2 findings
|
||||
|
||||
**Guideline**: For complex tasks (code analysis, implementation, POC creation), delegate to agents via Task tool (cli-explore-agent, code-developer, universal-executor) or CLI calls (ccw cli). Avoid direct analysis/execution in main process.
|
||||
**Guideline**: For complex tasks (code analysis, implementation, POC creation), delegate to agents via Agent tool (cli-explore-agent, code-developer, universal-executor) or CLI calls (ccw cli). Avoid direct analysis/execution in main process.
|
||||
|
||||
**Workflow Steps**:
|
||||
|
||||
@@ -725,7 +725,7 @@ Dimensions matched against topic keywords to identify focus areas:
|
||||
## Best Practices
|
||||
|
||||
1. **Clear Topic Definition**: Detailed topics → better role selection and exploration
|
||||
2. **Agent-First for Complex Tasks**: For code analysis, POC implementation, or technical validation during refinement, delegate to agents via Task tool (cli-explore-agent, code-developer, universal-executor) or CLI calls (ccw cli). Avoid direct analysis/execution in main process
|
||||
2. **Agent-First for Complex Tasks**: For code analysis, POC implementation, or technical validation during refinement, delegate to agents via Agent tool (cli-explore-agent, code-developer, universal-executor) or CLI calls (ccw cli). Avoid direct analysis/execution in main process
|
||||
3. **Review brainstorm.md**: Check thought evolution before final decisions
|
||||
4. **Embrace Conflicts**: Perspective conflicts often reveal important tradeoffs
|
||||
5. **Document Evolution**: brainstorm.md captures full thinking process for team review
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: clean
|
||||
description: Intelligent code cleanup with mainline detection, stale artifact discovery, and safe execution
|
||||
argument-hint: "[-y|--yes] [--dry-run] [\"focus area\"]"
|
||||
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Glob(*), Bash(*), Write(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Glob(*), Bash(*), Write(*)
|
||||
---
|
||||
|
||||
# Clean Command (/workflow:clean)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: workflow:collaborative-plan-with-file
|
||||
description: Collaborative planning with Plan Note - Understanding agent creates shared plan-note.md template, parallel agents fill pre-allocated sections, conflict detection without merge. Outputs executable plan-note.md.
|
||||
argument-hint: "[-y|--yes] <task description> [--max-agents=5]"
|
||||
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Bash(*), Write(*), Glob(*), Grep(*), mcp__ace-tool__search_context(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Bash(*), Write(*), Glob(*), Grep(*), mcp__ace-tool__search_context(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: debug-with-file
|
||||
description: Interactive hypothesis-driven debugging with documented exploration, understanding evolution, and Gemini-assisted correction
|
||||
argument-hint: "[-y|--yes] \"bug description or error message\""
|
||||
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: integration-test-cycle
|
||||
description: Self-iterating integration test workflow with codebase exploration, test development, autonomous test-fix cycles, and reflection-driven strategy adjustment
|
||||
argument-hint: "[-y|--yes] [-c|--continue] [--max-iterations=N] \"module or feature description\""
|
||||
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*), Skill(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*), Skill(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -209,7 +209,7 @@ Unified integration test workflow: **Explore → Design → Develop → Test →
|
||||
1. **Codebase Exploration via cli-explore-agent**
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: `Explore integration points: ${topicSlug}`,
|
||||
@@ -391,7 +391,7 @@ Also set `state.json.phase` to `"designed"`.
|
||||
1. **Generate Integration Tests via @code-developer**
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "code-developer",
|
||||
run_in_background: false,
|
||||
description: `Generate integration tests: ${topicSlug}`,
|
||||
@@ -435,7 +435,7 @@ Also set state.json "phase" to "developed".
|
||||
2. **Code Validation Gate via @test-fix-agent**
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "test-fix-agent",
|
||||
run_in_background: false,
|
||||
description: `Validate generated tests: ${topicSlug}`,
|
||||
@@ -605,7 +605,7 @@ After each iteration, update the `## Cumulative Learnings` section in reflection
|
||||
|
||||
**@test-fix-agent** (test execution):
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "test-fix-agent",
|
||||
run_in_background: false,
|
||||
description: `Execute integration tests: iteration ${N}`,
|
||||
@@ -637,7 +637,7 @@ For each failure, assign:
|
||||
|
||||
**@cli-planning-agent** (failure analysis with reflection):
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-planning-agent",
|
||||
run_in_background: false,
|
||||
description: `Analyze failures: iteration ${N} - ${strategy}`,
|
||||
@@ -676,7 +676,7 @@ Analyze test failures using reflection context and generate fix strategy.
|
||||
|
||||
**@test-fix-agent** (apply fixes):
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "test-fix-agent",
|
||||
run_in_background: false,
|
||||
description: `Apply fixes: iteration ${N} - ${strategy}`,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: refactor-cycle
|
||||
description: Tech debt discovery and self-iterating refactoring with multi-dimensional analysis, prioritized execution, regression validation, and reflection-driven adjustment
|
||||
argument-hint: "[-y|--yes] [-c|--continue] [--scope=module|project] \"module or refactoring goal\""
|
||||
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -200,7 +200,7 @@ Closed-loop tech debt lifecycle: **Discover → Assess → Plan → Refactor →
|
||||
1. **Codebase Exploration via cli-explore-agent**
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: `Explore codebase for debt: ${topicSlug}`,
|
||||
@@ -465,7 +465,7 @@ Set `state.json.current_item` to item ID.
|
||||
#### Step 4.2: Execute Refactoring
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "code-developer",
|
||||
run_in_background: false,
|
||||
description: `Refactor ${item.id}: ${item.title}`,
|
||||
@@ -499,7 +499,7 @@ ${JSON.stringify(item.refactor_plan, null, 2)}
|
||||
|
||||
```javascript
|
||||
// 1. Run tests
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "test-fix-agent",
|
||||
run_in_background: false,
|
||||
description: `Validate refactoring: ${item.id}`,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: roadmap-with-file
|
||||
description: Strategic requirement roadmap with iterative decomposition and issue creation. Outputs roadmap.md (human-readable, single source) + issues.jsonl (machine-executable). Handoff to team-planex.
|
||||
argument-hint: "[-y|--yes] [-c|--continue] [-m progressive|direct|auto] \"requirement description\""
|
||||
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -355,12 +355,12 @@ Bash(`mkdir -p ${sessionFolder}`)
|
||||
|
||||
**Agent Prompt Template**:
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-roadmap-plan-agent",
|
||||
run_in_background: false,
|
||||
description: `Roadmap decomposition: ${slug}`,
|
||||
prompt: `
|
||||
## Roadmap Decomposition Task
|
||||
## Roadmap Decomposition Agent
|
||||
|
||||
### Input Context
|
||||
- **Requirement**: ${requirement}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: animation-extract
|
||||
description: Extract animation and transition patterns from prompt inference and image references for design system documentation
|
||||
argument-hint: "[-y|--yes] [--design-id <id>] [--session <id>] [--images "<glob>"] [--focus "<types>"] [--interactive] [--refine]"
|
||||
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), Bash(*), AskUserQuestion(*), Task(ui-design-agent)
|
||||
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), Bash(*), AskUserQuestion(*), Agent(ui-design-agent)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -207,14 +207,14 @@ IF has_images:
|
||||
|
||||
### Step 2: Generate Animation Specification Options (Agent Task 1)
|
||||
|
||||
**Executor**: `Task(ui-design-agent)`
|
||||
**Executor**: `Agent(ui-design-agent)`
|
||||
|
||||
**Conditional Logic**: Branch based on `refine_mode` flag
|
||||
|
||||
```javascript
|
||||
IF NOT refine_mode:
|
||||
// EXPLORATION MODE (default)
|
||||
Task(ui-design-agent): `
|
||||
Agent(ui-design-agent): `
|
||||
[ANIMATION_SPECIFICATION_GENERATION_TASK]
|
||||
Generate context-aware animation specification questions
|
||||
|
||||
@@ -308,7 +308,7 @@ IF NOT refine_mode:
|
||||
|
||||
ELSE:
|
||||
// REFINEMENT MODE
|
||||
Task(ui-design-agent): `
|
||||
Agent(ui-design-agent): `
|
||||
[ANIMATION_REFINEMENT_OPTIONS_TASK]
|
||||
Generate refinement options for existing animation system
|
||||
|
||||
@@ -656,7 +656,7 @@ ELSE:
|
||||
|
||||
## Phase 2: Animation System Generation (Agent Task 2)
|
||||
|
||||
**Executor**: `Task(ui-design-agent)` for animation token generation
|
||||
**Executor**: `Agent(ui-design-agent)` for animation token generation
|
||||
|
||||
### Step 1: Load User Selection or Use Defaults
|
||||
|
||||
@@ -706,14 +706,14 @@ IF has_images:
|
||||
bash(mkdir -p {base_path}/animation-extraction)
|
||||
```
|
||||
|
||||
### Step 3: Launch Animation Generation Task
|
||||
### Step 3: Launch Animation Generation Agent
|
||||
|
||||
**Conditional Task**: Branch based on `refine_mode` flag
|
||||
|
||||
```javascript
|
||||
IF NOT refine_mode:
|
||||
// EXPLORATION MODE
|
||||
Task(ui-design-agent): `
|
||||
Agent(ui-design-agent): `
|
||||
[ANIMATION_SYSTEM_GENERATION_TASK]
|
||||
Generate production-ready animation system based on user preferences and CSS extraction
|
||||
|
||||
@@ -871,7 +871,7 @@ IF NOT refine_mode:
|
||||
|
||||
ELSE:
|
||||
// REFINEMENT MODE
|
||||
Task(ui-design-agent): `
|
||||
Agent(ui-design-agent): `
|
||||
[ANIMATION_SYSTEM_REFINEMENT_TASK]
|
||||
Apply selected refinements to existing animation system
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: explore-auto
|
||||
description: Interactive exploratory UI design workflow with style-centric batch generation, creates design variants from prompts/images with parallel execution and user selection
|
||||
argument-hint: "[--input "<value>"] [--targets "<list>"] [--target-type "page|component"] [--session <id>] [--style-variants <count>] [--layout-variants <count>]"
|
||||
allowed-tools: Skill(*), TodoWrite(*), Read(*), Bash(*), Glob(*), Write(*), Task(conceptual-planning-agent)
|
||||
allowed-tools: Skill(*), TodoWrite(*), Read(*), Bash(*), Glob(*), Write(*), Agent(conceptual-planning-agent)
|
||||
---
|
||||
|
||||
# UI Design Auto Workflow Command
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: generate
|
||||
description: Assemble UI prototypes by combining layout templates with design tokens (default animation support), pure assembler without new content generation
|
||||
argument-hint: [--design-id <id>] [--session <id>]
|
||||
allowed-tools: TodoWrite(*), Read(*), Write(*), Task(ui-design-agent), Bash(*)
|
||||
allowed-tools: TodoWrite(*), Read(*), Write(*), Agent(ui-design-agent), Bash(*)
|
||||
---
|
||||
|
||||
# Generate UI Prototypes (/workflow:ui-design:generate)
|
||||
@@ -129,7 +129,7 @@ ELSE:
|
||||
|
||||
## Phase 2: Assembly (Agent)
|
||||
|
||||
**Executor**: `Task(ui-design-agent)` grouped by `target × style` (max 10 layouts per agent, max 6 concurrent agents)
|
||||
**Executor**: `Agent(ui-design-agent)` grouped by `target × style` (max 10 layouts per agent, max 6 concurrent agents)
|
||||
|
||||
**⚠️ Core Principle**: **Each agent processes ONLY ONE style** (but can process multiple layouts for that style)
|
||||
|
||||
@@ -204,7 +204,7 @@ TodoWrite({todos: [
|
||||
For each batch (up to 6 parallel agents per batch):
|
||||
For each agent group `{target, style_id, layout_ids[]}` in current batch:
|
||||
```javascript
|
||||
Task(ui-design-agent): `
|
||||
Agent(ui-design-agent): `
|
||||
[LAYOUT_STYLE_ASSEMBLY]
|
||||
🎯 {target} × Style-{style_id} × Layouts-{layout_ids}
|
||||
⚠️ CONSTRAINT: Use ONLY style-{style_id}/design-tokens.json (never mix styles)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: workflow:ui-design:import-from-code
|
||||
description: Import design system from code files (CSS/JS/HTML/SCSS) with automatic file discovery and parallel agent analysis
|
||||
argument-hint: "[--design-id <id>] [--session <id>] [--source <path>]"
|
||||
allowed-tools: Read,Write,Bash,Glob,Grep,Task,TodoWrite
|
||||
allowed-tools: Read,Write,Bash,Glob,Grep,Agent,TodoWrite
|
||||
auto-continue: true
|
||||
---
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: layout-extract
|
||||
description: Extract structural layout information from reference images or text prompts using Claude analysis with variant generation or refinement mode
|
||||
argument-hint: "[-y|--yes] [--design-id <id>] [--session <id>] [--images "<glob>"] [--prompt "<desc>"] [--targets "<list>"] [--variants <count>] [--device-type <desktop|mobile|tablet|responsive>] [--interactive] [--refine]"
|
||||
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), Bash(*), AskUserQuestion(*), Task(ui-design-agent), mcp__exa__web_search_exa(*)
|
||||
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), Bash(*), AskUserQuestion(*), Agent(ui-design-agent), mcp__exa__web_search_exa(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -162,7 +162,7 @@ IF refine_mode:
|
||||
```
|
||||
|
||||
### Step 1: Generate Options (Agent Task 1 - Mode-Specific)
|
||||
**Executor**: `Task(ui-design-agent)`
|
||||
**Executor**: `Agent(ui-design-agent)`
|
||||
|
||||
**Exploration Mode** (default): Generate contrasting layout concepts
|
||||
**Refinement Mode** (`--refine`): Generate refinement options for existing layouts
|
||||
@@ -171,7 +171,7 @@ IF refine_mode:
|
||||
// Conditional agent task based on refine_mode
|
||||
IF NOT refine_mode:
|
||||
// EXPLORATION MODE
|
||||
Task(ui-design-agent): `
|
||||
Agent(ui-design-agent): `
|
||||
[LAYOUT_CONCEPT_GENERATION_TASK]
|
||||
Generate {variants_count} structurally distinct layout concepts for each target
|
||||
|
||||
@@ -217,7 +217,7 @@ IF NOT refine_mode:
|
||||
`
|
||||
ELSE:
|
||||
// REFINEMENT MODE
|
||||
Task(ui-design-agent): `
|
||||
Agent(ui-design-agent): `
|
||||
[LAYOUT_REFINEMENT_OPTIONS_TASK]
|
||||
Generate refinement options for existing layout(s)
|
||||
|
||||
@@ -461,7 +461,7 @@ Proceeding to generate {total_selections} detailed layout template(s)...
|
||||
|
||||
## Phase 2: Layout Template Generation (Agent Task 2)
|
||||
|
||||
**Executor**: `Task(ui-design-agent)` × `Total_Selected_Templates` in **parallel**
|
||||
**Executor**: `Agent(ui-design-agent)` × `Total_Selected_Templates` in **parallel**
|
||||
|
||||
### Step 1: Load User Selections or Default to All
|
||||
```bash
|
||||
@@ -512,7 +512,7 @@ REPORT: "Generating {total_tasks} layout templates across {targets.length} targe
|
||||
Generate layout templates for ALL selected concepts in parallel:
|
||||
```javascript
|
||||
FOR each task in task_list:
|
||||
Task(ui-design-agent): `
|
||||
Agent(ui-design-agent): `
|
||||
[LAYOUT_TEMPLATE_GENERATION_TASK #{task.variant_id} for {task.target}]
|
||||
Generate detailed layout template based on user-selected concept.
|
||||
Focus ONLY on structure and layout. DO NOT concern with visual style (colors, fonts, etc.).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: workflow:ui-design:reference-page-generator
|
||||
description: Generate multi-component reference pages and documentation from design run extraction
|
||||
argument-hint: "[--design-run <path>] [--package-name <name>] [--output-dir <path>]"
|
||||
allowed-tools: Read,Write,Bash,Task,TodoWrite
|
||||
allowed-tools: Read,Write,Bash,Agent,TodoWrite
|
||||
auto-continue: true
|
||||
---
|
||||
|
||||
@@ -198,7 +198,7 @@ echo "[Phase 1] Component data preparation complete"
|
||||
**Agent Task**:
|
||||
|
||||
```javascript
|
||||
Task(ui-design-agent): `
|
||||
Agent(ui-design-agent): `
|
||||
[PREVIEW_SHOWCASE_GENERATION]
|
||||
Generate interactive multi-component showcase panel for reference package
|
||||
|
||||
@@ -210,7 +210,7 @@ Task(ui-design-agent): `
|
||||
2. ${package_dir}/design-tokens.json (design tokens - REQUIRED)
|
||||
3. ${package_dir}/animation-tokens.json (optional, if exists)
|
||||
|
||||
## Generation Task
|
||||
## Generation Agent
|
||||
|
||||
Create interactive showcase with these sections:
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: unified-execute-with-file
|
||||
description: Universal execution engine for consuming any planning/brainstorm/analysis output with minimal progress tracking, multi-agent coordination, and incremental execution
|
||||
argument-hint: "[-y|--yes] [<path>[,<path2>] | -p|--plan <path>[,<path2>]] [--auto-commit] [--commit-prefix \"prefix\"] [\"execution context or task name\"]"
|
||||
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
@@ -34,7 +34,7 @@ When `--yes` or `-y`: Auto-confirm execution decisions, follow plan's DAG depend
|
||||
```
|
||||
|
||||
**Execution Methods**:
|
||||
- **Agent**: Task tool with code-developer (recommended for standard tasks)
|
||||
- **Agent**: Agent tool with code-developer (recommended for standard tasks)
|
||||
- **CLI-Codex**: `ccw cli --tool codex` (complex tasks, git-aware)
|
||||
- **CLI-Gemini**: `ccw cli --tool gemini` (analysis-heavy tasks)
|
||||
- **Auto**: Select based on task complexity (default in `-y` mode)
|
||||
@@ -99,7 +99,7 @@ Universal execution engine consuming **any** planning output and executing it wi
|
||||
│ Phase 5: Per-Task Execution (Agent OR CLI) │
|
||||
│ ├─ Extract relevant notes from previous tasks │
|
||||
│ ├─ Inject notes into execution context │
|
||||
│ ├─ Route to Agent (Task tool) OR CLI (ccw cli command) │
|
||||
│ ├─ Route to Agent (Agent tool) OR CLI (ccw cli command) │
|
||||
│ ├─ Generate structured notes for next task │
|
||||
│ ├─ Auto-commit if enabled (conventional commit format) │
|
||||
│ └─ Append event to unified log │
|
||||
@@ -507,10 +507,10 @@ ${recommendations.map(r => \`- ${r}\`).join('\\n')}
|
||||
|
||||
When: `executionMethod === "Agent"` or `Auto + Low Complexity`
|
||||
|
||||
Execute task via Task tool with code-developer agent:
|
||||
Execute task via Agent tool with code-developer agent:
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "code-developer", // or other agent types
|
||||
run_in_background: false,
|
||||
description: task.title,
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
| 内容类型 | 保留要求 | 示例 |
|
||||
|---------|---------|------|
|
||||
| **Bash命令** | 完整命令,包含所有参数、管道、重定向 | `find . -name "*.json" \| head -1` |
|
||||
| **Agent Prompt** | 全文保留,包含OBJECTIVE、TASK、EXPECTED等所有节 | 完整的Task({prompt: "..."}) |
|
||||
| **Agent Prompt** | 全文保留,包含OBJECTIVE、TASK、EXPECTED等所有节 | 完整的Agent({prompt: "..."}) |
|
||||
| **代码函数** | 完整函数体,所有if/else分支 | `analyzeTaskComplexity()` 全部代码 |
|
||||
| **参数表格** | 所有行列,不省略任何参数 | Session Types表格 |
|
||||
| **JSON Schema** | 所有字段、类型、required定义 | context-package.json schema |
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
1. **将代码替换为描述**
|
||||
- ❌ 错误:`Execute context gathering agent`
|
||||
- ✅ 正确:完整的 `Task({ subagent_type: "context-search-agent", prompt: "...[完整200行prompt]..." })`
|
||||
- ✅ 正确:完整的 `Agent({ subagent_type: "context-search-agent", prompt: "...[完整200行prompt]..." })`
|
||||
|
||||
2. **省略Prompt内容**
|
||||
- ❌ 错误:`Agent prompt for context gathering (see original file)`
|
||||
@@ -277,7 +277,7 @@ commands/ skills/
|
||||
---
|
||||
name: {skill-name}
|
||||
description: {简短描述}. Triggers on "{trigger-phrase}".
|
||||
allowed-tools: Task, AskUserQuestion, TodoWrite, Read, Write, Edit, Bash, Glob, Grep
|
||||
allowed-tools: Agent, AskUserQuestion, TodoWrite, Read, Write, Edit, Bash, Glob, Grep
|
||||
---
|
||||
```
|
||||
|
||||
@@ -440,7 +440,7 @@ Complete: IMPL_PLAN.md + Task JSONs
|
||||
|--------|---------|---------|
|
||||
| **代码块数量** | 计数 ` ```bash ` 和 ` ```javascript ` | 与原文件相等 |
|
||||
| **表格数量** | 计数 ` \| ` 开头的行 | 与原文件相等 |
|
||||
| **Agent Prompt** | 搜索 `Task({` | 完整的prompt参数内容 |
|
||||
| **Agent Prompt** | 搜索 `Agent({` | 完整的prompt参数内容 |
|
||||
| **步骤编号** | 检查 `### Step` | 编号序列与原文件一致 |
|
||||
| **文件行数** | `wc -l` | ±20%以内 |
|
||||
| **关键函数** | 搜索函数名 | 所有函数完整保留 |
|
||||
@@ -492,10 +492,10 @@ Execute the context-search-agent to gather project context.
|
||||
### Step 2: Run context gathering
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "context-search-agent",
|
||||
prompt: `
|
||||
## Context Search Task
|
||||
## Context Search Agent
|
||||
|
||||
### OBJECTIVE
|
||||
Gather comprehensive context for planning session ${sessionId}
|
||||
@@ -535,7 +535,7 @@ Gather comprehensive context for planning session ${sessionId}
|
||||
│ └─→ 数量应相等 │
|
||||
│ │
|
||||
│ Step 3: 关键内容抽查 │
|
||||
│ - 搜索 Task({ → Agent Prompt 完整性 │
|
||||
│ - 搜索 Agent({ → Agent Prompt 完整性 │
|
||||
│ - 搜索函数名 → 函数体完整性 │
|
||||
│ - 搜索表格标记 → 表格完整性 │
|
||||
│ │
|
||||
@@ -562,8 +562,8 @@ grep -c '^|' commands/workflow/tools/context-gather.md
|
||||
grep -c '^|' skills/workflow-plan/phases/02-context-gathering.md
|
||||
|
||||
# 4. Agent Prompt检查
|
||||
grep -c 'Task({' commands/workflow/tools/context-gather.md
|
||||
grep -c 'Task({' skills/workflow-plan/phases/02-context-gathering.md
|
||||
grep -c 'Agent({' commands/workflow/tools/context-gather.md
|
||||
grep -c 'Agent({' skills/workflow-plan/phases/02-context-gathering.md
|
||||
|
||||
# 5. 函数定义检查
|
||||
grep -E '^(function|const.*=.*=>|async function)' commands/workflow/tools/context-gather.md
|
||||
|
||||
@@ -140,7 +140,7 @@ graph TD
|
||||
---
|
||||
name: {skill-name}
|
||||
description: {一句话描述}. {触发关键词}. Triggers on "{关键词1}", "{关键词2}".
|
||||
allowed-tools: Task, AskUserQuestion, Read, Bash, Glob, Grep, Write, {其他MCP工具}
|
||||
allowed-tools: Agent, AskUserQuestion, Read, Bash, Glob, Grep, Write, {其他MCP工具}
|
||||
---
|
||||
|
||||
# {Skill 标题}
|
||||
@@ -192,7 +192,7 @@ description: | # 必需:描述 + 触发词
|
||||
Generate XXX documents.
|
||||
Triggers on "keyword1", "keyword2".
|
||||
allowed-tools: | # 必需:允许使用的工具
|
||||
Task, AskUserQuestion, Read, Bash,
|
||||
Agent, AskUserQuestion, Read, Bash,
|
||||
Glob, Grep, Write, mcp__chrome__*
|
||||
---
|
||||
```
|
||||
@@ -641,7 +641,7 @@ touch my-skill/templates/agent-base.md
|
||||
---
|
||||
name: my-skill
|
||||
description: Generate XXX. Triggers on "keyword1", "keyword2".
|
||||
allowed-tools: Task, AskUserQuestion, Read, Bash, Glob, Grep, Write
|
||||
allowed-tools: Agent, AskUserQuestion, Read, Bash, Glob, Grep, Write
|
||||
---
|
||||
|
||||
# My Skill
|
||||
@@ -680,7 +680,7 @@ Generate XXX through multi-phase analysis.
|
||||
|
||||
| 工具 | 用途 | 适用 Skill |
|
||||
|------|------|------------|
|
||||
| `Task` | 启动子 Agent | 所有 |
|
||||
| `Agent` | 启动子 Agent | 所有 |
|
||||
| `AskUserQuestion` | 用户交互 | 所有 |
|
||||
| `Read/Write/Glob/Grep` | 文件操作 | 所有 |
|
||||
| `Bash` | 脚本执行 | 需要自动化 |
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: brainstorm
|
||||
description: Unified brainstorming skill with dual-mode operation - auto pipeline and single role analysis. Triggers on "brainstorm", "头脑风暴".
|
||||
allowed-tools: Skill(*), Task(conceptual-planning-agent, context-search-agent), AskUserQuestion(*), TodoWrite(*), Read(*), Write(*), Edit(*), Glob(*), Bash(*)
|
||||
allowed-tools: Skill(*), Agent(conceptual-planning-agent, context-search-agent), AskUserQuestion(*), TodoWrite(*), Read(*), Write(*), Edit(*), Glob(*), Bash(*)
|
||||
---
|
||||
|
||||
# Brainstorm
|
||||
|
||||
@@ -146,10 +146,10 @@ Team Skills 使用 `team-worker` agent 架构,Coordinator 编排流水线,Wo
|
||||
| Skill | 用途 | 架构 |
|
||||
|-------|------|------|
|
||||
| `team-planex` | 规划+执行 wave pipeline | planner + executor, 适合清晰 issue/roadmap |
|
||||
| `team-lifecycle-v5` | 完整生命周期 (spec/impl/test) | team-worker agents with role-specs |
|
||||
| `team-lifecycle` | 完整生命周期 (spec/impl/test) | team-worker agents with role-specs |
|
||||
| `team-lifecycle-v4` | 优化版生命周期 | Optimized pipeline |
|
||||
| `team-lifecycle-v3` | 基础版生命周期 | All roles invoke unified skill |
|
||||
| `team-coordinate-v2` | 通用动态团队协调 | 运行时动态生成 role-specs |
|
||||
| `team-coordinate` | 通用动态团队协调 | 运行时动态生成 role-specs |
|
||||
| `team-coordinate` | 通用团队协调 v1 | Dynamic role generation |
|
||||
| `team-brainstorm` | 团队头脑风暴 | Multi-perspective analysis |
|
||||
| `team-frontend` | 前端开发团队 | Frontend specialists |
|
||||
@@ -163,7 +163,7 @@ Team Skills 使用 `team-worker` agent 架构,Coordinator 编排流水线,Wo
|
||||
| `team-uidesign` | UI 设计团队 | Design system + prototyping |
|
||||
| `team-ultra-analyze` | 深度协作分析 | Deep collaborative analysis |
|
||||
| `team-executor` | 轻量执行 (恢复会话) | Resume existing sessions |
|
||||
| `team-executor-v2` | 轻量执行 v2 | Improved session resumption |
|
||||
| `team-executor` | 轻量执行 v2 | Improved session resumption |
|
||||
|
||||
### Standalone Skills (独立技能)
|
||||
|
||||
|
||||
@@ -775,14 +775,14 @@
|
||||
"source": "../../../skills/team-coordinate/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-coordinate-v2",
|
||||
"description": "Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on \"team coordinate v2\".",
|
||||
"name": "team-coordinate",
|
||||
"description": "Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on \"Team Coordinate \".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-coordinate-v2/SKILL.md"
|
||||
"source": "../../../skills/team-coordinate/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-executor",
|
||||
@@ -795,14 +795,14 @@
|
||||
"source": "../../../skills/team-executor/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-executor-v2",
|
||||
"description": "Lightweight session execution skill. Resumes existing team-coordinate-v2 sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"team executor v2\".",
|
||||
"name": "team-executor",
|
||||
"description": "Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"Team Executor\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-executor-v2/SKILL.md"
|
||||
"source": "../../../skills/team-executor/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-frontend",
|
||||
@@ -855,14 +855,14 @@
|
||||
"source": "../../../skills/team-lifecycle-v4/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-lifecycle-v5",
|
||||
"name": "team-lifecycle",
|
||||
"description": "Unified team skill for full lifecycle - spec/impl/test. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents loaded with role-specific Phase 2-4 specs. Triggers on \"team lifecycle\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": true,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-lifecycle-v5/SKILL.md"
|
||||
"source": "../../../skills/team-lifecycle/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-planex",
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
{
|
||||
"name": "flow-create",
|
||||
"command": "/flow-create",
|
||||
"description": "",
|
||||
"arguments": "",
|
||||
"description": "Flow Template Generator - Generate workflow templates for meta-skill/flow-coordinator with interactive 3-phase workflow",
|
||||
"arguments": "[template-name] [--output <path>]",
|
||||
"category": "general",
|
||||
"subcategory": null,
|
||||
"usage_scenario": "implementation",
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
"version": "",
|
||||
"source": "../../../skills/brainstorm/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "ccw-help",
|
||||
"description": "CCW command help system. Search, browse, recommend commands, skills, teams. Triggers \"ccw-help\", \"ccw-issue\".",
|
||||
"category": "utility",
|
||||
"is_team": false,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "8.0.0",
|
||||
"source": "../../../skills/ccw-help/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "command-generator",
|
||||
"description": "Command file generator - 5 phase workflow for creating Claude Code command files with YAML frontmatter. Generates .md command files for project or user scope. Triggers on \"create command\", \"new command\", \"command generator\".",
|
||||
@@ -99,6 +109,16 @@
|
||||
"version": "",
|
||||
"source": "../../../skills/spec-generator/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-arch-opt",
|
||||
"description": "Unified team skill for architecture optimization. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on \"team arch-opt\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": true,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-arch-opt/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-brainstorm",
|
||||
"description": "Unified team skill for brainstorming team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team brainstorm\".",
|
||||
@@ -111,7 +131,7 @@
|
||||
},
|
||||
{
|
||||
"name": "team-coordinate",
|
||||
"description": "Universal team coordination skill with dynamic role generation. Only coordinator is built-in -- all worker roles are generated at runtime based on task analysis. Beat/cadence model for orchestration. Triggers on \"team coordinate\".",
|
||||
"description": "Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on \"Team Coordinate \".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
@@ -119,19 +139,9 @@
|
||||
"version": "",
|
||||
"source": "../../../skills/team-coordinate/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-coordinate-v2",
|
||||
"description": "Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on \"team coordinate v2\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-coordinate-v2/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-executor",
|
||||
"description": "Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"team executor\".",
|
||||
"description": "Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"Team Executor\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
@@ -139,16 +149,6 @@
|
||||
"version": "",
|
||||
"source": "../../../skills/team-executor/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-executor-v2",
|
||||
"description": "Lightweight session execution skill. Resumes existing team-coordinate-v2 sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"team executor v2\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-executor-v2/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-frontend",
|
||||
"description": "Unified team skill for frontend development team. All roles invoke this skill with --role arg. Built-in ui-ux-pro-max design intelligence. Triggers on \"team frontend\".",
|
||||
@@ -180,34 +180,24 @@
|
||||
"source": "../../../skills/team-iterdev/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-lifecycle-v3",
|
||||
"description": "Unified team skill for full lifecycle - spec/impl/test. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team lifecycle\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-lifecycle-v3/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-lifecycle-v4",
|
||||
"description": "Unified team skill for full lifecycle - spec/impl/test. Optimized cadence with inline discuss subagent and shared explore. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team lifecycle\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-lifecycle-v4/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-lifecycle-v5",
|
||||
"name": "team-lifecycle",
|
||||
"description": "Unified team skill for full lifecycle - spec/impl/test. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents loaded with role-specific Phase 2-4 specs. Triggers on \"team lifecycle\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": true,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-lifecycle-v5/SKILL.md"
|
||||
"source": "../../../skills/team-lifecycle/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-perf-opt",
|
||||
"description": "Unified team skill for performance optimization. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on \"team perf-opt\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": true,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-perf-opt/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-planex",
|
||||
@@ -340,7 +330,7 @@
|
||||
"source": "../../../skills/workflow-skill-designer/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "workflow-tdd-plan-plan",
|
||||
"name": "workflow-tdd-plan",
|
||||
"description": "Unified TDD workflow skill combining 6-phase TDD planning with Red-Green-Refactor task chain generation, and 4-phase TDD verification with compliance reporting. Triggers on \"workflow-tdd-plan\", \"workflow-tdd-verify\".",
|
||||
"category": "workflow",
|
||||
"is_team": false,
|
||||
@@ -359,4 +349,4 @@
|
||||
"version": "",
|
||||
"source": "../../../skills/workflow-test-fix/SKILL.md"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -1,49 +1,40 @@
|
||||
{
|
||||
"workflow-plan": {
|
||||
"calls_internally": [
|
||||
"workflow:session:start",
|
||||
"workflow:tools:context-gather",
|
||||
"workflow:tools:conflict-resolution",
|
||||
"workflow:tools:task-generate-agent"
|
||||
"workflow:session:start"
|
||||
],
|
||||
"next_steps": [
|
||||
"workflow-plan-verify",
|
||||
"workflow:status",
|
||||
"workflow-execute"
|
||||
],
|
||||
"alternatives": [
|
||||
"workflow-tdd-plan"
|
||||
"workflow:session:list",
|
||||
"workflow:unified-execute-with-file"
|
||||
],
|
||||
"alternatives": [],
|
||||
"prerequisites": []
|
||||
},
|
||||
"workflow-tdd-plan": {
|
||||
"calls_internally": [
|
||||
"workflow:session:start",
|
||||
"workflow:tools:context-gather",
|
||||
"workflow:tools:task-generate-tdd"
|
||||
"workflow:session:start"
|
||||
],
|
||||
"next_steps": [
|
||||
"workflow-tdd-verify",
|
||||
"workflow:status",
|
||||
"workflow-execute"
|
||||
],
|
||||
"alternatives": [
|
||||
"workflow-plan"
|
||||
"workflow:session:list",
|
||||
"workflow:unified-execute-with-file"
|
||||
],
|
||||
"alternatives": [],
|
||||
"prerequisites": []
|
||||
},
|
||||
"workflow-execute": {
|
||||
"workflow:unified-execute-with-file": {
|
||||
"prerequisites": [
|
||||
"workflow-plan",
|
||||
"workflow-tdd-plan"
|
||||
],
|
||||
"related": [
|
||||
"workflow:status",
|
||||
"workflow:resume"
|
||||
"workflow:session:list",
|
||||
"workflow:session:resume"
|
||||
],
|
||||
"next_steps": [
|
||||
"workflow:review",
|
||||
"workflow-tdd-verify"
|
||||
"review-cycle",
|
||||
"workflow-test-fix"
|
||||
]
|
||||
},
|
||||
"workflow-plan-verify": {
|
||||
@@ -51,24 +42,22 @@
|
||||
"workflow-plan"
|
||||
],
|
||||
"next_steps": [
|
||||
"workflow-execute"
|
||||
"workflow:unified-execute-with-file"
|
||||
],
|
||||
"related": [
|
||||
"workflow:status"
|
||||
"workflow:session:list"
|
||||
]
|
||||
},
|
||||
"workflow-tdd-verify": {
|
||||
"prerequisites": [
|
||||
"workflow-execute"
|
||||
"workflow:unified-execute-with-file"
|
||||
],
|
||||
"related": [
|
||||
"workflow:tools:tdd-coverage-analysis"
|
||||
]
|
||||
"related": []
|
||||
},
|
||||
"workflow:session:start": {
|
||||
"next_steps": [
|
||||
"workflow-plan",
|
||||
"workflow-execute"
|
||||
"workflow:unified-execute-with-file"
|
||||
],
|
||||
"related": [
|
||||
"workflow:session:list",
|
||||
@@ -76,71 +65,27 @@
|
||||
]
|
||||
},
|
||||
"workflow:session:resume": {
|
||||
"alternatives": [
|
||||
"workflow:resume"
|
||||
],
|
||||
"alternatives": [],
|
||||
"related": [
|
||||
"workflow:session:list",
|
||||
"workflow:status"
|
||||
"workflow:session:list"
|
||||
]
|
||||
},
|
||||
"workflow-lite-planex": {
|
||||
"calls_internally": [],
|
||||
"next_steps": [
|
||||
"workflow:status"
|
||||
"workflow:session:list"
|
||||
],
|
||||
"alternatives": [
|
||||
"workflow-plan"
|
||||
],
|
||||
"prerequisites": []
|
||||
},
|
||||
"workflow:lite-fix": {
|
||||
"next_steps": [
|
||||
"workflow:status"
|
||||
],
|
||||
"alternatives": [
|
||||
"workflow-lite-planex"
|
||||
"review-cycle": {
|
||||
"prerequisites": [
|
||||
"workflow:unified-execute-with-file"
|
||||
],
|
||||
"related": [
|
||||
"workflow-test-fix"
|
||||
]
|
||||
},
|
||||
"workflow:review-session-cycle": {
|
||||
"prerequisites": [
|
||||
"workflow-execute"
|
||||
],
|
||||
"next_steps": [
|
||||
"workflow:review-fix"
|
||||
],
|
||||
"related": [
|
||||
"workflow:review-module-cycle"
|
||||
]
|
||||
},
|
||||
"workflow:review-fix": {
|
||||
"prerequisites": [
|
||||
"workflow:review-module-cycle",
|
||||
"workflow:review-session-cycle"
|
||||
],
|
||||
"related": [
|
||||
"workflow-test-fix"
|
||||
]
|
||||
},
|
||||
"memory:docs": {
|
||||
"calls_internally": [
|
||||
"workflow:session:start",
|
||||
"workflow:tools:context-gather"
|
||||
],
|
||||
"next_steps": [
|
||||
"workflow-execute"
|
||||
]
|
||||
},
|
||||
"memory:skill-memory": {
|
||||
"next_steps": [
|
||||
"workflow-plan",
|
||||
"cli:analyze"
|
||||
],
|
||||
"related": [
|
||||
"memory:load-skill-memory"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,16 @@
|
||||
}
|
||||
],
|
||||
"utility": [
|
||||
{
|
||||
"name": "ccw-help",
|
||||
"description": "CCW command help system. Search, browse, recommend commands, skills, teams. Triggers \"ccw-help\", \"ccw-issue\".",
|
||||
"category": "utility",
|
||||
"is_team": false,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "8.0.0",
|
||||
"source": "../../../skills/ccw-help/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "issue-manage",
|
||||
"description": "Interactive issue management with menu-driven CRUD operations. Use when managing issues, viewing issue status, editing issue fields, performing bulk operations, or viewing issue history. Triggers on \"manage issue\", \"list issues\", \"edit issue\", \"delete issue\", \"bulk update\", \"issue dashboard\", \"issue history\", \"completed issues\".",
|
||||
@@ -108,6 +118,16 @@
|
||||
}
|
||||
],
|
||||
"team": [
|
||||
{
|
||||
"name": "team-arch-opt",
|
||||
"description": "Unified team skill for architecture optimization. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on \"team arch-opt\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": true,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-arch-opt/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-brainstorm",
|
||||
"description": "Unified team skill for brainstorming team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team brainstorm\".",
|
||||
@@ -120,7 +140,7 @@
|
||||
},
|
||||
{
|
||||
"name": "team-coordinate",
|
||||
"description": "Universal team coordination skill with dynamic role generation. Only coordinator is built-in -- all worker roles are generated at runtime based on task analysis. Beat/cadence model for orchestration. Triggers on \"team coordinate\".",
|
||||
"description": "Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on \"Team Coordinate \".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
@@ -128,19 +148,9 @@
|
||||
"version": "",
|
||||
"source": "../../../skills/team-coordinate/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-coordinate-v2",
|
||||
"description": "Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on \"team coordinate v2\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-coordinate-v2/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-executor",
|
||||
"description": "Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"team executor\".",
|
||||
"description": "Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"Team Executor\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
@@ -148,16 +158,6 @@
|
||||
"version": "",
|
||||
"source": "../../../skills/team-executor/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-executor-v2",
|
||||
"description": "Lightweight session execution skill. Resumes existing team-coordinate-v2 sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"team executor v2\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-executor-v2/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-frontend",
|
||||
"description": "Unified team skill for frontend development team. All roles invoke this skill with --role arg. Built-in ui-ux-pro-max design intelligence. Triggers on \"team frontend\".",
|
||||
@@ -189,34 +189,24 @@
|
||||
"source": "../../../skills/team-iterdev/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-lifecycle-v3",
|
||||
"description": "Unified team skill for full lifecycle - spec/impl/test. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team lifecycle\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-lifecycle-v3/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-lifecycle-v4",
|
||||
"description": "Unified team skill for full lifecycle - spec/impl/test. Optimized cadence with inline discuss subagent and shared explore. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team lifecycle\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": false,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-lifecycle-v4/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-lifecycle-v5",
|
||||
"name": "team-lifecycle",
|
||||
"description": "Unified team skill for full lifecycle - spec/impl/test. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents loaded with role-specific Phase 2-4 specs. Triggers on \"team lifecycle\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": true,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-lifecycle-v5/SKILL.md"
|
||||
"source": "../../../skills/team-lifecycle/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-perf-opt",
|
||||
"description": "Unified team skill for performance optimization. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on \"team perf-opt\".",
|
||||
"category": "team",
|
||||
"is_team": true,
|
||||
"has_phases": false,
|
||||
"has_role_specs": true,
|
||||
"version": "",
|
||||
"source": "../../../skills/team-perf-opt/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "team-planex",
|
||||
@@ -351,7 +341,7 @@
|
||||
"source": "../../../skills/workflow-skill-designer/SKILL.md"
|
||||
},
|
||||
{
|
||||
"name": "workflow-tdd-plan-plan",
|
||||
"name": "workflow-tdd-plan",
|
||||
"description": "Unified TDD workflow skill combining 6-phase TDD planning with Red-Green-Refactor task chain generation, and 4-phase TDD verification with compliance reporting. Triggers on \"workflow-tdd-plan\", \"workflow-tdd-verify\".",
|
||||
"category": "workflow",
|
||||
"is_team": false,
|
||||
@@ -371,4 +361,4 @@
|
||||
"source": "../../../skills/workflow-test-fix/SKILL.md"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: issue-manage
|
||||
description: Interactive issue management with menu-driven CRUD operations. Use when managing issues, viewing issue status, editing issue fields, performing bulk operations, or viewing issue history. Triggers on "manage issue", "list issues", "edit issue", "delete issue", "bulk update", "issue dashboard", "issue history", "completed issues".
|
||||
allowed-tools: Bash, Read, Write, AskUserQuestion, Task, Glob
|
||||
allowed-tools: Bash, Read, Write, AskUserQuestion, Agent, Glob
|
||||
---
|
||||
|
||||
# Issue Management Skill
|
||||
@@ -219,9 +219,8 @@ const action = AskUserQuestion({
|
||||
header: 'Action',
|
||||
options: [
|
||||
{ label: 'List Issues', description: 'Browse active issues' },
|
||||
{ label: 'View Issue', description: 'Detail view' },
|
||||
{ label: 'View Issue', description: 'Detail view (includes history)' },
|
||||
{ label: 'Edit Issue', description: 'Modify fields' },
|
||||
{ label: 'View History', description: 'Completed issues' },
|
||||
{ label: 'Bulk Operations', description: 'Batch actions' }
|
||||
]
|
||||
}]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: memory-manage
|
||||
description: Unified memory management - CLAUDE.md updates and documentation generation with interactive routing. Triggers on "memory manage", "update claude", "update memory", "generate docs", "更新记忆", "生成文档".
|
||||
allowed-tools: Task(*), Bash(*), AskUserQuestion(*), Read(*)
|
||||
allowed-tools: Agent(*), Bash(*), AskUserQuestion(*), Read(*)
|
||||
---
|
||||
|
||||
# Memory Management Skill
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: review-code
|
||||
description: Multi-dimensional code review with structured reports. Analyzes correctness, readability, performance, security, testing, and architecture. Triggers on "review code", "code review", "审查代码", "代码审查".
|
||||
allowed-tools: Task, AskUserQuestion, Read, Write, Glob, Grep, Bash, mcp__ace-tool__search_context, mcp__ide__getDiagnostics
|
||||
allowed-tools: Agent, AskUserQuestion, Read, Write, Glob, Grep, Bash, mcp__ace-tool__search_context, mcp__ide__getDiagnostics
|
||||
---
|
||||
|
||||
# Review Code
|
||||
|
||||
@@ -132,8 +132,9 @@ async function runOrchestrator() {
|
||||
// 确定当前需要审查的维度(使用 StateManager)
|
||||
const currentDimension = StateManager.getNextDimension(state);
|
||||
|
||||
const result = await Task({
|
||||
const result = await Agent({
|
||||
subagent_type: 'universal-executor',
|
||||
description: `Execute code review action: ${actionId}`,
|
||||
run_in_background: false,
|
||||
prompt: `
|
||||
[WORK_DIR]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: review-cycle
|
||||
description: Unified multi-dimensional code review with automated fix orchestration. Routes to session-based (git changes), module-based (path patterns), or fix mode. Triggers on "workflow:review-cycle", "workflow:review-session-cycle", "workflow:review-module-cycle", "workflow:review-cycle-fix".
|
||||
allowed-tools: Task, AskUserQuestion, TaskCreate, TaskUpdate, TaskList, Read, Write, Edit, Bash, Glob, Grep, Skill
|
||||
allowed-tools: Agent, AskUserQuestion, TaskCreate, TaskUpdate, TaskList, Read, Write, Edit, Bash, Glob, Grep, Skill
|
||||
---
|
||||
|
||||
# Review Cycle
|
||||
|
||||
@@ -332,7 +332,7 @@ for (let i = 0; i < batches.length; i += MAX_PARALLEL) {
|
||||
|
||||
// Launch agents in parallel (run_in_background=true)
|
||||
for (const batch of chunk) {
|
||||
const taskId = Task({
|
||||
const taskId = Agent({
|
||||
subagent_type: "cli-planning-agent",
|
||||
run_in_background: true,
|
||||
description: `Plan batch ${batch.batch_id}: ${batch.findings.length} findings`,
|
||||
@@ -386,7 +386,7 @@ for (let i = 1; i <= aggregatedPlan.groups.length; i++) {
|
||||
|
||||
**Planning Agent (Batch Mode - Partial Plan Only)**:
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-planning-agent",
|
||||
run_in_background: true,
|
||||
description: `Plan batch ${batch.batch_id}: ${batch.findings.length} findings`,
|
||||
@@ -488,7 +488,7 @@ Before finalizing outputs:
|
||||
|
||||
**Execution Agent** (per group):
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-execute-agent",
|
||||
description: `Fix ${group.findings.length} issues: ${group.group_name}`,
|
||||
prompt: `
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: skill-generator
|
||||
description: Meta-skill for creating new Claude Code skills with configurable execution modes. Supports sequential (fixed order) and autonomous (stateless) phase patterns. Use for skill scaffolding, skill creation, or building new workflows. Triggers on "create skill", "new skill", "skill generator".
|
||||
allowed-tools: Task, AskUserQuestion, Read, Bash, Glob, Grep, Write
|
||||
allowed-tools: Agent, AskUserQuestion, Read, Bash, Glob, Grep, Write
|
||||
---
|
||||
|
||||
# Skill Generator
|
||||
|
||||
@@ -240,7 +240,7 @@ async function executePhase(phaseId, phaseConfig, workDir) {
|
||||
const phasePrompt = Read(\`\${skillDir}/phases/\${phaseId}.md\`);
|
||||
|
||||
// Use Task to invoke Agent
|
||||
const result = await Task({
|
||||
const result = await Agent({
|
||||
subagent_type: phaseConfig.agent?.type || 'universal-executor',
|
||||
run_in_background: phaseConfig.agent?.run_in_background || false,
|
||||
prompt: \`
|
||||
@@ -573,7 +573,7 @@ async function runOrchestrator(workDir) {
|
||||
try {
|
||||
const actionPrompt = Read(\`\${skillDir}/phases/actions/\${actionId}.md\`);
|
||||
|
||||
const result = await Task({
|
||||
const result = await Agent({
|
||||
subagent_type: 'universal-executor',
|
||||
run_in_background: false,
|
||||
prompt: \`
|
||||
|
||||
@@ -12,7 +12,7 @@ Suitable for scenarios that need immediate results.
|
||||
|
||||
```javascript
|
||||
// Agent call - synchronous
|
||||
const result = Task({
|
||||
const result = Agent({
|
||||
subagent_type: 'universal-executor',
|
||||
prompt: 'Execute task...',
|
||||
run_in_background: false // Key: synchronous execution
|
||||
@@ -77,7 +77,7 @@ ccw cli -p "<PROMPT>" --tool <gemini|qwen|codex> --mode <analysis|write>
|
||||
General-purpose executor, the most commonly used agent type.
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: 'universal-executor',
|
||||
prompt: `
|
||||
Execute task:
|
||||
@@ -99,7 +99,7 @@ Execute task:
|
||||
Code exploration agent for quick codebase understanding.
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: 'Explore',
|
||||
prompt: `
|
||||
Explore src/ directory:
|
||||
@@ -123,7 +123,7 @@ Thoroughness: medium
|
||||
Deep code analysis agent.
|
||||
|
||||
```javascript
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: 'cli-explore-agent',
|
||||
prompt: `
|
||||
Deep analysis of src/auth/ module:
|
||||
|
||||
@@ -111,7 +111,7 @@ async function runOrchestrator() {
|
||||
try {
|
||||
const actionPrompt = Read(\`phases/actions/${actionId}.md\`);
|
||||
|
||||
const result = await Task({
|
||||
const result = await Agent({
|
||||
subagent_type: 'universal-executor',
|
||||
run_in_background: false,
|
||||
prompt: \`
|
||||
|
||||
@@ -96,7 +96,7 @@ async function execute${toPascalCase(id)}(context) {
|
||||
\` : '// No MCP tools configured'}
|
||||
|
||||
// 3. Launch Agent for in-depth analysis
|
||||
const agentResult = await Task({
|
||||
const agentResult = await Agent({
|
||||
subagent_type: '\${agent.type}',
|
||||
prompt: \`
|
||||
\${generateAgentPrompt(analysis_type, scope)}
|
||||
@@ -408,7 +408,7 @@ const semanticContext = await mcp__ace_tool__search_context({
|
||||
});
|
||||
|
||||
// Use semantic search results as Agent input context
|
||||
const agentResult = await Task({
|
||||
const agentResult = await Agent({
|
||||
subagent_type: 'Explore',
|
||||
prompt: \`
|
||||
Based on following semantic search results, perform in-depth analysis:
|
||||
|
||||
@@ -274,7 +274,7 @@ const tasks = [
|
||||
\`\`\`javascript
|
||||
const results = await Promise.all(
|
||||
tasks.map(task =>
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: 'universal-executor',
|
||||
run_in_background: false,
|
||||
prompt: task.prompt
|
||||
|
||||
@@ -223,7 +223,7 @@ function filterDocsByPhase(specs, phase, phaseIndex) {
|
||||
---
|
||||
name: api-docs-generator
|
||||
description: Generate API documentation from source code. Triggers on "generate api docs", "api documentation".
|
||||
allowed-tools: Task, Read, Write, Glob, Grep, Bash
|
||||
allowed-tools: Agent, Read, Write, Glob, Grep, Bash
|
||||
---
|
||||
|
||||
# API Docs Generator
|
||||
@@ -265,7 +265,7 @@ Phase 3: Generation → api-docs.md
|
||||
---
|
||||
name: task-manager
|
||||
description: Interactive task management with CRUD operations. Triggers on "manage tasks", "task list".
|
||||
allowed-tools: Task, AskUserQuestion, Read, Write
|
||||
allowed-tools: Agent, AskUserQuestion, Read, Write
|
||||
---
|
||||
|
||||
# Task Manager
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: skill-tuning
|
||||
description: Universal skill diagnosis and optimization tool. Detect and fix skill execution issues including context explosion, long-tail forgetting, data flow disruption, and agent coordination failures. Supports Gemini CLI for deep analysis. Triggers on "skill tuning", "tune skill", "skill diagnosis", "optimize skill", "skill debug".
|
||||
allowed-tools: Task, AskUserQuestion, Read, Write, Bash, Glob, Grep, mcp__ace-tool__search_context
|
||||
allowed-tools: Agent, AskUserQuestion, Read, Write, Bash, Glob, Grep, mcp__ace-tool__search_context
|
||||
---
|
||||
|
||||
# Skill Tuning
|
||||
|
||||
@@ -193,7 +193,7 @@ async function execute(state, workDir) {
|
||||
type: 'agent_failure',
|
||||
severity: 'medium',
|
||||
location: { file: 'SKILL.md' },
|
||||
description: 'Task tool used but not declared in allowed-tools',
|
||||
description: 'Agent tool used but not declared in allowed-tools',
|
||||
evidence: [`${totalCalls} Task calls found, but Task not in allowed-tools`],
|
||||
root_cause: 'Tool declaration mismatch',
|
||||
impact: 'May cause runtime permission issues',
|
||||
|
||||
@@ -216,7 +216,7 @@ async function execute(state, workDir) {
|
||||
file: 'phases/*.md',
|
||||
action: 'modify',
|
||||
diff: `+ try {
|
||||
const result = await Task({...});
|
||||
const result = await Agent({...});
|
||||
+ if (!result) throw new Error('Empty result');
|
||||
+ } catch (e) {
|
||||
+ updateState({ errors: [...errors, e.message], error_count: error_count + 1 });
|
||||
|
||||
@@ -99,8 +99,9 @@ async function runOrchestrator(workDir) {
|
||||
target_skill: { name: state.target_skill.name, path: state.target_skill.path }
|
||||
};
|
||||
|
||||
const result = await Task({
|
||||
const result = await Agent({
|
||||
subagent_type: 'universal-executor',
|
||||
description: `Execute skill-tuning action: ${actionId}`,
|
||||
run_in_background: false,
|
||||
prompt: `
|
||||
[CONTEXT]
|
||||
|
||||
@@ -114,18 +114,21 @@ Write(`${workDir}/final-output.json`, finalResult); // 只存最终结果
|
||||
// 上下文流转模式
|
||||
async function executePhase(context) {
|
||||
const { previousResult, constraints, config } = context;
|
||||
|
||||
const result = await Task({
|
||||
|
||||
const result = await Agent({
|
||||
subagent_type: 'universal-executor',
|
||||
description: 'Execute phase with context passing',
|
||||
run_in_background: false,
|
||||
prompt: `
|
||||
[CONTEXT]
|
||||
Previous: ${JSON.stringify(previousResult)}
|
||||
Constraints: ${constraints.join(', ')}
|
||||
|
||||
|
||||
[TASK]
|
||||
Process and return result directly.
|
||||
`
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
...context,
|
||||
currentResult: result,
|
||||
|
||||
@@ -140,8 +140,10 @@ function updateHistory(state, newItem) {
|
||||
|
||||
```javascript
|
||||
// Add summarization before passing to next phase
|
||||
const summary = await Task({
|
||||
const summary = await Agent({
|
||||
subagent_type: 'universal-executor',
|
||||
description: 'Summarize content for context compression',
|
||||
run_in_background: false,
|
||||
prompt: `Summarize in <100 words: ${fullContent}\nReturn JSON: { summary, key_points[] }`
|
||||
});
|
||||
nextPhasePrompt = `Previous summary: ${summary.summary}`;
|
||||
@@ -268,12 +270,17 @@ function validateAgentResult(result, requiredFields) {
|
||||
### flatten_nesting
|
||||
|
||||
```javascript
|
||||
// Before: Agent A's prompt tells it to call Task({subagent_type: 'B'})
|
||||
// Before: Agent A's prompt tells it to call Agent({subagent_type: 'B'})
|
||||
// After: Agent A returns signal, orchestrator handles
|
||||
// Agent A: return { needs_agent_b: true, context: {...} }
|
||||
// Orchestrator:
|
||||
if (parsedA.needs_agent_b) {
|
||||
resultB = await Task({ subagent_type: 'B', prompt: `Context: ${parsedA.context}` });
|
||||
resultB = await Agent({
|
||||
subagent_type: 'B',
|
||||
description: 'Handle delegated task from Agent A',
|
||||
run_in_background: false,
|
||||
prompt: `Context: ${parsedA.context}`
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: spec-generator
|
||||
description: Specification generator - 6 phase document chain producing product brief, PRD, architecture, and epics. Triggers on "generate spec", "create specification", "spec generator", "workflow:spec".
|
||||
allowed-tools: Task, AskUserQuestion, TaskCreate, TaskUpdate, TaskList, Read, Write, Edit, Bash, Glob, Grep, Skill
|
||||
allowed-tools: Agent, AskUserQuestion, TaskCreate, TaskUpdate, TaskList, Read, Write, Edit, Bash, Glob, Grep, Skill
|
||||
---
|
||||
|
||||
# Spec Generator
|
||||
|
||||
@@ -117,7 +117,7 @@ const hasCodebase = Glob('**/*.{ts,js,py,java,go,rs}').length > 0
|
||||
|| Glob('Cargo.toml').length > 0;
|
||||
|
||||
if (hasCodebase) {
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: `Explore codebase for spec: ${slug}`,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: team-arch-opt
|
||||
description: Unified team skill for architecture optimization. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on "team arch-opt".
|
||||
allowed-tools: Task, TaskCreate, TaskList, TaskGet, TaskUpdate, TeamCreate, TeamDelete, SendMessage, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep, mcp__ace-tool__search_context
|
||||
allowed-tools: Agent, TaskCreate, TaskList, TaskGet, TaskUpdate, TeamCreate, TeamDelete, SendMessage, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep, mcp__ace-tool__search_context
|
||||
---
|
||||
|
||||
# Team Architecture Optimization
|
||||
@@ -27,7 +27,7 @@ Unified team skill: Analyze codebase architecture, identify structural issues (d
|
||||
analyzer desig- refact- valid- review-
|
||||
ner orer ator er
|
||||
|
||||
Subagents (callable by workers, not team members):
|
||||
CLI Tools (callable by workers inline):
|
||||
[explore] [discuss]
|
||||
|
||||
(tw) = team-worker agent
|
||||
@@ -52,12 +52,12 @@ Parse `$ARGUMENTS`. No `--role` needed -- always routes to coordinator.
|
||||
| validator | [role-specs/validator.md](role-specs/validator.md) | VALIDATE-* | validation | false |
|
||||
| reviewer | [role-specs/reviewer.md](role-specs/reviewer.md) | REVIEW-* / QUALITY-* | read_only_analysis | false |
|
||||
|
||||
### Subagent Registry
|
||||
### CLI Tool Registry
|
||||
|
||||
| Subagent | Spec | Callable By | Purpose |
|
||||
|----------|------|-------------|---------|
|
||||
| explore | [subagents/explore-subagent.md](subagents/explore-subagent.md) | analyzer, refactorer | Shared codebase exploration for architecture-critical structures and dependency graphs |
|
||||
| discuss | [subagents/discuss-subagent.md](subagents/discuss-subagent.md) | designer, reviewer | Multi-perspective discussion for refactoring approaches and review findings |
|
||||
| Tool | Spec | Used By | Purpose |
|
||||
|------|------|---------|---------|
|
||||
| explore | [cli-tools/explore.md](cli-tools/explore.md) | analyzer, refactorer | Shared codebase exploration for architecture-critical structures and dependency graphs |
|
||||
| discuss | [cli-tools/discuss.md](cli-tools/discuss.md) | designer, reviewer | Multi-perspective discussion for refactoring approaches and review findings |
|
||||
|
||||
### Dispatch
|
||||
|
||||
@@ -137,7 +137,7 @@ Phase 3 needs task dispatch
|
||||
When coordinator spawns workers, use `team-worker` agent with role-spec path:
|
||||
|
||||
```
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker",
|
||||
team_name: <team-name>,
|
||||
@@ -361,7 +361,7 @@ AskUserQuestion({
|
||||
|
||||
| Choice | Action |
|
||||
|--------|--------|
|
||||
| Archive & Clean | Update session status="completed" -> TeamDelete(arch-opt) -> output final summary |
|
||||
| Archive & Clean | Update session status="completed" -> TeamDelete() -> output final summary |
|
||||
| Keep Active | Update session status="paused" -> output resume instructions: `Skill(skill="team-arch-opt", args="resume")` |
|
||||
| Export Results | AskUserQuestion for target path -> copy deliverables -> Archive & Clean |
|
||||
|
||||
@@ -384,7 +384,9 @@ AskUserQuestion({
|
||||
| +-- <hash>.md # Cached exploration results
|
||||
+-- wisdom/
|
||||
| +-- patterns.md # Discovered patterns and conventions
|
||||
| +-- shared-memory.json # Cross-role structured data
|
||||
+-- .msg/
|
||||
| +-- messages.jsonl # Message bus log
|
||||
| +-- meta.json # Session state + cross-role state
|
||||
+-- discussions/
|
||||
| +-- DISCUSS-REFACTOR.md # Refactoring design discussion record
|
||||
| +-- DISCUSS-REVIEW.md # Review discussion record
|
||||
@@ -458,7 +460,7 @@ Coordinator supports `--resume` / `--continue` for interrupted sessions:
|
||||
|----------|------------|
|
||||
| Role spec file not found | Error with expected path (role-specs/<name>.md) |
|
||||
| Command file not found | Fallback to inline execution in coordinator role.md |
|
||||
| Subagent spec not found | Error with expected path (subagents/<name>-subagent.md) |
|
||||
| CLI tool spec not found | Error with expected path (cli-tools/<name>.md) |
|
||||
| Fast-advance orphan detected | Coordinator resets task to pending on next check |
|
||||
| consensus_blocked HIGH | Coordinator creates revision task or pauses pipeline |
|
||||
| team-worker agent unavailable | Error: requires .claude/agents/team-worker.md |
|
||||
@@ -468,7 +470,7 @@ Coordinator supports `--resume` / `--continue` for interrupted sessions:
|
||||
| Review-fix cycle exceeds 3 iterations | Escalate to user with summary of remaining issues (per-branch/pipeline scope) |
|
||||
| One branch REFACTOR fails | Mark that branch failed, other branches continue to completion |
|
||||
| Branch scope overlap detected | Designer constrains non-overlapping target files; REFACTOR logs warning on detection |
|
||||
| Shared-memory concurrent writes | Each worker writes only its own namespace key (e.g., `refactorer.B01`) |
|
||||
| Meta.json concurrent writes | Each worker writes only its own namespace key (e.g., `refactorer.B01`) |
|
||||
| Branch fix cycle >= 3 | Escalate only that branch to user, other branches continue independently |
|
||||
| max_branches exceeded | Coordinator truncates to top N refactorings by priority at CP-2.5 |
|
||||
| Independent pipeline partial failure | Failed pipeline marked, others continue; aggregate reports partial results |
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
prefix: ANALYZE
|
||||
inner_loop: false
|
||||
subagents: [explore]
|
||||
cli_tools: [explore]
|
||||
message_types:
|
||||
success: analyze_complete
|
||||
error: error
|
||||
@@ -17,7 +17,7 @@ Analyze codebase architecture to identify structural issues: dependency cycles,
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | No |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path and target scope from task description
|
||||
2. Detect project type by scanning for framework markers:
|
||||
@@ -31,7 +31,7 @@ Analyze codebase architecture to identify structural issues: dependency cycles,
|
||||
| CLI entry / bin/ directory | CLI Tool | Command structure, plugin architecture, configuration layering |
|
||||
| No detection | Generic | All architecture dimensions |
|
||||
|
||||
3. Use `explore` subagent to map module structure, dependency graph, and layer boundaries within target scope
|
||||
3. Use `explore` CLI tool to map module structure, dependency graph, and layer boundaries within target scope
|
||||
4. Detect available analysis tools (linters, dependency analyzers, build tools)
|
||||
|
||||
## Phase 3: Architecture Analysis
|
||||
@@ -76,5 +76,5 @@ Execute analysis based on detected project type:
|
||||
- Evidence summary per issue
|
||||
- Detected project type and analysis methods used
|
||||
|
||||
3. Update `<session>/wisdom/shared-memory.json` under `analyzer` namespace:
|
||||
3. Update `<session>/wisdom/.msg/meta.json` under `analyzer` namespace:
|
||||
- Read existing -> merge `{ "analyzer": { project_type, issue_count, top_issue, scope, categories } }` -> write back
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
prefix: DESIGN
|
||||
inner_loop: false
|
||||
discuss_rounds: [DISCUSS-REFACTOR]
|
||||
subagents: [discuss]
|
||||
cli_tools: [discuss]
|
||||
message_types:
|
||||
success: design_complete
|
||||
error: error
|
||||
@@ -18,13 +18,13 @@ Analyze architecture reports and baseline metrics to design a prioritized refact
|
||||
|-------|--------|----------|
|
||||
| Architecture report | <session>/artifacts/architecture-report.md | Yes |
|
||||
| Architecture baseline | <session>/artifacts/architecture-baseline.json | Yes |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
||||
| Wisdom files | <session>/wisdom/patterns.md | No |
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Read architecture report -- extract ranked issue list with severities and categories
|
||||
3. Read architecture baseline -- extract current structural metrics
|
||||
4. Load shared-memory.json for analyzer findings (project_type, scope)
|
||||
4. Load .msg/meta.json for analyzer findings (project_type, scope)
|
||||
5. Assess overall refactoring complexity:
|
||||
|
||||
| Issue Count | Severity Mix | Complexity |
|
||||
@@ -57,7 +57,7 @@ Prioritize refactorings by impact/effort ratio:
|
||||
| P2 (Medium) | Medium impact + Low effort (duplication extraction) |
|
||||
| P3 (Low) | Low impact or High effort -- defer (large God Class decomposition) |
|
||||
|
||||
If complexity is High, invoke `discuss` subagent (DISCUSS-REFACTOR round) to evaluate trade-offs between competing strategies before finalizing the plan.
|
||||
If complexity is High, invoke `discuss` CLI tool (DISCUSS-REFACTOR round) to evaluate trade-offs between competing strategies before finalizing the plan.
|
||||
|
||||
Define measurable success criteria per refactoring (target metric improvement or structural change).
|
||||
|
||||
@@ -91,7 +91,7 @@ Define measurable success criteria per refactoring (target metric improvement or
|
||||
- Each refactoring must be **non-overlapping** in target files (no two REFACTOR-IDs modify the same file unless explicitly noted with conflict resolution)
|
||||
- Implementation guidance must be self-contained -- a branch refactorer should be able to work from a single REFACTOR block without reading others
|
||||
|
||||
2. Update `<session>/wisdom/shared-memory.json` under `designer` namespace:
|
||||
2. Update `<session>/wisdom/.msg/meta.json` under `designer` namespace:
|
||||
- Read existing -> merge -> write back:
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
prefix: REFACTOR
|
||||
inner_loop: true
|
||||
additional_prefixes: [FIX]
|
||||
subagents: [explore]
|
||||
cli_tools: [explore]
|
||||
message_types:
|
||||
success: refactor_complete
|
||||
error: error
|
||||
@@ -28,7 +28,7 @@ Implement architecture refactoring changes following the design plan. For FIX ta
|
||||
| Branch refactoring detail | <session>/artifacts/branches/B{NN}/refactoring-detail.md | Yes (REFACTOR with branch) |
|
||||
| Pipeline refactoring plan | <session>/artifacts/pipelines/{P}/refactoring-plan.md | Yes (REFACTOR with pipeline) |
|
||||
| Review/validation feedback | From task description | Yes (FIX) |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
||||
| Wisdom files | <session>/wisdom/patterns.md | No |
|
||||
| Context accumulator | From prior REFACTOR/FIX tasks | Yes (inner loop) |
|
||||
|
||||
@@ -47,10 +47,10 @@ Implement architecture refactoring changes following the design plan. For FIX ta
|
||||
- **Independent pipeline**: Read `<session>/artifacts/pipelines/{P}/refactoring-plan.md` -- extract this pipeline's plan
|
||||
|
||||
4. For FIX: parse review/validation feedback for specific issues to address
|
||||
5. Use `explore` subagent to load implementation context for target files
|
||||
5. Use `explore` CLI tool to load implementation context for target files
|
||||
6. For inner loop (single mode only): load context_accumulator from prior REFACTOR/FIX tasks
|
||||
|
||||
**Shared-memory namespace**:
|
||||
**Meta.json namespace**:
|
||||
- Single: write to `refactorer` namespace
|
||||
- Fan-out: write to `refactorer.B{NN}` namespace
|
||||
- Independent: write to `refactorer.{P}` namespace
|
||||
|
||||
@@ -3,7 +3,7 @@ prefix: REVIEW
|
||||
inner_loop: false
|
||||
additional_prefixes: [QUALITY]
|
||||
discuss_rounds: [DISCUSS-REVIEW]
|
||||
subagents: [discuss]
|
||||
cli_tools: [discuss]
|
||||
message_types:
|
||||
success: review_complete
|
||||
error: error
|
||||
@@ -21,7 +21,7 @@ Review refactoring code changes for correctness, pattern consistency, completene
|
||||
| Refactoring code changes | From REFACTOR task artifacts / git diff | Yes |
|
||||
| Refactoring plan / detail | Varies by mode (see below) | Yes |
|
||||
| Validation results | Varies by mode (see below) | No |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
||||
|
||||
1. Extract session path from task description
|
||||
2. **Detect branch/pipeline context** from task description:
|
||||
@@ -37,7 +37,7 @@ Review refactoring code changes for correctness, pattern consistency, completene
|
||||
- Fan-out branch: Read `<session>/artifacts/branches/B{NN}/refactoring-detail.md`
|
||||
- Independent: Read `<session>/artifacts/pipelines/{P}/refactoring-plan.md`
|
||||
|
||||
4. Load shared-memory.json for scoped refactorer namespace:
|
||||
4. Load .msg/meta.json for scoped refactorer namespace:
|
||||
- Single: `refactorer` namespace
|
||||
- Fan-out: `refactorer.B{NN}` namespace
|
||||
- Independent: `refactorer.{P}` namespace
|
||||
@@ -90,7 +90,7 @@ Per-dimension review process:
|
||||
- Dependency direction follows layer conventions (dependencies flow inward)
|
||||
- Appropriate abstraction level (not over-engineered, not under-abstracted)
|
||||
|
||||
If any Critical findings detected, invoke `discuss` subagent (DISCUSS-REVIEW round) to validate the assessment before issuing verdict.
|
||||
If any Critical findings detected, invoke `discuss` CLI tool (DISCUSS-REVIEW round) to validate the assessment before issuing verdict.
|
||||
|
||||
## Phase 4: Verdict & Feedback
|
||||
|
||||
@@ -108,7 +108,7 @@ Classify overall verdict based on findings:
|
||||
- Independent: `<session>/artifacts/pipelines/{P}/review-report.md`
|
||||
- Content: Per-dimension findings with severity, file:line, description; Overall verdict with rationale; Specific fix instructions for REVISE/REJECT verdicts
|
||||
|
||||
2. Update `<session>/wisdom/shared-memory.json` under scoped namespace:
|
||||
2. Update `<session>/wisdom/.msg/meta.json` under scoped namespace:
|
||||
- Single: merge `{ "reviewer": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
||||
- Fan-out: merge `{ "reviewer.B{NN}": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
||||
- Independent: merge `{ "reviewer.{P}": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
||||
|
||||
@@ -17,7 +17,7 @@ Validate refactoring changes by running build checks, test suites, dependency me
|
||||
|-------|--------|----------|
|
||||
| Architecture baseline | <session>/artifacts/architecture-baseline.json (shared) | Yes |
|
||||
| Refactoring plan / detail | Varies by mode (see below) | Yes |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
||||
|
||||
1. Extract session path from task description
|
||||
2. **Detect branch/pipeline context** from task description:
|
||||
@@ -37,7 +37,7 @@ Validate refactoring changes by running build checks, test suites, dependency me
|
||||
- Fan-out branch: Read `<session>/artifacts/branches/B{NN}/refactoring-detail.md` -- only this branch's criteria
|
||||
- Independent: Read `<session>/artifacts/pipelines/{P}/refactoring-plan.md`
|
||||
|
||||
5. Load shared-memory.json for project type and refactoring scope
|
||||
5. Load .msg/meta.json for project type and refactoring scope
|
||||
6. Detect available validation tools from project:
|
||||
|
||||
| Signal | Validation Tool | Method |
|
||||
@@ -50,7 +50,7 @@ Validate refactoring changes by running build checks, test suites, dependency me
|
||||
| Makefile with test target | Custom tests | make test |
|
||||
| No tooling detected | Manual validation | File existence + import grep checks |
|
||||
|
||||
7. Get changed files scope from shared-memory:
|
||||
7. Get changed files scope from .msg/meta.json:
|
||||
- Single: `refactorer` namespace
|
||||
- Fan-out: `refactorer.B{NN}` namespace
|
||||
- Independent: `refactorer.{P}` namespace
|
||||
@@ -108,7 +108,7 @@ Compare against baseline and plan criteria:
|
||||
- Independent: `<session>/artifacts/pipelines/{P}/validation-results.json`
|
||||
- Content: Per-dimension: name, baseline value, current value, improvement/regression, verdict; Overall verdict: PASS / WARN / FAIL; Failure details (if any)
|
||||
|
||||
2. Update `<session>/wisdom/shared-memory.json` under scoped namespace:
|
||||
2. Update `<session>/wisdom/.msg/meta.json` under scoped namespace:
|
||||
- Single: merge `{ "validator": { verdict, improvements, regressions, build_pass, test_pass } }`
|
||||
- Fan-out: merge `{ "validator.B{NN}": { verdict, improvements, regressions, build_pass, test_pass } }`
|
||||
- Independent: merge `{ "validator.{P}": { verdict, improvements, regressions, build_pass, test_pass } }`
|
||||
|
||||
@@ -27,7 +27,6 @@ Every task description uses structured format for clarity:
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "<TASK-ID>",
|
||||
owner: "<role>",
|
||||
description: "PURPOSE: <what this task achieves> | Success: <measurable completion criteria>
|
||||
TASK:
|
||||
- <step 1: specific action>
|
||||
@@ -38,15 +37,14 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: <branch-id or 'none'>
|
||||
- Upstream artifacts: <artifact-1>, <artifact-2>
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <deliverable path> + <quality criteria>
|
||||
CONSTRAINTS: <scope limits, focus areas>
|
||||
---
|
||||
InnerLoop: <true|false>
|
||||
BranchId: <B01|A|none>",
|
||||
blockedBy: [<dependency-list>],
|
||||
status: "pending"
|
||||
BranchId: <B01|A|none>"
|
||||
})
|
||||
TaskUpdate({ taskId: "<TASK-ID>", addBlockedBy: [<dependency-list>], owner: "<role>" })
|
||||
```
|
||||
|
||||
### Mode Router
|
||||
@@ -77,13 +75,13 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <session>/artifacts/architecture-baseline.json + <session>/artifacts/architecture-report.md | Quantified metrics with evidence
|
||||
CONSTRAINTS: Focus on <refactoring-scope> | Analyze before any changes
|
||||
---
|
||||
InnerLoop: false",
|
||||
status: "pending"
|
||||
InnerLoop: false"
|
||||
})
|
||||
TaskUpdate({ taskId: "ANALYZE-001", owner: "analyzer" })
|
||||
```
|
||||
|
||||
**DESIGN-001** (designer, Stage 2):
|
||||
@@ -101,14 +99,13 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Upstream artifacts: architecture-baseline.json, architecture-report.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <session>/artifacts/refactoring-plan.md | Priority-ordered with structural improvement targets, discrete REFACTOR-IDs
|
||||
CONSTRAINTS: Focus on highest-impact refactorings | Risk assessment required | Non-overlapping file targets per REFACTOR-ID
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["ANALYZE-001"],
|
||||
status: "pending"
|
||||
InnerLoop: false"
|
||||
})
|
||||
TaskUpdate({ taskId: "DESIGN-001", addBlockedBy: ["ANALYZE-001"], owner: "designer" })
|
||||
```
|
||||
|
||||
**REFACTOR-001** (refactorer, Stage 3):
|
||||
@@ -126,14 +123,13 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Upstream artifacts: refactoring-plan.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: Modified source files + validation passing | Refactorings applied without regressions
|
||||
CONSTRAINTS: Preserve existing behavior | Update all references | Follow code conventions
|
||||
---
|
||||
InnerLoop: true",
|
||||
blockedBy: ["DESIGN-001"],
|
||||
status: "pending"
|
||||
InnerLoop: true"
|
||||
})
|
||||
TaskUpdate({ taskId: "REFACTOR-001", addBlockedBy: ["DESIGN-001"], owner: "refactorer" })
|
||||
```
|
||||
|
||||
**VALIDATE-001** (validator, Stage 4 - parallel):
|
||||
@@ -152,14 +148,13 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Upstream artifacts: architecture-baseline.json, refactoring-plan.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <session>/artifacts/validation-results.json | Per-dimension validation with verdicts
|
||||
CONSTRAINTS: Must compare against baseline | Flag any regressions or broken imports
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["REFACTOR-001"],
|
||||
status: "pending"
|
||||
InnerLoop: false"
|
||||
})
|
||||
TaskUpdate({ taskId: "VALIDATE-001", addBlockedBy: ["REFACTOR-001"], owner: "validator" })
|
||||
```
|
||||
|
||||
**REVIEW-001** (reviewer, Stage 4 - parallel):
|
||||
@@ -176,14 +171,13 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Upstream artifacts: refactoring-plan.md, validation-results.json (if available)
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <session>/artifacts/review-report.md | Per-dimension findings with severity
|
||||
CONSTRAINTS: Focus on refactoring changes only | Provide specific file:line references
|
||||
---
|
||||
InnerLoop: false",
|
||||
blockedBy: ["REFACTOR-001"],
|
||||
status: "pending"
|
||||
InnerLoop: false"
|
||||
})
|
||||
TaskUpdate({ taskId: "REVIEW-001", addBlockedBy: ["REFACTOR-001"], owner: "reviewer" })
|
||||
```
|
||||
|
||||
---
|
||||
@@ -210,17 +204,21 @@ For each target index `i` (0-based), with prefix char `P = pipeline_prefix_chars
|
||||
// Create session subdirectory for this pipeline
|
||||
Bash("mkdir -p <session>/artifacts/pipelines/<P>")
|
||||
|
||||
TaskCreate({ subject: "ANALYZE-<P>01", ... }) // blockedBy: []
|
||||
TaskCreate({ subject: "DESIGN-<P>01", ... }) // blockedBy: ["ANALYZE-<P>01"]
|
||||
TaskCreate({ subject: "REFACTOR-<P>01", ... }) // blockedBy: ["DESIGN-<P>01"]
|
||||
TaskCreate({ subject: "VALIDATE-<P>01", ... }) // blockedBy: ["REFACTOR-<P>01"]
|
||||
TaskCreate({ subject: "REVIEW-<P>01", ... }) // blockedBy: ["REFACTOR-<P>01"]
|
||||
TaskCreate({ subject: "ANALYZE-<P>01", ... })
|
||||
TaskCreate({ subject: "DESIGN-<P>01", ... })
|
||||
TaskUpdate({ taskId: "DESIGN-<P>01", addBlockedBy: ["ANALYZE-<P>01"] })
|
||||
TaskCreate({ subject: "REFACTOR-<P>01", ... })
|
||||
TaskUpdate({ taskId: "REFACTOR-<P>01", addBlockedBy: ["DESIGN-<P>01"] })
|
||||
TaskCreate({ subject: "VALIDATE-<P>01", ... })
|
||||
TaskUpdate({ taskId: "VALIDATE-<P>01", addBlockedBy: ["REFACTOR-<P>01"] })
|
||||
TaskCreate({ subject: "REVIEW-<P>01", ... })
|
||||
TaskUpdate({ taskId: "REVIEW-<P>01", addBlockedBy: ["REFACTOR-<P>01"] })
|
||||
```
|
||||
|
||||
Task descriptions follow same template as single mode, with additions:
|
||||
- `Pipeline: <P>` in CONTEXT
|
||||
- Artifact paths use `<session>/artifacts/pipelines/<P>/` instead of `<session>/artifacts/`
|
||||
- Shared-memory namespace uses `<role>.<P>` (e.g., `analyzer.A`, `refactorer.B`)
|
||||
- Meta.json namespace uses `<role>.<P>` (e.g., `analyzer.A`, `refactorer.B`)
|
||||
- Each pipeline's scope is its specific target from `independent_targets[i]`
|
||||
|
||||
Example for pipeline A with target "refactor auth module":
|
||||
@@ -236,14 +234,14 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: refactor auth module
|
||||
- Pipeline: A
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: analyzer.A)
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: analyzer.A)
|
||||
EXPECTED: <session>/artifacts/pipelines/A/architecture-baseline.json + architecture-report.md
|
||||
CONSTRAINTS: Focus on auth module scope
|
||||
---
|
||||
InnerLoop: false
|
||||
PipelineId: A",
|
||||
status: "pending"
|
||||
PipelineId: A"
|
||||
})
|
||||
TaskUpdate({ taskId: "ANALYZE-A01", owner: "analyzer" })
|
||||
```
|
||||
|
||||
---
|
||||
@@ -255,7 +253,7 @@ PipelineId: A",
|
||||
**Procedure**:
|
||||
|
||||
1. Read `<session>/artifacts/refactoring-plan.md` to count REFACTOR-IDs
|
||||
2. Read `shared-memory.json` -> `designer.refactoring_count`
|
||||
2. Read `.msg/meta.json` -> `designer.refactoring_count`
|
||||
3. **Auto mode decision**:
|
||||
|
||||
| Refactoring Count | Decision |
|
||||
@@ -293,15 +291,14 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Branch: B{NN}
|
||||
- Upstream artifacts: branches/B{NN}/refactoring-detail.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: refactorer.B{NN})
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: refactorer.B{NN})
|
||||
EXPECTED: Modified source files for REFACTOR-{NNN} only
|
||||
CONSTRAINTS: Only implement this branch's refactoring | Do not touch files outside REFACTOR-{NNN} scope
|
||||
---
|
||||
InnerLoop: false
|
||||
BranchId: B{NN}",
|
||||
blockedBy: ["DESIGN-001"],
|
||||
status: "pending"
|
||||
BranchId: B{NN}"
|
||||
})
|
||||
TaskUpdate({ taskId: "REFACTOR-B{NN}", addBlockedBy: ["DESIGN-001"], owner: "refactorer" })
|
||||
|
||||
TaskCreate({
|
||||
subject: "VALIDATE-B{NN}",
|
||||
@@ -314,36 +311,34 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Branch: B{NN}
|
||||
- Upstream artifacts: architecture-baseline.json, branches/B{NN}/refactoring-detail.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: validator.B{NN})
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: validator.B{NN})
|
||||
EXPECTED: <session>/artifacts/branches/B{NN}/validation-results.json
|
||||
CONSTRAINTS: Only validate this branch's changes
|
||||
---
|
||||
InnerLoop: false
|
||||
BranchId: B{NN}",
|
||||
blockedBy: ["REFACTOR-B{NN}"],
|
||||
status: "pending"
|
||||
BranchId: B{NN}"
|
||||
})
|
||||
TaskUpdate({ taskId: "VALIDATE-B{NN}", addBlockedBy: ["REFACTOR-B{NN}"], owner: "validator" })
|
||||
|
||||
TaskCreate({
|
||||
subject: "REVIEW-B{NN}",
|
||||
description: "PURPOSE: Review branch B{NN} refactoring code | Success: Code quality verified for REFACTOR-{NNN}
|
||||
TASK:
|
||||
- Load modified files from refactorer.B{NN} shared-memory namespace
|
||||
- Load modified files from refactorer.B{NN} namespace in .msg/meta.json
|
||||
- Review across 5 dimensions for this branch's changes only
|
||||
- Issue verdict: APPROVE, REVISE, or REJECT
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Branch: B{NN}
|
||||
- Upstream artifacts: branches/B{NN}/refactoring-detail.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: reviewer.B{NN})
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: reviewer.B{NN})
|
||||
EXPECTED: <session>/artifacts/branches/B{NN}/review-report.md
|
||||
CONSTRAINTS: Only review this branch's changes
|
||||
---
|
||||
InnerLoop: false
|
||||
BranchId: B{NN}",
|
||||
blockedBy: ["REFACTOR-B{NN}"],
|
||||
status: "pending"
|
||||
BranchId: B{NN}"
|
||||
})
|
||||
TaskUpdate({ taskId: "REVIEW-B{NN}", addBlockedBy: ["REFACTOR-B{NN}"], owner: "reviewer" })
|
||||
```
|
||||
|
||||
7. Update session.json:
|
||||
|
||||
@@ -65,7 +65,7 @@ Find and spawn the next ready tasks.
|
||||
2. For each ready task, spawn team-worker:
|
||||
|
||||
```
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker for <task-id>",
|
||||
team_name: "arch-opt",
|
||||
@@ -104,8 +104,8 @@ Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
|
||||
|
||||
When both VALIDATE-001 and REVIEW-001 are completed:
|
||||
|
||||
1. Read validation verdict from shared-memory (validator namespace)
|
||||
2. Read review verdict from shared-memory (reviewer namespace)
|
||||
1. Read validation verdict from .msg/meta.json (validator namespace)
|
||||
2. Read review verdict from .msg/meta.json (reviewer namespace)
|
||||
|
||||
| Validate Verdict | Review Verdict | Action |
|
||||
|-----------------|----------------|--------|
|
||||
@@ -166,15 +166,14 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Branch: B{NN}
|
||||
- Upstream artifacts: branches/B{NN}/review-report.md, branches/B{NN}/validation-results.json
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: refactorer.B{NN})
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: refactorer.B{NN})
|
||||
EXPECTED: Fixed source files for B{NN} only
|
||||
CONSTRAINTS: Targeted fixes only | Do not touch other branches
|
||||
---
|
||||
InnerLoop: false
|
||||
BranchId: B{NN}",
|
||||
blockedBy: [],
|
||||
status: "pending"
|
||||
BranchId: B{NN}"
|
||||
})
|
||||
TaskUpdate({ taskId: "FIX-B{NN}-{cycle}", owner: "refactorer" })
|
||||
```
|
||||
|
||||
Create new VALIDATE and REVIEW with retry suffix:
|
||||
@@ -186,9 +185,8 @@ Create new VALIDATE and REVIEW with retry suffix:
|
||||
TaskCreate({
|
||||
subject: "FIX-{P}01-{cycle}",
|
||||
...same pattern with pipeline prefix...
|
||||
blockedBy: [],
|
||||
status: "pending"
|
||||
})
|
||||
TaskUpdate({ taskId: "FIX-{P}01-{cycle}", owner: "refactorer" })
|
||||
```
|
||||
|
||||
Create `VALIDATE-{P}01-R{cycle}` and `REVIEW-{P}01-R{cycle}`.
|
||||
|
||||
@@ -69,7 +69,7 @@ For callback/check/resume/complete: load `commands/monitor.md` and execute match
|
||||
### Router Implementation
|
||||
|
||||
1. **Load session context** (if exists):
|
||||
- Scan `.workflow/.team/ARCH-OPT-*/team-session.json` for active/paused sessions
|
||||
- Scan `.workflow/.team/ARCH-OPT-*/.msg/meta.json` for active/paused sessions
|
||||
- If found, extract session folder path, status, and `parallel_mode`
|
||||
|
||||
2. **Parse $ARGUMENTS** for detection keywords:
|
||||
@@ -186,13 +186,25 @@ Bash("mkdir -p .workflow/<session-id>/artifacts/pipelines/A .workflow/<session-i
|
||||
- `independent_targets`: populated for independent mode (e.g., ["refactor auth", "refactor API"])
|
||||
- `fix_cycles`: populated per-branch/pipeline as fix cycles occur
|
||||
|
||||
3. Initialize shared-memory.json:
|
||||
|
||||
```
|
||||
Write("<session>/wisdom/shared-memory.json", { "session_id": "<session-id>", "requirement": "<requirement>", "parallel_mode": "<mode>" })
|
||||
4. Initialize meta.json with pipeline metadata:
|
||||
```typescript
|
||||
// Use team_msg to write pipeline metadata to .msg/meta.json
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: "<session-id>",
|
||||
from: "coordinator",
|
||||
type: "state_update",
|
||||
summary: "Session initialized",
|
||||
data: {
|
||||
pipeline_mode: "<parallel_mode>",
|
||||
pipeline_stages: ["analyzer", "designer", "refactorer", "validator", "reviewer"],
|
||||
roles: ["coordinator", "analyzer", "designer", "refactorer", "validator", "reviewer"],
|
||||
team_name: "arch-opt"
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
4. Create team:
|
||||
5. Create team:
|
||||
|
||||
```
|
||||
TeamCreate({ team_name: "arch-opt" })
|
||||
@@ -217,7 +229,7 @@ Execute `commands/dispatch.md` inline (Command Execution Protocol):
|
||||
Find first unblocked task and spawn its worker:
|
||||
|
||||
```
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn analyzer worker",
|
||||
team_name: "arch-opt",
|
||||
@@ -286,6 +298,6 @@ AskUserQuestion({
|
||||
|
||||
| Choice | Steps |
|
||||
|--------|-------|
|
||||
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete("arch-opt") -> output final summary with artifact paths |
|
||||
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete() -> output final summary with artifact paths |
|
||||
| Keep Active | Update session status="paused" -> output: "Session paused. Resume with: Skill(skill='team-arch-opt', args='resume')" |
|
||||
| Export Results | AskUserQuestion for target directory -> copy all artifacts -> Archive & Clean flow |
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"inner_loop": false,
|
||||
"additional_prefixes": [],
|
||||
"discuss_rounds": [],
|
||||
"subagents": ["explore"],
|
||||
"cli_tools": ["explore"],
|
||||
"message_types": {
|
||||
"success": "analyze_complete",
|
||||
"error": "error"
|
||||
@@ -51,7 +51,7 @@
|
||||
"inner_loop": false,
|
||||
"additional_prefixes": [],
|
||||
"discuss_rounds": ["DISCUSS-REFACTOR"],
|
||||
"subagents": ["discuss"],
|
||||
"cli_tools": ["discuss"],
|
||||
"message_types": {
|
||||
"success": "design_complete",
|
||||
"error": "error"
|
||||
@@ -71,7 +71,7 @@
|
||||
"inner_loop": true,
|
||||
"additional_prefixes": ["FIX"],
|
||||
"discuss_rounds": [],
|
||||
"subagents": ["explore"],
|
||||
"cli_tools": ["explore"],
|
||||
"message_types": {
|
||||
"success": "refactor_complete",
|
||||
"error": "error",
|
||||
@@ -92,7 +92,7 @@
|
||||
"inner_loop": false,
|
||||
"additional_prefixes": [],
|
||||
"discuss_rounds": [],
|
||||
"subagents": [],
|
||||
"cli_tools": [],
|
||||
"message_types": {
|
||||
"success": "validate_complete",
|
||||
"error": "error",
|
||||
@@ -113,7 +113,7 @@
|
||||
"inner_loop": false,
|
||||
"additional_prefixes": ["QUALITY"],
|
||||
"discuss_rounds": ["DISCUSS-REVIEW"],
|
||||
"subagents": ["discuss"],
|
||||
"cli_tools": ["discuss"],
|
||||
"message_types": {
|
||||
"success": "review_complete",
|
||||
"error": "error",
|
||||
@@ -193,10 +193,10 @@
|
||||
"diagram": "See pipeline-diagram section"
|
||||
},
|
||||
|
||||
"subagents": [
|
||||
"cli_tools": [
|
||||
{
|
||||
"name": "explore",
|
||||
"agent_type": "cli-explore-agent",
|
||||
"implementation": "ccw cli with analysis mode",
|
||||
"callable_by": ["analyzer", "refactorer"],
|
||||
"purpose": "Shared codebase exploration for architecture-critical structures, dependency graphs, and module boundaries",
|
||||
"has_cache": true,
|
||||
@@ -204,7 +204,7 @@
|
||||
},
|
||||
{
|
||||
"name": "discuss",
|
||||
"agent_type": "cli-discuss-agent",
|
||||
"implementation": "ccw cli with analysis mode",
|
||||
"callable_by": ["designer", "reviewer"],
|
||||
"purpose": "Multi-perspective discussion for refactoring approaches and review findings",
|
||||
"has_cache": false
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
# Discuss Subagent
|
||||
|
||||
Multi-perspective discussion for evaluating refactoring strategies and reviewing code change quality. Used by designer (DISCUSS-REFACTOR) and reviewer (DISCUSS-REVIEW) when complex trade-offs require multi-angle analysis.
|
||||
|
||||
## Design Rationale
|
||||
|
||||
Complex refactoring decisions (e.g., choosing between dependency inversion vs mediator pattern to break a cycle) and nuanced code review findings (e.g., evaluating whether a temporary coupling increase is acceptable) benefit from structured multi-perspective analysis. This subagent provides that analysis inline without spawning additional team members.
|
||||
|
||||
## Invocation
|
||||
|
||||
Called by designer, reviewer after their primary analysis when complexity warrants multi-perspective evaluation:
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "cli-discuss-agent",
|
||||
run_in_background: false,
|
||||
description: "Discuss <round-id>: <topic> for architecture optimization",
|
||||
prompt: `Conduct a multi-perspective discussion on the following topic.
|
||||
|
||||
Round: <round-id>
|
||||
Topic: <discussion-topic>
|
||||
Session: <session-folder>
|
||||
|
||||
Context:
|
||||
<relevant-context-from-calling-role>
|
||||
|
||||
Perspectives to consider:
|
||||
- Architecture impact: Will this actually improve the target structural metric?
|
||||
- Risk assessment: What could break? Dangling references? Behavioral changes? Migration risk?
|
||||
- Maintainability: Is the refactored code more understandable and maintainable?
|
||||
- Alternative approaches: Are there simpler or safer ways to achieve the same structural improvement?
|
||||
|
||||
Evaluate trade-offs and provide a structured recommendation with:
|
||||
- Consensus verdict: proceed / revise / escalate
|
||||
- Confidence level: high / medium / low
|
||||
- Key trade-offs identified
|
||||
- Recommended approach with rationale
|
||||
- Dissenting perspectives (if any)`
|
||||
})
|
||||
```
|
||||
|
||||
## Round Configuration
|
||||
|
||||
| Round | Artifact | Parameters | Calling Role |
|
||||
|-------|----------|------------|-------------|
|
||||
| DISCUSS-REFACTOR | <session>/discussions/DISCUSS-REFACTOR.md | Refactoring strategy trade-offs | designer |
|
||||
| DISCUSS-REVIEW | <session>/discussions/DISCUSS-REVIEW.md | Code review finding validation | reviewer |
|
||||
|
||||
## Integration with Calling Role
|
||||
|
||||
The calling role is responsible for:
|
||||
|
||||
1. **Before calling**: Complete primary analysis, identify the specific trade-off or finding needing discussion
|
||||
2. **Calling**: Invoke subagent with round ID, topic, and relevant context
|
||||
3. **After calling**:
|
||||
|
||||
| Result | Action |
|
||||
|--------|--------|
|
||||
| consensus_reached (proceed) | Incorporate recommendation into output, continue |
|
||||
| consensus_reached (revise) | Adjust findings/strategy based on discussion insights |
|
||||
| consensus_blocked (HIGH) | Report to coordinator via message with severity |
|
||||
| consensus_blocked (MEDIUM) | Include in output with recommendation for revision |
|
||||
| consensus_blocked (LOW) | Note in output, proceed with original assessment |
|
||||
|
||||
## Output Schema
|
||||
|
||||
```json
|
||||
{
|
||||
"round_id": "<DISCUSS-REFACTOR|DISCUSS-REVIEW>",
|
||||
"topic": "<discussion-topic>",
|
||||
"verdict": "<proceed|revise|escalate>",
|
||||
"confidence": "<high|medium|low>",
|
||||
"trade_offs": [
|
||||
{ "dimension": "<architecture|risk|maintainability>", "pro": "<benefit>", "con": "<cost>" }
|
||||
],
|
||||
"recommendation": "<recommended-approach>",
|
||||
"rationale": "<reasoning>",
|
||||
"dissenting_views": ["<alternative-perspective>"]
|
||||
}
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Single perspective analysis fails | Continue with partial perspectives |
|
||||
| All analyses fail | Return basic recommendation from calling role's primary analysis |
|
||||
| Artifact not found | Return error immediately |
|
||||
| Discussion inconclusive | Return "revise" verdict with low confidence |
|
||||
@@ -1,113 +0,0 @@
|
||||
# Explore Subagent
|
||||
|
||||
Shared codebase exploration for discovering architecture-critical structures, dependency graphs, module boundaries, and layer organization. Results are cached to avoid redundant exploration across analyzer and refactorer roles.
|
||||
|
||||
## Design Rationale
|
||||
|
||||
Codebase exploration is a read-only operation shared between analyzer (mapping structural issues) and refactorer (understanding implementation context). Caching explorations avoids redundant work when refactorer re-explores structures the analyzer already mapped.
|
||||
|
||||
## Invocation
|
||||
|
||||
Called by analyzer, refactorer after needing codebase context for architecture analysis or implementation:
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: "Explore codebase for architecture-critical structures in <target-scope>",
|
||||
prompt: `Explore the codebase to identify architecture-critical structures.
|
||||
|
||||
Target scope: <target-scope>
|
||||
Session: <session-folder>
|
||||
Focus: <exploration-focus>
|
||||
|
||||
Tasks:
|
||||
1. Map the module structure, entry points, and layer boundaries within scope
|
||||
2. Build dependency graph (import/require relationships between modules)
|
||||
3. Identify architectural patterns (layering, dependency injection, event-driven, plugin architecture)
|
||||
4. Note any existing abstractions, interfaces, and module boundaries
|
||||
5. List key files with their roles, layer assignment, and dependency relationships
|
||||
|
||||
Output a structured exploration report with:
|
||||
- Module map (key files, their relationships, and layer assignments)
|
||||
- Dependency graph (directed edges between modules, cycle indicators)
|
||||
- Layer structure (identified layers and their boundaries)
|
||||
- Existing architectural patterns found
|
||||
- Architecture-relevant configuration (path aliases, barrel exports, module boundaries)`
|
||||
})
|
||||
```
|
||||
|
||||
## Cache Mechanism
|
||||
|
||||
### Cache Index Schema
|
||||
|
||||
`<session-folder>/explorations/cache-index.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"key": "<scope-hash>",
|
||||
"scope": "<target-scope>",
|
||||
"focus": "<exploration-focus>",
|
||||
"timestamp": "<ISO-8601>",
|
||||
"result_file": "<hash>.md"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Cache Lookup Rules
|
||||
|
||||
| Condition | Action |
|
||||
|-----------|--------|
|
||||
| Exact scope+focus match exists | Return cached result from <hash>.md |
|
||||
| No match | Execute subagent, cache result to <hash>.md, update index |
|
||||
| Cache file missing but index has entry | Remove stale entry, re-execute |
|
||||
| Cache older than current session | Use cached (explorations are stable within session) |
|
||||
|
||||
## Integration with Calling Role
|
||||
|
||||
The calling role is responsible for:
|
||||
|
||||
1. **Before calling**: Determine target scope and exploration focus
|
||||
2. **Calling**: Check cache first, invoke subagent only on cache miss
|
||||
3. **After calling**:
|
||||
|
||||
| Result | Action |
|
||||
|--------|--------|
|
||||
| Exploration successful | Use findings to inform analysis/implementation |
|
||||
| Exploration partial | Use available findings, note gaps |
|
||||
| Exploration failed | Proceed without exploration context, use direct file reading |
|
||||
|
||||
## Output Schema
|
||||
|
||||
```json
|
||||
{
|
||||
"scope": "<target-scope>",
|
||||
"module_map": [
|
||||
{ "file": "<path>", "role": "<description>", "layer": "<presentation|domain|data|infra>", "dependency_graph": { "imports": ["<path>"], "imported_by": ["<path>"] } }
|
||||
],
|
||||
"dependency_graph": {
|
||||
"nodes": ["<module-path>"],
|
||||
"edges": [{ "from": "<path>", "to": "<path>", "type": "<import|re-export|dynamic>" }],
|
||||
"cycles": [["<path-a>", "<path-b>", "<path-a>"]]
|
||||
},
|
||||
"layer_structure": [
|
||||
{ "layer": "<name>", "modules": ["<path>"], "violations": ["<description>"] }
|
||||
],
|
||||
"existing_patterns": [
|
||||
{ "type": "<pattern>", "location": "<file:line>", "description": "<what>" }
|
||||
],
|
||||
"investigation_targets": ["<file-or-pattern>"]
|
||||
}
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Single exploration angle fails | Continue with partial results |
|
||||
| All exploration fails | Return basic result from direct file listing |
|
||||
| Target scope not found | Return error immediately |
|
||||
| Cache corrupt | Clear cache-index.json, re-execute |
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: team-brainstorm
|
||||
description: Unified team skill for brainstorming team. All roles invoke this skill with --role arg for role-specific execution. Triggers on "team brainstorm".
|
||||
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Task(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
|
||||
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Agent(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
|
||||
---
|
||||
|
||||
# Team Brainstorm
|
||||
@@ -11,25 +11,34 @@ 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
|
||||
```
|
||||
|
||||
## 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
|
||||
@@ -38,13 +47,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 +110,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 +139,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 +152,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 +169,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 +186,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 +301,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",
|
||||
Agent({
|
||||
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",
|
||||
Agent({
|
||||
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 +363,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() -> 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
|
||||
delegates_to: []
|
||||
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
|
||||
delegates_to: []
|
||||
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
|
||||
delegates_to: []
|
||||
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
|
||||
delegates_to: []
|
||||
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
|
||||
@@ -1,167 +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 读取 shared-memory.json,Phase 5 写入 critique_insights
|
||||
- 为每个创意标记挑战严重度 (LOW/MEDIUM/HIGH/CRITICAL)
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- 生成创意、综合想法或评估排序
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务
|
||||
- 修改 shared-memory.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 shared-memory.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",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
from: "challenger",
|
||||
to: "coordinator",
|
||||
type: "critique_ready",
|
||||
summary: "[challenger] Critique complete: <critical>C/<high>H/<medium>M/<low>L -- Signal: <signal>",
|
||||
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")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 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 | shared-memory.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
|
||||
|
||||
### 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 shared-memory.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,257 +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",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
from: "coordinator",
|
||||
to: <recipient>,
|
||||
type: <message-type>,
|
||||
summary: "[coordinator] <action> complete: <subject>",
|
||||
ref: <artifact-path>
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from coordinator --to <recipient> --type <message-type> --summary \"[coordinator] <action> complete\" --ref <artifact-path> --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 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
|
||||
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 shared-memory.json for gc_round
|
||||
4. If criticalCount > 0 AND gcRound < max_gc_rounds:
|
||||
- Increment gc_round in shared-memory.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 |
|
||||
@@ -0,0 +1,206 @@
|
||||
# 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>",
|
||||
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"
|
||||
})
|
||||
TaskUpdate({ taskId: "<TASK-ID>", addBlockedBy: [<dependency-list>], owner: "<role>" })
|
||||
```
|
||||
|
||||
### 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",
|
||||
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"
|
||||
})
|
||||
TaskUpdate({ taskId: "IDEA-001", owner: "ideator" })
|
||||
```
|
||||
|
||||
**CHALLENGE-001** (challenger):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "CHALLENGE-001",
|
||||
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"
|
||||
})
|
||||
TaskUpdate({ taskId: "CHALLENGE-001", addBlockedBy: ["IDEA-001"], owner: "challenger" })
|
||||
```
|
||||
|
||||
**SYNTH-001** (synthesizer):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "SYNTH-001",
|
||||
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"
|
||||
})
|
||||
TaskUpdate({ taskId: "SYNTH-001", addBlockedBy: ["CHALLENGE-001"], owner: "synthesizer" })
|
||||
```
|
||||
|
||||
### Deep Pipeline
|
||||
|
||||
Creates all 6 tasks. First 2 same as Quick, then:
|
||||
|
||||
**IDEA-002** (ideator, GC revision):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "IDEA-002",
|
||||
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"
|
||||
})
|
||||
TaskUpdate({ taskId: "IDEA-002", addBlockedBy: ["CHALLENGE-001"], owner: "ideator" })
|
||||
```
|
||||
|
||||
**CHALLENGE-002** (challenger, round 2):
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "CHALLENGE-002",
|
||||
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"
|
||||
})
|
||||
TaskUpdate({ taskId: "CHALLENGE-002", addBlockedBy: ["IDEA-002"], owner: "challenger" })
|
||||
```
|
||||
|
||||
**SYNTH-001** blocked by CHALLENGE-002. **EVAL-001** blocked by SYNTH-001:
|
||||
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "EVAL-001",
|
||||
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"
|
||||
})
|
||||
TaskUpdate({ taskId: "EVAL-001", addBlockedBy: ["SYNTH-001"], owner: "evaluator" })
|
||||
```
|
||||
|
||||
### 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:
|
||||
|
||||
```
|
||||
Agent({
|
||||
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
|
||||
321
.claude/skills/team-brainstorm/roles/coordinator/role.md
Normal file
321
.claude/skills/team-brainstorm/roles/coordinator/role.md
Normal file
@@ -0,0 +1,321 @@
|
||||
# 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 meta.json with pipeline metadata:
|
||||
```typescript
|
||||
// Use team_msg to write pipeline metadata to .msg/meta.json
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: "<session-id>",
|
||||
from: "coordinator",
|
||||
type: "state_update",
|
||||
summary: "Session initialized",
|
||||
data: {
|
||||
pipeline_mode: "<mode>",
|
||||
pipeline_stages: ["ideator", "challenger", "synthesizer", "evaluator"],
|
||||
roles: ["coordinator", "ideator", "challenger", "synthesizer", "evaluator"],
|
||||
team_name: "brainstorm",
|
||||
topic: "<topic>",
|
||||
angles: ["<angle1>", "<angle2>"],
|
||||
gc_round": 0,
|
||||
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):
|
||||
|
||||
```
|
||||
Agent({
|
||||
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)
|
||||
Agent({
|
||||
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() -> 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 |
|
||||
@@ -1,157 +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 读取 shared-memory.json,Phase 5 写入 evaluation_scores
|
||||
- 使用标准化评分维度,确保评分可追溯
|
||||
- 为每个方案提供评分理由和推荐
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- 生成新创意、挑战假设或综合整合
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务
|
||||
- 修改 shared-memory.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 shared-memory.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",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
from: "evaluator",
|
||||
to: "coordinator",
|
||||
type: "evaluation_ready",
|
||||
summary: "[evaluator] Evaluation complete: Top pick \"<title>\" (<score>/10)",
|
||||
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")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 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 shared-memory.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,160 +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 读取 shared-memory.json,Phase 5 写入 generated_ideas
|
||||
- 针对每个指定角度产出至少3个创意
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- 执行挑战/评估/综合等其他角色工作
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务(TaskCreate 是 coordinator 专属)
|
||||
- 修改 shared-memory.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 shared-memory.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",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
from: "ideator",
|
||||
to: "coordinator",
|
||||
type: <ideas_ready|ideas_revised>,
|
||||
summary: "[ideator] <Generated|Revised> <count> ideas (round <num>)",
|
||||
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")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 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 | shared-memory.json | Yes |
|
||||
| Angles | shared-memory.json | Yes |
|
||||
| GC Round | shared-memory.json | Yes |
|
||||
| Previous critique | critiques/*.md | For revision tasks only |
|
||||
| Previous ideas | shared-memory.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
|
||||
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
|
||||
|
||||
### 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 shared-memory.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,168 +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 读取 shared-memory.json,Phase 5 写入 synthesis_themes
|
||||
- 从所有创意和挑战中提取共同主题
|
||||
- 解决相互矛盾的想法,生成整合方案
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- 生成新创意、挑战假设或评分排序
|
||||
- 直接与其他 worker 角色通信
|
||||
- 为其他角色创建任务
|
||||
- 修改 shared-memory.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 shared-memory.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",
|
||||
team: **<session-id>**, // MUST be session ID (e.g., BRS-xxx-date), NOT team name. Extract from Session: field.
|
||||
from: "synthesizer",
|
||||
to: "coordinator",
|
||||
type: "synthesis_ready",
|
||||
summary: "[synthesizer] Synthesis complete: <themeCount> themes, <proposalCount> proposals",
|
||||
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")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 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 | shared-memory.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 shared-memory.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 shared-memory.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 |
|
||||
@@ -1,133 +0,0 @@
|
||||
# Discuss Subagent
|
||||
|
||||
Lightweight multi-perspective critique engine. Called inline by any role needing peer review. Perspectives are dynamic -- specified by the calling role, not pre-defined.
|
||||
|
||||
## Design
|
||||
|
||||
Unlike team-lifecycle-v4's fixed perspective definitions (product, technical, quality, risk, coverage), team-coordinate uses **dynamic perspectives** passed in the prompt. The calling role decides what viewpoints matter for its artifact.
|
||||
|
||||
## Invocation
|
||||
|
||||
Called by roles after artifact creation:
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "cli-discuss-agent",
|
||||
run_in_background: false,
|
||||
description: "Discuss <round-id>",
|
||||
prompt: `## Multi-Perspective Critique: <round-id>
|
||||
|
||||
### Input
|
||||
- Artifact: <artifact-path>
|
||||
- Round: <round-id>
|
||||
- Session: <session-folder>
|
||||
|
||||
### Perspectives
|
||||
<Dynamic perspective list -- each entry defines: name, cli_tool, role_label, focus_areas>
|
||||
|
||||
Example:
|
||||
| Perspective | CLI Tool | Role | Focus Areas |
|
||||
|-------------|----------|------|-------------|
|
||||
| Feasibility | gemini | Engineer | Implementation complexity, technical risks, resource needs |
|
||||
| Clarity | codex | Editor | Readability, logical flow, completeness of explanation |
|
||||
| Accuracy | gemini | Domain Expert | Factual correctness, source reliability, claim verification |
|
||||
|
||||
### Execution Steps
|
||||
1. Read artifact from <artifact-path>
|
||||
2. For each perspective, launch CLI analysis in background:
|
||||
Bash(command="ccw cli -p 'PURPOSE: Analyze from <role> perspective for <round-id>
|
||||
TASK: <focus-areas>
|
||||
MODE: analysis
|
||||
CONTEXT: Artifact content below
|
||||
EXPECTED: JSON with strengths[], weaknesses[], suggestions[], rating (1-5)
|
||||
CONSTRAINTS: Output valid JSON only
|
||||
|
||||
Artifact:
|
||||
<artifact-content>' --tool <cli-tool> --mode analysis", run_in_background=true)
|
||||
3. Wait for all CLI results
|
||||
4. Divergence detection:
|
||||
- High severity: any rating <= 2, critical issue identified
|
||||
- Medium severity: rating spread (max - min) >= 3, or single perspective rated <= 2 with others >= 3
|
||||
- Low severity: minor suggestions only, all ratings >= 3
|
||||
5. Consensus determination:
|
||||
- No high-severity divergences AND average rating >= 3.0 -> consensus_reached
|
||||
- Otherwise -> consensus_blocked
|
||||
6. Synthesize:
|
||||
- Convergent themes (agreed by 2+ perspectives)
|
||||
- Divergent views (conflicting assessments)
|
||||
- Action items from suggestions
|
||||
7. Write discussion record to: <session-folder>/discussions/<round-id>-discussion.md
|
||||
|
||||
### Discussion Record Format
|
||||
# Discussion Record: <round-id>
|
||||
|
||||
**Artifact**: <artifact-path>
|
||||
**Perspectives**: <list>
|
||||
**Consensus**: reached / blocked
|
||||
**Average Rating**: <avg>/5
|
||||
|
||||
## Convergent Themes
|
||||
- <theme>
|
||||
|
||||
## Divergent Views
|
||||
- **<topic>** (<severity>): <description>
|
||||
|
||||
## Action Items
|
||||
1. <item>
|
||||
|
||||
## Ratings
|
||||
| Perspective | Rating |
|
||||
|-------------|--------|
|
||||
| <name> | <n>/5 |
|
||||
|
||||
### Return Value
|
||||
|
||||
**When consensus_reached**:
|
||||
Return a summary string with:
|
||||
- Verdict: consensus_reached
|
||||
- Average rating
|
||||
- Key action items (top 3)
|
||||
- Discussion record path
|
||||
|
||||
**When consensus_blocked**:
|
||||
Return a structured summary with:
|
||||
- Verdict: consensus_blocked
|
||||
- Severity: HIGH | MEDIUM | LOW
|
||||
- Average rating
|
||||
- Divergence summary: top 3 divergent points with perspective attribution
|
||||
- Action items: prioritized list of required changes
|
||||
- Recommendation: revise | proceed-with-caution | escalate
|
||||
- Discussion record path
|
||||
|
||||
### Error Handling
|
||||
- Single CLI fails -> fallback to direct Claude analysis for that perspective
|
||||
- All CLI fail -> generate basic discussion from direct artifact reading
|
||||
- Artifact not found -> return error immediately`
|
||||
})
|
||||
```
|
||||
|
||||
## Integration with Calling Role
|
||||
|
||||
The calling role is responsible for:
|
||||
|
||||
1. **Before calling**: Complete primary artifact output
|
||||
2. **Calling**: Invoke discuss subagent with appropriate dynamic perspectives
|
||||
3. **After calling**:
|
||||
|
||||
| Verdict | Severity | Role Action |
|
||||
|---------|----------|-------------|
|
||||
| consensus_reached | - | Include action items in Phase 5 report, proceed normally |
|
||||
| consensus_blocked | HIGH | Include divergence details in Phase 5 SendMessage. Do NOT self-revise -- coordinator decides. |
|
||||
| consensus_blocked | MEDIUM | Include warning in Phase 5 SendMessage. Proceed normally. |
|
||||
| consensus_blocked | LOW | Treat as consensus_reached with notes. Proceed normally. |
|
||||
|
||||
**SendMessage format for consensus_blocked (HIGH or MEDIUM)**:
|
||||
|
||||
```
|
||||
[<role>] <task-id> complete. Discuss <round-id>: consensus_blocked (severity=<severity>)
|
||||
Divergences: <top-3-divergent-points>
|
||||
Action items: <prioritized-items>
|
||||
Recommendation: <revise|proceed-with-caution|escalate>
|
||||
Artifact: <artifact-path>
|
||||
Discussion: <discussion-record-path>
|
||||
```
|
||||
@@ -1,120 +0,0 @@
|
||||
# Explore Subagent
|
||||
|
||||
Shared codebase exploration utility with centralized caching. Callable by any role needing code context.
|
||||
|
||||
## Invocation
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: "Explore <angle>",
|
||||
prompt: `Explore codebase for: <query>
|
||||
|
||||
Focus angle: <angle>
|
||||
Keywords: <keyword-list>
|
||||
Session folder: <session-folder>
|
||||
|
||||
## Cache Check
|
||||
1. Read <session-folder>/explorations/cache-index.json (if exists)
|
||||
2. Look for entry with matching angle
|
||||
3. If found AND file exists -> read cached result, return summary
|
||||
4. If not found -> proceed to exploration
|
||||
|
||||
## Exploration
|
||||
<angle-specific-focus-from-table-below>
|
||||
|
||||
## Output
|
||||
Write JSON to: <session-folder>/explorations/explore-<angle>.json
|
||||
Update cache-index.json with new entry
|
||||
|
||||
## Output Schema
|
||||
{
|
||||
"angle": "<angle>",
|
||||
"query": "<query>",
|
||||
"relevant_files": [
|
||||
{ "path": "...", "rationale": "...", "role": "...", "discovery_source": "...", "key_symbols": [] }
|
||||
],
|
||||
"patterns": [],
|
||||
"dependencies": [],
|
||||
"external_refs": [],
|
||||
"_metadata": { "created_by": "<calling-role>", "timestamp": "...", "cache_key": "..." }
|
||||
}
|
||||
|
||||
Return summary: file count, pattern count, top 5 files, output path`
|
||||
})
|
||||
```
|
||||
|
||||
## Cache Mechanism
|
||||
|
||||
### Cache Index Schema
|
||||
|
||||
`<session-folder>/explorations/cache-index.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"angle": "architecture",
|
||||
"keywords": ["auth", "middleware"],
|
||||
"file": "explore-architecture.json",
|
||||
"created_by": "analyst",
|
||||
"created_at": "2026-02-27T10:00:00Z",
|
||||
"file_count": 15
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Cache Lookup Rules
|
||||
|
||||
| Condition | Action |
|
||||
|-----------|--------|
|
||||
| Exact angle match exists | Return cached result |
|
||||
| No match | Execute exploration, cache result |
|
||||
| Cache file missing but index has entry | Remove stale entry, re-explore |
|
||||
|
||||
### Cache Invalidation
|
||||
|
||||
Cache is session-scoped. No explicit invalidation needed -- each session starts fresh. If a role suspects stale data, it can pass `force_refresh: true` in the prompt to bypass cache.
|
||||
|
||||
## Angle Focus Guide
|
||||
|
||||
| Angle | Focus Points | Typical Caller |
|
||||
|-------|-------------|----------------|
|
||||
| architecture | Layer boundaries, design patterns, component responsibilities, ADRs | any |
|
||||
| dependencies | Import chains, external libraries, circular dependencies, shared utilities | any |
|
||||
| modularity | Module interfaces, separation of concerns, extraction opportunities | any |
|
||||
| integration-points | API endpoints, data flow between modules, event systems | any |
|
||||
| security | Auth/authz logic, input validation, sensitive data handling, middleware | any |
|
||||
| dataflow | Data transformations, state propagation, validation points | any |
|
||||
| performance | Bottlenecks, N+1 queries, blocking operations, algorithm complexity | any |
|
||||
| error-handling | Try-catch blocks, error propagation, recovery strategies, logging | any |
|
||||
| patterns | Code conventions, design patterns, naming conventions, best practices | any |
|
||||
| testing | Test files, coverage gaps, test patterns, mocking strategies | any |
|
||||
| general | Broad semantic search for topic-related code | any |
|
||||
|
||||
## Exploration Strategies
|
||||
|
||||
### Low Complexity (direct search)
|
||||
|
||||
For simple queries, use ACE semantic search:
|
||||
|
||||
```
|
||||
mcp__ace-tool__search_context(project_root_path="<project-root>", query="<query>")
|
||||
```
|
||||
|
||||
ACE failure fallback: `rg -l '<keywords>' --type ts`
|
||||
|
||||
### Medium/High Complexity (multi-angle)
|
||||
|
||||
For complex queries, call cli-explore-agent per angle. The calling role determines complexity and selects angles.
|
||||
|
||||
## Search Tool Priority
|
||||
|
||||
| Tool | Priority | Use Case |
|
||||
|------|----------|----------|
|
||||
| mcp__ace-tool__search_context | P0 | Semantic search |
|
||||
| Grep / Glob | P1 | Pattern matching |
|
||||
| cli-explore-agent | Deep | Multi-angle exploration |
|
||||
| WebSearch | P3 | External docs |
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
name: team-coordinate-v2
|
||||
description: Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on "team coordinate v2".
|
||||
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Task(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
|
||||
name: team-coordinate
|
||||
description: Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on "Team Coordinate ".
|
||||
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Agent(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
|
||||
---
|
||||
|
||||
# Team Coordinate v2
|
||||
# Team Coordinate
|
||||
|
||||
Universal team coordination skill: analyze task -> generate role-specs -> dispatch -> execute -> deliver. Only the **coordinator** is built-in. All worker roles are **dynamically generated** as lightweight role-spec files and spawned via the `team-worker` agent.
|
||||
|
||||
@@ -13,7 +13,7 @@ Universal team coordination skill: analyze task -> generate role-specs -> dispat
|
||||
|
||||
```
|
||||
+---------------------------------------------------+
|
||||
| Skill(skill="team-coordinate-v2") |
|
||||
| Skill(skill="team-coordinate") |
|
||||
| args="task description" |
|
||||
+-------------------+-------------------------------+
|
||||
|
|
||||
@@ -27,9 +27,9 @@ Universal team coordination skill: analyze task -> generate role-specs -> dispat
|
||||
[team-worker agents, each loaded with a dynamic role-spec]
|
||||
(roles generated at runtime from task analysis)
|
||||
|
||||
Subagents (callable by any worker, not team members):
|
||||
[discuss-subagent] - multi-perspective critique (dynamic perspectives)
|
||||
[explore-subagent] - codebase exploration with cache
|
||||
CLI Tools (callable by any worker):
|
||||
ccw cli --mode analysis - analysis and exploration
|
||||
ccw cli --mode write - code generation and modification
|
||||
```
|
||||
|
||||
## Role Router
|
||||
@@ -49,12 +49,14 @@ Only coordinator is statically registered. All other roles are dynamic, stored a
|
||||
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | built-in orchestrator |
|
||||
| (dynamic) | `<session>/role-specs/<role-name>.md` | runtime-generated role-spec |
|
||||
|
||||
### Subagent Registry
|
||||
### CLI Tool Usage
|
||||
|
||||
| Subagent | Spec | Callable By | Purpose |
|
||||
|----------|------|-------------|---------|
|
||||
| discuss | [subagents/discuss-subagent.md](subagents/discuss-subagent.md) | any role | Multi-perspective critique (dynamic perspectives) |
|
||||
| explore | [subagents/explore-subagent.md](subagents/explore-subagent.md) | any role | Codebase exploration with cache |
|
||||
Workers can use CLI tools for analysis and code operations:
|
||||
|
||||
| Tool | Purpose |
|
||||
|------|---------|
|
||||
| ccw cli --mode analysis | Analysis, exploration, pattern discovery |
|
||||
| ccw cli --mode write | Code generation, modification, refactoring |
|
||||
|
||||
### Dispatch
|
||||
|
||||
@@ -64,7 +66,7 @@ Always route to coordinator. Coordinator reads `roles/coordinator/role.md` and e
|
||||
|
||||
User just provides task description.
|
||||
|
||||
**Invocation**: `Skill(skill="team-coordinate-v2", args="task description")`
|
||||
**Invocation**: `Skill(skill="team-coordinate", args="task description")`
|
||||
|
||||
**Lifecycle**:
|
||||
```
|
||||
@@ -93,7 +95,7 @@ User provides task description
|
||||
When coordinator spawns workers, use `team-worker` agent with role-spec path:
|
||||
|
||||
```
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker",
|
||||
team_name: <team-name>,
|
||||
@@ -143,7 +145,7 @@ AskUserQuestion({
|
||||
| Choice | Steps |
|
||||
|--------|-------|
|
||||
| Archive & Clean | Update session status="completed" -> TeamDelete -> output final summary with artifact paths |
|
||||
| Keep Active | Update session status="paused" -> output: "Resume with: Skill(skill='team-coordinate-v2', args='resume')" |
|
||||
| Keep Active | Update session status="paused" -> output: "Resume with: Skill(skill='team-coordinate', args='resume')" |
|
||||
| Export Results | AskUserQuestion(target path) -> copy artifacts to target -> Archive & Clean |
|
||||
|
||||
---
|
||||
@@ -193,7 +195,9 @@ Beat Cycle (single beat)
|
||||
| +-- <role-2>.md
|
||||
+-- artifacts/ # All MD deliverables from workers
|
||||
| +-- <artifact>.md
|
||||
+-- shared-memory.json # Cross-role state store
|
||||
+-- .msg/ # Team message bus + state
|
||||
| +-- messages.jsonl # Message log
|
||||
| +-- meta.json # Session metadata + cross-role state
|
||||
+-- wisdom/ # Cross-task knowledge
|
||||
| +-- learnings.md
|
||||
| +-- decisions.md
|
||||
@@ -203,7 +207,6 @@ Beat Cycle (single beat)
|
||||
| +-- explore-<angle>.json
|
||||
+-- discussions/ # Inline discuss records
|
||||
| +-- <round>.md
|
||||
+-- .msg/ # Team message bus logs
|
||||
```
|
||||
|
||||
### team-session.json Schema
|
||||
@@ -258,7 +261,7 @@ Coordinator supports `resume` / `continue` for interrupted sessions:
|
||||
| Unknown command | Error with available command list |
|
||||
| Dynamic role-spec not found | Error, coordinator may need to regenerate |
|
||||
| Command file not found | Fallback to inline execution |
|
||||
| Discuss subagent fails | Worker proceeds without discuss, logs warning |
|
||||
| CLI tool fails | Worker proceeds with direct implementation, logs warning |
|
||||
| Explore cache corrupt | Clear cache, re-explore |
|
||||
| Fast-advance spawns wrong task | Coordinator reconciles on next callback |
|
||||
| capability_gap reported | Coordinator generates new role-spec via handleAdapt |
|
||||
@@ -117,7 +117,7 @@ For each role, determine frontmatter and generation hints:
|
||||
|-------|------------|
|
||||
| `prefix` | From capability prefix (e.g., RESEARCH, DRAFT, IMPL) |
|
||||
| `inner_loop` | `true` if role has 2+ serial same-prefix tasks |
|
||||
| `subagents` | Suggested, not mandatory — coordinator may adjust based on task needs |
|
||||
| `CLI tools` | Suggested, not mandatory — coordinator may adjust based on task needs |
|
||||
| `pattern_hint` | Reference pattern name from role-spec-template (research/document/code/analysis/validation) — guides coordinator's Phase 2-4 composition, NOT a rigid template selector |
|
||||
| `output_type` | `artifact` (new files in session/artifacts/) / `codebase` (modify existing project files) / `mixed` (both) — determines verification strategy in Behavioral Traits |
|
||||
| `message_types.success` | `<prefix>_complete` |
|
||||
@@ -177,7 +177,7 @@ Write `<session-folder>/task-analysis.json`:
|
||||
"task_count": 1,
|
||||
"inner_loop": false,
|
||||
"role_spec_metadata": {
|
||||
"subagents": ["explore"],
|
||||
"CLI tools": ["explore"],
|
||||
"pattern_hint": "research",
|
||||
"output_type": "artifact",
|
||||
"message_types": {
|
||||
@@ -25,7 +25,6 @@ Create task chains from dynamic dependency graphs. Builds pipelines from the tas
|
||||
```
|
||||
TaskCreate({
|
||||
subject: "<PREFIX>-<NNN>",
|
||||
owner: "<role-name>",
|
||||
description: "PURPOSE: <goal> | Success: <success_criteria>
|
||||
TASK:
|
||||
- <step 1>
|
||||
@@ -35,15 +34,14 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Upstream artifacts: <artifact-1.md>, <artifact-2.md>
|
||||
- Key files: <file1>, <file2>
|
||||
- Shared memory: <session>/shared-memory.json
|
||||
- Shared state: team_msg(operation="get_state", session_id=<session-id>)
|
||||
EXPECTED: <deliverable path> + <quality criteria>
|
||||
CONSTRAINTS: <scope limits>
|
||||
---
|
||||
InnerLoop: <true|false>
|
||||
RoleSpec: <session-folder>/role-specs/<role-name>.md",
|
||||
blockedBy: [<dependency-list from graph>],
|
||||
status: "pending"
|
||||
RoleSpec: <session-folder>/role-specs/<role-name>.md"
|
||||
})
|
||||
TaskUpdate({ taskId: "<PREFIX>-<NNN>", addBlockedBy: [<dependency-list from graph>], owner: "<role-name>" })
|
||||
```
|
||||
|
||||
5. **Update team-session.json** with pipeline and tasks_total
|
||||
@@ -63,7 +61,7 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Upstream artifacts: <comma-separated list from task-analysis.json#tasks[].upstream_artifacts[]>
|
||||
- Key files: <comma-separated list from task-analysis.json#tasks[].key_files[]>
|
||||
- Shared memory: <session>/shared-memory.json
|
||||
- Shared state: team_msg(operation="get_state", session_id=<session-id>)
|
||||
EXPECTED: <artifact path from task-analysis.json#capabilities[].artifacts[]> + <quality criteria based on capability type>
|
||||
CONSTRAINTS: <constraints from task-analysis.json#tasks[].constraints>
|
||||
---
|
||||
@@ -132,7 +132,7 @@ Ready tasks found?
|
||||
| +- YES -> SKIP spawn (existing worker will pick it up via inner loop)
|
||||
| +- NO -> normal spawn below
|
||||
+- TaskUpdate -> in_progress
|
||||
+- team_msg log -> task_unblocked (team=<session-id>, NOT team name)
|
||||
+- team_msg log -> task_unblocked (session_id=<session-id>)
|
||||
+- Spawn team-worker (see spawn tool call below)
|
||||
+- Add to session.active_workers
|
||||
Update session file -> output summary -> STOP
|
||||
@@ -141,7 +141,7 @@ Ready tasks found?
|
||||
**Spawn worker tool call** (one per ready task):
|
||||
|
||||
```
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker for <subject>",
|
||||
team_name: <team-name>,
|
||||
@@ -190,11 +190,11 @@ All tasks completed (no pending, no in_progress)
|
||||
| })
|
||||
| +- "Archive & Clean":
|
||||
| | Update session status="completed"
|
||||
| | TeamDelete(<team-name>)
|
||||
| | TeamDelete()
|
||||
| | Output final summary with artifact paths
|
||||
| +- "Keep Active":
|
||||
| | Update session status="paused"
|
||||
| | Output: "Resume with: Skill(skill='team-coordinate-v2', args='resume')"
|
||||
| | Output: "Resume with: Skill(skill='team-coordinate', args='resume')"
|
||||
| +- "Export Results":
|
||||
| AskUserQuestion for target directory
|
||||
| Copy deliverables to target
|
||||
@@ -25,7 +25,7 @@ Orchestrate the team-coordinate workflow: task analysis, dynamic role-spec gener
|
||||
- **Read source code or perform codebase exploration** (delegate to worker roles)
|
||||
- Execute task work directly (delegate to workers)
|
||||
- Modify task output artifacts (workers own their deliverables)
|
||||
- Call implementation subagents (code-developer, etc.) directly
|
||||
- Call implementation agents (code-developer, etc.) directly
|
||||
- Skip dependency validation when creating task chains
|
||||
- Generate more than 5 worker roles (merge if exceeded)
|
||||
- Override consensus_blocked HIGH without user confirmation
|
||||
@@ -130,7 +130,7 @@ For callback/check/resume/adapt/complete: load `commands/monitor.md` and execute
|
||||
- Dependency graph: build DAG of work streams
|
||||
- Complexity scoring: count capabilities, cross-domain factor, parallel tracks
|
||||
- Role minimization: merge overlapping, absorb trivial, cap at 5
|
||||
- **Role-spec metadata**: Generate frontmatter fields (prefix, inner_loop, subagents, message_types)
|
||||
- **Role-spec metadata**: Generate frontmatter fields (prefix, inner_loop, additional_members, message_types)
|
||||
|
||||
4. **Output**: Write `<session>/task-analysis.json`
|
||||
|
||||
@@ -185,10 +185,10 @@ Regardless of complexity score or role count, coordinator MUST:
|
||||
5. **Read `specs/role-spec-template.md`** for Behavioral Traits + Reference Patterns
|
||||
|
||||
6. **For each role in task-analysis.json#roles**:
|
||||
- Fill YAML frontmatter: role, prefix, inner_loop, subagents, message_types
|
||||
- Fill YAML frontmatter: role, prefix, inner_loop, additional_members, message_types
|
||||
- **Compose Phase 2-4 content** (NOT copy from template):
|
||||
- Phase 2: Derive input sources and context loading steps from **task description + upstream dependencies**
|
||||
- Phase 3: Describe **execution goal** (WHAT to achieve) from task description — do NOT prescribe specific subagent or tool
|
||||
- Phase 3: Describe **execution goal** (WHAT to achieve) from task description — do NOT prescribe specific CLI tool or approach
|
||||
- Phase 4: Combine **Behavioral Traits** (from template) + **output_type** (from task analysis) to compose verification steps
|
||||
- Reference Patterns may guide phase structure, but task description determines specific content
|
||||
- Write generated role-spec to `<session>/role-specs/<role-name>.md`
|
||||
@@ -198,10 +198,28 @@ Regardless of complexity score or role count, coordinator MUST:
|
||||
8. **Initialize shared infrastructure**:
|
||||
- `wisdom/learnings.md`, `wisdom/decisions.md`, `wisdom/issues.md` (empty with headers)
|
||||
- `explorations/cache-index.json` (`{ "entries": [] }`)
|
||||
- `shared-memory.json` (`{}`)
|
||||
- `discussions/` (empty directory)
|
||||
|
||||
9. **Write team-session.json** with: session_id, task_description, status="active", roles, pipeline (empty), active_workers=[], completion_action="interactive", created_at
|
||||
9. **Initialize pipeline metadata** via team_msg:
|
||||
```typescript
|
||||
// 使用 team_msg 将 pipeline 元数据写入 .msg/meta.json
|
||||
// 注意: 此处为动态角色,执行时需将 <placeholders> 替换为 task-analysis.json 中生成的实际角色列表
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: "<session-id>",
|
||||
from: "coordinator",
|
||||
type: "state_update",
|
||||
summary: "Session initialized",
|
||||
data: {
|
||||
pipeline_mode: "<mode>",
|
||||
pipeline_stages: ["<role1>", "<role2>", "<...dynamic-roles>"],
|
||||
roles: ["coordinator", "<role1>", "<role2>", "<...dynamic-roles>"],
|
||||
team_name: "<team-name>" // 从 session ID 或任务描述中提取
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
10. **Write team-session.json** with: session_id, task_description, status="active", roles, pipeline (empty), active_workers=[], completion_action="interactive", created_at
|
||||
|
||||
**Success**: Session created, role-spec files generated, shared infrastructure initialized.
|
||||
|
||||
@@ -11,7 +11,7 @@ Template used by coordinator to generate lightweight worker role-spec files at r
|
||||
role: <role_name>
|
||||
prefix: <PREFIX>
|
||||
inner_loop: <true|false>
|
||||
subagents: [<subagent-names>]
|
||||
CLI tools: [<CLI tool-names>]
|
||||
message_types:
|
||||
success: <prefix>_complete
|
||||
error: error
|
||||
@@ -45,7 +45,7 @@ message_types:
|
||||
| `role` | Yes | Role name matching session registry |
|
||||
| `prefix` | Yes | Task prefix to filter (e.g., RESEARCH, DRAFT, IMPL) |
|
||||
| `inner_loop` | Yes | Whether team-worker loops through same-prefix tasks |
|
||||
| `subagents` | No | Array of subagent types this role may call |
|
||||
| `CLI tools` | No | Array of CLI tool types this role may call |
|
||||
| `message_types` | Yes | Message type mapping for team_msg |
|
||||
| `message_types.success` | Yes | Type string for successful completion |
|
||||
| `message_types.error` | Yes | Type string for errors (usually "error") |
|
||||
@@ -61,13 +61,13 @@ message_types:
|
||||
| ~80 lines target | Lightweight, domain-focused |
|
||||
| No pseudocode | Decision tables + text + tool calls only |
|
||||
| `<placeholder>` notation | Use angle brackets for variable substitution |
|
||||
| Reference subagents by name | team-worker resolves invocation from its delegation templates |
|
||||
| Reference CLI tools by name | team-worker resolves invocation from its delegation templates |
|
||||
|
||||
## Behavioral Traits
|
||||
|
||||
All dynamically generated role-specs MUST embed these traits into Phase 4. Coordinator copies this section verbatim into every generated role-spec as a Phase 4 appendix.
|
||||
|
||||
**Design principle**: Constrain behavioral characteristics (accuracy, feedback, quality gates), NOT specific actions (which tool, which subagent, which path). Tasks are diverse — the coordinator composes task-specific Phase 2-3 instructions, while these traits ensure execution quality regardless of task type.
|
||||
**Design principle**: Constrain behavioral characteristics (accuracy, feedback, quality gates), NOT specific actions (which tool, which CLI tool, which path). Tasks are diverse — the coordinator composes task-specific Phase 2-3 instructions, while these traits ensure execution quality regardless of task type.
|
||||
|
||||
### Accuracy — outputs must be verifiable
|
||||
|
||||
@@ -91,11 +91,11 @@ Phase 4 must produce a verification summary with these fields:
|
||||
- Phase 4 MUST verify Phase 3's **actual output** (not planned output)
|
||||
- Verification fails → retry Phase 3 (max 2 retries)
|
||||
- Still fails → report `partial_completion` with details, NOT `completed`
|
||||
- Update `shared-memory.json` with key findings after verification passes
|
||||
- Update shared state via `team_msg(operation="log", type="state_update", data={...})` after verification passes
|
||||
|
||||
### Error Protocol
|
||||
|
||||
- Primary approach fails → try alternative (different subagent / different tool)
|
||||
- Primary approach fails → try alternative (different CLI tool / different tool)
|
||||
- 2 retries exhausted → escalate to coordinator with failure details
|
||||
- NEVER: skip verification and report completed
|
||||
|
||||
@@ -107,33 +107,33 @@ Coordinator MAY reference these patterns when composing Phase 2-4 content for a
|
||||
|
||||
### Research / Exploration
|
||||
|
||||
- Phase 2: Define exploration scope + load prior knowledge from shared-memory and wisdom
|
||||
- Phase 3: Explore via subagents, direct tool calls, or codebase search — approach chosen by agent
|
||||
- Phase 4: Verify findings documented (Behavioral Traits) + update shared-memory
|
||||
- Phase 2: Define exploration scope + load prior knowledge from shared state and wisdom
|
||||
- Phase 3: Explore via CLI tools, direct tool calls, or codebase search — approach chosen by agent
|
||||
- Phase 4: Verify findings documented (Behavioral Traits) + update shared state
|
||||
|
||||
### Document / Content
|
||||
|
||||
- Phase 2: Load upstream artifacts + read target files (if modifying existing docs)
|
||||
- Phase 3: Create new documents OR modify existing documents — determined by task, not template
|
||||
- Phase 4: Verify documents exist with expected content (Behavioral Traits) + update shared-memory
|
||||
- Phase 4: Verify documents exist with expected content (Behavioral Traits) + update shared state
|
||||
|
||||
### Code Implementation
|
||||
|
||||
- Phase 2: Load design/spec artifacts from upstream
|
||||
- Phase 3: Implement code changes — subagent choice and approach determined by task complexity
|
||||
- Phase 4: Syntax check + file verification (Behavioral Traits) + update shared-memory
|
||||
- Phase 3: Implement code changes — CLI tool choice and approach determined by task complexity
|
||||
- Phase 4: Syntax check + file verification (Behavioral Traits) + update shared state
|
||||
|
||||
### Analysis / Audit
|
||||
|
||||
- Phase 2: Load analysis targets (artifacts or source files)
|
||||
- Phase 3: Multi-dimension analysis — perspectives and depth determined by task
|
||||
- Phase 4: Verify report exists + severity classification (Behavioral Traits) + update shared-memory
|
||||
- Phase 4: Verify report exists + severity classification (Behavioral Traits) + update shared state
|
||||
|
||||
### Validation / Testing
|
||||
|
||||
- Phase 2: Detect test framework + identify changed files from upstream
|
||||
- Phase 3: Run test-fix cycle — iteration count and strategy determined by task
|
||||
- Phase 4: Verify pass rate + coverage (Behavioral Traits) + update shared-memory
|
||||
- Phase 4: Verify pass rate + coverage (Behavioral Traits) + update shared state
|
||||
|
||||
---
|
||||
|
||||
@@ -146,7 +146,7 @@ How context flows between roles. Coordinator MUST reference this when composing
|
||||
| Channel | Scope | Mechanism | When to Use |
|
||||
|---------|-------|-----------|-------------|
|
||||
| **Artifacts** | Producer -> Consumer | Write to `<session>/artifacts/<name>.md`, consumer reads in Phase 2 | Structured deliverables (reports, plans, specs) |
|
||||
| **shared-memory.json** | Cross-role | Read-merge-write `<session>/shared-memory.json` | Key findings, decisions, metadata (small, structured data) |
|
||||
| **State Updates** | Cross-role | `team_msg(operation="log", type="state_update", data={...})` / `team_msg(operation="get_state", session_id=<session-id>)` | Key findings, decisions, metadata (small, structured data) |
|
||||
| **Wisdom** | Cross-task | Append to `<session>/wisdom/{learnings,decisions,conventions,issues}.md` | Patterns, conventions, risks discovered during execution |
|
||||
| **context_accumulator** | Intra-role (inner loop) | In-memory array, passed to each subsequent task in same-prefix loop | Prior task summaries within same role's inner loop |
|
||||
| **Exploration cache** | Cross-role | `<session>/explorations/cache-index.json` + per-angle JSON | Codebase discovery results, prevents duplicate exploration |
|
||||
@@ -158,22 +158,29 @@ Every generated role-spec Phase 2 MUST declare which upstream sources to load:
|
||||
```
|
||||
1. Extract session path from task description
|
||||
2. Read upstream artifacts: <list which artifacts from which upstream role>
|
||||
3. Read shared-memory.json for cross-role decisions
|
||||
3. Read cross-role state via `team_msg(operation="get_state", session_id=<session-id>)`
|
||||
4. Load wisdom files for accumulated knowledge
|
||||
5. For inner_loop roles: load context_accumulator from prior tasks
|
||||
6. Check exploration cache before running new explorations
|
||||
```
|
||||
|
||||
### shared-memory.json Usage Convention
|
||||
### State Update Convention
|
||||
|
||||
- **Read-merge-write**: Read current content -> merge new keys -> write back (NOT overwrite)
|
||||
- **Namespaced keys**: Each role writes under its own namespace: `{ "<role_name>": { ... } }`
|
||||
Cross-role state is managed via `team_msg` state updates instead of a separate file:
|
||||
|
||||
- **Write state**: `team_msg(operation="log", session_id=<session-id>, from=<role>, type="state_update", data={ "<role_name>": { ... } })`
|
||||
- **Read state**: `team_msg(operation="get_state", session_id=<session-id>)`
|
||||
- **Namespaced keys**: Each role writes under its own namespace key in `data`
|
||||
- **Small data only**: Key findings, decision summaries, metadata. NOT full documents
|
||||
- **Example**:
|
||||
```json
|
||||
{
|
||||
"researcher": { "key_findings": [...], "scope": "..." },
|
||||
"writer": { "documents_created": [...], "style_decisions": [...] },
|
||||
"developer": { "files_changed": [...], "patterns_used": [...] }
|
||||
}
|
||||
- **State stored in**: `.msg/meta.json` (auto-managed by team_msg)
|
||||
- **Example write**:
|
||||
```
|
||||
team_msg(operation="log", session_id="TC-auth-2026-03-03", from="researcher", type="state_update", data={
|
||||
"researcher": { "key_findings": [...], "scope": "..." }
|
||||
})
|
||||
```
|
||||
- **Example read**:
|
||||
```
|
||||
team_msg(operation="get_state", session_id="TC-auth-2026-03-03")
|
||||
// Returns merged state from all state_update messages
|
||||
```
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
name: team-executor-v2
|
||||
description: Lightweight session execution skill. Resumes existing team-coordinate-v2 sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on "team executor v2".
|
||||
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Task(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
|
||||
name: team-executor
|
||||
description: Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on "Team Executor".
|
||||
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Agent(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
|
||||
---
|
||||
|
||||
# Team Executor v2
|
||||
# Team Executor
|
||||
|
||||
Lightweight session execution skill: load session -> reconcile state -> spawn team-worker agents -> execute -> deliver. **No analysis, no role generation** -- only executes existing team-coordinate sessions.
|
||||
|
||||
@@ -107,7 +107,7 @@ Validate session
|
||||
When executor spawns workers, use `team-worker` agent with role-spec path:
|
||||
|
||||
```
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker",
|
||||
team_name: <team-name>,
|
||||
@@ -126,7 +126,7 @@ Ready tasks found?
|
||||
| +- YES -> SKIP spawn (existing worker picks it up)
|
||||
| +- NO -> normal spawn below
|
||||
+- TaskUpdate -> in_progress
|
||||
+- team_msg log -> task_unblocked (team=<session-id>)
|
||||
+- team_msg log -> task_unblocked (session_id=<session-id>)
|
||||
+- Spawn team-worker (see spawn tool call below)
|
||||
+- Add to session.active_workers
|
||||
Update session file -> output summary -> STOP
|
||||
@@ -135,7 +135,7 @@ Ready tasks found?
|
||||
**Spawn worker tool call**:
|
||||
|
||||
```
|
||||
Task({
|
||||
Agent({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker for <subject>",
|
||||
team_name: <team-name>,
|
||||
@@ -23,7 +23,7 @@ Orchestrate the team-executor workflow: session validation, state reconciliation
|
||||
### MUST NOT
|
||||
- Execute task work directly (delegate to workers)
|
||||
- Modify task output artifacts (workers own their deliverables)
|
||||
- Call implementation subagents (code-developer, etc.) directly
|
||||
- Call CLI tools or spawn utility members directly for implementation (code-developer, etc.)
|
||||
- Generate new role-specs (use existing session role-specs only)
|
||||
- Skip session validation
|
||||
- Override consensus_blocked HIGH without user confirmation
|
||||
@@ -13,7 +13,9 @@ Required session structure for team-executor v2. All components MUST exist for v
|
||||
| +-- <role-2>.md
|
||||
+-- artifacts/ # All MD deliverables from workers
|
||||
| +-- <artifact>.md
|
||||
+-- shared-memory.json # Cross-role state store
|
||||
+-- .msg/ # Team message bus + state
|
||||
| +-- messages.jsonl # Message log
|
||||
| +-- meta.json # Session metadata + cross-role state
|
||||
+-- wisdom/ # Cross-task knowledge
|
||||
| +-- learnings.md
|
||||
| +-- decisions.md
|
||||
@@ -23,7 +25,6 @@ Required session structure for team-executor v2. All components MUST exist for v
|
||||
| +-- explore-<angle>.json
|
||||
+-- discussions/ # Inline discuss records
|
||||
| +-- <round>.md
|
||||
+-- .msg/ # Team message bus logs
|
||||
```
|
||||
|
||||
## Validation Checklist
|
||||
@@ -120,7 +121,7 @@ team-executor validates the following before execution:
|
||||
| `session_id` | string | Unique session identifier |
|
||||
| `task_description` | string | Original task description from user |
|
||||
| `status` | string | One of: "active", "paused", "completed" |
|
||||
| `team_name` | string | Team name for Task tool |
|
||||
| `team_name` | string | Team name for Agent tool |
|
||||
| `roles` | array | List of role definitions |
|
||||
| `roles[].name` | string | Role name (must match .md filename) |
|
||||
| `roles[].prefix` | string | Task prefix for this role |
|
||||
@@ -162,7 +163,7 @@ team-executor validates the following before execution:
|
||||
"responsibility_type": "<type>",
|
||||
"inner_loop": false,
|
||||
"role_spec_metadata": {
|
||||
"subagents": [],
|
||||
"additional_members": [],
|
||||
"message_types": {
|
||||
"success": "<prefix>_complete",
|
||||
"error": "error"
|
||||
@@ -238,7 +239,7 @@ For each role-spec in role-specs/<role>.md:
|
||||
| +-- developer.md # YAML frontmatter + Phase 2-4
|
||||
| +-- tester.md # YAML frontmatter + Phase 2-4
|
||||
+-- artifacts/ # (may be empty)
|
||||
+-- shared-memory.json # Valid JSON (may be {})
|
||||
+-- .msg/ # Team message bus + state (messages.jsonl + meta.json)
|
||||
+-- wisdom/
|
||||
| +-- learnings.md
|
||||
| +-- decisions.md
|
||||
@@ -246,7 +247,6 @@ For each role-spec in role-specs/<role>.md:
|
||||
+-- explorations/
|
||||
| +-- cache-index.json
|
||||
+-- discussions/ # (may be empty)
|
||||
+-- .msg/ # (may be empty)
|
||||
```
|
||||
|
||||
---
|
||||
@@ -1,97 +1,74 @@
|
||||
---
|
||||
name: team-frontend
|
||||
description: Unified team skill for frontend development team. All roles invoke this skill with --role arg. Built-in ui-ux-pro-max design intelligence. Triggers on "team frontend".
|
||||
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Task(*), AskUserQuestion(*), TodoWrite(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*), WebFetch(*), WebSearch(*)
|
||||
description: Unified team skill for frontend development. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Built-in ui-ux-pro-max design intelligence. Triggers on "team frontend".
|
||||
allowed-tools: Agent, TaskCreate, TaskList, TaskGet, TaskUpdate, TeamCreate, TeamDelete, SendMessage, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, mcp__ace-tool__search_context
|
||||
---
|
||||
|
||||
# Team Frontend Development
|
||||
|
||||
Unified team skill: frontend development with built-in ui-ux-pro-max design intelligence. Covers requirement analysis, design system generation, frontend implementation, and quality assurance. All team members invoke with `--role=xxx` to route to role-specific execution.
|
||||
Unified team skill: frontend development with built-in ui-ux-pro-max design intelligence. Covers requirement analysis, design system generation, frontend implementation, and quality assurance. Built on **team-worker agent architecture** -- all worker roles share a single agent definition with role-specific Phase 2-4 loaded from markdown specs.
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────┐
|
||||
│ Skill(skill="team-frontend") │
|
||||
│ args="<task-description>" or args="--role=xxx" │
|
||||
└──────────────────────────┬───────────────────────────┘
|
||||
│ Role Router
|
||||
┌──── --role present? ────┐
|
||||
│ NO │ YES
|
||||
↓ ↓
|
||||
Orchestration Mode Role Dispatch
|
||||
(auto -> coordinator) (route to role.md)
|
||||
│
|
||||
┌────┴────┬───────────┬───────────┬───────────┐
|
||||
↓ ↓ ↓ ↓ ↓
|
||||
┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐
|
||||
│ coord │ │analyst │ │architect│ │developer│ │ qa │
|
||||
│ │ │ANALYZE-*│ │ARCH-* │ │DEV-* │ │QA-* │
|
||||
└────────┘ └────────┘ └────────┘ └────────┘ └────────┘
|
||||
```
|
||||
+---------------------------------------------------+
|
||||
| Skill(skill="team-frontend") |
|
||||
| args="<task-description>" |
|
||||
+-------------------+-------------------------------+
|
||||
|
|
||||
Orchestration Mode (auto -> coordinator)
|
||||
|
|
||||
Coordinator (inline)
|
||||
Phase 0-5 orchestration
|
||||
|
|
||||
+-------+-------+-------+-------+
|
||||
v v v v
|
||||
[tw] [tw] [tw] [tw]
|
||||
analyst archi- devel- qa
|
||||
tect oper
|
||||
|
||||
## Command Architecture
|
||||
|
||||
Each role is organized as a folder with a `role.md` orchestrator and optional `commands/` for delegation:
|
||||
|
||||
```
|
||||
roles/
|
||||
├── coordinator/
|
||||
│ ├── role.md
|
||||
│ └── commands/
|
||||
├── analyst/
|
||||
│ ├── role.md
|
||||
│ └── commands/
|
||||
│ └── design-intelligence.md
|
||||
├── architect/
|
||||
│ ├── role.md
|
||||
│ └── commands/
|
||||
├── developer/
|
||||
│ ├── role.md
|
||||
│ └── commands/
|
||||
└── qa/
|
||||
├── role.md
|
||||
└── commands/
|
||||
└── pre-delivery-checklist.md
|
||||
(tw) = team-worker agent
|
||||
```
|
||||
|
||||
## Role Router
|
||||
|
||||
This skill is **coordinator-only**. Workers do NOT invoke this skill -- they are spawned as `team-worker` agents directly.
|
||||
|
||||
### Input Parsing
|
||||
|
||||
Parse `$ARGUMENTS` to extract `--role`. If absent -> Orchestration Mode (auto route to coordinator).
|
||||
Parse `$ARGUMENTS`. No `--role` needed -- always routes to coordinator.
|
||||
|
||||
### Role Registry
|
||||
|
||||
| Role | File | Task Prefix | Type | Compact |
|
||||
|------|------|-------------|------|---------|
|
||||
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | (none) | orchestrator | **compressed -> must re-read** |
|
||||
| analyst | [roles/analyst/role.md](roles/analyst/role.md) | ANALYZE-* | pipeline | compressed -> must re-read |
|
||||
| architect | [roles/architect/role.md](roles/architect/role.md) | ARCH-* | pipeline | compressed -> must re-read |
|
||||
| developer | [roles/developer/role.md](roles/developer/role.md) | DEV-* | pipeline | compressed -> must re-read |
|
||||
| qa | [roles/qa/role.md](roles/qa/role.md) | QA-* | pipeline | compressed -> must re-read |
|
||||
|
||||
> **COMPACT PROTECTION**: Role files are execution documents, not reference material. When context compression occurs and role instructions are reduced to summaries, **you MUST immediately `Read` the corresponding role.md to reload before continuing execution**. Do not execute any Phase based on summaries.
|
||||
| Role | Spec | Task Prefix | Type | Inner Loop |
|
||||
|------|------|-------------|------|------------|
|
||||
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | (none) | orchestrator | - |
|
||||
| analyst | [role-specs/analyst.md](role-specs/analyst.md) | ANALYZE-* | read_only_analysis | false |
|
||||
| architect | [role-specs/architect.md](role-specs/architect.md) | ARCH-* | code_generation | false |
|
||||
| developer | [role-specs/developer.md](role-specs/developer.md) | DEV-* | code_generation | true |
|
||||
| qa | [role-specs/qa.md](role-specs/qa.md) | QA-* | read_only_analysis | false |
|
||||
|
||||
### Dispatch
|
||||
|
||||
1. Extract `--role` from arguments
|
||||
2. If no `--role` -> route to coordinator (Orchestration Mode)
|
||||
3. Look up role in registry -> Read the role file -> Execute its phases
|
||||
Always route to coordinator. Coordinator reads `roles/coordinator/role.md` and executes its phases.
|
||||
|
||||
### Orchestration Mode
|
||||
|
||||
When invoked without `--role`, coordinator auto-starts. User just provides task description.
|
||||
User just provides task description.
|
||||
|
||||
**Invocation**: `Skill(skill="team-frontend", args="<task-description>")`
|
||||
**Invocation**:
|
||||
```bash
|
||||
Skill(skill="team-frontend", args="<task-description>")
|
||||
```
|
||||
|
||||
**Lifecycle**:
|
||||
```
|
||||
User provides task description
|
||||
-> coordinator Phase 1-3: Requirement clarification + industry identification -> TeamCreate -> Create task chain
|
||||
-> coordinator Phase 1-3: Parse requirements -> TeamCreate -> Create task chain
|
||||
-> coordinator Phase 4: spawn first batch workers (background) -> STOP
|
||||
-> Worker executes -> SendMessage callback -> coordinator advances next step
|
||||
-> Loop until pipeline complete -> Phase 5 report
|
||||
-> Worker (team-worker agent) executes -> SendMessage callback -> coordinator advances
|
||||
-> GC loop (developer <-> qa) if fix_required (max 2 rounds)
|
||||
-> All tasks complete -> Phase 5 report + completion action
|
||||
```
|
||||
|
||||
**User Commands** (wake paused coordinator):
|
||||
@@ -103,272 +80,120 @@ User provides task description
|
||||
|
||||
---
|
||||
|
||||
## Shared Infrastructure
|
||||
## Command Execution Protocol
|
||||
|
||||
The following templates apply to all worker roles. Each role.md only needs to write **Phase 2-4** role-specific logic.
|
||||
When coordinator needs to execute a command (dispatch, monitor):
|
||||
|
||||
### Worker Phase 1: Task Discovery (shared by all workers)
|
||||
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
|
||||
|
||||
Every worker executes the same task discovery flow on startup:
|
||||
|
||||
1. Call `TaskList()` to get all tasks
|
||||
2. Filter: subject matches this role's prefix + owner is this role + status is pending + blockedBy is empty
|
||||
3. No tasks -> idle wait
|
||||
4. Has tasks -> `TaskGet` for details -> `TaskUpdate` mark in_progress
|
||||
|
||||
**Resume Artifact Check** (prevent duplicate output after resume):
|
||||
- Check whether this task's output artifact already exists
|
||||
- Artifact complete -> skip to Phase 5 report completion
|
||||
- Artifact incomplete or missing -> normal Phase 2-4 execution
|
||||
|
||||
### Worker Phase 5: Report (shared by all workers)
|
||||
|
||||
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., `FES-xxx-date`), NOT team name. Extract from `Session:` field in task description.
|
||||
2. **SendMessage**: Send result to coordinator (content and summary both prefixed with `[<role>]`)
|
||||
3. **TaskUpdate**: Mark task completed
|
||||
4. **Loop**: Return to Phase 1 to check next task
|
||||
|
||||
### Wisdom Accumulation (all roles)
|
||||
|
||||
Cross-task knowledge accumulation. Coordinator creates `wisdom/` directory at session initialization.
|
||||
|
||||
**Directory**:
|
||||
Example:
|
||||
```
|
||||
<session-folder>/wisdom/
|
||||
├── learnings.md # Patterns and insights
|
||||
├── decisions.md # Architecture and design decisions
|
||||
├── conventions.md # Codebase conventions
|
||||
└── issues.md # Known risks and issues
|
||||
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
|
||||
```
|
||||
|
||||
**Worker Load** (Phase 2): Extract `Session: <path>` from task description, read wisdom directory files.
|
||||
**Worker Contribute** (Phase 4/5): Write this task's discoveries to corresponding wisdom files.
|
||||
|
||||
### Role Isolation Rules
|
||||
|
||||
#### Output Tagging
|
||||
|
||||
All outputs must carry `[role_name]` prefix.
|
||||
|
||||
#### Coordinator Isolation
|
||||
|
||||
| Allowed | Forbidden |
|
||||
|---------|-----------|
|
||||
| Requirement clarification (AskUserQuestion) | Direct code writing/modification |
|
||||
| Create task chain (TaskCreate) | Calling implementation subagents |
|
||||
| Dispatch tasks to workers | Direct analysis/testing/review |
|
||||
| Monitor progress (message bus) | Bypassing workers |
|
||||
| Report results to user | Modifying source code |
|
||||
|
||||
#### Worker Isolation
|
||||
|
||||
| Allowed | Forbidden |
|
||||
|---------|-----------|
|
||||
| Process tasks with own prefix | Process tasks with other role prefixes |
|
||||
| SendMessage to coordinator | Communicate directly with other workers |
|
||||
| Use tools declared in Toolbox | Create tasks for other roles (TaskCreate) |
|
||||
| Delegate to commands/ files | Modify resources outside own responsibility |
|
||||
|
||||
### Message Bus (All Roles)
|
||||
|
||||
Every SendMessage **before**, must call `mcp__ccw-tools__team_msg` to log.
|
||||
|
||||
**Message types by role**:
|
||||
|
||||
| Role | Types |
|
||||
|------|-------|
|
||||
| coordinator | `task_unblocked`, `sync_checkpoint`, `fix_required`, `error`, `shutdown` |
|
||||
| analyst | `analyze_ready`, `analyze_progress`, `error` |
|
||||
| architect | `arch_ready`, `arch_revision`, `arch_progress`, `error` |
|
||||
| developer | `dev_complete`, `dev_progress`, `error` |
|
||||
| qa | `qa_passed`, `qa_result`, `fix_required`, `error` |
|
||||
|
||||
### Shared Memory
|
||||
|
||||
Cross-role accumulated knowledge stored in `shared-memory.json`:
|
||||
|
||||
| Field | Owner | Content |
|
||||
|-------|-------|---------|
|
||||
| `design_intelligence` | analyst | ui-ux-pro-max output |
|
||||
| `design_token_registry` | architect | colors, typography, spacing, shadows |
|
||||
| `component_inventory` | architect | Component specs |
|
||||
| `style_decisions` | architect | Design system decisions |
|
||||
| `qa_history` | qa | QA audit results |
|
||||
| `industry_context` | analyst | Industry-specific rules |
|
||||
|
||||
Each role reads in Phase 2, writes own fields in Phase 5.
|
||||
|
||||
---
|
||||
|
||||
## Pipeline Architecture
|
||||
|
||||
### Three Pipeline Modes
|
||||
|
||||
```
|
||||
page (single page - linear):
|
||||
ANALYZE-001 -> ARCH-001 -> DEV-001 -> QA-001
|
||||
|
||||
feature (multi-component feature - with architecture review):
|
||||
ANALYZE-001 -> ARCH-001(tokens+structure) -> QA-001(architecture-review)
|
||||
-> DEV-001(components) -> QA-002(code-review)
|
||||
|
||||
system (full frontend system - dual-track parallel):
|
||||
ANALYZE-001 -> ARCH-001(tokens) -> QA-001(token-review)
|
||||
-> [ARCH-002(components) || DEV-001(tokens)](parallel, blockedBy QA-001)
|
||||
-> QA-002(component-review) -> DEV-002(components) -> QA-003(final)
|
||||
```
|
||||
|
||||
### Generator-Critic Loop (developer <-> qa)
|
||||
|
||||
Developer and qa iterate to ensure code quality and design compliance:
|
||||
|
||||
```
|
||||
┌──────────┐ DEV artifact ┌──────────┐
|
||||
│ developer│ ─────────────────────> │ qa │
|
||||
│(Generator)│ │ (Critic) │
|
||||
│ │ <───────────────────── │ │
|
||||
└──────────┘ QA feedback └──────────┘
|
||||
(max 2 rounds)
|
||||
|
||||
Convergence: qa.score >= 8 && qa.critical_count === 0
|
||||
```
|
||||
|
||||
### Consulting Pattern (developer -> analyst)
|
||||
|
||||
Developer can request design decision consultation via coordinator:
|
||||
|
||||
```
|
||||
developer -> coordinator: "Need design decision consultation"
|
||||
coordinator -> analyst: Create ANALYZE-consult task
|
||||
analyst -> coordinator: Design recommendation
|
||||
coordinator -> developer: Forward recommendation
|
||||
```
|
||||
|
||||
### Cadence Control
|
||||
|
||||
**Beat model**: Event-driven, each beat = coordinator wake -> process -> spawn -> STOP.
|
||||
|
||||
```
|
||||
Beat Cycle (single beat)
|
||||
═══════════════════════════════════════════════════════════
|
||||
Event Coordinator Workers
|
||||
───────────────────────────────────────────────────────────
|
||||
callback/resume ──> ┌─ handleCallback ─┐
|
||||
│ mark completed │
|
||||
│ check pipeline │
|
||||
├─ handleSpawnNext ─┤
|
||||
│ find ready tasks │
|
||||
│ spawn workers ───┼──> [Worker A] Phase 1-5
|
||||
│ (parallel OK) ──┼──> [Worker B] Phase 1-5
|
||||
└─ STOP (idle) ─────┘ │
|
||||
│
|
||||
callback <─────────────────────────────────────────┘
|
||||
(next beat) SendMessage + TaskUpdate(completed)
|
||||
═══════════════════════════════════════════════════════════
|
||||
```
|
||||
|
||||
**Pipeline beat view**:
|
||||
|
||||
```
|
||||
Page mode (4 beats, strictly serial)
|
||||
──────────────────────────────────────────────────────────
|
||||
Beat 1 2 3 4
|
||||
│ │ │ │
|
||||
ANALYZE -> ARCH -> DEV -> QA
|
||||
▲ ▲
|
||||
pipeline pipeline
|
||||
start done
|
||||
|
||||
A=ANALYZE ARCH=architect D=DEV Q=QA
|
||||
|
||||
Feature mode (5 beats, with architecture review gate)
|
||||
──────────────────────────────────────────────────────────
|
||||
Beat 1 2 3 4 5
|
||||
│ │ │ │ │
|
||||
ANALYZE -> ARCH -> QA-1 -> DEV -> QA-2
|
||||
▲ ▲
|
||||
arch review code review
|
||||
|
||||
System mode (7 beats, dual-track parallel)
|
||||
──────────────────────────────────────────────────────────
|
||||
Beat 1 2 3 4 5 6 7
|
||||
│ │ │ ┌────┴────┐ │ │ │
|
||||
ANALYZE -> ARCH-1 -> QA-1 -> ARCH-2 || DEV-1 -> QA-2 -> DEV-2 -> QA-3
|
||||
▲ ▲
|
||||
parallel window final check
|
||||
```
|
||||
|
||||
**Checkpoints**:
|
||||
|
||||
| Trigger | Location | Behavior |
|
||||
|---------|----------|----------|
|
||||
| Architecture review gate | QA-001 (arch review) complete | Pause if critical issues, wait for architect revision |
|
||||
| GC loop limit | developer <-> qa max 2 rounds | Exceed rounds -> stop iteration, report current state |
|
||||
| Pipeline stall | No ready + no running | Check missing tasks, report to user |
|
||||
|
||||
**Stall Detection** (coordinator `handleCheck` executes):
|
||||
|
||||
| Check | Condition | Resolution |
|
||||
|-------|-----------|------------|
|
||||
| Worker no response | in_progress task no callback | Report waiting task list, suggest user `resume` |
|
||||
| Pipeline deadlock | no ready + no running + has pending | Check blockedBy dependency chain, report blocking point |
|
||||
| GC loop exceeded | DEV/QA iteration > max_rounds | Terminate loop, output latest QA report |
|
||||
|
||||
### Task Metadata Registry
|
||||
|
||||
| Task ID | Role | Phase | Dependencies | Description |
|
||||
|---------|------|-------|-------------|-------------|
|
||||
| ANALYZE-001 | analyst | analysis | (none) | Requirement analysis + design intelligence via ui-ux-pro-max |
|
||||
| ARCH-001 | architect | design | ANALYZE-001 | Design token system + component architecture |
|
||||
| ARCH-002 | architect | design | QA-001 (system mode) | Component specs refinement |
|
||||
| DEV-001 | developer | impl | ARCH-001 or QA-001 | Frontend component/page implementation |
|
||||
| DEV-002 | developer | impl | QA-002 (system mode) | Component implementation from refined specs |
|
||||
| QA-001 | qa | review | ARCH-001 or DEV-001 | Architecture review or code review |
|
||||
| QA-002 | qa | review | DEV-001 | Code review (feature/system mode) |
|
||||
| QA-003 | qa | review | DEV-002 (system mode) | Final quality check |
|
||||
|
||||
---
|
||||
|
||||
## Coordinator Spawn Template
|
||||
|
||||
When coordinator spawns workers, use background mode (Spawn-and-Stop):
|
||||
### v5 Worker Spawn (all roles)
|
||||
|
||||
When coordinator spawns workers, use `team-worker` agent with role-spec path:
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "general-purpose",
|
||||
Agent({
|
||||
subagent_type: "team-worker",
|
||||
description: "Spawn <role> worker",
|
||||
team_name: <team-name>,
|
||||
team_name: "frontend",
|
||||
name: "<role>",
|
||||
run_in_background: true,
|
||||
prompt: `You are team "<team-name>" <ROLE>.
|
||||
prompt: `## Role Assignment
|
||||
role: <role>
|
||||
role_spec: .claude/skills/team-frontend/role-specs/<role>.md
|
||||
session: <session-folder>
|
||||
session_id: <session-id>
|
||||
team_name: frontend
|
||||
requirement: <task-description>
|
||||
inner_loop: <true|false>
|
||||
|
||||
## Primary Directive
|
||||
All your work must be executed through Skill to load role definition:
|
||||
Skill(skill="team-frontend", args="--role=<role>")
|
||||
|
||||
Current requirement: <task-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).`
|
||||
})
|
||||
```
|
||||
|
||||
**Inner Loop roles** (developer): Set `inner_loop: true`. The team-worker agent handles the loop internally.
|
||||
|
||||
**Single-task roles** (analyst, architect, qa): Set `inner_loop: false`.
|
||||
|
||||
---
|
||||
|
||||
## Pipeline Definitions
|
||||
|
||||
### Pipeline Diagrams
|
||||
|
||||
**Page Mode** (4 beats, linear):
|
||||
```
|
||||
Pipeline: Page (Linear)
|
||||
=====================================================
|
||||
Stage 1 Stage 2 Stage 3 Stage 4
|
||||
ANALYZE-001 --> ARCH-001 --> DEV-001 --> QA-001
|
||||
[analyst] [architect] [developer] [qa]
|
||||
```
|
||||
|
||||
**Feature Mode** (5 beats, with architecture review gate):
|
||||
```
|
||||
Pipeline: Feature (Architecture Review Gate)
|
||||
=====================================================
|
||||
Stage 1 Stage 2 Stage 3 Stage 4 Stage 5
|
||||
ANALYZE-001 --> ARCH-001 --> QA-001 --> DEV-001 --> QA-002
|
||||
[analyst] [architect] [qa:arch-rev] [developer] [qa:code-rev]
|
||||
```
|
||||
|
||||
**System Mode** (7 beats, dual-track parallel):
|
||||
```
|
||||
Pipeline: System (Dual-Track Parallel)
|
||||
=====================================================
|
||||
Stage 1 Stage 2 Stage 3 Stage 4 (parallel) Stage 5 Stage 6 Stage 7
|
||||
ANALYZE-001 --> ARCH-001 --> QA-001 --> ARCH-002 ─┐ --> QA-002 --> DEV-002 --> QA-003
|
||||
[analyst] [architect] [qa:arch-rev] [architect] | [qa] [developer] [qa:final]
|
||||
DEV-001 ──┘
|
||||
[developer:tokens]
|
||||
```
|
||||
|
||||
### Generator-Critic Loop (developer <-> qa)
|
||||
|
||||
```
|
||||
developer (Generator) -> QA artifact -> qa (Critic)
|
||||
<- QA feedback <-
|
||||
(max 2 rounds)
|
||||
|
||||
Convergence: qa.score >= 8 && qa.critical_count === 0
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Task Metadata Registry
|
||||
|
||||
| Task ID | Role | Stage | Dependencies | Description |
|
||||
|---------|------|-------|-------------|-------------|
|
||||
| ANALYZE-001 | analyst | analysis | (none) | Requirement analysis + design intelligence |
|
||||
| ARCH-001 | architect | design | ANALYZE-001 | Design token system + component architecture |
|
||||
| ARCH-002 | architect | design | QA-001 (system) | Component specs refinement |
|
||||
| DEV-001 | developer | impl | ARCH-001 or QA-001 | Frontend implementation |
|
||||
| DEV-002 | developer | impl | QA-002 (system) | Component implementation |
|
||||
| QA-001 | qa | review | ARCH-001 or DEV-001 | Architecture or code review |
|
||||
| QA-002 | qa | review | DEV-001 | Code review |
|
||||
| QA-003 | qa | review | DEV-002 (system) | Final quality check |
|
||||
|
||||
---
|
||||
|
||||
## ui-ux-pro-max Integration
|
||||
|
||||
### Design Intelligence Engine
|
||||
@@ -377,50 +202,100 @@ Analyst role invokes ui-ux-pro-max via Skill to obtain industry design intellige
|
||||
|
||||
| Action | Invocation |
|
||||
|--------|------------|
|
||||
| Full design system recommendation | `Skill(skill="ui-ux-pro-max", args="<industry> <keywords> --design-system")` |
|
||||
| Domain search (UX, typography, color) | `Skill(skill="ui-ux-pro-max", args="<query> --domain <domain>")` |
|
||||
| Full design system | `Skill(skill="ui-ux-pro-max", args="<industry> <keywords> --design-system")` |
|
||||
| Domain search | `Skill(skill="ui-ux-pro-max", args="<query> --domain <domain>")` |
|
||||
| Tech stack guidance | `Skill(skill="ui-ux-pro-max", args="<query> --stack <stack>")` |
|
||||
| Persist design system (cross-session) | `Skill(skill="ui-ux-pro-max", args="<query> --design-system --persist -p <projectName>")` |
|
||||
|
||||
**Supported Domains**: product, style, typography, color, landing, chart, ux, web
|
||||
**Supported Stacks**: html-tailwind, react, nextjs, vue, svelte, shadcn, swiftui, react-native, flutter
|
||||
|
||||
**Fallback**: If ui-ux-pro-max skill not installed, degrade to LLM general design knowledge. Suggest installation: `/plugin install ui-ux-pro-max@ui-ux-pro-max-skill`
|
||||
|
||||
---
|
||||
|
||||
## Completion Action
|
||||
|
||||
At Phase 5, coordinator offers interactive completion:
|
||||
|
||||
```
|
||||
AskUserQuestion({
|
||||
questions: [{
|
||||
question: "Team pipeline complete. What would you like to do?",
|
||||
header: "Completion",
|
||||
options: [
|
||||
{ label: "Archive & Clean (Recommended)" },
|
||||
{ label: "Keep Active" },
|
||||
{ label: "Export Results" }
|
||||
]
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
| Choice | Steps |
|
||||
|--------|-------|
|
||||
| Archive & Clean | Verify completed -> update status -> TeamDelete() -> final summary |
|
||||
| Keep Active | Status="paused" -> "Resume with: Skill(skill='team-frontend', args='resume')" |
|
||||
| Export Results | Ask target dir -> copy artifacts -> Archive flow |
|
||||
|
||||
---
|
||||
|
||||
## Message Bus
|
||||
|
||||
Every SendMessage must be preceded by `mcp__ccw-tools__team_msg` log:
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
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`
|
||||
|
||||
**Message types by role**:
|
||||
|
||||
| Role | Types |
|
||||
|------|-------|
|
||||
| coordinator | `task_unblocked`, `sync_checkpoint`, `fix_required`, `error`, `shutdown` |
|
||||
| analyst | `analyze_ready`, `error` |
|
||||
| architect | `arch_ready`, `arch_revision`, `error` |
|
||||
| developer | `dev_complete`, `dev_progress`, `error` |
|
||||
| qa | `qa_passed`, `qa_result`, `fix_required`, `error` |
|
||||
|
||||
---
|
||||
|
||||
## Session Directory
|
||||
|
||||
```
|
||||
.workflow/.team/FE-<slug>-<YYYY-MM-DD>/
|
||||
├── team-session.json # Session state
|
||||
├── shared-memory.json # Cross-role accumulated knowledge
|
||||
├── .msg/
|
||||
│ ├── messages.jsonl # Message bus log
|
||||
│ └── meta.json # Session state + cross-role state
|
||||
├── wisdom/ # Cross-task knowledge
|
||||
│ ├── learnings.md
|
||||
│ ├── decisions.md
|
||||
│ ├── conventions.md
|
||||
│ └── issues.md
|
||||
├── analysis/ # Analyst output
|
||||
│ ├── design-intelligence.json
|
||||
│ └── requirements.md
|
||||
├── architecture/ # Architect output
|
||||
│ ├── design-tokens.json
|
||||
│ ├── component-specs/
|
||||
│ │ └── <component-name>.md
|
||||
│ └── project-structure.md
|
||||
├── qa/ # QA output
|
||||
│ └── audit-<NNN>.md
|
||||
└── build/ # Developer output
|
||||
├── token-files/
|
||||
└── component-files/
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Unknown --role value | Error with available role list |
|
||||
| Missing --role arg | Orchestration Mode -> auto route to coordinator |
|
||||
| Role file not found | Error with expected path (roles/<name>/role.md) |
|
||||
| QA score < 6 over 2 GC rounds | Coordinator reports to user |
|
||||
| Dual-track sync failure | Fallback to single-track sequential execution |
|
||||
| ui-ux-pro-max skill not installed | Degrade to LLM general design knowledge, show install command |
|
||||
| DEV cannot find design files | Wait for sync point or escalate to coordinator |
|
||||
| Unknown command | Error with available command list |
|
||||
| QA score < 6 over 2 GC rounds | Escalate to user |
|
||||
| Dual-track sync failure (system mode) | Fallback to single-track sequential |
|
||||
| ui-ux-pro-max unavailable | Degrade to LLM general design knowledge |
|
||||
| Worker no response | Report waiting task, suggest user `resume` |
|
||||
| Pipeline deadlock | Check blockedBy chain, report blocking point |
|
||||
|
||||
91
.claude/skills/team-frontend/role-specs/analyst.md
Normal file
91
.claude/skills/team-frontend/role-specs/analyst.md
Normal file
@@ -0,0 +1,91 @@
|
||||
---
|
||||
prefix: ANALYZE
|
||||
inner_loop: false
|
||||
message_types:
|
||||
success: analyze_ready
|
||||
error: error
|
||||
---
|
||||
|
||||
# Requirements Analyst
|
||||
|
||||
Analyze frontend requirements and retrieve industry design intelligence via ui-ux-pro-max skill. Produce design-intelligence.json and requirements.md for downstream consumption by architect and developer roles.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| Industry context | Extracted from task description | Yes |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path, industry type, and tech stack from task description
|
||||
2. Detect existing design system:
|
||||
|
||||
| Signal | Detection Method |
|
||||
|--------|-----------------|
|
||||
| Token files | Glob `**/*token*.*` |
|
||||
| CSS files | Glob `**/*.css` |
|
||||
| Package.json | Read for framework dependencies |
|
||||
|
||||
3. Detect tech stack from package.json:
|
||||
|
||||
| Dependency | Stack |
|
||||
|------------|-------|
|
||||
| `next` | nextjs |
|
||||
| `react` | react |
|
||||
| `vue` | vue |
|
||||
| `svelte` | svelte |
|
||||
| `@shadcn/ui` | shadcn |
|
||||
| (none) | html-tailwind |
|
||||
|
||||
4. Load .msg/meta.json for shared state
|
||||
|
||||
## Phase 3: Design Intelligence Retrieval
|
||||
|
||||
Retrieve design intelligence via ui-ux-pro-max skill integration.
|
||||
|
||||
**Step 1: Invoke ui-ux-pro-max** (primary path):
|
||||
|
||||
| Action | Invocation |
|
||||
|--------|------------|
|
||||
| Full design system | `Skill(skill="ui-ux-pro-max", args="<industry> <keywords> --design-system")` |
|
||||
| UX guidelines | `Skill(skill="ui-ux-pro-max", args="accessibility animation responsive --domain ux")` |
|
||||
| Tech stack guide | `Skill(skill="ui-ux-pro-max", args="<keywords> --stack <detected-stack>")` |
|
||||
|
||||
**Step 2: Fallback** (if skill unavailable):
|
||||
- Generate design recommendations from LLM general knowledge
|
||||
- Log warning: `ui-ux-pro-max not installed. Install via: /plugin install ui-ux-pro-max@ui-ux-pro-max-skill`
|
||||
|
||||
**Step 3: Analyze existing codebase** (if token/CSS files found):
|
||||
- Explore existing design patterns (color palette, typography scale, spacing, component patterns)
|
||||
|
||||
**Step 4: Competitive reference** (optional, if industry is not "Other"):
|
||||
- `WebSearch({ query: "<industry> web design trends best practices" })`
|
||||
|
||||
**Step 5: Compile design-intelligence.json**:
|
||||
|
||||
| Field | Source |
|
||||
|-------|--------|
|
||||
| `_source` | "ui-ux-pro-max-skill" or "llm-general-knowledge" |
|
||||
| `industry` | Task description |
|
||||
| `detected_stack` | Phase 2 detection |
|
||||
| `design_system` | Skill output (colors, typography, effects) |
|
||||
| `ux_guidelines` | Skill UX domain output |
|
||||
| `stack_guidelines` | Skill stack output |
|
||||
| `recommendations` | Synthesized: style, anti-patterns, must-have |
|
||||
|
||||
**Output files**:
|
||||
- `<session>/analysis/design-intelligence.json`
|
||||
- `<session>/analysis/requirements.md`
|
||||
|
||||
## Phase 4: Self-Review
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| JSON validity | Parse design-intelligence.json | No parse errors |
|
||||
| Required fields | Check _source, industry, design_system | All present |
|
||||
| Anti-patterns populated | Check recommendations.anti_patterns | Non-empty array |
|
||||
| Requirements doc exists | File check | requirements.md written |
|
||||
|
||||
Update .msg/meta.json: merge `design_intelligence` and `industry_context` keys.
|
||||
85
.claude/skills/team-frontend/role-specs/architect.md
Normal file
85
.claude/skills/team-frontend/role-specs/architect.md
Normal file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
prefix: ARCH
|
||||
inner_loop: false
|
||||
message_types:
|
||||
success: arch_ready
|
||||
error: error
|
||||
---
|
||||
|
||||
# Frontend Architect
|
||||
|
||||
Consume design-intelligence.json to define design token system, component architecture, and project structure. Token values prioritize ui-ux-pro-max recommendations. Produce architecture artifacts for developer consumption.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| Scope | Extracted from task description (tokens/components/full) | No (default: full) |
|
||||
| Design intelligence | <session>/analysis/design-intelligence.json | Yes |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path and scope from task description
|
||||
2. Load design intelligence from analyst output
|
||||
3. Load .msg/meta.json for shared state (industry_context, design_intelligence)
|
||||
4. Detect existing project structure via Glob `src/**/*`
|
||||
|
||||
**Fail-safe**: If design-intelligence.json not found, use default token values and log warning.
|
||||
|
||||
## Phase 3: Architecture Design
|
||||
|
||||
**Scope selection**:
|
||||
|
||||
| Scope | Output |
|
||||
|-------|--------|
|
||||
| `tokens` | Design token system only |
|
||||
| `components` | Component specs only |
|
||||
| `full` | Both tokens and components + project structure |
|
||||
|
||||
**Step 1: Design Token System** (scope: tokens or full):
|
||||
|
||||
Generate `<session>/architecture/design-tokens.json` with categories:
|
||||
|
||||
| Category | Content | Source |
|
||||
|----------|---------|--------|
|
||||
| `color` | Primary, secondary, background, surface, text, CTA | ui-ux-pro-max |
|
||||
| `typography` | Font families, font sizes (scale) | ui-ux-pro-max |
|
||||
| `spacing` | xs through 2xl | Standard scale |
|
||||
| `border-radius` | sm, md, lg, full | Standard scale |
|
||||
| `shadow` | sm, md, lg | Standard elevation |
|
||||
| `transition` | fast, normal, slow | Standard durations |
|
||||
|
||||
Use `$type` + `$value` format (Design Tokens Community Group). Support light/dark mode via nested values.
|
||||
|
||||
**Step 2: Component Architecture** (scope: components or full):
|
||||
|
||||
Generate component specs in `<session>/architecture/component-specs/`:
|
||||
- Design reference (style, stack)
|
||||
- Props table (name, type, default, description)
|
||||
- Variants table
|
||||
- Accessibility requirements (role, keyboard, ARIA, contrast)
|
||||
- Anti-patterns to avoid (from design intelligence)
|
||||
|
||||
**Step 3: Project Structure** (scope: full):
|
||||
|
||||
Generate `<session>/architecture/project-structure.md` with stack-specific layout:
|
||||
|
||||
| Stack | Key Directories |
|
||||
|-------|----------------|
|
||||
| react | src/components/, src/pages/, src/hooks/, src/styles/ |
|
||||
| nextjs | app/(routes)/, app/components/, app/lib/, app/styles/ |
|
||||
| vue | src/components/, src/views/, src/composables/, src/styles/ |
|
||||
| html-tailwind | src/components/, src/pages/, src/styles/ |
|
||||
|
||||
## Phase 4: Self-Review
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| JSON validity | Parse design-tokens.json | No errors |
|
||||
| Required categories | Check color, typography, spacing | All present |
|
||||
| Anti-pattern compliance | Token values vs anti-patterns | No violations |
|
||||
| Component specs complete | Each has props + accessibility | All complete |
|
||||
| File existence | Verify all planned files | All present |
|
||||
|
||||
Update .msg/meta.json: merge `design_token_registry` and `component_inventory` keys.
|
||||
92
.claude/skills/team-frontend/role-specs/developer.md
Normal file
92
.claude/skills/team-frontend/role-specs/developer.md
Normal file
@@ -0,0 +1,92 @@
|
||||
---
|
||||
prefix: DEV
|
||||
inner_loop: true
|
||||
message_types:
|
||||
success: dev_complete
|
||||
error: error
|
||||
---
|
||||
|
||||
# Frontend Developer
|
||||
|
||||
Consume architecture artifacts (design tokens, component specs, project structure) to implement frontend code. Reference design-intelligence.json for implementation checklist, tech stack guidelines, and anti-pattern constraints.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| Scope | Extracted from task description (tokens/components/full) | No (default: full) |
|
||||
| Design intelligence | <session>/analysis/design-intelligence.json | No |
|
||||
| Design tokens | <session>/architecture/design-tokens.json | Yes |
|
||||
| Component specs | <session>/architecture/component-specs/*.md | No |
|
||||
| Project structure | <session>/architecture/project-structure.md | No |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path and scope from task description
|
||||
2. Load design tokens (required -- if missing, report to coordinator)
|
||||
3. Load design intelligence for anti-patterns and guidelines
|
||||
4. Load component specs and project structure
|
||||
5. Detect tech stack from design intelligence `detected_stack`
|
||||
6. Load .msg/meta.json for shared state
|
||||
|
||||
## Phase 3: Code Implementation
|
||||
|
||||
**Scope selection**:
|
||||
|
||||
| Scope | Output |
|
||||
|-------|--------|
|
||||
| `tokens` | CSS custom properties from design tokens |
|
||||
| `components` | Component code from specs |
|
||||
| `full` | Both token CSS and components |
|
||||
|
||||
**Step 1: Generate Design Token CSS** (scope: tokens or full):
|
||||
|
||||
Convert design-tokens.json to `src/styles/tokens.css`:
|
||||
|
||||
| JSON Category | CSS Variable Prefix |
|
||||
|---------------|---------------------|
|
||||
| color | `--color-` |
|
||||
| typography.font-family | `--font-` |
|
||||
| typography.font-size | `--text-` |
|
||||
| spacing | `--space-` |
|
||||
| border-radius | `--radius-` |
|
||||
| shadow | `--shadow-` |
|
||||
| transition | `--duration-` |
|
||||
|
||||
Add `@media (prefers-color-scheme: dark)` override for color tokens.
|
||||
|
||||
**Step 2: Implement Components** (scope: components or full):
|
||||
|
||||
Implementation strategy by complexity:
|
||||
|
||||
| Condition | Strategy |
|
||||
|-----------|----------|
|
||||
| <= 2 components | Direct inline Edit/Write |
|
||||
| 3-5 components | Single batch implementation |
|
||||
| > 5 components | Group by module, implement per batch |
|
||||
|
||||
**Coding standards** (mandatory):
|
||||
- Use design token CSS variables -- never hardcode colors/spacing
|
||||
- All interactive elements: `cursor: pointer`
|
||||
- Transitions: 150-300ms via `var(--duration-normal)`
|
||||
- Text contrast: minimum 4.5:1 ratio
|
||||
- Include `focus-visible` styles for keyboard navigation
|
||||
- Support `prefers-reduced-motion`
|
||||
- Responsive: mobile-first with md/lg breakpoints
|
||||
- No emoji as functional icons
|
||||
|
||||
## Phase 4: Self-Review
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| Hardcoded colors | Scan for hex codes outside tokens.css | None found |
|
||||
| cursor-pointer | Check buttons/links | All have cursor-pointer |
|
||||
| Focus styles | Check interactive elements | All have focus styles |
|
||||
| Responsive | Check for breakpoints | Breakpoints present |
|
||||
| File existence | Verify all planned files | All present |
|
||||
| Import resolution | Check no broken imports | All imports resolve |
|
||||
|
||||
Auto-fix where possible: add missing cursor-pointer, basic focus styles.
|
||||
|
||||
Update .msg/meta.json: merge `component_inventory` key with implemented file list.
|
||||
78
.claude/skills/team-frontend/role-specs/qa.md
Normal file
78
.claude/skills/team-frontend/role-specs/qa.md
Normal file
@@ -0,0 +1,78 @@
|
||||
---
|
||||
prefix: QA
|
||||
inner_loop: false
|
||||
message_types:
|
||||
success: qa_passed
|
||||
error: error
|
||||
---
|
||||
|
||||
# QA Engineer
|
||||
|
||||
Execute 5-dimension quality audit integrating ux-guidelines Do/Don't rules, pre-delivery checklist, and industry anti-pattern library. Perform CSS-level precise review on architecture artifacts and implementation code.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| Review type | Extracted from task description | No (default: code-review) |
|
||||
| Design intelligence | <session>/analysis/design-intelligence.json | No |
|
||||
| Design tokens | <session>/architecture/design-tokens.json | No |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path and review type from task description
|
||||
2. Load design intelligence (for anti-patterns, must-have rules)
|
||||
3. Load design tokens (for compliance checks)
|
||||
4. Load .msg/meta.json (for industry context, strictness level)
|
||||
5. Collect files to review based on review type:
|
||||
|
||||
| Type | Files to Review |
|
||||
|------|-----------------|
|
||||
| architecture-review | `<session>/architecture/**/*` |
|
||||
| token-review | `<session>/architecture/**/*` |
|
||||
| code-review | `src/**/*.{tsx,jsx,vue,svelte,html,css}` |
|
||||
| final | `src/**/*.{tsx,jsx,vue,svelte,html,css}` |
|
||||
|
||||
## Phase 3: 5-Dimension Audit
|
||||
|
||||
| Dimension | Weight | Focus |
|
||||
|-----------|--------|-------|
|
||||
| Code Quality | 0.20 | Structure, naming, maintainability |
|
||||
| Accessibility | 0.25 | WCAG compliance, keyboard nav, screen reader |
|
||||
| Design Compliance | 0.20 | Anti-pattern check, design token usage |
|
||||
| UX Best Practices | 0.20 | Interaction patterns, responsive, animations |
|
||||
| Pre-Delivery | 0.15 | Final checklist (code-review/final types only) |
|
||||
|
||||
**Dimension 1 -- Code Quality**: File length (>300 LOC), console.log, empty catch, unused imports.
|
||||
|
||||
**Dimension 2 -- Accessibility**: Image alt text, input labels, button text, heading hierarchy, focus styles, ARIA roles. Strict mode (medical/financial): prefers-reduced-motion required.
|
||||
|
||||
**Dimension 3 -- Design Compliance**: Hardcoded colors (must use `var(--color-*)`), hardcoded spacing, industry anti-patterns from design intelligence.
|
||||
|
||||
**Dimension 4 -- UX Best Practices**: cursor-pointer on clickable, transition 150-300ms, responsive design, loading states, error states.
|
||||
|
||||
**Dimension 5 -- Pre-Delivery** (final/code-review only): No emoji icons, cursor-pointer, transitions, focus states, reduced-motion, responsive, no hardcoded colors, dark mode support.
|
||||
|
||||
**Score calculation**: `score = sum(dimension_score * weight)`
|
||||
|
||||
**Verdict**:
|
||||
|
||||
| Condition | Verdict | Message Type |
|
||||
|-----------|---------|-------------|
|
||||
| score >= 8 AND critical == 0 | PASSED | `qa_passed` |
|
||||
| score >= 6 AND critical == 0 | PASSED_WITH_WARNINGS | `qa_result` |
|
||||
| score < 6 OR critical > 0 | FIX_REQUIRED | `fix_required` |
|
||||
|
||||
## Phase 4: Self-Review
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| All dimensions scored | Check 5 dimension scores | All present |
|
||||
| Audit report written | File check | audit-NNN.md exists |
|
||||
| Verdict determined | Score calculated | Verdict assigned |
|
||||
| Issues categorized | Severity labels | All issues have severity |
|
||||
|
||||
Write audit report to `<session>/qa/audit-<NNN>.md` with: summary, dimension scores, issues by severity, passed dimensions.
|
||||
|
||||
Update .msg/meta.json: append to `qa_history` array.
|
||||
@@ -1,150 +0,0 @@
|
||||
# Command: design-intelligence
|
||||
|
||||
> 通过 Skill 调用 ui-ux-pro-max 获取行业设计智能,生成 design-intelligence.json。
|
||||
|
||||
## When to Use
|
||||
|
||||
- Phase 3 of analyst role: Core design intelligence retrieval
|
||||
- ui-ux-pro-max skill 已安装
|
||||
|
||||
## Strategy
|
||||
|
||||
### Delegation Mode
|
||||
|
||||
**Mode**: Skill invocation
|
||||
**Skill**: `ui-ux-pro-max`
|
||||
|
||||
## Execution Steps
|
||||
|
||||
### Step 1: 调用 ui-ux-pro-max 生成设计系统
|
||||
|
||||
analyst 在 subagent 中通过 Skill 调用 ui-ux-pro-max,获取完整设计系统推荐:
|
||||
|
||||
```javascript
|
||||
// 核心调用:生成完整设计系统
|
||||
// ui-ux-pro-max 的 Step 2 会自动执行 search.py --design-system
|
||||
Task({
|
||||
subagent_type: "general-purpose",
|
||||
run_in_background: false,
|
||||
description: "Retrieve design intelligence via ui-ux-pro-max skill",
|
||||
prompt: `调用 ui-ux-pro-max skill 获取设计系统推荐。
|
||||
|
||||
## 需求
|
||||
- 产品类型/行业: ${industry}
|
||||
- 关键词: ${keywords}
|
||||
- 技术栈: ${detectedStack}
|
||||
|
||||
## 执行步骤
|
||||
|
||||
### 1. 生成设计系统(必须)
|
||||
Skill(skill="ui-ux-pro-max", args="${industry} ${keywords} --design-system")
|
||||
|
||||
### 2. 补充 UX 指南
|
||||
Skill(skill="ui-ux-pro-max", args="accessibility animation responsive --domain ux")
|
||||
|
||||
### 3. 获取技术栈指南
|
||||
Skill(skill="ui-ux-pro-max", args="${keywords} --stack ${detectedStack}")
|
||||
|
||||
## 输出
|
||||
将所有结果整合写入: ${sessionFolder}/analysis/design-intelligence-raw.md
|
||||
|
||||
包含:
|
||||
- 设计系统推荐(pattern, style, colors, typography, effects, anti-patterns)
|
||||
- UX 最佳实践
|
||||
- 技术栈指南
|
||||
- 行业反模式列表
|
||||
`
|
||||
})
|
||||
```
|
||||
|
||||
### Step 2: 解析 Skill 输出
|
||||
|
||||
```javascript
|
||||
// 读取 ui-ux-pro-max 的原始输出
|
||||
let rawOutput = ''
|
||||
try {
|
||||
rawOutput = Read(`${sessionFolder}/analysis/design-intelligence-raw.md`)
|
||||
} catch {}
|
||||
|
||||
// 解析为结构化 design-intelligence.json
|
||||
const designIntelligence = {
|
||||
_source: "ui-ux-pro-max-skill",
|
||||
_generated_at: new Date().toISOString(),
|
||||
industry: industry,
|
||||
detected_stack: detectedStack,
|
||||
design_system: parseDesignSystem(rawOutput),
|
||||
ux_guidelines: parseUxGuidelines(rawOutput),
|
||||
stack_guidelines: parseStackGuidelines(rawOutput),
|
||||
recommendations: {
|
||||
style: null,
|
||||
color_palette: null,
|
||||
typography: null,
|
||||
anti_patterns: parseAntiPatterns(rawOutput),
|
||||
must_have: industryConfig?.mustHave || []
|
||||
}
|
||||
}
|
||||
|
||||
Write(`${sessionFolder}/analysis/design-intelligence.json`, JSON.stringify(designIntelligence, null, 2))
|
||||
```
|
||||
|
||||
### Step 3: Fallback
|
||||
|
||||
```javascript
|
||||
// 若 ui-ux-pro-max skill 不可用(未安装),降级为 LLM 通用设计知识
|
||||
// analyst 在 Phase 3 中直接基于 LLM 知识生成设计推荐
|
||||
if (!skillAvailable) {
|
||||
return {
|
||||
_source: "llm-general-knowledge",
|
||||
_fallback: true,
|
||||
note: "ui-ux-pro-max skill not installed. Install via: /plugin install ui-ux-pro-max@ui-ux-pro-max-skill"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Skill 调用参考
|
||||
|
||||
ui-ux-pro-max 支持的调用方式:
|
||||
|
||||
| 用途 | 调用 |
|
||||
|------|------|
|
||||
| 完整设计系统 | `Skill(skill="ui-ux-pro-max", args="<query> --design-system")` |
|
||||
| 持久化设计系统 | `Skill(skill="ui-ux-pro-max", args="<query> --design-system --persist -p <name>")` |
|
||||
| 领域搜索 | `Skill(skill="ui-ux-pro-max", args="<query> --domain <domain>")` |
|
||||
| 技术栈指南 | `Skill(skill="ui-ux-pro-max", args="<query> --stack <stack>")` |
|
||||
|
||||
可用领域: product, style, typography, color, landing, chart, ux, web
|
||||
可用技术栈: html-tailwind, react, nextjs, vue, svelte, shadcn, swiftui, react-native, flutter
|
||||
|
||||
## Output Format
|
||||
|
||||
```json
|
||||
{
|
||||
"_source": "ui-ux-pro-max-skill",
|
||||
"design_system": {
|
||||
"pattern": "...",
|
||||
"style": "...",
|
||||
"colors": { "primary": "...", "secondary": "...", "cta": "..." },
|
||||
"typography": { "heading": "...", "body": "..." },
|
||||
"effects": "...",
|
||||
"anti_patterns": []
|
||||
},
|
||||
"ux_guidelines": [],
|
||||
"stack_guidelines": {},
|
||||
"recommendations": {
|
||||
"style": null,
|
||||
"color_palette": null,
|
||||
"typography": null,
|
||||
"anti_patterns": [],
|
||||
"must_have": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| ui-ux-pro-max skill not installed | Fallback to LLM general knowledge, suggest install command |
|
||||
| Skill execution error | Retry once, then fallback |
|
||||
| Partial output | Use available data, fill gaps with defaults |
|
||||
| Timeout | Use partial results, log warning |
|
||||
@@ -1,225 +0,0 @@
|
||||
# Analyst Role
|
||||
|
||||
Requirements analyst. Invokes ui-ux-pro-max search engine to retrieve industry design intelligence, analyzes requirements, matches industry inference rules, generates design-intelligence.json for downstream consumption.
|
||||
|
||||
## Identity
|
||||
|
||||
- **Name**: `analyst` | **Tag**: `[analyst]`
|
||||
- **Task Prefix**: `ANALYZE-*`
|
||||
- **Responsibility**: Read-only analysis + design intelligence retrieval
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- Only process `ANALYZE-*` prefixed tasks
|
||||
- All output (SendMessage, team_msg, logs) must carry `[analyst]` identifier
|
||||
- Only communicate with coordinator via SendMessage
|
||||
- Work strictly within requirement analysis and design intelligence scope
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- Execute work outside this role's responsibility scope (architecture, implementation, QA)
|
||||
- Communicate directly with other worker roles (must go through coordinator)
|
||||
- Create tasks for other roles (TaskCreate is coordinator-exclusive)
|
||||
- Modify source code files
|
||||
- Omit `[analyst]` identifier in any output
|
||||
|
||||
---
|
||||
|
||||
## Toolbox
|
||||
|
||||
### Available Commands
|
||||
|
||||
| Command | File | Phase | Description |
|
||||
|---------|------|-------|-------------|
|
||||
| `design-intelligence` | [commands/design-intelligence.md](commands/design-intelligence.md) | Phase 3 | ui-ux-pro-max integration for design system retrieval |
|
||||
|
||||
### Tool Capabilities
|
||||
|
||||
| Tool | Type | Used By | Purpose |
|
||||
|------|------|---------|---------|
|
||||
| `Read` | builtin | Phase 2 | Load session files, shared memory |
|
||||
| `Glob` | builtin | Phase 2 | Detect existing token files, CSS files |
|
||||
| `Grep` | builtin | Phase 2 | Search codebase patterns |
|
||||
| `Bash` | builtin | Phase 3 | Call ui-ux-pro-max search.py |
|
||||
| `WebSearch` | builtin | Phase 3 | Competitive reference, design trends |
|
||||
| `Task(cli-explore-agent)` | subagent | Phase 3 | Deep codebase exploration |
|
||||
| `Skill(ui-ux-pro-max)` | skill | Phase 3 | Design intelligence retrieval |
|
||||
|
||||
---
|
||||
|
||||
## Message Types
|
||||
|
||||
| Type | Direction | Trigger | Description |
|
||||
|------|-----------|---------|-------------|
|
||||
| `analyze_ready` | analyst → coordinator | Analysis complete | Design intelligence ready for downstream consumption |
|
||||
| `analyze_progress` | analyst → coordinator | Partial progress | Analysis progress update |
|
||||
| `error` | analyst → coordinator | Analysis failure | Analysis failed or tool unavailable |
|
||||
|
||||
## Message Bus
|
||||
|
||||
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., FES-xxx-date), NOT team name. Extract from Session: field.
|
||||
from: "analyst",
|
||||
to: "coordinator",
|
||||
type: <message-type>,
|
||||
summary: "[analyst] ANALYZE complete: <task-subject>",
|
||||
ref: <artifact-path>
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from analyst --to coordinator --type <message-type> --summary \"[analyst] ...\" --ref <artifact-path> --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 `ANALYZE-*` + owner match + pending + unblocked -> TaskGet -> TaskUpdate in_progress.
|
||||
|
||||
### Phase 2: Context Loading
|
||||
|
||||
**Input Sources**:
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Extract from task description `Session: <path>` | Yes |
|
||||
| Industry context | Extract from task description `Industry: <type>` | Yes |
|
||||
| Shared memory | `<session-folder>/shared-memory.json` | No |
|
||||
| Session info | `<session-folder>/team-session.json` | No |
|
||||
| Existing tokens | Glob `**/*token*.*` | No |
|
||||
| Existing CSS | Glob `**/*.css` | No |
|
||||
| Package.json | For tech stack detection | No |
|
||||
|
||||
**Loading Steps**:
|
||||
|
||||
1. Extract session folder from task description
|
||||
2. Extract industry context from task description
|
||||
3. Load shared memory and session info
|
||||
4. Detect existing design system in project
|
||||
5. Detect tech stack from package.json
|
||||
|
||||
**Tech Stack Detection**:
|
||||
|
||||
| Detection | Stack |
|
||||
|-----------|-------|
|
||||
| `next` in dependencies | nextjs |
|
||||
| `react` in dependencies | react |
|
||||
| `vue` in dependencies | vue |
|
||||
| `svelte` in dependencies | svelte |
|
||||
| `@shadcn/ui` in dependencies | shadcn |
|
||||
| No package.json | html-tailwind |
|
||||
|
||||
### Phase 3: Core Analysis - Design Intelligence Retrieval
|
||||
|
||||
Key integration point with ui-ux-pro-max. Retrieve design intelligence via Skill.
|
||||
|
||||
**Execution Strategy**:
|
||||
|
||||
| Condition | Strategy |
|
||||
|-----------|----------|
|
||||
| ui-ux-pro-max skill available | Full design system retrieval via Skill |
|
||||
| ui-ux-pro-max not installed | Fallback to LLM general knowledge |
|
||||
|
||||
**Step 1: Invoke ui-ux-pro-max via Skill**
|
||||
|
||||
Delegate to `commands/design-intelligence.md` for detailed execution.
|
||||
|
||||
**Skill Invocations**:
|
||||
|
||||
| Action | Invocation |
|
||||
|--------|------------|
|
||||
| Full design system | `Skill(skill="ui-ux-pro-max", args="<industry> <keywords> --design-system")` |
|
||||
| UX guidelines | `Skill(skill="ui-ux-pro-max", args="accessibility animation responsive --domain ux")` |
|
||||
| Tech stack guide | `Skill(skill="ui-ux-pro-max", args="<keywords> --stack <detected-stack>")` |
|
||||
|
||||
**Step 2: Fallback - LLM General Knowledge**
|
||||
|
||||
If ui-ux-pro-max skill not available (not installed or execution failed):
|
||||
- Generate design recommendations from LLM general knowledge
|
||||
- Quality is lower than data-driven recommendations from ui-ux-pro-max
|
||||
- Suggest installation: `/plugin install ui-ux-pro-max@ui-ux-pro-max-skill`
|
||||
|
||||
**Step 3: Analyze Existing Codebase**
|
||||
|
||||
If existing token files or CSS files found:
|
||||
|
||||
```
|
||||
Task({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: "Explore existing design system",
|
||||
prompt: "Analyze existing design system: <token-files>, <css-files>. Find: color palette, typography scale, spacing system, component patterns. Output as JSON."
|
||||
})
|
||||
```
|
||||
|
||||
**Step 4: Competitive Reference** (optional)
|
||||
|
||||
If industry is not "Other":
|
||||
- Quick web search for design inspiration
|
||||
- `WebSearch({ query: "<industry> web design trends 2025 best practices" })`
|
||||
|
||||
### Phase 4: Synthesis and Output
|
||||
|
||||
**Compile Design Intelligence**:
|
||||
|
||||
Generate `design-intelligence.json` with:
|
||||
|
||||
| Field | Source | Description |
|
||||
|-------|--------|-------------|
|
||||
| `_source` | Execution | "ui-ux-pro-max-skill" or "llm-general-knowledge" |
|
||||
| `industry` | Task | Industry context |
|
||||
| `detected_stack` | Phase 2 | Tech stack detection result |
|
||||
| `design_system` | Skill/fallback | Colors, typography, style |
|
||||
| `ux_guidelines` | Skill | UX best practices |
|
||||
| `stack_guidelines` | Skill | Tech-specific guidance |
|
||||
| `existing_patterns` | Phase 3 | Codebase analysis results |
|
||||
| `recommendations` | Synthesis | Style, colors, anti-patterns, must-have |
|
||||
|
||||
**Output Files**:
|
||||
|
||||
1. **design-intelligence.json**: Structured data for downstream consumption
|
||||
2. **requirements.md**: Human-readable requirements summary
|
||||
|
||||
**Update Shared Memory**:
|
||||
- Write `design_intelligence` field
|
||||
- Write `industry_context` field
|
||||
|
||||
### Phase 5: Report to Coordinator
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
|
||||
|
||||
Standard report flow: team_msg log -> SendMessage with `[analyst]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
|
||||
|
||||
**Report Content**:
|
||||
- Task subject and status
|
||||
- Design intelligence source (ui-ux-pro-max or LLM fallback)
|
||||
- Industry and detected stack
|
||||
- Anti-patterns count
|
||||
- Output file paths
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| No ANALYZE-* tasks available | Idle, wait for coordinator assignment |
|
||||
| ui-ux-pro-max not found | Fallback to LLM general knowledge, log warning |
|
||||
| search.py execution error | Retry once, then fallback |
|
||||
| Python not available | Fallback to LLM general knowledge |
|
||||
| Session folder not found | Notify coordinator, request location |
|
||||
| Web search fails | Skip competitive reference, continue |
|
||||
| Critical issue beyond scope | SendMessage fix_required to coordinator |
|
||||
@@ -1,219 +0,0 @@
|
||||
# Architect Role
|
||||
|
||||
Frontend architect. Consumes design-intelligence.json, defines design token system, component architecture, project structure, and technology selection. Design token values should prioritize ui-ux-pro-max recommendations.
|
||||
|
||||
## Identity
|
||||
|
||||
- **Name**: `architect` | **Tag**: `[architect]`
|
||||
- **Task Prefix**: `ARCH-*`
|
||||
- **Responsibility**: Code generation (architecture artifacts)
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- Only process `ARCH-*` prefixed tasks
|
||||
- All output (SendMessage, team_msg, logs) must carry `[architect]` identifier
|
||||
- Only communicate with coordinator via SendMessage
|
||||
- Work strictly within architecture design and token definition scope
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- Execute work outside this role's responsibility scope (analysis, implementation, QA)
|
||||
- Communicate directly with other worker roles (must go through coordinator)
|
||||
- Create tasks for other roles (TaskCreate is coordinator-exclusive)
|
||||
- Implement concrete component code (only define specifications)
|
||||
- Omit `[architect]` identifier in any output
|
||||
|
||||
---
|
||||
|
||||
## Toolbox
|
||||
|
||||
### Available Commands
|
||||
|
||||
> No command files -- all phases execute inline.
|
||||
|
||||
### Tool Capabilities
|
||||
|
||||
| Tool | Type | Used By | Purpose |
|
||||
|------|------|---------|---------|
|
||||
| `Read` | builtin | Phase 2-3 | Load design intelligence, shared memory |
|
||||
| `Write` | builtin | Phase 3-4 | Write architecture artifacts |
|
||||
| `Edit` | builtin | Phase 3-4 | Modify architecture files |
|
||||
| `Glob` | builtin | Phase 2 | Detect project structure |
|
||||
| `Grep` | builtin | Phase 2 | Search patterns |
|
||||
| `Task(code-developer)` | subagent | Phase 3 | Complex architecture file generation |
|
||||
|
||||
---
|
||||
|
||||
## Message Types
|
||||
|
||||
| Type | Direction | Trigger | Description |
|
||||
|------|-----------|---------|-------------|
|
||||
| `arch_ready` | architect → coordinator | Architecture complete | Architecture artifacts ready for downstream |
|
||||
| `arch_revision` | architect → coordinator | Revision after QA feedback | Architecture revision complete |
|
||||
| `arch_progress` | architect → coordinator | Partial progress | Architecture progress update |
|
||||
| `error` | architect → coordinator | Architecture failure | Architecture design failed |
|
||||
|
||||
## Message Bus
|
||||
|
||||
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., FES-xxx-date), NOT team name. Extract from Session: field.
|
||||
from: "architect",
|
||||
to: "coordinator",
|
||||
type: <message-type>,
|
||||
summary: "[architect] ARCH complete: <task-subject>",
|
||||
ref: <artifact-path>
|
||||
})
|
||||
```
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --team <session-id> --from architect --to coordinator --type <message-type> --summary \"[architect] ...\" --ref <artifact-path> --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 `ARCH-*` + owner match + pending + unblocked -> TaskGet -> TaskUpdate in_progress.
|
||||
|
||||
### Phase 2: Context Loading
|
||||
|
||||
**Input Sources**:
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session folder | Extract from task description `Session: <path>` | Yes |
|
||||
| Scope | Extract from task description `Scope: <tokens|components|full>` | No (default: full) |
|
||||
| Design intelligence | `<session-folder>/analysis/design-intelligence.json` | No |
|
||||
| Shared memory | `<session-folder>/shared-memory.json` | No |
|
||||
| Project files | Glob `src/**/*` | No |
|
||||
|
||||
**Loading Steps**:
|
||||
|
||||
1. Extract session folder from task description
|
||||
2. Extract scope (tokens / components / full)
|
||||
3. Load design intelligence from analyst output
|
||||
4. Load shared memory
|
||||
5. Load existing project structure via Glob
|
||||
|
||||
**Fail-safe**: If design-intelligence.json not found -> SendMessage to coordinator requesting location.
|
||||
|
||||
### Phase 3: Architecture Design
|
||||
|
||||
**Scope Selection**:
|
||||
|
||||
| Scope | Output |
|
||||
|-------|--------|
|
||||
| `tokens` | Design token system only |
|
||||
| `components` | Component architecture only |
|
||||
| `full` | Both tokens and components |
|
||||
|
||||
#### Step 1: Design Token System (scope: tokens or full)
|
||||
|
||||
Generate `design-tokens.json` with categories:
|
||||
|
||||
| Category | Content | Source |
|
||||
|----------|---------|--------|
|
||||
| `color` | Primary, secondary, background, surface, text, CTA | ui-ux-pro-max recommendations |
|
||||
| `typography` | Font families, font sizes | ui-ux-pro-max recommendations |
|
||||
| `spacing` | Scale from xs to 2xl | Standard scale |
|
||||
| `border-radius` | sm, md, lg, full | Standard scale |
|
||||
| `shadow` | sm, md, lg | Standard elevation |
|
||||
| `transition` | fast, normal, slow | Standard durations |
|
||||
|
||||
**Token Structure**:
|
||||
- Use `$type` and `$value` format (Design Tokens Community Group)
|
||||
- Support light/dark mode via nested values
|
||||
- Fallback to defaults if design intelligence unavailable
|
||||
|
||||
#### Step 2: Component Architecture (scope: components or full)
|
||||
|
||||
Generate component specifications in `architecture/component-specs/`:
|
||||
|
||||
**Component Spec Template**:
|
||||
1. Design Reference (style, stack)
|
||||
2. Props table (name, type, default, description)
|
||||
3. Variants table (name, description)
|
||||
4. Accessibility requirements (role, keyboard, ARIA, contrast)
|
||||
5. Implementation hints (CSS keywords)
|
||||
6. Anti-patterns to avoid (from design intelligence)
|
||||
|
||||
**Component List**: Derived from task description analysis.
|
||||
|
||||
#### Step 3: Project Structure (scope: full or no existing project)
|
||||
|
||||
Generate `project-structure.md`:
|
||||
|
||||
**Stack-specific Structure**:
|
||||
|
||||
| Stack | Directory Layout |
|
||||
|-------|-----------------|
|
||||
| react | src/components/, src/pages/, src/hooks/, src/styles/, src/utils/, src/types/ |
|
||||
| nextjs | app/(routes)/, app/components/, app/lib/, app/styles/, app/types/ |
|
||||
| vue | src/components/, src/views/, src/composables/, src/styles/, src/types/ |
|
||||
| html-tailwind | src/components/, src/pages/, src/styles/, src/assets/ |
|
||||
|
||||
**Conventions**:
|
||||
- Naming: kebab-case for files, PascalCase for components
|
||||
- Imports: absolute imports via @/ alias
|
||||
- Styling: CSS Modules + design tokens (or Tailwind for html-tailwind)
|
||||
- Testing: co-located test files (*.test.tsx)
|
||||
|
||||
### Phase 4: Self-Validation
|
||||
|
||||
**Validation Checks**:
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| JSON validity | Parse design-tokens.json | No errors |
|
||||
| Required categories | Check for color, typography, spacing | All present |
|
||||
| Anti-pattern compliance | Check token values against anti-patterns | No violations |
|
||||
| File existence | Verify all planned files exist | All files present |
|
||||
|
||||
**Validation Result**:
|
||||
|
||||
| Status | Condition |
|
||||
|--------|-----------|
|
||||
| complete | No issues found |
|
||||
| complete_with_warnings | Non-critical issues found |
|
||||
|
||||
**Update Shared Memory**:
|
||||
- Write `design_token_registry` field with generated tokens
|
||||
|
||||
### Phase 5: Report to Coordinator
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
|
||||
|
||||
Standard report flow: team_msg log -> SendMessage with `[architect]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
|
||||
|
||||
**Report Content**:
|
||||
- Task subject and status
|
||||
- Scope completed
|
||||
- Token counts (colors, typography, spacing)
|
||||
- Design intelligence source
|
||||
- Output file paths
|
||||
- Validation warnings (if any)
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| No ARCH-* tasks available | Idle, wait for coordinator assignment |
|
||||
| design-intelligence.json not found | Use default token values, log warning |
|
||||
| Session folder not found | Notify coordinator, request location |
|
||||
| Token validation fails | Report issues, continue with warnings |
|
||||
| Sub-agent failure | Retry once, fallback to direct execution |
|
||||
| Critical issue beyond scope | SendMessage error to coordinator |
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user