Learn

Draw Diagrams Using Agent Skills

Automate architecture, workflow, and system design diagrams using agent skills. Enable your AI agent to generate consistent, high-quality technical visuals directly from prompts, reducing manual effort and improving documentation speed.

Automate architecture diagrams, flow diagrams, sequence diagrams, and ER diagrams using agent skills.

When working as a software engineer, we often need diagrams to explain how a project works. Instead of drawing every diagram manually, we can use agent skills to generate editable diagram files from prompts.

In this article, we will use different diagram skills and different visual styles. This avoids making every diagram look like the same sketch-style diagram.

For the examples below, I used this open-source repository: https://github.com/codewalnut-labs/documenso

How to Install Diagram Skills

Visit https://www.skills.sh/, type the skill name, open the skill page, and run the install command in the terminal.

Skill Type in skills.sh Install Command Use For
Excalidraw Diagram Generator excalidraw-diagram-generator npx skills add https://github.com/github/awesome-copilot --skill excalidraw-diagram-generator Sketch-style Excalidraw diagrams
Mermaid Diagrams mermaid-diagrams npx skills add https://github.com/softaworks/agent-toolkit --skill mermaid-diagrams Markdown-friendly diagrams
Draw.io drawio npx skills add https://github.com/bahayonghang/drawio-skills --skill drawio Professional Draw.io diagrams
Baoyu Diagram baoyu-diagram npx skills add https://github.com/jimliu/baoyu-skills --skill baoyu-diagram Self-contained SVG diagrams

Let's generate different types of diagrams using these skills.

Diagram Type 1: Architecture Diagram

Architecture diagrams help explain the high-level structure of a project.

Use this when you want to show:

  • Frontend
  • Backend/API
  • Database
  • Authentication
  • File storage
  • External services
  • Main system modules

Prompt

Use the excalidraw-diagram-generator skill.

Analyze this repository:
https://github.com/codewalnut-labs/documenso

Create a high-level architecture diagram for Documenso.

Include only components that are actually present in the codebase.

Check the README, `apps/` folder, `packages/` folder, API-related code, Prisma schema, authentication code, background jobs, document/PDF handling, email handling, storage code, and external integrations before drawing.

Show Remix/Hono runtime, app entry points, API routes, domain packages, Prisma/Postgres, auth, jobs, document/PDF handling, email handling, storage, and verified external integrations only if they are present in the repository.

Use clear labels and arrows.

Save the diagram as:
docs/architecture.excalidraw

Steps

  1. Open the project in your AI coding agent.
  2. Run the prompt above.
  3. Let the agent analyze the repository.
  4. Open docs/architecture.excalidraw.
  5. Review the diagram.

Architecture Diagram

Diagram file:

https://github.com/codewalnut-labs/documenso/blob/docs/add-project-architecture-diagram/docs/architecture.excalidraw

Reference PR:

https://github.com/codewalnut-labs/documenso/pull/4

Diagram Type 2: Flow Diagram

Flow diagrams help explain a user journey or process.

Keep the flow diagram focused on one path. Do not include every edge case in the product.

For this example, use the recipient signing flow.

Prompt

Use the mermaid-diagrams skill.

Repo: https://github.com/codewalnut-labs/documenso

Create a flowchart for the recipient signing page only.

Scope: open signing link, validate token, load document, fill required fields, submit signature, reject document, complete signing, invalid-token error.

Limit: medium-size diagram, max 10 nodes, max 3 decisions.

Style: Mermaid flowchart, top-to-bottom, light theme, blue steps, green success, red error.

Save: docs/recipient-signing-flow.mmd
Export: docs/recipient-signing-flow.png

Steps

  1. Run the prompt in the repository.
  2. Open docs/recipient-signing-flow.mmd.
  3. Review the diagram.

Flow Diagram

Open PR source file:

https://github.com/codewalnut-labs/documenso/blob/codex/recipient-signing-flow-diagram/docs/recipient-signing-flow.mmd

Open PR diagram image:

https://github.com/codewalnut-labs/documenso/blob/codex/recipient-signing-flow-diagram/docs/recipient-signing-flow.png

Reference PR:

https://github.com/codewalnut-labs/documenso/pull/10

Diagram Type 3: Sequence Diagram

Sequence diagrams help explain how different parts of a system communicate over time.

Keep the sequence diagram medium-sized. A sequence diagram becomes hard to read when it has too many actors.

For this example, use the recipient signing submit flow.

Prompt

Use the drawio skill.

Repo: https://github.com/codewalnut-labs/documenso

Create a Draw.io sequence diagram for the recipient signing submit flow only.

Scope: recipient, signing UI, tRPC recipient router, field signing handler, document completion handler, Prisma.

Limit: medium-size diagram, max 5 participants, max 10 messages.

Style: Draw.io sequence diagram, clean lifelines, white background, muted purple/gray palette, no sketch style.

Save: docs/recipient-signing-sequence.drawio
Export: docs/recipient-signing-sequence.png

Steps

  1. Run the prompt in the repository.
  2. Open docs/recipient-signing-sequence.drawio.
  3. Verify the order of calls.

Sequence Diagram

Open PR source file:

https://github.com/codewalnut-labs/documenso/blob/codex/recipient-signing-sequence-diagram/docs/recipient-signing-sequence.drawio

Open PR diagram image:

https://github.com/codewalnut-labs/documenso/blob/codex/recipient-signing-sequence-diagram/docs/recipient-signing-sequence.png

Reference PR:

https://github.com/codewalnut-labs/documenso/pull/11

Diagram Type 4: ER Diagram

ER diagrams help explain database entities and relationships.

Do not include every model from a large schema. Pick a focused data slice.

For this example, use the document signing data model.

Prompt

Use the baoyu-diagram skill.

Repo: https://github.com/codewalnut-labs/documenso

Create a medium-size ER diagram from packages/prisma/schema.prisma.

Scope: Document or Envelope, Recipient, Field, Signature, DocumentData, and DocumentAuditLog only if directly related.

Limit: medium-size diagram, max 6 entities; show only PK, FK, and 1-2 important fields.

Style: self-contained SVG, database-card layout, teal headers, gray lines, no sketch style.

Save: docs/envelope-recipient-er.svg
Export: docs/envelope-recipient-er.png

Steps

  1. Run the prompt in the repository.
  2. Open docs/envelope-recipient-er.png.
  3. Verify every model and relationship.

ER Diagram

Open PR source file:

https://github.com/codewalnut-labs/documenso/blob/codex/envelope-recipient-er-diagram/docs/envelope-recipient-er.svg

Open PR diagram image:

https://github.com/codewalnut-labs/documenso/blob/codex/envelope-recipient-er-diagram/docs/envelope-recipient-er.svg

Reference PR:

https://github.com/codewalnut-labs/documenso/pull/12

Which Diagram Should You Use?

Diagram Type Use For Suggested Style
Architecture Diagram Project structure and system components Excalidraw architecture diagram
Flow Diagram Medium user journey or process Mermaid light flowchart
Sequence Diagram Medium API call flow Draw.io sequence diagram
ER Diagram Medium database relationship view SVG database-card diagram

Updating an Existing Diagram

You can also ask the agent to update an existing diagram when the code changes.

Prompt

Update the existing diagram with current codebase state.

Keep the same module, same style, and same complexity.
Remove stale parts.
Add only verified codebase components.
Do not expand it into the full system.
Want help with your react app?

Get in touch - Our team has developed scalable solutions for enterprises and has a Crunch rating of 4.9⭐.

Contact us
Blog CTA Banner
Author
Ashik
Ashik
Software Engineer
Disclaimer: This article outline is created by Humans, content is written by AI and the final article is reviewed & edited by a CodeWalnut engineer.
Next-JS Logo
Kickstart your
AI Agents
project

Experience coding prowess firsthand. Choose CodeWalnut to build a prototype within a week and make your choice with confidence.

Book a Meeting
Vercel Logo
Kickstart your
AI Agents
project

Accelerate your web app vision with CodeWalnut. In just a week, we'll shape your idea into a polished prototype, powered by Vercel. Ready to make it real? Choose us with confidence!

Book a Meeting
Heroku Logo
Kickstart your
Heroku
project

Dreaming of a powerful web app on Heroku? Let CodeWalnut bring it to life in just one week. Take the leap and trust us to deliver with confidence!

Book a Meeting
Download 👑Premium Template
Contact Us
Red Curved Arrow
Download Free Template

Open Source Java + React Code with API and Database Configuration

Get Code
Red Curved Arrow
Request Your 👑Premium Template
Get It Now
Red Curved Arrow
You are just one step away!

Enter your Email to receive free template developed by CodeWalnut Experts

Thank you! Your template has been sent Successfully!

Before you rush to your inbox, Do you know CodeWalnut offers free consultation?
Contact Us
Oops! Something went wrong while submitting the form.
You are just one step away!

Enter your Email to receive free template developed by CodeWalnut Experts.

Thank you! Your template has been sent Successfully!

Before you rush to your inbox, Do you know CodeWalnut offers free consultation?
Contact Us
Oops! Something went wrong while submitting the form.
You are just one step away!

Enter your email to receive the PR checklist prepared by CodeWalnut experts.

Thank you! Your PR Checklist has been sent Successfully!

Before you rush to your inbox, Do you know CodeWalnut offers free consultation?
Contact Us
Oops! Something went wrong while submitting the form.
Need help with building your next application?
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
What best describes you?
Beginner Programmer
Tech Manager
Enterprise IT Leader
Here are some useful resources for you
A boilerplate for React + Java
PR checklist to control code quality
Download Free Template
Open Source Java + React Code with API and Database Configuration
Download now
Here are some useful resources for you
React-Java Boilerplate
A boilerplate for React + Java
PR checklist to control code quality

Book a 15 min session to build your bulletproof development lifecycle

Book a meeting
Nattu
Nattu, Co Founder
Need help with building your next application?
Yes! Show me how