Loading...
Loading...
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 wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.
npx skill4agent add forcedotcom/sf-skills generating-mermaid-diagramsgenerating-mermaid-diagrams| Type | Preferred Mermaid form | Typical use |
|---|---|---|
| OAuth / auth flows | | Authorization Code, JWT, PKCE, Device Flow |
| ERD / data model | | object relationships and sharing context |
| integration sequence | | request/response or event choreography |
| system landscape | | high-level architecture |
| role / access hierarchy | | users, profiles, permissions |
| Agentforce behavior map | | agent → topic → action relationships |
sequenceDiagramflowchart LRautonumberflowchart LR## <Diagram Title>
### Mermaid Diagram
```mermaid
<diagram>
```
### ASCII Fallback
```text
<ascii>
```
### Notes
- <key point>
- <assumption or limitation>| Need | Delegate to | Reason |
|---|---|---|
| real object / field definitions | generating-custom-object / generating-custom-field | grounded ERD generation |
| rendered diagram / image output | generating-visual-diagrams | visual polish beyond Mermaid |
| connected-app auth setup context | configuring-connected-apps | accurate OAuth flows |
| Agentforce logic visualization | developing-agentforce | source-of-truth behavior details |
| Flow behavior diagrams | generating-flow | actual Flow logic grounding |
| 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 |
| OAuth flow actors differ by grant type | Read the relevant asset template first before generating to avoid actor mismatch |
```mermaidautonumber| 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 |