PluginBench
Skill
Pass
Audit score 90

generating-mermaid-diagrams

forcedotcom/sf-skills

How to install generating-mermaid-diagrams

npx skills add https://github.com/forcedotcom/sf-skills --skill generating-mermaid-diagrams
Claude Code
Cursor
Windsurf
Cline
Full instructions (SKILL.md)

Source of truth, from forcedotcom/sf-skills.


name: generating-mermaid-diagrams 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 wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems." compatibility: "Requires Mermaid-capable renderer for diagram previews" metadata: version: "1.0"

generating-mermaid-diagrams: 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 generating-mermaid-diagrams 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:


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:

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 definitionsgenerating-custom-object / generating-custom-fieldgrounded ERD generation
rendered diagram / image outputgenerating-visual-diagramsvisual polish beyond Mermaid
connected-app auth setup contextconfiguring-connected-appsaccurate OAuth flows
Agentforce logic visualizationdeveloping-agentforcesource-of-truth behavior details
Flow behavior diagramsgenerating-flowactual Flow logic grounding

Gotchas

IssueResolution
Mermaid renderer not availableProvide ASCII fallback automatically; note that the Mermaid block still carries the diagram for copy-paste into a renderer
ERD becomes unreadable with too many objectsSplit into sub-diagrams by domain (Sales, Service, etc.) and link them in prose
Sequence diagram step order unclearUse autonumber directive to make step ordering explicit
OAuth flow actors differ by grant typeRead the relevant asset template first before generating to avoid actor mismatch

Reference File Index

Conventions & rules — read before generating

Styling

Preview

OAuth flow templates — load the matching template when generating OAuth diagrams

Data model ERD templates — load the matching template when generating ERDs

Other diagram templates


Output Expectations

Deliverables produced by this skill for each request:

  • Mermaid code block — fenced ```mermaid block ready to paste into GitHub, Confluence, or any Mermaid-capable renderer
  • ASCII fallback (when requested or when Mermaid renderer is unavailable) — text-only diagram using box/arrow characters
  • Brief explanation — 2-5 bullet points calling out key relationships, flow direction, and any assumptions or limitations in the diagram
  • For ERDs: object cards with field labels and relationship type annotations
  • For sequence diagrams: numbered steps (autonumber) with clear actor labels

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

Related skills

More from forcedotcom/sf-skills and the wider catalog.

GE

generating-apex

forcedotcom/sf-skills

Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.

2.6k installsAudited
GE

generating-apex-test

forcedotcom/sf-skills

Generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking strategies, assertion best practices, and disciplined test-fix loops. Use this skill when creating new Apex test classes, improving test coverage, debugging and fixing failing Apex tests, running test execution and coverage analysis, or implementing testing patterns for triggers, services, controllers, batch jobs, queueables, and integrations. Triggers on *Test.cls, *_Test.cls files, sf apex run test workflows, coverage reports, test-fix loops. Do NOT trigger for production Apex code (use generating-apex) or Jest/LWC tests.

2.6k installsAudited
GE

generating-lwc-components

forcedotcom/sf-skills

Lightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.

2.6k installsAudited
GE

generating-flow

forcedotcom/sf-skills

Generate Salesforce Flows using the MCP tool execute_metadata_action. Use when the user asks to create, build, or generate a flow — including Screen, Autolaunched, Record-Triggered (before/after-save), Scheduled. Also trigger for flow-like requests such as \"when a record is created\", \"trigger daily at\", \"send an email when\", \"update the field when\", \"automate\", \"workflow\", or \"flow XML/metadata\". This is the only skill for Salesforce Flow generation.

2.5k installsAudited
QU

querying-soql

forcedotcom/sf-skills

SOQL query generation, optimization, and analysis with 100-point scoring. Use this skill when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan analysis, and performance or safety improvements for Salesforce queries. TRIGGER when: user writes, optimizes, or debugs SOQL/SOSL queries, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER when: bulk data operations (use handling-sf-data), Apex DML logic (use generating-apex), or report/dashboard queries.

2.5k installsAudited
GE

generating-custom-object

forcedotcom/sf-skills

Use this skill when users need to create, generate, or validate Salesforce Custom Object metadata. Trigger when users mention custom objects, creating objects, object metadata, .object files, sharing models, name fields, or validation rules on objects. Also use when users say things like \"create a custom object\", \"generate object metadata\", \"set up an object for...\", or when they're troubleshooting object deployment errors especially around sharing models and Master-Detail relationships. Always use this skill for any custom object metadata work.

2.5k installsAudited