investigation-workflow by rysweet/amplihack
npx skills add https://github.com/rysweet/amplihack --skill investigation-workflow本技能提供了一个系统化的六阶段工作流,用于调查和理解现有系统、代码库和架构。与为实施而优化的开发工作流不同,此工作流专为探索、理解和知识捕获而优化。
调查任务(使用此工作流):
开发任务(改用 DEFAULT_WORKFLOW.md):
探索优先:在深入代码之前定义范围和策略 并行深度探索:同时部署多个代理以高效收集信息 需要验证:通过实际应用测试理解程度 知识捕获:记录发现以防止重复调查
目的:在任何探索之前定义调查边界和成功标准。
任务:
成功标准:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
交付成果:
目的:计划部署哪些代理以及调查什么,防止低效的随机探索。
任务:
代理选择指南:
成功标准:
交付成果:
目的:同时部署多个探索代理以高效收集信息。
关键:此阶段默认使用并行执行。
任务:
[analyzer(module1), analyzer(module2), analyzer(module3)] - 多个代码区域[analyzer, patterns, security] - 同一区域的多个视角[architect, database, integration] - 系统架构探索并行代理示例:
调查:"反射系统如何工作?"
→ [analyzer(~/.amplihack/.claude/tools/amplihack/hooks/), patterns(reflection), integration(logging)]
调查:"为什么 CI 失败?"
→ [analyzer(ci-config), patterns(ci-failures), integration(github-actions)]
调查:"理解认证流程"
→ [analyzer(auth-module), security(auth), patterns(auth), integration(external-auth)]
成功标准:
交付成果:
目的:通过实际应用测试和验证理解程度。
任务:
验证示例:
理解:"认证使用 JWT 令牌"
验证:在代码中追踪实际的令牌创建和验证
理解:"CI 因依赖冲突而失败"
验证:检查 CI 日志,在本地重现,验证修复是否有效
理解:"反射分析所有用户消息"
验证:检查反射日志,追踪消息处理
成功标准:
交付成果:
目的:将发现编译成连贯的解释,回答原始问题。
任务:
综合输出:
成功标准:
交付成果:
目的:创建持久的文档,使此调查无需重复进行。
任务:
amplihack.memory.discoveries 中的 store_discovery() 将发现存储到内存中文档指南:
## 发现:[简要标题]
**上下文**:调查了什么以及为什么
**关键发现**:
- 主要洞察 1
- 主要洞察 2
- **支持证据**:指向代码、日志或验证测试的链接
- **影响**:这对项目有何影响
- **相关模式**:指向 PATTERNS.md 中类似模式的链接
成功标准:
交付成果:
~/.amplihack/.claude/runtime/logs/调查完成后,如果任务需要实施(不仅仅是理解),则过渡到 DEFAULT_WORKFLOW.md:
get_recent_discoveries())和会话日志来指导设计决策混合工作流示例:
用户:"/ultrathink 调查认证如何工作,然后添加 OAuth 支持"
阶段 1:调查
→ 运行 INVESTIGATION_WORKFLOW.md(6 个阶段)
→ 完成对现有认证系统的理解
→ 通过 discoveries 适配器将发现存储到内存中
阶段 2:开发
→ 过渡到 DEFAULT_WORKFLOW.md
→ 从步骤 4 继续(研究与设计)
→ 使用调查洞察来设计 OAuth 集成
→ 继续完成步骤 15(实施 → 测试 → PR)
何时过渡:
目标效率:与临时调查相比,此工作流的目标是减少 30-40% 的消息数量。
| 临时方法 | 调查工作流 |
|---|---|
| 70-90 条消息 | 40-60 条消息 |
| 频繁回溯 | 有计划的探索 |
| 冗余调查 | 并行深度探索 |
| 范围不明确 | 明确的范围定义 |
| 知识丢失 | 记录的洞察 |
效率提升来自:
两个工作流共享核心原则:
| 方面 | 调查工作流 | DEFAULT_WORKFLOW.md |
|---|---|---|
| 目标 | 理解 | 实施 |
| 阶段 | 6 个阶段 | 多步骤工作流 |
| 执行 | 探索优先 | 实施优先 |
| 并行重点 | 阶段 3(深度探索) | 各种步骤 |
| 测试 | 理解验证 | 代码验证 |
| 交付成果 | 文档 | 工作代码 |
| Git 使用 | 可选 | 必需(分支、PR) |
| 调查阶段 | DEFAULT_WORKFLOW 等效阶段 | 目的 |
|---|---|---|
| 阶段 1:范围定义 | 步骤 1:需求澄清 | 定义成功的样子 |
| 阶段 2:探索策略 | 步骤 4:研究与设计 | 规划方法 |
| 阶段 3:并行深度探索 | 步骤 5:实施 | 执行计划(探索 vs. 构建) |
| 阶段 4:验证 | 步骤 7-8:测试 | 验证结果 |
| 阶段 5:综合 | 步骤 11:审查 | 确保质量和完整性 |
| 阶段 6:知识捕获 | 步骤 15:清理 | 使结果持久化 |
UltraThink 工作流检测:当调用 /ultrathink 时,它会使用关键词自动检测调查任务并建议此工作流。
自动工作流建议:
用户:"/ultrathink 调查认证如何工作"
UltraThink:检测到调查任务。使用 INVESTIGATION_WORKFLOW.md
→ 从 .claude/workflow/INVESTIGATION_WORKFLOW.md 读取工作流
→ 遵循六阶段调查工作流
→ 开始阶段 1:范围定义
要自定义此工作流:
~/.amplihack/.claude/workflow/INVESTIGATION_WORKFLOW.md 以修改、添加或删除阶段更改将在未来的调查中立即生效。
跟踪这些指标以验证工作流的有效性:
当不确定是调查还是开发时:
~/.amplihack/.claude/workflow/INVESTIGATION_WORKFLOW.md(完整的 436 行规范)~/.amplihack/.claude/agents/CATALOG.md 查看所有可用代理~/.amplihack/.claude/context/PATTERNS.md 查看可重用的调查模式每周安装量
122
仓库
GitHub 星标
39
首次出现
Jan 21, 2026
安全审计
安装于
opencode111
claude-code105
gemini-cli103
codex103
cursor101
github-copilot100
This skill provides a systematic 6-phase workflow for investigating and understanding existing systems, codebases, and architectures. Unlike development workflows optimized for implementation, this workflow is optimized for exploration, understanding, and knowledge capture.
Investigation Tasks (use this workflow):
Development Tasks (use DEFAULT_WORKFLOW.md instead):
Exploration First : Define scope and strategy before diving into code Parallel Deep Dives : Deploy multiple agents simultaneously for efficient information gathering Verification Required : Test understanding through practical application Knowledge Capture : Document findings to prevent repeat investigations
Purpose : Define investigation boundaries and success criteria before any exploration.
Tasks :
Success Criteria :
Deliverables :
Purpose : Plan which agents to deploy and what to investigate, preventing inefficient random exploration.
Tasks :
Agent Selection Guidelines :
Success Criteria :
Deliverables :
Purpose : Deploy multiple exploration agents simultaneously to gather information efficiently.
CRITICAL : This phase uses PARALLEL EXECUTION by default.
Tasks :
[analyzer(module1), analyzer(module2), analyzer(module3)] - Multiple code areas[analyzer, patterns, security] - Multiple perspectives on same area[architect, database, integration] - System architecture explorationParallel Agent Examples :
Investigation: "How does the reflection system work?"
→ [analyzer(~/.amplihack/.claude/tools/amplihack/hooks/), patterns(reflection), integration(logging)]
Investigation: "Why is CI failing?"
→ [analyzer(ci-config), patterns(ci-failures), integration(github-actions)]
Investigation: "Understand authentication flow"
→ [analyzer(auth-module), security(auth), patterns(auth), integration(external-auth)]
Success Criteria :
Deliverables :
Purpose : Test and validate understanding through practical application.
Tasks :
Verification Examples :
Understanding: "Authentication uses JWT tokens"
Verification: Trace actual token creation and validation in code
Understanding: "CI fails because of dependency conflict"
Verification: Check CI logs, reproduce locally, verify fix works
Understanding: "Reflection analyzes all user messages"
Verification: Examine reflection logs, trace message processing
Success Criteria :
Deliverables :
Purpose : Compile findings into coherent explanation that answers original questions.
Tasks :
Synthesis Outputs :
Success Criteria :
Deliverables :
Purpose : Create durable documentation so this investigation never needs to be repeated.
Tasks :
store_discovery() from amplihack.memory.discoveriesDocumentation Guidelines :
## Discovery: [Brief Title]
**Context**: What was investigated and why
**Key Findings**:
- Main insight 1
- Main insight 2
- **Supporting Evidence**: Links to code, logs, or verification tests
- **Implications**: How this affects the project
- **Related Patterns**: Links to similar patterns in PATTERNS.md
Success Criteria :
Deliverables :
~/.amplihack/.claude/runtime/logs/After investigation completes , if the task requires implementation (not just understanding), transition to DEFAULT_WORKFLOW.md :
get_recent_discoveries()) and session logs to inform design decisionsExample Hybrid Workflow :
User: "/ultrathink investigate how authentication works, then add OAuth support"
Phase 1: Investigation
→ Run INVESTIGATION_WORKFLOW.md (6 phases)
→ Complete understanding of existing auth system
→ Store findings in memory via discoveries adapter
Phase 2: Development
→ Transition to DEFAULT_WORKFLOW.md
→ Resume at Step 4 (Research and Design)
→ Use investigation insights to design OAuth integration
→ Continue through Step 15 (implementation → testing → PR)
When to Transition :
Target Efficiency : This workflow targets a 30-40% reduction in message count compared to ad-hoc investigation.
| Ad-Hoc Approach | Investigation Workflow |
|---|---|
| 70-90 messages | 40-60 messages |
| Frequent backtracking | Planned exploration |
| Redundant investigation | Parallel deep dives |
| Unclear scope | Explicit scope definition |
| Lost knowledge | Documented insights |
Efficiency Gains Come From :
Both workflows share core principles:
| Aspect | Investigation Workflow | DEFAULT_WORKFLOW.md |
|---|---|---|
| Goal | Understanding | Implementation |
| Phases | 6 phases | Multi-step workflow |
| Execution | Exploration-first | Implementation-first |
| Parallel Focus | Phase 3 (Deep Dives) | Various steps |
| Testing | Understanding verification | Code validation |
| Deliverable | Documentation | Working code |
| Git Usage | Optional | Required (branches, PRs) |
| Investigation Phase | DEFAULT_WORKFLOW Equivalent | Purpose |
|---|---|---|
| Phase 1: Scope Definition | Step 1: Requirements Clarification | Define what success looks like |
| Phase 2: Exploration Strategy | Step 4: Research and Design | Plan the approach |
| Phase 3: Parallel Deep Dives | Step 5: Implementation | Execute the plan (explore vs. build) |
| Phase 4: Verification | Steps 7-8: Testing | Validate results |
| Phase 5: Synthesis | Step 11: Review | Ensure quality and completeness |
| Phase 6: Knowledge Capture | Step 15: Cleanup | Make results durable |
UltraThink Workflow Detection : When /ultrathink is invoked, it automatically detects investigation tasks using keywords and suggests this workflow.
Automatic Workflow Suggestion :
User: "/ultrathink investigate how authentication works"
UltraThink: Detected investigation task. Using INVESTIGATION_WORKFLOW.md
→ Reading workflow from .claude/workflow/INVESTIGATION_WORKFLOW.md
→ Following 6-phase investigation workflow
→ Starting Phase 1: Scope Definition
To customize this workflow:
~/.amplihack/.claude/workflow/INVESTIGATION_WORKFLOW.md to modify, add, or remove phasesChanges take effect immediately for future investigations.
Track these metrics to validate workflow effectiveness:
When in doubt about investigation vs. development:
~/.amplihack/.claude/workflow/INVESTIGATION_WORKFLOW.md (complete 436-line specification)~/.amplihack/.claude/agents/CATALOG.md for all available agents~/.amplihack/.claude/context/PATTERNS.md for reusable investigation patternsWeekly Installs
122
Repository
GitHub Stars
39
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode111
claude-code105
gemini-cli103
codex103
cursor101
github-copilot100
任务估算指南:敏捷开发故事点、计划扑克、T恤尺码法详解
10,500 周安装