Agent skill
sf-diagram-mermaid
Salesforce architecture diagrams using Mermaid with ASCII fallback. 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 sf-diagram-nanobananapro), or asks about non-Salesforce systems.
Install this agent skill to your Project
npx add-skill https://github.com/Jaganpro/sf-skills/tree/main/skills/sf-diagram-mermaid
Metadata
Additional technical details for this skill
- author
- Jag Valaiyapathy
- scoring
- 80 points across 5 categories
- version
- 1.2.0
SKILL.md
sf-diagram-mermaid: 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.
When This Skill Owns the Task
Use sf-diagram-mermaid 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
Delegate elsewhere when the user wants:
- rendered PNG/SVG images or polished mockups → sf-diagram-nanobananapro
- non-Salesforce systems only → use a more general diagramming skill
- object discovery before an ERD → sf-metadata
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
sequenceDiagramfor time-ordered interactions - use
flowchart LRfor ERDs and capability maps - keep a single primary story per diagram when possible
2. Gather data
For ERDs and grounded diagrams:
- use sf-metadata 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
autonumberwhen 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
| Need | Delegate to | Reason |
|---|---|---|
| real object / field definitions | sf-metadata | grounded ERD generation |
| rendered diagram / image output | sf-diagram-nanobananapro | visual polish beyond Mermaid |
| connected-app auth setup context | sf-connected-apps | accurate OAuth flows |
| Agentforce logic visualization | sf-ai-agentscript | source-of-truth behavior details |
| Flow behavior diagrams | sf-flow | actual Flow logic grounding |
Reference Map
Start here
- references/diagram-conventions.md
- references/mermaid-reference.md
- references/usage-examples.md
Styling / ERD specifics
- references/mermaid-styling.md
- references/color-palette.md
- references/erd-conventions.md
Preview
- references/preview-guide.md
- scripts/mermaid_preview.py
- scripts/query-org-metadata.py
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 |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
sf-integration
Salesforce integration architecture with 120-point scoring. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use sf-connected-apps), Apex-only logic (use sf-apex), or data import/export (use sf-data).
sf-deploy
Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex/LWC code (use sf-apex/sf-lwc), creating metadata XML (use sf-metadata), or querying org data (use sf-data).
sf-industry-commoncore-omnistudio-analyze
Cross-cutting OmniStudio analysis skill for namespace detection, dependency visualization, and impact analysis across OmniScripts, FlexCards, Integration Procedures, and Data Mappers. TRIGGER when: user asks about OmniStudio dependencies, wants namespace detection (Core vs vlocity_cmt vs vlocity_ins), needs impact analysis, or requests dependency diagrams. DO NOT TRIGGER when: authoring OmniScripts (use sf-industry-commoncore-omniscript), building FlexCards (use sf-industry-commoncore-flexcard), creating Integration Procedures (use sf-industry-commoncore-integration-procedure), or configuring Data Mappers (use sf-industry-commoncore-datamapper).
sf-industry-commoncore-callable-apex
Salesforce Industries Common Core (OmniStudio/Vlocity) Apex callable generation and review with 120-point scoring. TRIGGER when: user creates or reviews System.Callable classes, migrates `VlocityOpenInterface` / `VlocityOpenInterface2`, or builds Industries callable extensions used by OmniStudio, Integration Procedures, or DataRaptors. DO NOT TRIGGER when: generic Apex classes/triggers (use sf-apex), building Integration Procedures (use sf-industry-commoncore-integration-procedure), authoring OmniScripts (use sf-industry-commoncore-omniscript), configuring Data Mappers (use sf-industry-commoncore-datamapper), or analyzing namespace/dependency issues (use sf-industry-commoncore-omnistudio-analyze).
sf-datacloud-act
Salesforce Data Cloud Act phase. TRIGGER when: user manages activations, activation targets, data actions, or downstream delivery of Data Cloud audiences and data. DO NOT TRIGGER when: the task is segment creation (use sf-datacloud-segment), data retrieval/search work (use sf-datacloud-retrieve), or STDM/session tracing (use sf-ai-agentforce-observability).
sf-datacloud
Salesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
Didn't find tool you were looking for?