team-review
npx skills add https://github.com/catlog22/claude-code-workflow --skill team-review
Agent 安装分布
Skill 文档
Team Review
Unified team skill: code scanning, vulnerability review, optimization suggestions, and automated fix. All team members invoke with --role=xxx to route to role-specific execution.
Architecture
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Skill(skill="team-review") â
â args="<target>" or args="--role=xxx" â
ââââââââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââ
â Role Router
âââââ --role present? âââââ
â NO â YES
â â
Orchestration Mode Role Dispatch
(auto â coordinator) (route to role.md)
â
ââââââ´âââââ¬ââââââââââââ¬ââââââââââââ
â â â â
ââââââââââ ââââââââââ ââââââââââ ââââââââââ
â coord â âscanner â âreviewerâ â fixer â
â (RC-*) â â(SCAN-*)â â(REV-*) â â(FIX-*) â
ââââââââââ ââââââââââ ââââââââââ ââââââââââ
Role Router
Input Parsing
Parse $ARGUMENTS to extract --role. If absent â Orchestration Mode (auto route to coordinator).
Role Registry
| Role | File | Task Prefix | Type | Compact |
|---|---|---|---|---|
| coordinator | roles/coordinator/role.md | RC-* | orchestrator | â ï¸ å缩åå¿ é¡»é读 |
| scanner | roles/scanner/role.md | SCAN-* | read-only-analysis | å缩åå¿ é¡»é读 |
| reviewer | roles/reviewer/role.md | REV-* | read-only-analysis | å缩åå¿ é¡»é读 |
| fixer | roles/fixer/role.md | FIX-* | code-generation | å缩åå¿ é¡»é读 |
â ï¸ COMPACT PROTECTION: è§è²æä»¶æ¯æ§è¡ææ¡£ï¼ä¸æ¯åèèµæãå½ context compression åçåï¼è§è²æä»¤ä» å©æè¦æ¶ï¼å¿ é¡»ç«å³
Readå¯¹åº role.md éæ°å è½½ååç»§ç»æ§è¡ãä¸å¾åºäºæè¦æ§è¡ä»»ä½ Phaseã
Dispatch
- Extract
--rolefrom arguments - If no
--roleâ route to coordinator (Orchestration Mode) - Look up role in registry â Read the role file â Execute its phases
Orchestration Mode
When invoked without --role, coordinator auto-starts. User just provides target description.
Invocation: Skill(skill="team-review", args="<target-path>")
Lifecycle:
User provides scan target
â coordinator Phase 1-3: Parse flags â 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
User Commands (wake paused coordinator):
| Command | Action |
|---|---|
check / status |
Output execution status graph, no advancement |
resume / continue |
Check worker states, advance next step |
Pipeline (CP-1 Linear)
coordinator dispatch
â SCAN-* (scanner: toolchain + LLM scan)
â REV-* (reviewer: deep analysis + report)
â [user confirm]
â FIX-* (fixer: plan + execute + verify)
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
ââ STOP (idle) ââââââ â
â
callback âââââââââââââââââââââââââââââââââââââââââââ
(next beat) SendMessage + TaskUpdate(completed)
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Pipeline beat view:
Review Pipeline (3 beats, linear with user checkpoint)
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Beat 1 2 ⸠3
â â â â
SCAN â REV âââ [confirm] â FIX
â² â²
pipeline pipeline
start done
SCAN=scanner REV=reviewer FIX=fixer
Checkpoints:
| Trigger | Location | Behavior |
|---|---|---|
| ReviewâFix transition | REV-* complete | Pause, present review report, wait for user resume to confirm fix |
Quick mode (-q) |
After SCAN-* | Pipeline ends after scan, no review/fix |
Fix-only mode (--fix) |
Entry | Skip scan/review, go directly to fixer |
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 |
Task Metadata Registry
| Task ID | Role | Phase | Dependencies | Description |
|---|---|---|---|---|
| SCAN-001 | scanner | scan | (none) | Toolchain + LLM code scanning |
| REV-001 | reviewer | review | SCAN-001 | Deep analysis and review report |
| FIX-001 | fixer | fix | REV-001 + user confirm | Plan + execute + verify fixes |
Shared Infrastructure
Worker Phase 1: Task Discovery (shared by all workers)
Every worker executes the same task discovery flow on startup:
- Call
TaskList()to get all tasks - Filter: subject matches this role’s prefix + owner is this role + status is pending + blockedBy is empty
- No tasks â idle wait
- Has tasks â
TaskGetfor details âTaskUpdatemark 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:
- Message Bus: Call
mcp__ccw-tools__team_msgto log message- Parameters: operation=”log”, team=”review”, from=, to=”coordinator”, type=, summary=”[] “, ref=
- CLI fallback: When MCP unavailable â
ccw team log --team review --from <role> --to coordinator --type <type> --summary "[<role>] ..." --json
- SendMessage: Send result to coordinator (content and summary both prefixed with
[<role>]) - TaskUpdate: Mark task completed
- 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:
<session-folder>/wisdom/
âââ learnings.md # Patterns and insights
âââ decisions.md # Architecture and design decisions
âââ conventions.md # Codebase conventions
âââ issues.md # Known risks and issues
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
| 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 |
| Delegate to commands/ files | Modify resources outside own responsibility |
Coordinator additional restrictions: Do not write/modify code directly, do not call implementation subagents, do not execute analysis/test/review directly.
| Component | Location |
|---|---|
| Session directory | .workflow/.team-review/<workflow_id>/ |
| Shared memory | shared-memory.json in session dir |
| Team config | specs/team-config.json |
| Finding schema | specs/finding-schema.json |
| Dimensions | specs/dimensions.md |
Coordinator Spawn Template
When coordinator spawns workers, use Skill invocation:
Skill(skill="team-review", args="--role=scanner <target> <flags>")
Skill(skill="team-review", args="--role=reviewer --input <scan-output> <flags>")
Skill(skill="team-review", args="--role=fixer --input <fix-manifest> <flags>")
Usage
# Via coordinator (auto pipeline)
Skill(skill="team-review", args="src/auth/**") # scan + review
Skill(skill="team-review", args="--full src/auth/**") # scan + review + fix
Skill(skill="team-review", args="--fix .review/review-*.json") # fix only
Skill(skill="team-review", args="-q src/auth/**") # quick scan only
# Direct role invocation
Skill(skill="team-review", args="--role=scanner src/auth/**")
Skill(skill="team-review", args="--role=reviewer --input scan-result.json")
Skill(skill="team-review", args="--role=fixer --input fix-manifest.json")
# Flags (all modes)
--dimensions=sec,cor,perf,maint # custom dimensions (default: all 4)
-y / --yes # skip confirmations
-q / --quick # quick scan mode
--full # full pipeline (scan â review â fix)
--fix # fix mode only
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 file path (roles//role.md) |
| Invalid flags | Warn and continue with defaults |
| No target specified (no –role) | AskUserQuestion to clarify |
Execution Rules
- Parse first: Extract –role and flags from $ARGUMENTS before anything else
- Progressive loading: Read ONLY the matched role.md, not all four
- Full delegation: Role.md owns entire execution — do not add logic here
- Self-contained: Each role.md includes its own message bus, task lifecycle, toolbox
- DO NOT STOP: Continuous execution until role completes all 5 phases