Deep Analysis Workflow
Execute a structured exploration + synthesis workflow using parallel code-explorer agents and a codebase-synthesizer agent. This skill can be invoked standalone or loaded by other skills as a reusable building block.
Phase 1: Exploration
Goal: Thoroughly explore the codebase to gather raw findings.
Determine analysis context:
- If
$ARGUMENTS is provided, use it as the analysis context (feature area, question, or general exploration goal)
- If no arguments and this skill was loaded by another skill, use the calling skill's context
- If no arguments and standalone invocation, set context to "general codebase understanding"
- Set
PATH = current working directory
- Inform the user: "Exploring codebase at:
PATH" with the analysis context
Load skills for this phase:
- Read
${CLAUDE_PLUGIN_ROOT}/skills/project-conventions/SKILL.md and apply its guidance
- Read
${CLAUDE_PLUGIN_ROOT}/skills/language-patterns/SKILL.md and apply its guidance
Determine focus areas:
- For feature-focused analysis, use 3 agents:
Agent 1: Explore entry points and user-facing code related to the context
Agent 2: Explore data models, schemas, and storage related to the context
Agent 3: Explore utilities, helpers, and shared infrastructure
- For general codebase understanding, 2 agents may suffice:
Agent 1: Explore application structure, entry points, and core logic
Agent 2: Explore configuration, infrastructure, and shared utilities
Launch code-explorer agents:
Launch agents in parallel using the Task tool with subagent_type: "claude-alchemy-tools:code-explorer":
Path to analyze: [PATH]
Analysis context: [context from step 1]
Focus area: [specific focus for this agent]
Find and analyze:
- Relevant files and their purposes
- Key functions/classes and their roles
- Existing patterns and conventions
- Integration points and dependencies
Return a structured report of your findings.
Handle agent failures:
- If an agent fails, note which focus area was missed
- Continue with successful results — partial findings are still valuable
- If all agents fail, inform the user and offer to retry or explore manually
Phase 2: Synthesis
Goal: Merge exploration findings into a unified analysis.
Launch codebase-synthesizer agent:
Use the Task tool with subagent_type: "claude-alchemy-tools:codebase-synthesizer" and model: "opus":
Analysis context: [context from Phase 1]
Codebase path: [PATH]
Exploration findings from [N] agents:
--- Agent 1: [Focus Area] ---
[Full report from agent 1]
--- Agent 2: [Focus Area] ---
[Full report from agent 2]
--- Agent 3: [Focus Area] (if applicable) ---
[Full report from agent 3]
Synthesize these findings into a unified analysis. Merge duplicates,
read critical files in depth, map relationships between components,
identify patterns, and assess challenges.
Review synthesis:
- Verify the synthesizer covered all focus areas
- If critical gaps exist, use Glob/Grep to fill them directly
Completion
- Standalone invocation: Present the synthesized analysis to the user. The results remain in conversation memory for follow-up questions.
- Loaded by another skill: The synthesis is complete. Control returns to the calling workflow — do not present a standalone summary.
Error Handling
If any phase fails:
- Explain what went wrong
- Ask the user how to proceed:
- Retry the phase
- Continue with partial results
- Abort the analysis
Agent Coordination
When launching parallel agents:
- Give each agent a distinct focus area to minimize overlap
- Wait for all agents to complete before proceeding to synthesis
- Handle agent failures gracefully — continue with partial results
When calling Task tool for agents:
- Use
model: "opus" for codebase-synthesizer agent
- Use default model (sonnet) for code-explorer agents
1---2name: deep-analysis-83description: Reusable deep exploration and synthesis workflow. Use when asked for "deep analysis", "deep understanding", "analyze codebase", "explore and analyze", or "investigate codebase".4---5
6# Deep Analysis Workflow
7
8Execute a structured exploration + synthesis workflow using parallel code-explorer agents and a codebase-synthesizer agent. This skill can be invoked standalone or loaded by other skills as a reusable building block.
9
10## Phase 1: Exploration
11
12**Goal:** Thoroughly explore the codebase to gather raw findings.
13
141. **Determine analysis context:**
15 - If `$ARGUMENTS` is provided, use it as the analysis context (feature area, question, or general exploration goal)
16 - If no arguments and this skill was loaded by another skill, use the calling skill's context
17 - If no arguments and standalone invocation, set context to "general codebase understanding"
18 - Set `PATH = current working directory`
19 - Inform the user: "Exploring codebase at: `PATH`" with the analysis context
20
212. **Load skills for this phase:**
22 - Read `${CLAUDE_PLUGIN_ROOT}/skills/project-conventions/SKILL.md` and apply its guidance
23 - Read `${CLAUDE_PLUGIN_ROOT}/skills/language-patterns/SKILL.md` and apply its guidance
24
253. **Determine focus areas:**
26 - For feature-focused analysis, use 3 agents:
27 ```
28 Agent 1: Explore entry points and user-facing code related to the context
29 Agent 2: Explore data models, schemas, and storage related to the context
30 Agent 3: Explore utilities, helpers, and shared infrastructure
31 ```
32 - For general codebase understanding, 2 agents may suffice:
33 ```
34 Agent 1: Explore application structure, entry points, and core logic
35 Agent 2: Explore configuration, infrastructure, and shared utilities
36 ```
37
384. **Launch code-explorer agents:**
39
40 Launch agents in parallel using the Task tool with `subagent_type: "claude-alchemy-tools:code-explorer"`:
41 ```
42 Path to analyze: [PATH]
43 Analysis context: [context from step 1]
44 Focus area: [specific focus for this agent]
45
46 Find and analyze:
47 - Relevant files and their purposes
48 - Key functions/classes and their roles
49 - Existing patterns and conventions
50 - Integration points and dependencies
51
52 Return a structured report of your findings.
53 ```
54
555. **Handle agent failures:**
56 - If an agent fails, note which focus area was missed
57 - Continue with successful results — partial findings are still valuable
58 - If all agents fail, inform the user and offer to retry or explore manually
59
60---
61
62## Phase 2: Synthesis
63
64**Goal:** Merge exploration findings into a unified analysis.
65
661. **Launch codebase-synthesizer agent:**
67
68 Use the Task tool with `subagent_type: "claude-alchemy-tools:codebase-synthesizer"` and `model: "opus"`:
69 ```
70 Analysis context: [context from Phase 1]
71 Codebase path: [PATH]
72
73 Exploration findings from [N] agents:
74
75 --- Agent 1: [Focus Area] ---
76 [Full report from agent 1]
77
78 --- Agent 2: [Focus Area] ---
79 [Full report from agent 2]
80
81 --- Agent 3: [Focus Area] (if applicable) ---
82 [Full report from agent 3]
83
84 Synthesize these findings into a unified analysis. Merge duplicates,
85 read critical files in depth, map relationships between components,
86 identify patterns, and assess challenges.
87 ```
88
892. **Review synthesis:**
90 - Verify the synthesizer covered all focus areas
91 - If critical gaps exist, use Glob/Grep to fill them directly
92
93---
94
95## Completion
96
97- **Standalone invocation:** Present the synthesized analysis to the user. The results remain in conversation memory for follow-up questions.
98- **Loaded by another skill:** The synthesis is complete. Control returns to the calling workflow — do not present a standalone summary.
99
100---
101
102## Error Handling
103
104If any phase fails:
1051. Explain what went wrong
1062. Ask the user how to proceed:
107 - Retry the phase
108 - Continue with partial results
109 - Abort the analysis
110
111---
112
113## Agent Coordination
114
115When launching parallel agents:
116- Give each agent a distinct focus area to minimize overlap
117- Wait for all agents to complete before proceeding to synthesis
118- Handle agent failures gracefully — continue with partial results
119
120When calling Task tool for agents:
121- Use `model: "opus"` for codebase-synthesizer agent
122- Use default model (sonnet) for code-explorer agents