PluginBench
Skill
Review
Audit score 70

sf-diagram-mermaid

jaganpro/sf-skills

Generate Salesforce architecture diagrams in Mermaid with ASCII fallback for docs and terminals.

What is sf-diagram-mermaid?

Creates text-based diagrams (Mermaid and ASCII) for Salesforce systems: OAuth flows, ERDs, integration sequences, and architecture visualizations. Use this when you need diagrams that live in markdown, READMEs, or issues—not rendered images.

  • Generate Mermaid diagrams for OAuth flows, ERDs, sequence diagrams, and system architecture
  • Provide ASCII fallback versions for terminal and plaintext documentation compatibility
  • Support flowchart, sequence diagram, and ERD layouts optimized for Salesforce patterns
  • Integrate with sf-metadata for grounded object discovery and relationship mapping
  • Output diagrams ready to embed directly in markdown and version control

How to install sf-diagram-mermaid

npx skills add https://github.com/jaganpro/sf-skills --skill sf-diagram-mermaid
Prerequisites
  • Mermaid-capable renderer for diagram previews (GitHub, GitLab, Notion, or local Mermaid viewer)
  • Optional: sf-metadata skill for grounded ERD generation from actual org schema
Claude Code
Cursor
Windsurf
Cline

How to use sf-diagram-mermaid

  1. 1.Specify the diagram type needed (sequence, flowchart, ERD, or architecture)
  2. 2.Provide scope and entities involved, or let the skill infer from context
  3. 3.Request output preference: Mermaid only, ASCII only, or both
  4. 4.Review the generated diagram and ask for refinements (layout, styling, detail level)
  5. 5.Copy the Mermaid or ASCII output into your documentation or markdown file

Use cases

Good for
  • Document Salesforce OAuth authorization flows (Authorization Code, JWT, PKCE, Device Flow)
  • Visualize data models and object relationships with ERDs
  • Map integration sequences and event choreography between systems
  • Show Agentforce agent-to-topic-to-action behavior hierarchies
  • Create role and permission hierarchy diagrams for access control documentation
Who it's for
  • Salesforce architects designing system landscapes
  • Integration engineers documenting OAuth and API flows
  • Data modelers creating entity-relationship diagrams
  • Technical writers embedding diagrams in documentation
  • Developers building Agentforce agents and automation

sf-diagram-mermaid FAQ

When should I use this instead of sf-diagram-nanobananapro?

Use sf-diagram-mermaid for text-based diagrams that live in docs, READMEs, and version control. Use sf-diagram-nanobananapro when you need rendered PNG/SVG images or polished visual mockups.

Can this skill generate diagrams from my actual Salesforce org?

Yes, when you use it together with sf-metadata to discover real objects and relationships. The skill can then ground the ERD in your actual schema.

What if my diagram is too complex for a single view?

Break it into multiple focused diagrams, each with a single primary story. The skill recommends keeping scope tight for readability.

Do I need Mermaid installed locally?

No. Mermaid diagrams render natively in GitHub, GitLab, and many markdown viewers. For local preview, use the included mermaid_preview.py script.

Can I customize colors and styling?

Yes. The skill supports Mermaid styling and includes a color-palette reference. Styling is kept minimal by default for documentation-first clarity.

Full instructions (SKILL.md)

Source of truth, from jaganpro/sf-skills.


name: sf-diagram-mermaid description: > 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. license: MIT compatibility: "Requires Mermaid-capable renderer for diagram previews" metadata: version: "1.2.0" author: "Jag Valaiyapathy" scoring: "80 points across 5 categories"

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