External diagram mermaid generate

From forcedotcom/sf-skills · View interactive version

External diagram mermaid generate is an AI agent skill from the GitHub repository forcedotcom/sf-skills. Salesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says \"diagram\", \"visualize\", \"ERD\", or asks for sequence dia

How to use this skill

Skill file

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:

Out of Scope — Delegate elsewhere when the user wants:


Supported Diagram Families

| Type | Preferred Mermaid form | Typical use |

|---|---|---|

| OAuth / auth flows | sequenceDiagram | Authorization Code, JWT, PKCE, Device Flow |

| ERD / data model | flowchart LR | object relationships and sharing context |

| integration sequence | sequenceDiagram | request/response or event choreography |

| system landscape | flowchart | high-level architecture |

| role / access hierarchy | flowchart | users, profiles, permissions |

| Agentforce behavior map | flowchart | agent → topic → action relationships |


Required Context to Gather First

Ask for or infer:


Recommended Workflow

1. Pick the right diagram structure

2. Gather data

For ERDs and grounded diagrams:

3. Generate Mermaid first

Apply:

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

For ERDs

For ASCII output


Output Format

## <Diagram Title>

### Mermaid Diagram

<diagram>


### ASCII Fallback

<ascii>


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

Cross-Skill Integration

| Need | Delegate to | Reason |

|---|---|---|

| real object / field definitions | platform-custom-object-generate / platform-custom-field-generate | grounded ERD generation |

| connected-app auth setup context | integration-connectivity-connected-app-configure | accurate OAuth flows |

| Agentforce logic visualization | agentforce-generate | source-of-truth behavior details |

| Flow behavior diagrams | automation-flow-generate | actual Flow logic grounding |


Gotchas

| Issue | Resolution |

|---|---|

| Mermaid renderer not available | Provide ASCII fallback automatically; note that the Mermaid block still carries the diagram for copy-paste into a renderer |

| ERD becomes unreadable with too many objects | Split into sub-diagrams by domain (Sales, Service, etc.) and link them in prose |

| Sequence diagram step order unclear | Use autonumber directive to make step ordering explicit |

| OAuth flow actors differ by grant type | Read 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:


Score Guide

| Score | Meaning |

|---|---|

| 72–80 | production-ready diagram |

| 60–71 | clear and useful with minor polish left |

| 48–59 | functional but could be clearer |

| 35–47 | needs structural improvement |

| < 35 | inaccurate or incomplete |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.