基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tools-only/X-Skills --skill mermaid-generator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Index of Build Systems Skills
Coordination patterns for distributed dataflow systems including barriers, epochs, and distributed snapshots
Windowing, sessionization, time-series aggregation, and late data handling for streaming systems
| name | mermaid-generator |
| description | This skill generates interactive workflow diagrams using the Mermaid JavaScript library |
Generate simple minimalist but colorful interactive workflow diagrams using Mermaid.js for intelligent textbooks. Creates complete MicroSim packages with standalone HTML files, MkDocs integration, and Dublin Core metadata. Each diagram features colorful node backgrounds, 16-point fonts for optimal readability, and follows the educational MicroSim pattern.
Because this skill is part of the workflow for creation of textbooks using mkdocs, the design goal is to create simple unadorned diagrams without any complex padding, borders or decoration. This is because our focus is to educate, not entertain and show off our ability to do rounded corners and gradient shading.
Use the mermaid-generator skill when users request:
Example user requests:
Analyze the user's description to extract:
If the description is incomplete or unclear, prompt the user for additional information:
To create an accurate workflow diagram, I need more information:
1. What are the main steps in this process?
2. Are there any decision points where the flow branches?
3. What happens in success vs. error scenarios?
4. Should this flow top-down or left-right?
Required information before proceeding:
Consult references/mermaid-flowchart-syntax.md for detailed syntax guidance.
Design decisions:
Choose node shapes based on purpose:
("Label") for start/end["Label"] for process steps{"Decision?"} for decision points(("Label")) for connectorsSelect color palette from reference guide:
Define style classes for consistent theming:
classDef startNode fill:#667eea,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef processNode fill:#764ba2,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef decisionNode fill:#f093fb,stroke:#333,stroke-width:2px,color:#333,font-size:16px
Ensure 16pt fonts for all nodes and edge labels:
font-size:16px in all classDef declarationslinkStyle default font-size:16pxUse top-down direction unless user specifies otherwise:
flowchart TD
Example Mermaid code structure:
flowchart TD
Start("Start Process"):::startNode
Step1["Gather Input"]:::processNode
Decision{"Valid Input?"}:::decisionNode
Step2["Process Data"]:::processNode
Success("Success"):::successNode
Error("Error - Retry"):::errorNode
Start --> Step1 --> Decision
Decision -->|Yes| Step2 --> Success
Decision -->|No| Error --> Step1
classDef startNode fill:#667eea,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef processNode fill:#764ba2,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef decisionNode fill:#f093fb,stroke:#333,stroke-width:2px,color:#333,font-size:16px
classDef successNode fill:#4facfe,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef errorNode fill:#fa709a,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
linkStyle default stroke:#999,stroke-width:2px,font-size:16px
Create the diagram directory following the MicroSim pattern:
mkdir -p /docs/sims/[diagram-name]
Naming convention:
software-lifecycle, scientific-method, network-troubleshootingUse the template files in assets/template/ as a starting point. Replace placeholders with actual content:
Copy assets/template/main.html and replace these placeholders:
{{TITLE}}: Diagram title (e.g., "Software Development Lifecycle"){{SUBTITLE}}: Brief subtitle (e.g., "Interactive Workflow Diagram"){{MERMAID_CODE}}: The complete Mermaid flowchart code (from Step 2){{DESCRIPTION}}: 2-3 sentence explanation of the diagramImportant: Ensure proper indentation of the Mermaid code within the <div class="mermaid"> tag.
Copy assets/template/style.css directly - no modifications needed unless custom styling is requested.
The default stylesheet ensures:
Copy assets/template/script.js directly. This provides:
Copy assets/template/index.md and replace placeholders:
{{TITLE}}: Same as main.html title{{OVERVIEW}}: 1-paragraph overview of the workflow{{DESCRIPTION}}: Detailed description of the process{{WORKFLOW_STEPS}}: Bulleted list of main steps:
1. **Step Name** - Description of what happens
2. **Decision Point** - What decision is being made
3. **Final Step** - How the process concludes
{{KEY_CONCEPTS}}: Bulleted list of educational concepts illustrated{{RELATED_CONCEPTS}}: Links to related textbook sections or conceptsCopy assets/template/metadata.json and replace placeholders:
{{TITLE}}: Diagram title{{DESCRIPTION}}: Brief description{{SUBJECT}}: Educational subject area (e.g., "Computer Science", "Biology"){{DATE}}: Current date in ISO format (YYYY-MM-DD){{COVERAGE}}: Scope of content (e.g., "Introductory", "Advanced"){{AUDIENCE}}: Target audience (e.g., "High School", "Undergraduate"){{NODE_COUNT}}: Number of nodes in diagram{{EDGE_COUNT}}: Number of edges/arrows in diagram{{CONCEPTS_LIST}}: JSON array of concept labels (e.g., "Algorithm Design", "Data Validation"){{BLOOM_LEVEL}}: Highest Bloom's Taxonomy level addressed (e.g., "Understand", "Apply", "Analyze")Example metadata.json:
{
"title": "Software Development Lifecycle",
"description": "Interactive workflow diagram showing the phases of software development from planning through deployment",
"subject": "Computer Science",
"creator": "Claude AI with Mermaid Generator Skill",
"date": "2025-11-06",
"type": "Interactive Workflow Diagram",
"format": "text/html",
"language": "en-US",
"coverage": "Introductory",
"rights": "CC BY-NC-SA 4.0",
"audience": "Undergraduate",
"diagram_type": "flowchart",
"direction": "TD",
"node_count":
Add the new diagram to the textbook's navigation in mkdocs.yml:
nav:
- Visualizations:
- Software Lifecycle: sims/software-lifecycle/index.md
Or integrate into relevant chapter navigation:
nav:
- Chapter 3 - Software Engineering:
- Introduction: chapters/03/index.md
- Lifecycle Diagram: sims/software-lifecycle/index.md
Perform quality checks:
{{PLACEHOLDERS}} remainTest the diagram:
cd /docs
mkdocs serve
# Navigate to http://localhost:8000/sims/[diagram-name]/
Open main.html directly in browser to test standalone functionality.
Provide a summary of what was created:
Created interactive Mermaid workflow diagram: [Diagram Name]
Location: /docs/sims/[diagram-name]/
Files generated:
✓ main.html - Standalone interactive diagram
✓ index.md - MkDocs integration page
✓ style.css - Responsive styling
✓ script.js - Interactive features (zoom, export)
✓ metadata.json - Dublin Core metadata
Features:
• Top-down flowchart layout
• Colorful node backgrounds for visual clarity
• 16-point fonts for optimal readability
• [X] nodes and [Y] edges
• Zoom controls and SVG export
The diagram illustrates: [brief description]
To view:
1. Standalone: Open /docs/sims/[diagram-name]/main.html
2. In textbook: Run `mkdocs serve` and navigate to the page
Next steps:
- Add navigation link in mkdocs.yml
- Reference from relevant chapter content
- Consider creating related diagrams for connected concepts
Linear Process Flow:
Start → Step 1 → Step 2 → Step 3 → End
Decision Tree:
Start → Decision 1 (Yes/No)
├─ Yes → Action A → End
└─ No → Decision 2 (Yes/No)
├─ Yes → Action B → End
└─ No → Action C → End
Loop/Iteration:
Start → Initialize → Process → Check Complete?
├─ No → Process (loop back)
└─ Yes → End
Error Handling:
Start → Try Action → Success?
├─ Yes → Continue → End
└─ No → Error Handler → Retry or Exit
Issue: Mermaid code doesn't render
flowchart TD directive is first lineIssue: Fonts not 16px
font-size:16px in all classDef declarationslinkStyle default font-size:16px is present.mermaid .node text stylingIssue: Colors not showing
:::className syntax on nodesIssue: Diagram too large/small
Issue: Labels cut off or truncated
A["Text **bold**"]references/mermaid-flowchart-syntax.md: Comprehensive Mermaid syntax guide with examples, node shapes, styling options, and color palettesassets/template/main.html: Standalone HTML diagram templateassets/template/style.css: Responsive stylesheet with 16px fontsassets/template/script.js: Interactive features (zoom, export, tracking)assets/template/index.md: MkDocs integration templateassets/template/metadata.json: Dublin Core metadata templateUser Request: "Create a diagram showing the steps of making coffee"
Generated Mermaid Code:
flowchart TD
Start("Start"):::startNode
Step1["Boil Water"]:::processNode
Step2["Grind Coffee Beans"]:::processNode
Step3["Add Coffee to Filter"]:::processNode
Step4["Pour Hot Water"]:::processNode
Step5["Wait 4 Minutes"]:::processNode
End("Enjoy Coffee!"):::endNode
Start --> Step1 --> Step2 --> Step3 --> Step4 --> Step5 --> End
classDef startNode fill:#4ecdc4,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef processNode fill:#95e1d3,stroke:#333,stroke-width:2px,color:#333,font-size:16px
classDef endNode fill:#6c5ce7,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
linkStyle default stroke:#999,stroke-width:2px,font-size:16px
User Request: "Create a flowchart for troubleshooting a computer that won't start"
Generated Mermaid Code:
flowchart TD
Start("Computer Won't Start"):::startNode
Check1{"Is it plugged in?"}:::decisionNode
Fix1["Plug in power cable"]:::processNode
Check2{"Does it have power?"}:::decisionNode
Check3{"Do you hear beeps?"}:::decisionNode
Fix2["Check power supply"]:::processNode
Fix3["Check RAM seating"]:::processNode
Fix4["Call technician"]:::processNode
Success("Computer Started!"):::successNode
Start --> Check1
Check1 -->|No| Fix1 --> Check2
Check1 -->|Yes| Check2
Check2 -->|No| Fix2 --> Success
Check2 -->|Yes| Check3
Check3 -->|Yes| Fix3 --> Success
Check3 -->|No| Fix4
classDef startNode fill:#667eea,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef processNode fill:#764ba2,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef decisionNode fill:#f093fb,stroke:#333,stroke-width:2px,color:#333,font-size:16px
classDef successNode fill:#4facfe,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
linkStyle default stroke:#999,stroke-width:2px,font-size:16px
User Request: "Visualize a simple search algorithm"
Generated Mermaid Code:
flowchart TD
Start("Start Search"):::startNode
Input["Get search target"]:::processNode
Init["Set index = 0"]:::processNode
Loop["Check array[index]"]:::processNode
Match{"Match found?"}:::decisionNode
End{"More items?"}:::decisionNode
Increment["index = index + 1"]:::processNode
Success("Return index"):::successNode
Fail("Return -1"):::errorNode
Start --> Input --> Init --> Loop --> Match
Match -->|Yes| Success
Match -->|No| End
End -->|Yes| Increment --> Loop
End -->|No| Fail
classDef startNode fill:#0083b0,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef processNode fill:#00b4d8,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef decisionNode fill:#90e0ef,stroke:#333,stroke-width:2px,color:#333,font-size:16px
classDef successNode fill:#48cae4,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
classDef errorNode fill:#0077b6,stroke:#333,stroke-width:2px,color:#fff,font-size:16px
linkStyle default stroke:#999,stroke-width:2px,font-size:16px
This skill works well with other intelligent textbook skills:
v1.0 - Initial release