From bdk
Generate comprehensive architecture documentation for complex code modules with Graphviz diagrams and examples. Use when user asks to "explain this code", "document the architecture", or wants to understand how a module/system works.
npx claudepluginhub broneq/bdk --plugin bdkThis skill is limited to using the following tools:
> Relies on BDK foundation (STARTUP_INSTRUCTIONS.md) for project context and MCP tool preference.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Relies on BDK foundation (STARTUP_INSTRUCTIONS.md) for project context and MCP tool preference.
Generate architecture docs for complex code with visual diagrams and examples.
path arg specifies code to explain. Clarify:
Step 2.1: Initial Discovery
!python3 ${CLAUDE_PLUGIN_ROOT}/scripts/inject.py --chain ${CLAUDE_PLUGIN_ROOT}/fragments/tool-tiers/explore.chain.json
Using the exploration tools above: find all symbols, identify high-dependency symbols, use community grouping to determine subagent partitioning where available.
Step 2.2: Map Dependencies
For each key class/function: query_graph(pattern="callers_of", node=<symbol>) and query_graph(pattern="callees_of", node=<symbol>). Fall back to Serena find_referencing_symbols if graph unavailable.
Step 2.3: Decide Partitioning Strategy
When graph communities are available, use community boundaries as partitioning units — one community per subagent. Otherwise fall back to file-count rules:
| 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.
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
From subagent findings, create structured docs.
Structure:
Use for:
Under 15 nodes. Label edges clearly.
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:
Save to .bdk/explain-complex-code/[feature-name].md.
After saving, invoke /bdk:graphviz-docs-compiler to extract .dot files and compile to SVG.