Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
forcedotcom avatar

Generating Mermaid Diagrams

  • 2.3k installs
  • 763 repo stars
  • Updated July 24, 2026
  • forcedotcom/sf-skills

generating-mermaid-diagrams creates Salesforce Mermaid and ASCII diagrams for architecture, OAuth, ERDs, and Agentforce maps.

About

The generating-mermaid-diagrams skill produces text-based Salesforce diagrams as Mermaid with optional ASCII fallback for architecture, OAuth, ERD, integration sequence, and Agentforce behavior maps. In scope are sequenceDiagram auth flows, flowchart LR ERDs, system landscapes, role hierarchies, and markdown-embeddable outputs. Out of scope are rendered PNG or SVG mockups and non-Salesforce-only systems, which delegate to sibling skills. Workflow gathers diagram type, entities, output preference, styling level, and org metadata for grounded ERDs before generating Mermaid and optional ASCII. High-signal rules cover autonumber for sequences, simple ERD cards, restrained styling, and readable ASCII width. Cross-skill integration points to custom object discovery, visual diagrams, connected apps, Agentforce, and Flow skills. Reference files include conventions, syntax, styling palettes, OAuth templates, and datamodel ERD assets. Agents trigger on diagram, visualize, ERD, or architecture requests for Salesforce contexts.

  • Mermaid plus optional ASCII for Salesforce architecture and OAuth flows.
  • Supports sequence, flowchart ERD, integration, and Agentforce maps.
  • Delegates PNG or SVG output to generating-visual-diagrams skill.
  • Gathers diagram type, scope, and org metadata before generating.
  • OAuth and datamodel template assets for accurate actor and object flows.

Generating Mermaid Diagrams by the numbers

  • 2,341 all-time installs (skills.sh)
  • +7 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #162 of 1,901 Documentation skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

generating-mermaid-diagrams capabilities & compatibility

Capabilities
diagram type selection for sequence, erd, and la · mermaid first generation with ascii fallback opt · salesforce oauth and datamodel template routing · cross skill delegation for visuals and metadata · styling and erd convention references
Use cases
documentation · api development
npx skills add https://github.com/forcedotcom/sf-skills --skill generating-mermaid-diagrams

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.3k
repo stars763
Security audit3 / 3 scanners passed
Last updatedJuly 24, 2026
Repositoryforcedotcom/sf-skills

How do I visualize Salesforce architecture, OAuth, or data models as markdown-friendly Mermaid diagrams?

Generate Mermaid and ASCII diagrams for Salesforce architecture, OAuth flows, ERDs, integrations, and Agentforce structure in markdown-friendly docs.

Who is it for?

Salesforce teams documenting auth flows, ERDs, and integration sequences in markdown.

Skip if: Skip for polished PNG or SVG renders or purely non-Salesforce system diagrams.

When should I use this skill?

User says diagram, ERD, visualize OAuth, Agentforce map, or Mermaid for Salesforce.

What you get

Mermaid diagram block with optional ASCII fallback, notes, and accurate Salesforce-specific labels.

  • Mermaid flowchart diagrams
  • Topic-action architecture maps

By the numbers

  • Template init block sets flowchart nodeSpacing to 80 and rankSpacing to 70

Files

SKILL.mdMarkdownGitHub ↗

generating-mermaid-diagrams: Salesforce Diagram Generation

Use this skill when the user needs text-based diagrams: Mermaid diagrams for architecture, OAuth, integration flows, ERDs, or Agentforce structure, plus ASCII fallback when plain-text compatibility matters.

Scope

In Scope

Use generating-mermaid-diagrams when the user wants:

  • Mermaid output
  • ASCII fallback diagrams
  • architecture, sequence, flowchart, or ERD views in markdown-friendly form
  • diagrams that can live directly in docs, READMEs, or issues

Out of Scope — Delegate elsewhere when the user wants:

  • rendered PNG/SVG images or polished mockups → generating-visual-diagrams
  • non-Salesforce systems only → use a more general diagramming skill
  • object discovery before an ERD → generating-custom-object or generating-custom-field

---

Supported Diagram Families

TypePreferred Mermaid formTypical use
OAuth / auth flowssequenceDiagramAuthorization Code, JWT, PKCE, Device Flow
ERD / data modelflowchart LRobject relationships and sharing context
integration sequencesequenceDiagramrequest/response or event choreography
system landscapeflowcharthigh-level architecture
role / access hierarchyflowchartusers, profiles, permissions
Agentforce behavior mapflowchartagent → topic → action relationships

---

Required Context to Gather First

Ask for or infer:

  • diagram type
  • scope and entities / systems involved
  • output preference: Mermaid only, ASCII only, or both
  • whether styling should be minimal, documentation-first, or presentation-friendly
  • for ERDs: whether org metadata is available for grounding

---

Recommended Workflow

1. Pick the right diagram structure

  • use sequenceDiagram for time-ordered interactions
  • use flowchart LR for ERDs and capability maps
  • keep a single primary story per diagram when possible

2. Gather data

For ERDs and grounded diagrams:

  • use generating-custom-object or generating-custom-field when real schema discovery is needed
  • optionally use the local metadata helper script for counts / relationship context when appropriate

3. Generate Mermaid first

Apply:

  • accurate labels
  • simple readable node text
  • consistent relationship notation
  • restrained styling that renders cleanly in markdown viewers

4. Add ASCII fallback when useful

Provide an ASCII version when the user wants terminal compatibility or plaintext documentation.

5. Explain the diagram briefly

Call out the key relationships, flow direction, and any assumptions.

---

High-Signal Rules

For sequence diagrams

  • use autonumber when step order matters
  • distinguish requests vs responses clearly
  • use notes sparingly for protocol detail

For ERDs

  • prefer flowchart LR
  • keep object cards simple
  • use clear relationship arrows
  • avoid field overload unless the user explicitly asks for field-level detail
  • color-code object types only when it improves readability

For ASCII output

  • keep width reasonable
  • align arrows and boxes consistently
  • optimize for readability over decoration

---

Output Format

````markdown

<Diagram Title>

Mermaid Diagram

<diagram>

ASCII Fallback

<ascii>

Notes

  • <key point>
  • <assumption or limitation>

````

---

Cross-Skill Integration

NeedDelegate toReason
real object / field definitionsgenerating-custom-object / generating-custom-fieldgrounded ERD generation
rendered diagram / image outputgenerating-visual-diagramsvisual polish beyond Mermaid
connected-app auth setup contextconfiguring-connected-appsaccurate OAuth flows
Agentforce logic visualizationdeveloping-agentforcesource-of-truth behavior details
Flow behavior diagramsgenerating-flowactual Flow logic grounding

---

Gotchas

IssueResolution
Mermaid renderer not availableProvide ASCII fallback automatically; note that the Mermaid block still carries the diagram for copy-paste into a renderer
ERD becomes unreadable with too many objectsSplit into sub-diagrams by domain (Sales, Service, etc.) and link them in prose
Sequence diagram step order unclearUse autonumber directive to make step ordering explicit
OAuth flow actors differ by grant typeRead the relevant asset template first before generating to avoid actor mismatch

---

Reference File Index

Conventions & rules — read before generating

  • references/diagram-conventions.md — consistency rules for all diagram types
  • references/mermaid-reference.md — Mermaid syntax quick reference
  • references/usage-examples.md — worked examples per diagram type

Styling

  • references/mermaid-styling.md — theming and annotation patterns
  • references/color-palette.md — color-blind-friendly palette with hex values
  • references/erd-conventions.md — ERD-specific layout and notation rules

Preview

  • references/preview-guide.md — how to render Mermaid locally
  • scripts/README.md — setup and usage instructions for all scripts in this skill
  • scripts/mermaid_preview.py — live-reload preview server; run to preview diagrams in browser
  • scripts/query-org-metadata.py — queries org schema to ground ERD generation

OAuth flow templates — load the matching template when generating OAuth diagrams

  • assets/oauth/authorization-code.md — Authorization Code grant
  • assets/oauth/authorization-code-pkce.md — PKCE variant for mobile/SPA
  • assets/oauth/jwt-bearer.md — JWT Bearer server-to-server
  • assets/oauth/client-credentials.md — Client Credentials service accounts
  • assets/oauth/device-authorization.md — Device Flow for CLI/IoT
  • assets/oauth/refresh-token.md — Refresh Token renewal flow
  • assets/oauth/user-agent-social-sign-on.md — User-Agent / Social Sign-On

Data model ERD templates — load the matching template when generating ERDs

  • assets/datamodel/salesforce-erd.md — core Salesforce objects
  • assets/datamodel/sales-cloud-erd.md — Sales Cloud objects
  • assets/datamodel/service-cloud-erd.md — Service Cloud objects
  • assets/datamodel/b2b-commerce-erd.md — B2B Commerce objects
  • assets/datamodel/campaigns-erd.md — Campaigns and campaign member model
  • assets/datamodel/consent-erd.md — Consent and privacy objects
  • assets/datamodel/files-erd.md — Files and ContentDocument model
  • assets/datamodel/forecasting-erd.md — Forecasting objects
  • assets/datamodel/fsl-erd.md — Field Service Lightning objects
  • assets/datamodel/party-model-erd.md — Party model objects
  • assets/datamodel/quote-order-erd.md — Quote and Order objects
  • assets/datamodel/revenue-cloud-erd.md — Revenue Cloud objects
  • assets/datamodel/scheduler-erd.md — Scheduler objects
  • assets/datamodel/territory-management-erd.md — Territory Management objects

Other diagram templates

  • assets/architecture/system-landscape.md — system landscape overview template
  • assets/integration/api-sequence.md — API callout sequence template
  • assets/agentforce/agent-flow.md — Agentforce agent → topic → action flow
  • assets/role-hierarchy/user-hierarchy.md — role and permission hierarchy template

---

Output Expectations

Deliverables produced by this skill for each request:

  • Mermaid code block — fenced `mermaid block ready to paste into GitHub, Confluence, or any Mermaid-capable renderer
  • ASCII fallback (when requested or when Mermaid renderer is unavailable) — text-only diagram using box/arrow characters
  • Brief explanation — 2-5 bullet points calling out key relationships, flow direction, and any assumptions or limitations in the diagram
  • For ERDs: object cards with field labels and relationship type annotations
  • For sequence diagrams: numbered steps (autonumber) with clear actor labels

---

Score Guide

ScoreMeaning
72–80production-ready diagram
60–71clear and useful with minor polish left
48–59functional but could be clearer
35–47needs structural improvement
< 35inaccurate or incomplete

Related skills

Forks & variants (1)

Generating Mermaid Diagrams has 1 known copy in the catalog totaling 531 installs. They canonicalize to this original listing.

How it compares

Pick generating-mermaid-diagrams over generic Mermaid skills when the subject is specifically Salesforce Agentforce agent topic and action architecture.

FAQ

When should I use ASCII fallback?

Provide ASCII when the user wants terminal compatibility or plaintext docs without a Mermaid renderer.

What if the ERD has too many objects?

Split into domain sub-diagrams such as Sales or Service and link them in prose.

Where do OAuth actor names come from?

Load the matching OAuth asset template for the grant type before generating to avoid actor mismatch.

Is Generating Mermaid Diagrams safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Documentationdocsintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.