d2-architect

Analyze codebases to generate D2 diagrams for ER, Sequence, Architecture, and Class types.

56|5|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/diegomarino/claude-toolshed --skill d2-architect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: d2-architect
Source: https://github.com/diegomarino/claude-toolshed/tree/main/plugins/d2/skills/d2-architect
Command: npx skills add https://github.com/diegomarino/claude-toolshed --skill d2-architect

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the creation of D2 diagrams by analyzing a codebase, saving developers the time and effort of manually mapping out system architecture and data models.

Core Features & Use Cases

  • Codebase Analysis: Scans directories to identify relevant code patterns (models, routes, services, config).
  • Automated Diagram Generation: Infers and generates multiple diagram types (ER, Sequence, Architecture, Class) based on code structure.
  • Use Case: Point this Skill at your backend project's src/ directory, and it will generate an ER diagram for your database models, a sequence diagram for your API request flow, and an architecture diagram for your services.

Quick Start

Use the d2-architect skill to scan the codebase at the path 'src/'.

Frequently Asked Questions about d2-architect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically generate D2 diagrams from my codebase?

To generate D2 diagrams from your codebase, you can use a code analysis skill to scan a specified directory path. It analyzes code structures and automatically infers and generates relevant diagrams like ER, Sequence, Architecture, and Class.

How does automated code analysis infer diagram types for system design?

Automated code analysis infers diagram types by scanning directories to identify relevant code patterns such as models, routes, and services. Based on the discovered code structure and file types, it determines whether to generate ER, Sequence, Architecture, or Class diagrams.

Can I generate an ER diagram directly from my backend source code?

Yes, you can generate an ER diagram directly from backend source code. By pointing the code analysis tool at a directory like 'src/', it scans your database models and automatically maps them into a D2 ER diagram.

What is the best way to map API request flows into a sequence diagram?

The best way to map API request flows into a sequence diagram is to use automated code generation. By analyzing your backend project's source code, the tool tracks service interactions and automatically generates the corresponding D2 sequence diagram.

Do I need any external dependencies to run automated D2 diagram generation?

No external dependencies are required to run automated D2 diagram generation. The skill operates independently using its internal scripts and references to analyze code structures and produce architecture, class, ER, and sequence diagrams.

What specific code patterns are analyzed to create architecture diagrams?

To create architecture diagrams, the analysis specifically targets code patterns like models, routes, services, and configuration files. By scanning these structural elements within your specified file paths, it automatically generates a D2 architecture diagram.