New to Claude Skills? Learn how to install them →

forcedotcom on GitHub

Salesforce Diagram Generation

OfficialFree

Create text-based Salesforce diagrams with ease.

by forcedotcom808 stars on forcedotcom/sf-skills
11 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Salesforce Diagram Generation does

The external-diagram-mermaid-generate skill is designed specifically for generating text-based diagrams related to Salesforce architecture. By leveraging Mermaid syntax, users can create various types of diagrams, including architecture views, OAuth flows, entity relationship diagrams (ERDs), integration sequences, and Agentforce structure visualizations. This skill is particularly useful for developers and designers who need to incorporate diagrams directly into documentation, READMEs, or issue trackers in a markdown-friendly format.

One of the key features of this skill is its ability to provide ASCII fallback diagrams, ensuring compatibility in environments where graphical rendering may not be available. Users can specify their preferences for diagram output, whether they want Mermaid diagrams, ASCII-only, or both. The skill supports multiple diagram types, including sequence diagrams for OAuth flows, flowcharts for ERDs, and high-level system landscapes, making it versatile for various use cases.

To effectively use this skill, users should gather context about the diagram type, scope, and entities involved before generating the diagrams. The skill includes a recommended workflow that guides users through selecting the appropriate diagram structure, gathering necessary data, and generating the diagrams while adhering to best practices for clarity and readability. Additionally, it provides a set of conventions and rules to follow for consistent output, ensuring that the diagrams are not only functional but also visually coherent.

Overall, this skill is ideal for Salesforce developers and architects who require a straightforward method to visualize complex systems and relationships, enhancing their documentation and communication efforts.

When to use it

Use this skill when you need to generate diagrams for Salesforce architecture, OAuth flows, ERDs, or integration sequences in a markdown-friendly format.

When not to use it

This skill is not suitable for generating diagrams related to non-Salesforce systems; for those cases, a more general diagramming tool should be used.

What you can build with it

Generating ERDs for Salesforce Objects

Use this skill to create entity relationship diagrams that illustrate the relationships between Salesforce objects, helping in database design and understanding.

Visualizing OAuth Flows

Generate sequence diagrams to visualize different OAuth authorization flows, making it easier to communicate authentication processes.

Creating Integration Sequence Diagrams

Use this skill to depict the request/response patterns in integration sequences, aiding in the design and documentation of API interactions.

How to install Salesforce Diagram Generation

View source

1. Install with the skills CLI

npx skills add forcedotcom/sf-skills/external-diagram-mermaid-generate --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by forcedotcom

external-diagram-mermaid-generate: 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 external-diagram-mermaid-generate 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:


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:

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

## <Diagram Title>

### Mermaid Diagram
```mermaid
<diagram>
```

### ASCII Fallback
```text
<ascii>
```

### Notes
- <key point>
- <assumption or limitation>

Cross-Skill Integration

NeedDelegate toReason
real object / field definitionsplatform-custom-object-generate / platform-custom-field-generategrounded ERD generation
connected-app auth setup contextintegration-connectivity-connected-app-configureaccurate OAuth flows
Agentforce logic visualizationagentforce-generatesource-of-truth behavior details
Flow behavior diagramsautomation-flow-generateactual 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

Styling

Preview

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

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

Other diagram templates


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

Frequently asked questions about Salesforce Diagram Generation

Similar skills