mermaid
Create validated Mermaid diagrams (sequence, architecture, flowchart) with automatic syntax checking and self-healing. Use when users request diagrams, visualizations of API flows, system architecture, or process documentation. All diagrams are validated with mermaid-cli before delivery.
What this skill does
# Mermaid Diagrams
Create professional diagrams using Mermaid syntax for documentation, design discussions, and system architecture planning. This skill covers three primary diagram types:
- **Sequence Diagrams**: Show temporal interactions and message flows between actors, services, or processes
- **Architecture Diagrams**: Visualize relationships between services and resources in cloud or CI/CD deployments
- **Flowchart Diagrams**: Illustrate processes, decision trees, algorithms, and workflow logic
## ๐ Automatic Validation Workflow
**IMPORTANT**: All diagrams generated by this skill are automatically validated with mermaid-cli. This ensures error-free diagrams that render correctly every time.
### Mandatory Workflow Steps
When creating diagrams, ALWAYS follow this exact workflow:
1. **Generate Diagram Content** (based on user requirements)
2. **AUTOMATICALLY VALIDATE** using mermaid-cli (mandatory step)
3. **APPLY SELF-HEALING FIXES** if validation fails (automatic)
4. **CONFIRM VALIDATION SUCCESS** before presenting to user
5. **DELIVER VALIDATED DIAGRAM** to user
**NEVER skip validation or present unvalidated diagrams to users.**
## Sequence Diagrams
Sequence diagrams are interaction diagrams that show how processes operate with one another and in what order. They visualize temporal interactions between participants, making them ideal for documenting API flows, system integrations, user interactions, and distributed system communications.
### Quick Instructions
1. Define participants: Use `actor` (humans) or `participant` with type attributes
2. Add messages: `->>` (sync), `-->>` (response), `-)` (async)
3. Show activations: Append `+`/`-` to arrows (`A->>+B`, `B-->>-A`)
4. Control structures: `alt`/`else`, `loop`, `par`, `critical` for complex flows
**โ For detailed syntax, see [references/sequence-diagrams.md](references/sequence-diagrams.md)**
### ๐ Automatic Validation Process
After generating any sequence diagram, you MUST:
1. **Create temp files:**
```bash
echo "YOUR_SEQUENCE_DIAGRAM_HERE" > /tmp/mermaid_validate.mmd
```
2. **Run enhanced validation (your bash script approach):**
```bash
mmdc -i /tmp/mermaid_validate.mmd -o /tmp/mermaid_validate.svg 2>/tmp/mermaid_validate.err
rc=$?
if [ $rc -ne 0 ]; then
echo "๐ mmdc failed (exit code $rc)."; cat /tmp/mermaid_validate.err; exit 1
fi
# Check SVG for error markers that mmdc might miss
if grep -q -i 'Syntax error in graph\|mermaidError\|errorText\|Parse error' /tmp/mermaid_validate.svg; then
echo "๐ Mermaid syntax error found in output SVG"
exit 1
fi
# Verify SVG actually contains diagram content (not just error text)
if ! grep -q '<svg.*width.*height' /tmp/mermaid_validate.svg; then
echo "๐ SVG output appears invalid or empty"
exit 1
fi
echo "โ
Diagram appears valid"
```
3. **If validation fails, apply fixes:**
- Check participant syntax: ensure `participant` or `actor` keywords used correctly
- Verify arrow syntax: `->>`, `-->>`, `-)` patterns are correct
- Validate control structures: `alt`, `loop`, `par` blocks are properly closed
- Review error details in `/tmp/mermaid_validate.err` for specific issues
4. **Re-validate until successful:** (repeat step 2)
5. **Cleanup and confirm:**
```bash
rm -f /tmp/mermaid_validate.mmd /tmp/mermaid_validate.svg /tmp/mermaid_validate.err
```
**VALIDATION MUST PASS BEFORE PRESENTING TO USER!**
### โ ๏ธ CRITICAL: Key Syntax Differences
**NEVER MIX THESE SYNTAXES!** Each diagram type has completely different keywords. Mixing them will break your diagram.
**Sequence Diagrams:**
```mermaid
sequenceDiagram
actor User
participant API@{ "type": "control" }
participant DB@{ "type": "database" }
```
- Use `actor` for humans (stick figure icon)
- Use `participant` with type attributes for systems
- โ Use: `participant`, `actor`
- โ NEVER use: `service`, `database`, `group`
**Architecture Diagrams:**
```mermaid
architecture-beta
service api(server)[API]
database db(database)[Database]
group backend(cloud)[Backend]
```
- Use `service` for components
- Use `database` as a keyword (NOT participant!)
- Use `group` for organizing services
- โ Use: `service`, `database`, `group`
- โ NEVER use: `participant`, `actor`
### Minimal Example
```mermaid
sequenceDiagram
actor User
participant API@{ "type": "control" }
participant DB@{ "type": "database" }
User->>+API: Request data
API->>+DB: Query
DB-->>-API: Result
API-->>-User: Response
```
### Guidelines
- Limit to 5-7 participants per diagram for clarity
- Use activations (`+`/`-`) to show processing periods
- Apply control structures (`alt`, `loop`, `par`) for complex flows
**โ See [references/sequence-diagrams.md](references/sequence-diagrams.md) for detailed patterns and best practices**
---
## Architecture Diagrams
Architecture diagrams show relationships between services and resources commonly found within cloud or CI/CD deployments. Services (nodes) are connected by edges, and related services can be placed within groups to illustrate organization.
### Quick Instructions
1. Start with `architecture-beta` keyword
2. Define groups: `group {id}({icon})[{label}]`
3. Add services: `service {id}({icon})[{label}] in {group}`
4. Connect edges: `{id}:{T|B|L|R} -- {T|B|L|R}:{id}`
5. Add arrows: `-->` (single) or `<-->` (bidirectional)
**CRITICAL Syntax Rules:**
- **IDs**: Use simple alphanumeric (e.g., `api`, `db1`, `auth_service`) - NO spaces or special chars
- **Labels**: AVOID special characters that break parsing:
- โ NO hyphens (`Gen-AI`, `Cross-Account`)
- โ NO colons (`AWS Account: prod`)
- โ NO special punctuation
- โ Use spaces: `[Gen AI]` instead of `[Gen-AI]`
- โ Use simple words: `[Cross Account IAM Role]` instead of `[Cross-Account IAM Role]`
**Default icons**: `cloud`, `database`, `disk`, `internet`, `server`
**โ For extended icons and advanced features, see [references/architecture-diagrams.md](references/architecture-diagrams.md)**
### ๐ Automatic Validation Process
After generating any architecture diagram, you MUST:
1. **Create temp files:**
```bash
echo "YOUR_ARCHITECTURE_DIAGRAM_HERE" > /tmp/mermaid_validate.mmd
```
2. **Run enhanced validation (your bash script approach):**
```bash
mmdc -i /tmp/mermaid_validate.mmd -o /tmp/mermaid_validate.svg 2>/tmp/mermaid_validate.err
rc=$?
if [ $rc -ne 0 ]; then
echo "๐ mmdc failed (exit code $rc)."; cat /tmp/mermaid_validate.err; exit 1
fi
# Check SVG for error markers that mmdc might miss
if grep -q -i 'Syntax error in graph\|mermaidError\|errorText\|Parse error' /tmp/mermaid_validate.svg; then
echo "๐ Mermaid syntax error found in output SVG"
exit 1
fi
# Verify SVG actually contains diagram content (not just error text)
if ! grep -q '<svg.*width.*height' /tmp/mermaid_validate.svg; then
echo "๐ SVG output appears invalid or empty"
exit 1
fi
echo "โ
Diagram appears valid"
```
3. **If validation fails, apply automatic fixes:**
- **Fix hyphens in labels**: `[Gen-AI]` โ `[Gen AI]`
- **Remove colons**: `[API:prod]` โ `[API Prod]`
- **Remove special characters**: keep only alphanumeric, spaces, underscores
- **Fix IDs**: ensure no spaces in service/group IDs (use underscores)
- Review error details in `/tmp/mermaid_validate.err` for specific issues
4. **Re-validate until successful:** (repeat step 2)
5. **Cleanup and confirm:**
```bash
rm -f /tmp/mermaid_validate.mmd /tmp/mermaid_validate.svg /tmp/mermaid_validate.err
```
**VALIDATION MUST PASS BEFORE PRESENTING TO USER!**
### Minimal Example
```mermaid
architecture-beta
group stg_aitools(cloud)[AWS Stg AI Tools]
group stg_genai(cloud)[AWS Stg Gen AI]
service litellm(server)[LiteLLM Service] in stg_aitools
service rds(database)[RDS PostgreSQL] in stg_aitools
service redis(disk)[Redis Cache]Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only โ no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.