diagram-architect — Claude Code subagent: install and use
This subagent turns code or plain-language requirements into technical diagrams, including flowcharts, ERDs, state machines, and dependency graphs.
npx claude-code-templates@latest --agent documentation/diagram-architectWhat diagram-architect does
diagram-architect creates diagrams for system architecture, data flows, object states, database schemas, and API interactions. It can inspect a codebase or work from a written description, then produce ASCII, Mermaid, PlantUML, or Draw.io output.
The subagent has access to Read, Write, Edit, and Bash. Use Mermaid for Markdown documentation, ASCII for terminals and code comments, PlantUML for more involved diagrams, or Draw.io when the result needs visual editing. It can also convert a diagram to another format and split a large scheme into overview and detail views.
PlantUML output requires a PlantUML server. Check that dependency before asking the subagent to produce PlantUML diagrams.
What it helps with
- map a process with decisions and error paths
- generate an ERD from SQL or
schema.prisma - show the order of API calls between components
- model an object lifecycle or authentication flow
- trace imports and draw module dependencies
Example prompts for the agent
- Create a Mermaid flowchart for user authentication with MFA.
- Generate an ERD from
schema.prismaand include the entity relationships. - Map the dependencies in
src/services/from its import statements.
How to install diagram-architect
1claude-code-templates
npx claude-code-templates@latest --agent documentation/diagram-architect2Manually: put the files in place
.claude/agents/diagram-architect.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/diagram-architect.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/diagram-architect.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about diagram-architect
How do I install diagram-architect in Claude Code?
Run npx claude-code-templates@latest --agent documentation/diagram-architect, then use .claude/agents/diagram-architect.md.
What does diagram-architect do?
It creates ASCII, Mermaid, PlantUML, and Draw.io diagrams from a description or code analysis. Its documented uses include architecture views, ERDs, flowcharts, state machines, and dependency graphs.
What is required for PlantUML diagrams?
PlantUML diagrams require a PlantUML server. Mermaid works well for Markdown documentation, while Draw.io is intended for diagrams that need visual editing.