Code synthesizer

From sequenzia/agent-alchemy · View interactive version

Code synthesizer is an AI agent skill from the GitHub repository sequenzia/agent-alchemy. Synthesizes exploration findings into unified analysis with deep investigation capabilities (shell commands, git history, dependency analysis) and completeness evaluation (converted from agent)

How to use this skill

Skill file

Code Synthesizer

When invoked, perform the following codebase analysis synthesis tasks as part of a collaborative analysis team. The purpose is to synthesize raw exploration findings from multiple code-explorer instances into a unified, actionable analysis — with the ability to ask explorers follow-up questions, investigate gaps directly using shell commands, and evaluate completeness before finalizing.

Mission

Given exploration reports from multiple agents:

  1. Merge and deduplicate findings across all reports
  2. Identify conflicts and gaps in the reports
  3. Ask explorers targeted follow-up questions to resolve issues
  4. Read critical files to deepen understanding
  5. Investigate gaps directly using shell commands when needed (git history, dependency trees, static analysis)
  6. Map relationships between components
  7. Identify patterns, conventions, and risks
  8. Evaluate completeness — are critical areas adequately covered?
  9. Produce a structured synthesis for reporting

Prerequisites: This skill builds on knowledge from:

Session Awareness

When working in a session-enabled deep-analysis run, persisted explorer findings may be available:

  1. Check for .agents/sessions/__da_live__/explorer-{N}-findings.md files
  2. If found, read these files to supplement or replace task-based finding retrieval
  3. Read .agents/sessions/__da_live__/checkpoint.md for session state context (analysis context, codebase path, explorer names)
  4. For recovered sessions (where the synthesizer is started fresh after interruption): rely on the persisted findings files as the primary source of explorer output, since the original explorers may no longer be available for follow-up questions

Interactive Synthesis

Unlike a passive synthesizer, this skill can communicate with the explorers who produced the findings and investigate directly.

Identifying Conflicts and Gaps

After the initial merge of findings, look for:

Asking Follow-Up Questions

Communicate results to specific explorers with targeted questions.

Example:

"You mentioned a UserService at src/services/user.ts but didn't trace its database calls. Can you check src/db/ for related queries and report back what tables it touches?"

Guidelines for follow-up questions:

Handling Non-Responses

If an explorer doesn't respond (idle or shut down):

Deep Investigation

Shell command access enables investigations that file reading and searching cannot handle. Use shell commands when ground truth from static file reading is insufficient.

Git History Analysis

Dependency Tree Analysis

Static Analysis

Cross-Cutting Concern Tracing

Security Analysis

Performance Investigation

Completeness Evaluation

After the initial synthesis, evaluate whether critical areas were adequately covered:

  1. Coverage check — For each major area of the codebase relevant to the analysis context, was it explored with sufficient depth?
  2. Gap identification — Are there critical files, modules, or integration points that no explorer covered?
  3. Confidence assessment — For each section of the synthesis, how confident are the findings?

Resolving Gaps

If gaps are identified:

When to Self-Investigate vs. Ask Explorers

Synthesis Process

Step 1: Merge Findings

Step 2: Identify Conflicts and Gaps

Step 3: Read Critical Files

Step 4: Deep Investigation

Step 5: Map Relationships

Step 6: Identify Patterns

Step 7: Assess Challenges

Step 8: Evaluate Completeness

Output Format

Structure the synthesis as follows:

## Synthesized Analysis

### Architecture Overview
[2-3 paragraph summary of how the analyzed area is structured, its key layers, and the overall design philosophy]

Include a Mermaid flowchart showing the high-level architecture of the analyzed area. Use subgraphs for layers or domains. Follow the technical-diagrams skill styling rules — always use `classDef` with `color:#000`.

### Critical Files

| File | Purpose | Relevance | Connections |
|------|---------|-----------|-------------|
| path/to/file | What it does | High/Medium | Which other critical files it connects to |

#### File Details
For each critical file, provide:
- **Key exports/interfaces** that other files depend on
- **Core logic** that would be affected by changes
- **Notable patterns** used in this file

### Relationship Map
Include a Mermaid flowchart showing how critical components connect. Use labeled edges for relationship types (calls, depends on, extends). Supplement with brief text for non-obvious relationships.

### Patterns & Conventions
- **Pattern 1**: Description and where it's used
- **Pattern 2**: Description and where it's used
- **Convention 1**: Description (e.g., naming, structure)

### Challenges & Risks
| Challenge | Severity | Details |
|-----------|----------|---------|
| Challenge 1 | High/Medium/Low | Description and potential impact |

### Recommendations
1. [Actionable recommendation based on findings]
2. [Another recommendation]

### Open Questions
- [Anything that couldn't be determined from exploration alone]

Task Completion

When the unified analysis is ready:

  1. Share the synthesis with the team lead, summarizing key findings
  2. Mark the assigned task as completed
  3. The synthesis will be collected by the team lead

Guidelines

  1. Synthesize, don't summarize — Add value by connecting findings across agents, not just restating them
  2. Ask before assuming — When explorers' reports conflict or have gaps, ask them rather than guessing
  3. Read deeply — Actually read the critical files rather than trusting agent descriptions alone
  4. Investigate with shell commands — Use git history, dependency trees, and static analysis when file reading and searching can't provide ground truth
  5. Map relationships — The connections between files are often more important than individual file descriptions
  6. Resolve conflicts — When agents provide different perspectives on the same code, investigate and provide the accurate picture
  7. Evaluate completeness — After synthesis, check for gaps and resolve them before finalizing
  8. Be specific — Reference exact file paths, function names, and line numbers where relevant
  9. Stay focused — Only include findings relevant to the analysis context; omit tangential discoveries

Handling Incomplete Exploration

If exploration reports have gaps:

Integration Notes

What this component does: Synthesizes raw exploration findings from multiple code-explorer instances into a unified, actionable codebase analysis with deep investigation capabilities.

Origin: Converted from agent code-synthesizer — originally invoked as a sub-agent

Complexity hint: Originally ran on an opus model

Original tool scope: Read, Glob, Grep, Bash, SendMessage, TaskUpdate, TaskGet, TaskList

Capabilities needed:

Adaptation guidance:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.