Loading...
Loading...
Compare original and translation side by side
/explore authenticationOpus 4.6: Exploration agents use native adaptive thinking for deeper pattern recognition across large codebases.
/explore authenticationOpus 4.6:探索型Agent采用原生自适应思维,可在大型代码库中实现更深度的模式识别。
AskUserQuestion(
questions=[{
"question": "What aspect do you want to explore?",
"header": "Focus",
"options": [
{"label": "Full exploration (Recommended)", "description": "Code structure + data flow + architecture + health assessment"},
{"label": "Code structure only", "description": "Find files, classes, functions related to topic"},
{"label": "Data flow", "description": "Trace how data moves through the system"},
{"label": "Architecture patterns", "description": "Identify design patterns and integrations"},
{"label": "Quick search", "description": "Just find relevant files, skip deep analysis"}
],
"multiSelect": false
}]
)AskUserQuestion(
questions=[{
"question": "你想要探索哪个方面?",
"header": "探索重点",
"options": [
{"label": "全面探索(推荐)", "description": "代码结构 + 数据流 + 架构 + 健康评估"},
{"label": "仅代码结构", "description": "查找与主题相关的文件、类、函数"},
{"label": "数据流", "description": "追踪数据在系统中的流转路径"},
{"label": "架构模式", "description": "识别设计模式与集成关系"},
{"label": "快速搜索", "description": "仅查找相关文件,跳过深度分析"}
],
"multiSelect": false
}]
)CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1| Aspect | Task Tool | Agent Teams |
|---|---|---|
| Discovery sharing | Lead synthesizes after all complete | Explorers share discoveries as they go |
| Cross-referencing | Lead connects dots | Data flow explorer alerts architecture explorer |
| Cost | ~150K tokens | ~400K tokens |
| Best for | Quick/focused searches | Deep full-codebase exploration |
Fallback: If Agent Teams encounters issues, fall back to Task tool for remaining exploration.
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1| 维度 | Task Tool | Agent Teams |
|---|---|---|
| 发现内容共享 | 主导者在所有任务完成后汇总 | 探索者在工作过程中实时共享发现 |
| 交叉引用 | 主导者关联各部分信息 | 数据流探索者可提醒架构探索者相关发现 |
| 成本 | ~150K tokens | ~400K tokens |
| 最佳适用场景 | 快速/聚焦搜索 | 深度全代码库探索 |
降级方案:若Agent Teams出现问题,剩余探索任务切换为Task tool模式。
undefinedundefined
---
---| Phase | Activities | Output |
|---|---|---|
| 1. Initial Search | Grep, Glob for matches | File locations |
| 2. Memory Check | Search knowledge graph | Prior context |
| 3. Deep Exploration | 4 parallel explorers | Multi-angle analysis |
| 4. Code Health Assessment | Rate found code 0-10 | Quality scores |
| 5. Dependency Hotspot Map | Identify coupling | Hotspot visualization |
| 6. Product Perspective | Business context | Findability suggestions |
| 7. Report Generation | Compile findings | Actionable report |
| 阶段 | 活动内容 | 输出结果 |
|---|---|---|
| 1. 初始搜索 | 使用Grep、Glob查找匹配内容 | 文件位置 |
| 2. 内存检查 | 搜索知识图谱 | 已有上下文信息 |
| 3. 深度探索 | 4个并行探索Agent | 多角度分析结果 |
| 4. 代码健康评估 | 对找到的代码进行0-10分评分 | 质量得分 |
| 5. 依赖热点映射 | 识别高耦合代码 | 热点可视化图 |
| 6. 产品视角补充 | 业务上下文分析 | 可发现性优化建议 |
| 7. 生成探索报告 | 汇总所有发现 | 可执行的报告 |
undefinedundefinedundefinedundefinedmcp__memory__search_nodes(query="$ARGUMENTS")
mcp__memory__search_nodes(query="architecture")mcp__memory__search_nodes(query="$ARGUMENTS")
mcp__memory__search_nodes(query="architecture")run_in_background: trueundefinedrun_in_background: trueundefined
**Explorer Roles:**
1. **Code Structure Explorer** - Files, classes, functions
2. **Data Flow Explorer** - Entry points, processing, storage
3. **Backend Architect** - Patterns, integration, dependencies
4. **Frontend Developer** - Components, state, routes
**探索者角色:**
1. **代码结构探索者** - 负责文件、类、函数
2. **数据流探索者** - 负责入口点、处理流程、存储
3. **后端架构师** - 负责模式、集成、依赖
4. **前端开发者** - 负责组件、状态、路由TeamCreate(team_name="explore-{topic}", description="Explore {topic}")
Task(subagent_type="Explore", name="structure-explorer",
team_name="explore-{topic}",
prompt="""Find all files, classes, and functions related to: {topic}
When you discover key entry points, message data-flow-explorer so they
can trace data paths from those points.
When you find backend patterns, message backend-explorer.
When you find frontend components, message frontend-explorer.""")
Task(subagent_type="Explore", name="data-flow-explorer",
team_name="explore-{topic}",
prompt="""Trace entry points, processing, and storage for: {topic}
When structure-explorer shares entry points, start tracing from those.
When you discover cross-boundary data flows (frontend→backend or vice versa),
message both backend-explorer and frontend-explorer.""")
Task(subagent_type="backend-system-architect", name="backend-explorer",
team_name="explore-{topic}",
prompt="""Analyze backend architecture patterns for: {topic}
When structure-explorer or data-flow-explorer share backend findings,
investigate deeper — API design, database schema, service patterns.
Share integration points with frontend-explorer for consistency.""")
Task(subagent_type="frontend-ui-developer", name="frontend-explorer",
team_name="explore-{topic}",
prompt="""Analyze frontend components, state, and routes for: {topic}
When structure-explorer shares component locations, investigate deeper.
When backend-explorer shares API patterns, verify frontend alignment.
Share component hierarchy with data-flow-explorer.""")SendMessage(type="shutdown_request", recipient="structure-explorer", content="Exploration complete")
SendMessage(type="shutdown_request", recipient="data-flow-explorer", content="Exploration complete")
SendMessage(type="shutdown_request", recipient="backend-explorer", content="Exploration complete")
SendMessage(type="shutdown_request", recipient="frontend-explorer", content="Exploration complete")
TeamDelete()Fallback: If team formation fails, use standard Phase 3 Task spawns above.
TeamCreate(team_name="explore-{topic}", description="Explore {topic}")
Task(subagent_type="Explore", name="structure-explorer",
team_name="explore-{topic}",
prompt="""Find all files, classes, and functions related to: {topic}
When you discover key entry points, message data-flow-explorer so they
can trace data paths from those points.
When you find backend patterns, message backend-explorer.
When you find frontend components, message frontend-explorer.""")
Task(subagent_type="Explore", name="data-flow-explorer",
team_name="explore-{topic}",
prompt="""Trace entry points, processing, and storage for: {topic}
When structure-explorer shares entry points, start tracing from those.
When you discover cross-boundary data flows (frontend→backend or vice versa),
message both backend-explorer and frontend-explorer.""")
Task(subagent_type="backend-system-architect", name="backend-explorer",
team_name="explore-{topic}",
prompt="""Analyze backend architecture patterns for: {topic}
When structure-explorer or data-flow-explorer share backend findings,
investigate deeper — API design, database schema, service patterns.
Share integration points with frontend-explorer for consistency.""")
Task(subagent_type="frontend-ui-developer", name="frontend-explorer",
team_name="explore-{topic}",
prompt="""Analyze frontend components, state, and routes for: {topic}
When structure-explorer shares component locations, investigate deeper.
When backend-explorer shares API patterns, verify frontend alignment.
Share component hierarchy with data-flow-explorer.""")SendMessage(type="shutdown_request", recipient="structure-explorer", content="Exploration complete")
SendMessage(type="shutdown_request", recipient="data-flow-explorer", content="Exploration complete")
SendMessage(type="shutdown_request", recipient="backend-explorer", content="Exploration complete")
SendMessage(type="shutdown_request", recipient="frontend-explorer", content="Exploration complete")
TeamDelete()降级方案:若团队创建失败,使用上述标准的阶段3 Task启动方式。
Task(
subagent_type="code-quality-reviewer",
prompt="""CODE HEALTH ASSESSMENT for files related to: $ARGUMENTS
Rate each dimension 0-10:
1. READABILITY (0-10)
- Clear naming conventions?
- Appropriate comments?
- Logical organization?
2. MAINTAINABILITY (0-10)
- Single responsibility?
- Low coupling?
- Easy to modify?
3. TESTABILITY (0-10)
- Pure functions where possible?
- Dependency injection?
- Existing test coverage?
4. COMPLEXITY (0-10, inverted: 10=simple, 0=complex)
- Cyclomatic complexity?
- Nesting depth?
- Function length?
5. DOCUMENTATION (0-10)
- API docs present?
- Usage examples?
- Architecture notes?
Output:
{
"overall_score": N.N,
"dimensions": {
"readability": N,
"maintainability": N,
"testability": N,
"complexity": N,
"documentation": N
},
"hotspots": ["file:line - issue"],
"recommendations": ["improvement suggestion"]
}
SUMMARY: End with: "HEALTH: [N.N]/10 - [best dimension] strong, [worst dimension] needs work"
""",
run_in_background=True,
max_turns=25
)Task(
subagent_type="code-quality-reviewer",
prompt="""CODE HEALTH ASSESSMENT for files related to: $ARGUMENTS
Rate each dimension 0-10:
1. READABILITY (0-10)
- Clear naming conventions?
- Appropriate comments?
- Logical organization?
2. MAINTAINABILITY (0-10)
- Single responsibility?
- Low coupling?
- Easy to modify?
3. TESTABILITY (0-10)
- Pure functions where possible?
- Dependency injection?
- Existing test coverage?
4. COMPLEXITY (0-10, inverted: 10=simple, 0=complex)
- Cyclomatic complexity?
- Nesting depth?
- Function length?
5. DOCUMENTATION (0-10)
- API docs present?
- Usage examples?
- Architecture notes?
Output:
{
"overall_score": N.N,
"dimensions": {
"readability": N,
"maintainability": N,
"testability": N,
"complexity": N,
"documentation": N
},
"hotspots": ["file:line - issue"],
"recommendations": ["improvement suggestion"]
}
SUMMARY: End with: "HEALTH: [N.N]/10 - [best dimension] strong, [worst dimension] needs work"
""",
run_in_background=True,
max_turns=25
)undefinedundefined[Module A] --depends--> [Target] <--depends-- [Module B]
|
v
[Module C]undefined[Module A] --depends--> [Target] <--depends-- [Module B]
|
v
[Module C]undefinedTask(
subagent_type="product-strategist",
prompt="""PRODUCT PERSPECTIVE for: $ARGUMENTS
Analyze from a product/business viewpoint:
1. BUSINESS CONTEXT
- What user problem does this code solve?
- What feature/capability does it enable?
- Who are the users of this code?
2. FINDABILITY SUGGESTIONS
- Better naming for discoverability?
- Missing documentation entry points?
- Where should someone look first?
3. KNOWLEDGE GAPS
- What context is missing for new developers?
- What tribal knowledge exists?
- What should be documented?
4. SEARCH OPTIMIZATION
- Keywords someone might use to find this
- Alternative terms for the same concept
- Related concepts to cross-reference
Output:
{
"business_purpose": "description",
"primary_users": ["user type"],
"findability_issues": ["issue - suggestion"],
"recommended_entry_points": ["file - why start here"],
"search_keywords": ["keyword"],
"documentation_gaps": ["gap"]
}
SUMMARY: End with: "FINDABILITY: [N] issues - start at [recommended entry point]"
""",
run_in_background=True,
max_turns=25
)Task(
subagent_type="product-strategist",
prompt="""PRODUCT PERSPECTIVE for: $ARGUMENTS
Analyze from a product/business viewpoint:
1. BUSINESS CONTEXT
- What user problem does this code solve?
- What feature/capability does it enable?
- Who are the users of this code?
2. FINDABILITY SUGGESTIONS
- Better naming for discoverability?
- Missing documentation entry points?
- Where should someone look first?
3. KNOWLEDGE GAPS
- What context is missing for new developers?
- What tribal knowledge exists?
- What should be documented?
4. SEARCH OPTIMIZATION
- Keywords someone might use to find this
- Alternative terms for the same concept
- Related concepts to cross-reference
Output:
{
"business_purpose": "description",
"primary_users": ["user type"],
"findability_issues": ["issue - suggestion"],
"recommended_entry_points": ["file - why start here"],
"search_keywords": ["keyword"],
"documentation_gaps": ["gap"]
}
SUMMARY: End with: "FINDABILITY: [N] issues - start at [recommended entry point]"
""",
run_in_background=True,
max_turns=25
)undefinedundefined| File | Purpose | Health Score |
|---|---|---|
| [description] | [N.N/10] |
| File | Purpose | Health Score |
|---|---|---|
| [description] | [N.N/10] |
| Dimension | Score | Notes |
|---|---|---|
| Readability | [N/10] | [note] |
| Maintainability | [N/10] | [note] |
| Testability | [N/10] | [note] |
| Complexity | [N/10] | [note] |
| Documentation | [N/10] | [note] |
| Overall | [N.N/10] |
| Dimension | Score | Notes |
|---|---|---|
| Readability | [N/10] | [note] |
| Maintainability | [N/10] | [note] |
| Testability | [N/10] | [note] |
| Complexity | [N/10] | [note] |
| Documentation | [N/10] | [note] |
| Overall | [N.N/10] |
[Incoming deps] → [TARGET] → [Outgoing deps][Incoming deps] → [TARGET] → [Outgoing deps]| Entry Point | Why Start Here |
|---|---|
| [reason] |
| Entry Point | Why Start Here |
|---|---|
| [reason] |
undefinedundefined