feat: Add coordinator commands and role specifications for UI design team

- Implemented the 'monitor' command for coordinator role to handle monitoring events, task completion, and pipeline management.
- Created role specifications for the coordinator, detailing responsibilities, command execution protocols, and session management.
- Added role specifications for the analyst, discussant, explorer, and synthesizer in the ultra-analyze skill, defining their context loading, analysis, and synthesis processes.
This commit is contained in:
catlog22
2026-03-03 23:35:41 +08:00
parent a7ed0365f7
commit 26bda9c634
188 changed files with 9332 additions and 3512 deletions

View File

@@ -16,8 +16,8 @@ Test quality analyst. Responsible for defect pattern analysis, coverage gap iden
- All output (SendMessage, team_msg, logs) must carry `[analyst]` identifier
- Only communicate with coordinator via SendMessage
- Work strictly within read-only analysis responsibility scope
- Phase 2: Read shared-memory.json (all historical data)
- Phase 5: Write analysis_report to shared-memory.json
- Phase 2: Read role states via team_msg(operation='get_state')
- Phase 5: Share analysis_report via team_msg(type='state_update')
### MUST NOT
@@ -35,7 +35,7 @@ Test quality analyst. Responsible for defect pattern analysis, coverage gap iden
| Tool | Type | Used By | Purpose |
|------|------|---------|---------|
| Read | Read | Phase 2 | Load shared-memory.json, strategy, results |
| Read | Read | Phase 2 | Load role states, strategy, results |
| Glob | Read | Phase 2 | Find result files, test files |
| Write | Write | Phase 3 | Create quality-report.md |
| TaskUpdate | Write | Phase 5 | Mark task completed |
@@ -57,19 +57,17 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
```
mcp__ccw-tools__team_msg({
operation: "log",
team: <session-id>, // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description.
session_id: <session-id>,
from: "analyst",
to: "coordinator",
type: <message-type>,
summary: "[analyst] TESTANA complete: <summary>",
ref: <artifact-path>
data: {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")
Bash("ccw team log --session-id <session-id> --from analyst --type <message-type> --json")
```
---
@@ -89,7 +87,7 @@ Standard task discovery flow: TaskList -> filter by prefix `TESTANA-*` + owner m
| Input | Source | Required |
|-------|--------|----------|
| Session path | Task description (Session: <path>) | Yes |
| Shared memory | <session-folder>/shared-memory.json | Yes |
| Role state | team_msg(operation="get_state", session_id=<session-id>) | Yes |
| Execution results | <session-folder>/results/run-*.json | Yes |
| Test strategy | <session-folder>/strategy/test-strategy.md | Yes |
| Test files | <session-folder>/tests/**/* | Yes |
@@ -98,10 +96,10 @@ Standard task discovery flow: TaskList -> filter by prefix `TESTANA-*` + owner m
1. Extract session path from task description (look for `Session: <path>`)
2. Read shared memory:
2. Read role states:
```
Read("<session-folder>/shared-memory.json")
mcp__ccw-tools__team_msg({ operation: "get_state", session_id: <session-id> })
```
3. Read all execution results:
@@ -186,7 +184,7 @@ Write("<session-folder>/analysis/quality-report.md", <report-content>)
**Historical comparison**:
```
Glob({ pattern: ".workflow/.team/TST-*/shared-memory.json" })
Glob({ pattern: ".workflow/.team/TST-*/.msg/meta.json" })
```
If multiple sessions exist:
@@ -198,27 +196,31 @@ If multiple sessions exist:
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
1. **Update shared memory**:
1. **Share analysis report via team_msg(type='state_update')**:
```
sharedMemory.analysis_report = {
quality_score: <total-score>,
coverage_gaps: <gap-list>,
top_defect_patterns: <patterns>.slice(0, 5),
gc_effectiveness: <improvement>,
recommendations: <immediate-actions>
}
Write("<session-folder>/shared-memory.json", <updated-json>)
mcp__ccw-tools__team_msg({
operation: "log", session_id: <session-id>, from: "analyst",
type: "state_update",
data: {
analysis_report: {
quality_score: <total-score>,
coverage_gaps: <gap-list>,
top_defect_patterns: <patterns>.slice(0, 5),
gc_effectiveness: <improvement>,
recommendations: <immediate-actions>
}
}
})
```
2. **Log via team_msg**:
```
mcp__ccw-tools__team_msg({
operation: "log", team: <session-id> // MUST be session ID, NOT team name, from: "analyst", to: "coordinator",
operation: "log", session_id: <session-id>, from: "analyst",
type: "analysis_ready",
summary: "[analyst] Quality report: score <score>/10, <pattern-count> defect patterns, <gap-count> coverage gaps",
ref: "<session-folder>/analysis/quality-report.md"
data: {ref: "<session-folder>/analysis/quality-report.md"}
})
```

View File

@@ -134,27 +134,44 @@ Extract changed files and modules for pipeline selection.
3. Call TeamCreate with team name
4. Initialize wisdom directory (learnings.md, decisions.md, conventions.md, issues.md)
5. Initialize shared memory:
5. Initialize shared state via `team_msg(type='state_update')` and write `meta.json`:
```
Write("<session-folder>/shared-memory.json", {
task: <description>,
pipeline: <selected-pipeline>,
changed_files: [...],
changed_modules: [...],
coverage_targets: {...},
gc_round: 0,
max_gc_rounds: 3,
test_strategy: null,
generated_tests: [],
execution_results: [],
defect_patterns: [],
effective_test_patterns: [],
coverage_history: []
Write("<session-folder>/.msg/meta.json", {
session_id: <session-id>,
mode: <selected-mode>,
scope: <scope>,
status: "active"
})
```
6. Write session file with: session_id, mode, scope, status="active"
6. Initialize cross-role state via team_msg(type='state_update'):
```
mcp__ccw-tools__team_msg({
operation: "log",
session_id: <session-id>,
from: "coordinator",
type: "state_update",
data: {
task: <description>,
pipeline: <selected-pipeline>,
changed_files: [...],
changed_modules: [...],
coverage_targets: {...},
gc_round: 0,
max_gc_rounds: 3,
test_strategy: null,
generated_tests: [],
execution_results: [],
defect_patterns: [],
effective_test_patterns: [],
coverage_history: []
}
})
```
7. Write session state with: session_id, mode, scope, status="active"
**Success**: Team created, session file written, wisdom initialized.
@@ -238,10 +255,10 @@ When receiving `tests_failed` or `coverage_report`:
```
mcp__ccw-tools__team_msg({
operation: "log",
team: <session-id>, // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description.
from: "coordinator", to: "generator",
session_id: <session-id>,
from: "coordinator",
type: "gc_loop_trigger",
summary: "[coordinator] GC round <N>: coverage <X>% < target <Y>%, revise tests"
data: {ref: "<session-folder>"}
})
```

View File

@@ -0,0 +1,156 @@
# Command: Dispatch
Create the testing task chain with correct dependencies and structured task descriptions. Supports targeted, standard, and comprehensive pipelines.
## Phase 2: Context Loading
| Input | Source | Required |
|-------|--------|----------|
| User requirement | From coordinator Phase 1 | Yes |
| Session folder | From coordinator Phase 2 | Yes |
| Pipeline mode | From session.json `pipeline` | Yes |
| Coverage targets | From session.json `coverage_targets` | Yes |
1. Load user requirement and scope from session.json
2. Load pipeline definition from SKILL.md Pipeline Definitions
3. Read `pipeline` mode and `coverage_targets` from session.json
## Phase 3: Task Chain Creation (Mode-Branched)
### Task Description Template
Every task description uses structured format:
```
TaskCreate({
subject: "<TASK-ID>",
owner: "<role>",
description: "PURPOSE: <what this task achieves> | Success: <measurable criteria>
TASK:
- <step 1: specific action>
- <step 2: specific action>
CONTEXT:
- Session: <session-folder>
- Scope: <scope>
- Layer: <L1-unit|L2-integration|L3-e2e>
- Upstream artifacts: <artifact-1>, <artifact-2>
- Shared memory: <session>/wisdom/.msg/meta.json
EXPECTED: <deliverable path> + <quality criteria>
CONSTRAINTS: <scope limits, focus areas>
---
InnerLoop: <true|false>",
blockedBy: [<dependency-list>],
status: "pending"
})
```
### Mode Router
| Mode | Action |
|------|--------|
| `targeted` | Create 3 tasks: STRATEGY -> TESTGEN(L1) -> TESTRUN(L1) |
| `standard` | Create 6 tasks: STRATEGY -> TESTGEN(L1) -> TESTRUN(L1) -> TESTGEN(L2) -> TESTRUN(L2) -> TESTANA |
| `comprehensive` | Create 8 tasks with parallel groups |
---
### Targeted Pipeline
**STRATEGY-001** (strategist):
```
TaskCreate({
subject: "STRATEGY-001",
description: "PURPOSE: Analyze change scope, define test strategy | Success: Strategy doc with layer recommendations
TASK:
- Analyze git diff for changed files and modules
- Detect test framework and existing patterns
- Define L1 unit test scope and coverage targets
CONTEXT:
- Session: <session-folder>
- Scope: <scope>
EXPECTED: <session>/strategy/test-strategy.md
CONSTRAINTS: Read-only analysis
---
InnerLoop: false",
blockedBy: [],
status: "pending"
})
```
**TESTGEN-001** (generator, L1):
```
TaskCreate({
subject: "TESTGEN-001",
description: "PURPOSE: Generate L1 unit tests | Success: Executable test files covering priority files
TASK:
- Read test strategy for priority files and patterns
- Generate unit tests: happy path, edge cases, error handling
- Validate syntax
CONTEXT:
- Session: <session-folder>
- Layer: L1-unit
- Upstream artifacts: strategy/test-strategy.md
EXPECTED: <session>/tests/L1-unit/
CONSTRAINTS: Only generate test code, do not modify source
---
InnerLoop: true",
blockedBy: ["STRATEGY-001"],
status: "pending"
})
```
**TESTRUN-001** (executor, L1):
```
TaskCreate({
subject: "TESTRUN-001",
description: "PURPOSE: Execute L1 unit tests, collect coverage | Success: pass_rate >= 0.95 AND coverage >= target
TASK:
- Run tests with coverage collection
- Parse pass rate and coverage metrics
- Auto-fix failures (max 3 iterations)
CONTEXT:
- Session: <session-folder>
- Input: tests/L1-unit
- Coverage target: <L1-target>%
EXPECTED: <session>/results/run-001.json
CONSTRAINTS: Only fix test files, not source code
---
InnerLoop: true",
blockedBy: ["TESTGEN-001"],
status: "pending"
})
```
### Standard Pipeline
Adds to targeted:
**TESTGEN-002** (generator, L2): blockedBy ["TESTRUN-001"], Layer: L2-integration
**TESTRUN-002** (executor, L2): blockedBy ["TESTGEN-002"], Input: tests/L2-integration
**TESTANA-001** (analyst): blockedBy ["TESTRUN-002"]
### Comprehensive Pipeline
**Parallel groups**:
- TESTGEN-001 + TESTGEN-002 both blockedBy ["STRATEGY-001"] (parallel generation)
- TESTRUN-001 blockedBy ["TESTGEN-001"], TESTRUN-002 blockedBy ["TESTGEN-002"] (parallel execution)
- TESTGEN-003 blockedBy ["TESTRUN-001", "TESTRUN-002"], Layer: L3-e2e
- TESTRUN-003 blockedBy ["TESTGEN-003"]
- TESTANA-001 blockedBy ["TESTRUN-003"]
## Phase 4: Validation
1. Verify all tasks created with correct subjects and dependencies
2. Check no circular dependencies
3. Verify blockedBy references exist
4. Log task chain to team_msg:
```
mcp__ccw-tools__team_msg({
operation: "log",
session_id: <session-id>,
from: "coordinator",
type: "pipeline_selected",
data: { pipeline: "<mode>", task_count: <N> }
})
```

View File

@@ -0,0 +1,188 @@
# Command: Monitor
Handle all coordinator monitoring events: worker callbacks, status checks, pipeline advancement, Generator-Critic loop control, and completion.
## Phase 2: Context Loading
| Input | Source | Required |
|-------|--------|----------|
| Session state | <session>/session.json | Yes |
| Task list | TaskList() | Yes |
| Trigger event | From Entry Router detection | Yes |
| Pipeline definition | From SKILL.md | Yes |
1. Load session.json for current state, pipeline mode, gc_rounds, coverage_targets
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, task ID:
| Message Pattern | Role Detection |
|----------------|---------------|
| `[strategist]` or task ID `STRATEGY-*` | strategist |
| `[generator]` or task ID `TESTGEN-*` | generator |
| `[executor]` or task ID `TESTRUN-*` | executor |
| `[analyst]` or task ID `TESTANA-*` | analyst |
2. Mark task as completed:
```
TaskUpdate({ taskId: "<task-id>", status: "completed" })
```
3. Record completion in session state
4. **Generator-Critic check** (executor callbacks only):
- If completed task is TESTRUN-* AND message indicates tests_failed or coverage below target:
- Read gc_rounds for this layer from session.json
- Execute **GC Loop Decision** (see below)
5. Checkpoints:
| Completed Task | Checkpoint | Action |
|---------------|------------|--------|
| STRATEGY-001 | CP-1 | Notify user: test strategy ready for review |
| Last TESTRUN-* | CP-2 | Check coverage, decide GC loop or next layer |
| TESTANA-001 | CP-3 | Pipeline complete |
6. Proceed to handleSpawnNext
### GC Loop Decision
When executor reports test results:
| Condition | Action |
|-----------|--------|
| passRate >= 0.95 AND coverage >= target | Log success, proceed to next stage |
| (passRate < 0.95 OR coverage < target) AND gcRound < maxRounds | Create TESTGEN-fix task, increment gc_round |
| gcRound >= maxRounds | Accept current coverage with warning, proceed |
**TESTGEN-fix task creation**:
```
TaskCreate({
subject: "TESTGEN-<layer>-fix-<round>",
owner: "generator",
description: "PURPOSE: Revise tests to fix failures and improve coverage
TASK:
- Read previous test results and failure details
- Revise tests to address failures
- Improve coverage for uncovered areas
CONTEXT:
- Session: <session-folder>
- Layer: <layer>
- Previous results: <session>/results/run-<N>.json
EXPECTED: Revised test files in <session>/tests/<layer>/
---
InnerLoop: true",
blockedBy: [],
status: "pending"
})
```
Create TESTRUN-fix blocked on TESTGEN-fix.
### 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, determine role from task subject prefix:
| Prefix | Role | Inner Loop |
|--------|------|------------|
| STRATEGY-* | strategist | false |
| TESTGEN-* | generator | true |
| TESTRUN-* | executor | true |
| TESTANA-* | analyst | false |
3. Spawn team-worker:
```
Task({
subagent_type: "team-worker",
description: "Spawn <role> worker for <task-id>",
team_name: "testing",
name: "<role>",
run_in_background: true,
prompt: `## Role Assignment
role: <role>
role_spec: .claude/skills/team-testing/role-specs/<role>.md
session: <session-folder>
session_id: <session-id>
team_name: testing
requirement: <task-description>
inner_loop: <true|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.`
})
```
4. **Parallel spawn** (comprehensive pipeline):
| Scenario | Spawn Behavior |
|----------|---------------|
| TESTGEN-001 + TESTGEN-002 both unblocked | Spawn both in parallel |
| TESTRUN-001 + TESTRUN-002 both unblocked | Spawn both in parallel |
5. STOP after spawning -- wait for next callback
### handleCheck
Output current pipeline status.
```
Pipeline Status (<pipeline-mode>):
[DONE] STRATEGY-001 (strategist) -> test-strategy.md
[RUN] TESTGEN-001 (generator) -> generating L1...
[WAIT] TESTRUN-001 (executor) -> blocked by TESTGEN-001
[WAIT] TESTGEN-002 (generator) -> blocked by TESTRUN-001
...
GC Rounds: L1: 0/3, L2: 0/3
Session: <session-id>
```
Output status -- do NOT advance pipeline.
### 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
### handleComplete
Triggered when all pipeline tasks are completed and no GC cycles remain.
**Completion check**:
| Pipeline | Completion Condition |
|----------|---------------------|
| targeted | STRATEGY-001 + TESTGEN-001 + TESTRUN-001 (+ any fix tasks) completed |
| standard | All 6 tasks (+ any fix tasks) completed |
| comprehensive | All 8 tasks (+ any fix tasks) completed |
1. If any tasks not completed, return to handleSpawnNext
2. If all completed, transition to coordinator Phase 5
## Phase 4: State Persistence
After every handler execution:
1. Update session.json with current state (active tasks, gc_rounds per layer, last event)
2. Verify task list consistency
3. STOP and wait for next event

View File

@@ -0,0 +1,276 @@
# Coordinator - Testing Team
**Role**: coordinator
**Type**: Orchestrator
**Team**: testing
Orchestrates the testing pipeline: manages task chains, spawns team-worker agents, handles Generator-Critic loops, quality gates, and drives the pipeline to completion.
## Boundaries
### MUST
- Use `team-worker` agent type for all worker spawns (NOT `general-purpose`)
- Follow Command Execution Protocol for dispatch and monitor commands
- Respect pipeline stage dependencies (blockedBy)
- Stop after spawning workers -- wait for callbacks
- Handle Generator-Critic cycles with max 3 iterations per layer
- Execute completion action in Phase 5
### MUST NOT
- Implement domain logic (test generation, execution, analysis) -- workers handle this
- Spawn workers without creating tasks first
- Skip quality gates when coverage is below target
- Modify test files or source code directly -- delegate to workers
- Force-advance pipeline past failed GC loops
---
## 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 [strategist], [generator], [executor], [analyst] | -> handleCallback |
| Status check | Arguments contain "check" or "status" | -> handleCheck |
| Manual resume | Arguments contain "resume" or "continue" | -> handleResume |
| Pipeline complete | All tasks have status "completed" | -> handleComplete |
| Interrupted session | Active/paused session exists | -> Phase 0 (Resume Check) |
| New session | None of above | -> Phase 1 (Change Scope Analysis) |
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/TST-*/.msg/meta.json` for active/paused sessions
- If found, extract session folder path, status, and pipeline mode
2. **Parse $ARGUMENTS** for detection keywords:
- Check for role name tags in message content
- Check for "check", "status", "resume", "continue" keywords
3. **Route to handler**:
- For monitor handlers: Read `commands/monitor.md`, execute matched handler, STOP
- For Phase 0: Execute Session Resume Check below
- For Phase 1: Execute Change Scope Analysis 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: "testing" })
```
5. Spawn workers for ready tasks -> Phase 4 coordination loop
---
## Phase 1: Change Scope Analysis
1. Parse user task description from $ARGUMENTS
2. Analyze change scope:
```
Bash("git diff --name-only HEAD~1 2>/dev/null || git diff --name-only --cached")
```
Extract changed files and modules for pipeline selection.
3. Select pipeline:
| Condition | Pipeline |
|-----------|----------|
| fileCount <= 3 AND moduleCount <= 1 | targeted |
| fileCount <= 10 AND moduleCount <= 3 | standard |
| Otherwise | comprehensive |
4. Ask for missing parameters via AskUserQuestion if scope is unclear
5. Record requirements: mode, scope, focus, constraints
---
## Phase 2: Session & Team Setup
1. Create session directory:
```
Bash("mkdir -p .workflow/.team/TST-<slug>-<date>/strategy .workflow/.team/TST-<slug>-<date>/tests/L1-unit .workflow/.team/TST-<slug>-<date>/tests/L2-integration .workflow/.team/TST-<slug>-<date>/tests/L3-e2e .workflow/.team/TST-<slug>-<date>/results .workflow/.team/TST-<slug>-<date>/analysis .workflow/.team/TST-<slug>-<date>/wisdom")
```
2. Write session.json:
```json
{
"status": "active",
"team_name": "testing",
"requirement": "<requirement>",
"timestamp": "<ISO-8601>",
"pipeline": "<targeted|standard|comprehensive>",
"coverage_targets": { "L1": 80, "L2": 60, "L3": 40 },
"gc_rounds": {},
"max_gc_rounds": 3
}
```
3. Initialize .msg/meta.json:
```
Write("<session>/wisdom/.msg/meta.json", { "session_id": "<session-id>", "requirement": "<requirement>", "pipeline": "<mode>" })
```
4. Create team:
```
TeamCreate({ team_name: "testing" })
```
5. Initialize wisdom directory (learnings.md, decisions.md, conventions.md, issues.md)
---
## Phase 3: Task Chain Creation
Execute `commands/dispatch.md` inline (Command Execution Protocol):
1. Read `roles/coordinator/commands/dispatch.md`
2. Follow dispatch Phase 2 (context loading) -> Phase 3 (task chain creation) -> Phase 4 (validation)
3. Result: all pipeline tasks created with correct blockedBy dependencies
---
## Phase 4: Spawn & Coordination Loop
### Initial Spawn
Find first unblocked task and spawn its worker:
```
Task({
subagent_type: "team-worker",
description: "Spawn strategist worker",
team_name: "testing",
name: "strategist",
run_in_background: true,
prompt: `## Role Assignment
role: strategist
role_spec: .claude/skills/team-testing/role-specs/strategist.md
session: <session-folder>
session_id: <session-id>
team_name: testing
requirement: <requirement>
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.
### Coordination (via monitor.md handlers)
All subsequent coordination is handled by `commands/monitor.md` handlers triggered by worker callbacks:
- handleCallback -> mark task done -> check pipeline -> handleSpawnNext
- handleSpawnNext -> find ready tasks -> spawn team-worker agents -> STOP
- handleComplete -> all done -> Phase 5
---
## Phase 5: Report + Completion Action
1. Load session state -> count completed tasks, calculate duration
2. List deliverables:
| Deliverable | Path |
|-------------|------|
| Test Strategy | <session>/strategy/test-strategy.md |
| Test Files | <session>/tests/<layer>/ |
| Execution Results | <session>/results/run-*.json |
| Quality Report | <session>/analysis/quality-report.md |
3. Output pipeline summary: task count, GC rounds, coverage metrics
4. **Completion Action** (interactive):
```
AskUserQuestion({
questions: [{
question: "Testing 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: "Deepen Coverage", description: "Add more test layers or increase coverage targets" }
]
}]
})
```
5. Handle user choice:
| Choice | Steps |
|--------|-------|
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete("testing") -> output final summary |
| Keep Active | Update session status="paused" -> output: "Session paused. Resume with: Skill(skill='team-testing', args='resume')" |
| Deepen Coverage | Create additional TESTGEN+TESTRUN tasks for next layer -> Phase 4 |
---
## Error Handling
| Scenario | Resolution |
|----------|------------|
| Teammate no response | Send tracking message, 2 times -> respawn worker |
| GC loop exceeded (3 rounds) | Accept current coverage, log to wisdom, proceed |
| Test environment failure | Report to user, suggest manual fix |
| All tests fail | Check test framework config, notify analyst |
| Coverage tool unavailable | Degrade to pass rate judgment |
| Worker crash | Respawn worker, reassign task |
| Dependency cycle | Detect, report to user, halt |

View File

@@ -16,8 +16,8 @@ Test executor. Executes tests, collects coverage, attempts auto-fix for failures
- All output (SendMessage, team_msg, logs) must carry `[executor]` identifier
- Only communicate with coordinator via SendMessage
- Work strictly within validation responsibility scope
- Phase 2: Read shared-memory.json
- Phase 5: Write execution_results + defect_patterns to shared-memory.json
- Phase 2: Read role states via team_msg(operation='get_state')
- Phase 5: Share execution_results + defect_patterns via team_msg(type='state_update')
- Report coverage and pass rate for coordinator's GC decision
### MUST NOT
@@ -36,7 +36,7 @@ Test executor. Executes tests, collects coverage, attempts auto-fix for failures
| Tool | Type | Used By | Purpose |
|------|------|---------|---------|
| Read | Read | Phase 2 | Load shared-memory.json |
| Read | Read | Phase 2 | Load role states |
| Glob | Read | Phase 2 | Find test files to execute |
| Bash | Execute | Phase 3 | Run test commands |
| Write | Write | Phase 3 | Save test results |
@@ -62,19 +62,17 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
```
mcp__ccw-tools__team_msg({
operation: "log",
team: <session-id>, // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description.
session_id: <session-id>,
from: "executor",
to: "coordinator",
type: <message-type>,
summary: "[executor] TESTRUN complete: <summary>",
ref: <artifact-path>
data: {ref: "<artifact-path>"}
})
```
**CLI fallback** (when MCP unavailable):
```
Bash("ccw team log --team <session-id> --from executor --to coordinator --type <message-type> --summary \"[executor] ...\" --ref <artifact-path> --json")
Bash("ccw team log --session-id <session-id> --from executor --type <message-type> --json")
```
---
@@ -94,7 +92,7 @@ Standard task discovery flow: TaskList -> filter by prefix `TESTRUN-*` + owner m
| Input | Source | Required |
|-------|--------|----------|
| Session path | Task description (Session: <path>) | Yes |
| Shared memory | <session-folder>/shared-memory.json | Yes |
| Role state | team_msg(operation="get_state", session_id=<session-id>) | Yes |
| Test directory | Task description (Input: <path>) | Yes |
| Coverage target | Task description | Yes |
@@ -105,7 +103,7 @@ Standard task discovery flow: TaskList -> filter by prefix `TESTRUN-*` + owner m
3. Extract coverage target from task description (default: 80%)
```
Read("<session-folder>/shared-memory.json")
mcp__ccw-tools__team_msg({ operation: "get_state", session_id: <session-id> })
```
4. Determine test framework from shared memory:
@@ -219,39 +217,39 @@ Write("<session-folder>/results/run-<N>.json", <result-json>)
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
1. **Update shared memory**:
1. **Share execution results via team_msg(type='state_update')**:
```
sharedMemory.execution_results.push(<result-data>)
if (<result-data>.defect_patterns) {
sharedMemory.defect_patterns = [
...sharedMemory.defect_patterns,
...<result-data>.defect_patterns
]
}
if (<result-data>.effective_patterns) {
sharedMemory.effective_test_patterns = [
...new Set([...sharedMemory.effective_test_patterns, ...<result-data>.effective_patterns])
]
}
sharedMemory.coverage_history.push({
layer: <test-dir>,
coverage: <coverage>,
target: <target>,
pass_rate: <pass_rate>,
timestamp: <ISO-date>
mcp__ccw-tools__team_msg({
operation: "log", session_id: <session-id>, from: "executor",
type: "state_update",
data: {
execution_results: [...sharedMemory.execution_results, <result-data>],
defect_patterns: [
...sharedMemory.defect_patterns,
...(<result-data>.defect_patterns || [])
],
effective_test_patterns: [
...new Set([...sharedMemory.effective_test_patterns, ...(<result-data>.effective_patterns || [])])
],
coverage_history: [...sharedMemory.coverage_history, {
layer: <test-dir>,
coverage: <coverage>,
target: <target>,
pass_rate: <pass_rate>,
timestamp: <ISO-date>
}]
}
})
Write("<session-folder>/shared-memory.json", <updated-json>)
```
2. **Log via team_msg**:
```
mcp__ccw-tools__team_msg({
operation: "log", team: <session-id> // MUST be session ID, NOT team name, from: "executor", to: "coordinator",
operation: "log", session_id: <session-id>, from: "executor",
type: <passed ? "tests_passed" : "tests_failed">,
summary: "[executor] <passed|failed>: pass=<pass_rate>%, coverage=<coverage>% (target: <target>%), iterations=<N>",
ref: "<session-folder>/results/run-<N>.json"
data: {ref: "<session-folder>/results/run-<N>.json"}
})
```

View File

@@ -16,8 +16,8 @@ Test case generator. Generates test code by layer (L1 unit / L2 integration / L3
- All output (SendMessage, team_msg, logs) must carry `[generator]` identifier
- Only communicate with coordinator via SendMessage
- Work strictly within code generation responsibility scope
- Phase 2: Read shared-memory.json + test strategy
- Phase 5: Write generated_tests to shared-memory.json
- Phase 2: Read role states via team_msg(operation='get_state') + test strategy
- Phase 5: Share generated_tests via team_msg(type='state_update')
- Generate executable test code
### MUST NOT
@@ -36,7 +36,7 @@ Test case generator. Generates test code by layer (L1 unit / L2 integration / L3
| Tool | Type | Used By | Purpose |
|------|------|---------|---------|
| Read | Read | Phase 2 | Load shared-memory.json, strategy, source files |
| Read | Read | Phase 2 | Load role states, strategy, source files |
| Glob | Read | Phase 2 | Find test files, source files |
| Write | Write | Phase 3 | Create test files |
| Edit | Write | Phase 3 | Modify existing test files |
@@ -62,19 +62,17 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
```
mcp__ccw-tools__team_msg({
operation: "log",
team: <session-id>, // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description.
session_id: <session-id>,
from: "generator",
to: "coordinator",
type: <message-type>,
summary: "[generator] TESTGEN complete: <summary>",
ref: <artifact-path>
data: {ref: "<artifact-path>"}
})
```
**CLI fallback** (when MCP unavailable):
```
Bash("ccw team log --team <session-id> --from generator --to coordinator --type <message-type> --summary \"[generator] ...\" --ref <artifact-path> --json")
Bash("ccw team log --session-id <session-id> --from generator --type <message-type> --json")
```
---
@@ -94,7 +92,7 @@ Standard task discovery flow: TaskList -> filter by prefix `TESTGEN-*` + owner m
| Input | Source | Required |
|-------|--------|----------|
| Session path | Task description (Session: <path>) | Yes |
| Shared memory | <session-folder>/shared-memory.json | Yes |
| Role state | team_msg(operation="get_state", session_id=<session-id>) | Yes |
| Test strategy | <session-folder>/strategy/test-strategy.md | Yes |
| Source files | From test_strategy.priority_files | Yes |
| Wisdom | <session-folder>/wisdom/ | No |
@@ -104,10 +102,10 @@ Standard task discovery flow: TaskList -> filter by prefix `TESTGEN-*` + owner m
1. Extract session path from task description (look for `Session: <path>`)
2. Extract layer from task description (look for `Layer: <L1-unit|L2-integration|L3-e2e>`)
3. Read shared memory:
3. Read role states:
```
Read("<session-folder>/shared-memory.json")
mcp__ccw-tools__team_msg({ operation: "get_state", session_id: <session-id> })
```
4. Read test strategy:
@@ -213,29 +211,33 @@ If syntax errors found, attempt auto-fix for common issues (imports, types).
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
1. **Update shared memory**:
1. **Share generated tests via team_msg(type='state_update')**:
```
sharedMemory.generated_tests = [
...sharedMemory.generated_tests,
...<new-test-files>.map(f => ({
file: f,
layer: <layer>,
round: <is-revision ? gc_round : 0>,
revised: <is-revision>
}))
]
Write("<session-folder>/shared-memory.json", <updated-json>)
mcp__ccw-tools__team_msg({
operation: "log", session_id: <session-id>, from: "generator",
type: "state_update",
data: {
generated_tests: [
...sharedMemory.generated_tests,
...<new-test-files>.map(f => ({
file: f,
layer: <layer>,
round: <is-revision ? gc_round : 0>,
revised: <is-revision>
}))
]
}
})
```
2. **Log via team_msg**:
```
mcp__ccw-tools__team_msg({
operation: "log", team: <session-id> // MUST be session ID, NOT team name, from: "generator", to: "coordinator",
operation: "log", session_id: <session-id>, from: "generator",
type: <is-revision ? "tests_revised" : "tests_generated">,
summary: "[generator] <Generated|Revised> <file-count> <layer> test files",
ref: "<session-folder>/tests/<layer>/"
data: {ref: "<session-folder>/tests/<layer>/"}
})
```

View File

@@ -16,8 +16,8 @@ Test strategy designer. Analyzes git diff, determines test layers, defines cover
- All output (SendMessage, team_msg, logs) must carry `[strategist]` identifier
- Only communicate with coordinator via SendMessage
- Work strictly within read-only analysis responsibility scope
- Phase 2: Read shared-memory.json
- Phase 5: Write test_strategy to shared-memory.json
- Phase 2: Read role states via team_msg(operation='get_state')
- Phase 5: Share test_strategy via team_msg(type='state_update')
### MUST NOT
@@ -35,7 +35,7 @@ Test strategy designer. Analyzes git diff, determines test layers, defines cover
| Tool | Type | Used By | Purpose |
|------|------|---------|---------|
| Read | Read | Phase 2 | Load shared-memory.json, existing test patterns |
| Read | Read | Phase 2 | Load role states, existing test patterns |
| Bash | Read | Phase 2 | Git diff analysis, framework detection |
| Glob | Read | Phase 2 | Find test files, config files |
| Write | Write | Phase 3 | Create test-strategy.md |
@@ -58,19 +58,17 @@ Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
```
mcp__ccw-tools__team_msg({
operation: "log",
team: <session-id>, // MUST be session ID (e.g., TST-xxx-date), NOT team name. Extract from Session: field in task description.
session_id: <session-id>,
from: "strategist",
to: "coordinator",
type: <message-type>,
summary: "[strategist] STRATEGY complete: <summary>",
ref: <artifact-path>
data: {ref: "<artifact-path>"}
})
```
**CLI fallback** (when MCP unavailable):
```
Bash("ccw team log --team <session-id> --from strategist --to coordinator --type <message-type> --summary \"[strategist] ...\" --ref <artifact-path> --json")
Bash("ccw team log --session-id <session-id> --from strategist --type <message-type> --json")
```
---
@@ -90,17 +88,17 @@ Standard task discovery flow: TaskList -> filter by prefix `STRATEGY-*` + owner
| Input | Source | Required |
|-------|--------|----------|
| Session path | Task description (Session: <path>) | Yes |
| Shared memory | <session-folder>/shared-memory.json | Yes |
| Role state | team_msg(operation="get_state", session_id=<session-id>) | Yes |
| Git diff | `git diff HEAD~1` or `git diff --cached` | Yes |
| Changed files | From git diff --name-only | Yes |
**Loading steps**:
1. Extract session path from task description (look for `Session: <path>`)
2. Read shared-memory.json for changed files and modules
2. Read role states for changed files and modules
```
Read("<session-folder>/shared-memory.json")
mcp__ccw-tools__team_msg({ operation: "get_state", session_id: <session-id> })
```
3. Get detailed git diff for analysis:
@@ -162,27 +160,31 @@ Write("<session-folder>/strategy/test-strategy.md", <strategy-content>)
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
1. **Update shared memory**:
1. **Share test strategy via team_msg(type='state_update')**:
```
sharedMemory.test_strategy = {
framework: <detected-framework>,
layers: { L1: [...], L2: [...], L3: [...] },
coverage_targets: { L1: <n>, L2: <n>, L3: <n> },
priority_files: [...],
risks: [...]
}
Write("<session-folder>/shared-memory.json", <updated-json>)
mcp__ccw-tools__team_msg({
operation: "log", session_id: <session-id>, from: "strategist",
type: "state_update",
data: {
test_strategy: {
framework: <detected-framework>,
layers: { L1: [...], L2: [...], L3: [...] },
coverage_targets: { L1: <n>, L2: <n>, L3: <n> },
priority_files: [...],
risks: [...]
}
}
})
```
2. **Log via team_msg**:
```
mcp__ccw-tools__team_msg({
operation: "log", team: "testing", from: "strategist", to: "coordinator",
operation: "log", session_id: <session-id>, from: "strategist",
type: "strategy_ready",
summary: "[strategist] Strategy complete: <file-count> files, L1-L3 layers defined",
ref: "<session-folder>/strategy/test-strategy.md"
data: {ref: "<session-folder>/strategy/test-strategy.md"}
})
```