forcedotcom/sf-skills / skills/external-diagram-mermaid-generate
external-diagram-mermaid-generate
UnverifiedSalesforce 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 asks about non-Salesforce systems.
README.md
View on GitHub# external-diagram-mermaid-generate
> Salesforce architecture diagram generation using Mermaid syntax with ASCII fallback
## Overview
`external-diagram-mermaid-generate` is a Salesforce architecture diagram skill that generates professional diagrams using Mermaid syntax with ASCII art fallback for terminal compatibility.
## Features
- **OAuth Flows** - Authorization Code, PKCE, JWT Bearer, Client Credentials, Device Flow
- **Data Models** - ERD diagrams with platform-custom-object-generate integration
- **Integrations** - Sequence diagrams for API patterns
- **Architecture** - System landscape overviews
- **Role Hierarchies** - Security model visualization
- **Agentforce** - Agent topic and action flows
- **Accessible** - Color-blind friendly palette
- **Terminal Friendly** - ASCII fallback for all diagrams
## Quick Start
```text
# Generate an OAuth diagram
"Create a JWT Bearer OAuth flow diagram"
# Generate a data model
"Create an ERD for Account, Contact, and Opportunity"
# Generate an integration diagram
"Diagram our Salesforce to SAP sync flow"
```
## Diagram Types
| Type | Template | Use Case |
|------|----------|----------|
| Authorization Code | `oauth/authorization-code.md` | Web apps with backends |
| PKCE Flow | `oauth/authorization-code-pkce.md` | Mobile/SPA apps |
| JWT Bearer | `oauth/jwt-bearer.md` | Server-to-server, CI/CD |
| Client Credentials | `oauth/client-credentials.md` | Service accounts |
| Device Flow | `oauth/device-authorization.md` | CLI tools, IoT |
| Refresh Token | `oauth/refresh-token.md` | Token renewal |
| Data Model | `datamodel/salesforce-erd.md` | Object relationships |
| Integration | `integration/api-sequence.md` | API callout patterns |
| Architecture | `architecture/system-landscape.md` | System overview |
| Role Hierarchy | `role-hierarchy/user-hierarchy.md` | Security model |
| Agentforce | `agentforce/agent-flow.md` | AI agent architecture |
## Scoring System (80 Points)
| Category | Points | Criteria |
|----------|--------|----------|
| Accuracy | 20 | Correct actors, flow steps, relationships |
| Clarity | 20 | Readable labels, logical layout |
| Completeness | 15 | All key elements included |
| Styling | 15 | Color scheme, theming, annotations |
| Best Practices | 10 | Proper notation, UML conventions |
## Color Palette
Tailwind-inspired pastel colors with dark borders (see [references/color-palette.md](references/color-palette.md)):
| Component | Fill (200) | Stroke (700+) |
|-----------|------------|---------------|
| AI & Agents | `#fbcfe8` | `#be185d` |
| Integration | `#fed7aa` | `#c2410c` |
| Development | `#ddd6fe` | `#6d28d9` |
| Metadata | `#a5f3fc` | `#0e7490` |
| Data | `#fde68a` | `#b45309` |
| Deploy | `#a7f3d0` | `#047857` |
## Example Output
### Mermaid Diagram
```mermaid
sequenceDiagram
autonumber
participant A as Server
participant SF as Salesforce
A->>A: Create JWT
A->>SF: POST /token (JWT)
SF->>SF: Validate Signature
SF->>A: Access Token
```
### ASCII Fallback
```text
┌───────────────┐ ┌───────────────┐
│ Server │ │ Salesforce │
└───────┬───────┘ └───────┬───────┘
│ 1. Create JWT │
│ 2. POST /token │
│────────────────────>│
│ │
│ 3. Validate JWT │
│ │
│ 4. Access Token │
│<────────────────────│
```
## Cross-Skill Integration
| Skill | Integration |
|-------|-------------|
| platform-custom-object-generate / platform-custom-field-generate | Auto-discover objects/fields for ERD |
| integration-connectivity-connected-app-configure | Link OAuth flows to app setup |
| agentforce-generate | Visualize agent architecture |
## Documentation
- [Color Palette](references/color-palette.md) - Styling guide
- [Mermaid Reference](references/mermaid-reference.md) - Syntax quick reference
- [Diagram Conventions](references/diagram-conventions.md) - Consistency rules
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |