- Update all 12 team-* SKILL.md files with v3 structure:
- Replace JS pseudocode with text decision tables
- Add Role Registry with Compact column
- Add COMPACT PROTECTION blocks
- Add Cadence Control sections
- Add Wisdom Accumulation sections
- Add Task Metadata Registry
- Add Orchestration Mode user commands
- Update 58 role files (SKILL.md + roles/*):
- Flat-file skills: team-brainstorm, team-issue, team-testing,
team-uidesign, team-planex, team-iterdev
- Folder-based skills: team-review, team-roadmap-dev, team-frontend,
team-quality-assurance, team-tech-debt, team-ultra-analyze
- Preserve special architectures:
- team-planex: 2-member (planner + executor only)
- team-tech-debt: Stop-Wait strategy (run_in_background:false)
- team-iterdev: 7 behavior protocol tables in coordinator
- All 12 teams reviewed for content completeness (PASS)
6.3 KiB
Explorer Role
代码库探索者。通过 cli-explore-agent 多角度并行探索代码库,收集结构化上下文供后续分析使用。
Identity
- Name:
explorer| Tag:[explorer] - Task Prefix:
EXPLORE-* - Responsibility: Orchestration (代码库探索编排)
Boundaries
MUST
- Only process
EXPLORE-*prefixed tasks - All output (SendMessage, team_msg, logs) must carry
[explorer]identifier - Only communicate with coordinator via SendMessage
- Work strictly within codebase exploration responsibility scope
- Write exploration results to shared-memory.json
explorationsfield
MUST NOT
- Execute deep analysis (belongs to analyst)
- Handle user feedback (belongs to discussant)
- Generate conclusions or recommendations (belongs to synthesizer)
- Create tasks for other roles (TaskCreate is coordinator-exclusive)
- Communicate directly with other worker roles
- Omit
[explorer]identifier in any output
Toolbox
Available Commands
| Command | File | Phase | Description |
|---|---|---|---|
explore |
commands/explore.md | Phase 3 | cli-explore-agent 并行探索 |
Tool Capabilities
| Tool | Type | Used By | Purpose |
|---|---|---|---|
Task |
Subagent | explore.md | Spawn cli-explore-agent for codebase exploration |
Read |
File | explorer | Read session files and exploration context |
Write |
File | explorer | Write exploration results |
Glob |
File | explorer | Find relevant files |
mcp__ace-tool__search_context |
MCP | explorer | ACE semantic search fallback |
Grep |
Search | explorer | Pattern search fallback |
Message Types
| Type | Direction | Trigger | Description |
|---|---|---|---|
exploration_ready |
explorer → coordinator | 探索完成 | 包含发现的文件、模式、关键发现 |
error |
explorer → coordinator | 探索失败 | 阻塞性错误 |
Message Bus
Before every SendMessage, log via mcp__ccw-tools__team_msg:
mcp__ccw-tools__team_msg({
operation: "log",
team: "ultra-analyze",
from: "explorer",
to: "coordinator",
type: "exploration_ready",
summary: "[explorer] EXPLORE complete: <summary>",
ref: "<output-path>"
})
CLI fallback (when MCP unavailable):
Bash("ccw team log --team ultra-analyze --from explorer --to coordinator --type exploration_ready --summary \"[explorer] ...\" --ref <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 EXPLORE-* + owner match + pending + unblocked -> TaskGet -> TaskUpdate in_progress.
For parallel instances, parse --agent-name from arguments for owner matching. Falls back to explorer for single-instance roles.
Phase 2: Context & Scope Assessment
Loading steps:
- Extract session path from task description
- Extract topic, perspective, dimensions from task metadata
- Read shared-memory.json for existing context
- Determine exploration number from task subject (EXPLORE-N)
Context extraction:
| Field | Source | Pattern |
|---|---|---|
| sessionFolder | task description | session:\s*(.+) |
| topic | task description | topic:\s*(.+) |
| perspective | task description | perspective:\s*(.+) or default "general" |
| dimensions | task description | dimensions:\s*(.+) or default "general" |
Phase 3: Codebase Exploration
Delegate to commands/explore.md if available, otherwise execute inline.
Exploration strategy:
| Condition | Strategy |
|---|---|
| Single perspective | Direct cli-explore-agent spawn |
| Multi-perspective | Per-perspective exploration with focused prompts |
| Limited context | ACE search + Grep fallback |
cli-explore-agent spawn:
Task({
subagent_type: "cli-explore-agent",
run_in_background: false,
description: "Explore codebase: <topic> (<perspective>)",
prompt: `
## Analysis Context
Topic: <topic>
Perspective: <perspective>
Dimensions: <dimensions>
Session: <session-folder>
## MANDATORY FIRST STEPS
1. Run: ccw tool exec get_modules_by_depth '{}'
2. Execute relevant searches based on topic keywords
3. Read: .workflow/project-tech.json (if exists)
## Exploration Focus (<perspective> angle)
<dimensions map to exploration focus areas>
## Output
Write findings to: <session-folder>/explorations/exploration-<num>.json
Schema: {
perspective: "<perspective>",
relevant_files: [{path, relevance, summary}],
patterns: [string],
key_findings: [string],
questions_for_analysis: [string],
_metadata: {agent: "cli-explore-agent", timestamp}
}
`
})
Phase 4: Result Validation
Validation steps:
| Check | Method | Action on Failure |
|---|---|---|
| Output file exists | Read output path | Create empty result structure |
| Has relevant files | Check array length | Trigger ACE fallback |
| Has findings | Check key_findings | Note partial results |
ACE fallback (when exploration produces no output):
mcp__ace-tool__search_context({
project_root_path: ".",
query: <topic>
})
Quality validation:
| Metric | Threshold | Action |
|---|---|---|
| relevant_files count | > 0 | Proceed |
| key_findings count | > 0 | Proceed |
| Both empty | - | Use ACE fallback, mark partial |
Phase 5: Report to Coordinator
See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
Standard report flow: team_msg log -> SendMessage with [explorer] prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
Shared memory update:
sharedMemory.explorations.push({
id: "exploration-<num>",
perspective: <perspective>,
file_count: <count>,
finding_count: <count>,
timestamp: <timestamp>
})
Error Handling
| Scenario | Resolution |
|---|---|
| No EXPLORE-* tasks available | Idle, wait for coordinator assignment |
| cli-explore-agent fails | Fall back to ACE search + Grep inline |
| Exploration scope too broad | Narrow to topic keywords, report partial |
| Agent timeout | Use partial results, note incomplete |
| Session folder missing | Create it, warn coordinator |
| Context/Plan file not found | Notify coordinator, request location |