mcpField
S
sf-diagram-mermaid

sf-diagram-mermaid

github.com/jaganproDevelopment4241.4k installsUpdated 26w ago
Repository

About sf-diagram-mermaid

sf-diagram-mermaid is a skill for generating text-based diagrams for Salesforce systems and workflows. It produces Mermaid diagrams for documentation and can provide an ASCII alternative when plaintext compatibility is needed.

Key features

  1. 01Generate Mermaid diagrams
  2. 02Create ASCII fallback diagrams
  3. 03Support sequence, flowchart, and ERD views
  4. 04Visualize OAuth and integration flows
  5. 05Map Agentforce behavior

Use cases

  1. 01Document an OAuth authorization sequence
  2. 02Show Salesforce object relationships
  3. 03Explain an integration or Agentforce flow

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jaganpro/sf-skills --skill sf-diagram-mermaid

After installing, type/sf-diagram-mermaidin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

CREDITS.md
README.md
assets/agentforce/
agent-flow.md
assets/architecture/
system-landscape.md
assets/datamodel/
b2b-commerce-erd.md
campaigns-erd.md
consent-erd.md
files-erd.md
forecasting-erd.md
fsl-erd.md
party-model-erd.md
quote-order-erd.md
revenue-cloud-erd.md
sales-cloud-erd.md
salesforce-erd.md
scheduler-erd.md
service-cloud-erd.md
territory-management-erd.md
assets/integration/
api-sequence.md
assets/oauth/
authorization-code-pkce.md
authorization-code.md
client-credentials.md
device-authorization.md
jwt-bearer.md
refresh-token.md
user-agent-social-sign-on.md
assets/role-hierarchy/
user-hierarchy.md
references/
color-palette.md
diagram-conventions.md
erd-conventions.md

Details

From the project README

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

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:

  • 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 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 definitionssf-metadatagrounded ERD generation
rendered diagram / image outputsf-diagram-nanobananaprovisual polish beyond Mermaid
connected-app auth setup contextsf-connected-appsaccurate OAuth flows
Agentforce logic visualizationsf-ai-agentscriptsource-of-truth behavior details
Flow behavior diagramssf-flowactual Flow logic grounding

Reference Map

Start here
Styling / ERD specifics
Preview

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

Comments

Markdown supported