ai-tools/d2-diagram/SKILL.md
Generate D2 diagram files (.d2) for technical reference — flowcharts, architecture diagrams, sequence diagrams, state machines, database schemas, and class diagrams. Use whenever the user wants to create, document, or visualize any system, flow, architecture, API, database, or process. Trigger on "make a diagram", "draw a flowchart", "document this architecture", "visualize this flow", "create a sequence diagram", "map this system", or any request to illustrate how something works.
npx skillsauth add randyhaylor/enhanceclaude d2-diagramInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generates .d2 files for VS Code (requires D2 extension).
guides/workflow.mdtemplates/flowchart.d2 — process flows, decision trees, request handlingarchitecture.d2 — microservices, layered system architecturesequence.d2 — API calls, auth flows, request/response chainsstate-machine.d2 — order lifecycle, connection states, workflow stagessql-schema.d2 — database tables with relationshipsclass-diagram.d2 — OOP class hierarchies, interfaces, SDKsinfra-cloud.d2 — cloud/VPC/subnet topology (AWS-style)grid-dashboard.d2 — UI layouts, component maps, dashboardssyntax/nodes.md — declaring nodes, labels, IDsconnections.md — arrows, labels, chaining, bidirectionalcontainers.md — grouping nodes, nested references, _ parentshapes.md — full shape list with when to use eachstyles.md — fill, stroke, dash, bold, shadow, opacitydimensions.md — width, height, grid-rows, grid-columnslayout.md — direction, layout engines (dagre/elk/tala)globs.md — *, **, *** bulk selectors for global styles and connectionsvars.md — variables, substitution (${var}), d2-config blockclasses.md — reusable style definitions applied to multiple nodesicons.md — built-in and URL-based icons on nodesnear.md — positioning labels/nodes relative to constants (top-left, etc.)null.md — removing/hiding nodes with nullcomments.md — # comments and block commentsgotchas.md — naming rules, cross-container refs, common errorsadvanced/layers.md — multiple diagram layers for step-by-step viewsscenarios.md — scenario variations branching from a base diagramimports.md — importing from other .d2 filestooltips-links.md — interactive hover text and clickable linksthemes.md — built-in theme IDs, dark themes, sketch modespecial/sequence.md — sequence_diagram syntax, actors, self-messagessql-table.md — sql_table shape, constraints, FK relationshipsclass.md — class shape, visibility (+/-/#), inheritance linesmarkdown-code.md — embedding md/code blocks inside nodesd2 path/to/file.d2 /dev/null # errors → stdout
Validate before starting + after each logical round of changes (not after every single line). VS Code diagnostics API misses D2 errors; CLI only.
tools
# XState v5 Quick Reference ## How to Look Up API Details For complete function signatures, types, and interfaces, **grep `api-reference.md`** — do NOT read it in full (12k+ lines). Example: ``` Grep pattern="createActor" path="~/.claude/skills/xstate/api-reference.md" output_mode="content" -C 5 ``` Then use `Read` with `offset`/`limit` to get the full section. This is the primary way to get precise technical info when the quick reference below isn't enough. ## Design Workflow Recommended
tools
Workaround for agent teams in VS Code extension where TeamCreate teammates cannot execute tools. Uses an echo-back-and-resume pattern where agents return tool requests instead of executing them directly.
development
Format documentation, READMEs, and structured text using header hierarchy where each level stands alone. Use when creating docs, research notes, summaries, or when user requests 'scannable,' 'well-structured,' 'skimmable,' or 'readable at multiple depths' output. Applies to markdown, technical specs, and any hierarchical text formatting.
development
Enforce strict Test-Driven Development workflow: write one test, make it pass, verify, then proceed. Prevents over-implementation and ensures code matches requirements exactly. Use when implementing new features, adding settings, or building functionality incrementally.