Skill detail
external-diagram-mermaid-generate
Generates Salesforce architecture diagrams using Mermaid with ASCII fallback, covering OAuth flows, ERDs, integration sequences, and system landscapes.
Inspect before use
Read the source instructions and check the requirements before you install this skill.
SKILL.md
The saved excerpt is a snapshot from when this skill was listed. The external source remains the complete and most current version.
---
name: external-diagram-mermaid-generate
description: "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 diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user asks about non-Salesforce systems."
metadata:
cliTools:
- tool: ["curl"]
semver: ">=7.0.0"
- tool: ["jq"]
semver: ">=1.6.0"
- tool: ["python"]
semver: ">=3.10.0"
- tool: ["python3"]
semver: ">=3.10.0"
- tool: ["sf"]
semver: ">=2.0.0"
relatedSkills:
- "agentforce-generate"
- "automation-flow-generate"
- "integration-connectivity-connected-app-configure"
- "integration-connectivity-generate"
- "platform-apex-generate"
- "platform-custom-field-generate"
- "platform-custom-object-generate"
- "platform-data-manage"
- "platform-metadata-deploy"
version: "1.0"
domains: ["External"]
---
# 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:
- non-Salesforce systems only → use a more general diagramming skill
- object discovery before an ERD → [platform-custom-object-generate](../platform-custom-object-generate/SKILL.md) or [platform-custom-field-generate](../platform-custom-field-generate/SKILL.md)
---
## 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:
- 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 [platform-custom-object-generate](../platform-custom-object-generate/SKILL.md) or [platform-custom-field-generate](../platform-custom-field-generate/SKILL.md) 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
- Read the full source on GitHub (opens external page)