explain-complex-code
Generate comprehensive architecture documentation for complex code modules with Mermaid diagrams and examples.
Skill by broneq
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/broneq-explain-complex-code
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/explain-complex-code
What's inside
- Skill name
explain-complex-code- Description
- Generate comprehensive architecture documentation for complex code modules with Mermaid diagrams and examples. Use when user asks to "explain this code", "document the architecture", or wants to understand how a module/system works.
- License
- MIT
- Instructions
- 119 lines in SKILL.md · view on GitHub
Files (3)
- SKILL.md
- documentation-template.md · references/
- examples.md · references/
SKILL.md (first lines)
# Explain Complex Code
> Relies on BDK foundation (STARTUP_INSTRUCTIONS.md) for project context.
Generate architecture docs for complex code with visual diagrams and examples.
## Workflow
### 1. Understand Scope
`path` arg specifies code to explain. Clarify:
- **Focus areas**: Architecture, algorithms, data flow, testing strategy
- **Audience level**: Team onboarding, external docs, debugging guide
### 2. Analyze Code Structure
**Step 2.1: Initial Discovery**
Find all symbols in the area and identify the high-dependency ones (most importers).
**Step 2.2: Map Dependencies**
For each key class/function: find its callers across the source tree, and read its body for the callees it uses.
**Step 2.3: Decide Partitioning Strategy**
Partition by file count, keeping each directory that forms one logical block together:
| Files Count | Strategy | Subagent Count |
|-------------|----------|----------------|
| 1-2 files | One subagent for entire module | 1 subagent |
| 3-5 files | Group into 1-2 logical blocks | 1-2 subagents |
| 6-10 files | Group into 2-3 logical blocks | 2-3 subagents |
| 10+ files | Group by architectural layers | 3-4 subagents |
**Never more than 3-4 subagents.**
### 3. Launch Subagents Strategically
Launch ALL subagents in ONE message. Per subagent:
```
Explore the following files as a logical block: [FILE_LIST]
For EACH file, report:
1. Core responsibilities and purpose
2. Key classes/functions and their roles
3. Important dependencies
4. Critical algorithms or rules
5. Data structures
6. Edge cases or special handling
Then synthesize:
7. How these files work together
8. Data flow between them
9. Shared dependencies or patterns
```
### 4. Synthesize Documentation
From subagent findings, create structured docs.
**Structure:**
1. **Overview**: 2-3 sentence summary
2. **Core Architecture**: File tree + component diagram
3. **Architecture Flow**: Process flow with Mermaid
4. **Critical Rules**: Non-obvious rules with examples
5. **Live Examples**: Prototype code (NOT actual implementation)
6. **Core Classes**: Key classes with usage patterns
7. **Testing Coverage**: Existing test structure and patterns
### 5. Create Mermaid Diagrams
Embed diagrams directly as fenced ```mermaid``` code blocks — no separate source file, no compile step, renders natively wherever the doc is viewed.
**Follow `/bdk:mermaid-drawer`** for type selection, node budget and colour. It is the shared standard across every BDK skill that emits a diagram, so docs from different skills read alike. Architecture docs typically need a component `flowchart` with one `subgraph` per layer; add a `sequenceDiagram` when the module's behaviour is a call chain across boundaries, and a `stateDiagram-v2` when it drives an entity through named states.
### 6. Write Prototype Examples
**CRITICAL RULE**: Prototype code only — NOT actual implementation.
**Good Prototype:**
```
# Parse and validate
parsed = parse(input_data)
if not parsed.is_valid:
return error_response()
# Transform based on type
result = transform(parsed)
return format_output(result)
```
**Prototype Rules:**
- Placeholder function names
- Clear control flow
- Comments for key steps
- Under 20 lines per example
- One concept per example
### 7. Save Documentation
Save to `.bdk/explain-complex-code/[feature-name].md`.
## Quality Checklist
- [ ] Overview (2-3 sentences)
- [ ] File tree
- [ ] At least one Mermaid diagram
- [ ] Critical rules with examples
- [ ] Live examples with prototype code
- [ ] Core classes with usage
- [ ] Testing coverage
## Notes
- **Prototype code mandatory**: Never copy actual implementation
- **Parallel subagents save time**: Launch all in one message
- **Focus non-obvious details**: Skip basic patternsFrom broneq/bdk, MIT.
More from broneq/bdk
- 0.589score
pr-review
broneq
Review GitHub PRs from URLs - templated inline comments, summary, and a verdict you confirm/override before it posts via gh.
SkillAFreshness: A★ 1Claude Code +9 - 0.589score
design
broneq
Design partner for any feature.
SkillAFreshness: A★ 1Claude Code +9 - 0.589score
mermaid-drawer
broneq
BDK's shared Mermaid standard - diagram type selection, node budget, and a palette verified legible in light and dark themes.
SkillAFreshness: A★ 1Claude Code +9 - 0.589score
cr
broneq
Run code review with dynamic agent scaling (3-13 agents based on change size).
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
create-adr
broneq
Create Architecture Decision Records (ADRs) based on MADR template.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
debug
broneq
Debug issues through structured investigation, failing test creation, and targeted fixes.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
agent-lint
broneq
Lint a BDK agent file for best practices and portability.
SkillAFreshness: A★ 1Claude Code +9 - 0.586score
create-plan
broneq
Create comprehensive implementation plan with exploration and trade-off analysis
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
add-rule
broneq
Capture one lesson or convention as a properly-homed rule — routed to .claude/rules/, a doc comment, or a test signpost; dedupes and respects budgets.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
bdk-lint-tools
broneq
Project-configured lint/format/typecheck commands from .bdk/settings.json.
SkillAFreshness: A★ 1Claude Code +9 - 0.583score
skill-lint
broneq
Lint a BDK skill or agent file for best practices and portability.
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
bdk-test-tools
broneq
Project-configured test commands from .bdk/settings.json.
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 6
- Last commit (this folder)
- Sep 25, 2026 (1 month ago)
- Last release
- Sep 25, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/broneq/bdk
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from broneq
- 0.589score
pr-review
broneq
Review GitHub PRs from URLs - templated inline comments, summary, and a verdict you confirm/override before it posts via gh.
SkillAFreshness: A★ 1Claude Code +9 - 0.589score
design
broneq
Design partner for any feature.
SkillAFreshness: A★ 1Claude Code +9 - 0.589score
cr
broneq
Run code review with dynamic agent scaling (3-13 agents based on change size).
SkillAFreshness: A★ 1Claude Code +9 - 0.589score
mermaid-drawer
broneq
BDK's shared Mermaid standard - diagram type selection, node budget, and a palette verified legible in light and dark themes.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
debug
broneq
Debug issues through structured investigation, failing test creation, and targeted fixes.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
agent-lint
broneq
Lint a BDK agent file for best practices and portability.
SkillAFreshness: A★ 1Claude Code +9
Cite this page
explain-complex-code skill. Agent Mart. https://agentmart.dev/skills/broneq-explain-complex-code (last updated 2026-10-24)