Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Design complex multi-diagram architectures using advanced Mermaid syntax
.claude/skills/brycewang-stanford-mermaid-architect-guide/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 81% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 60% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 46% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 31% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 121% | 0% |
Design complex, multi-view system architectures and research infrastructure diagrams using advanced Mermaid features including C4 diagrams, hand-drawn rendering mode, subgraph nesting, and theme customization.
While basic Mermaid flowcharts are widely known, Mermaid's advanced capabilities enable sophisticated architectural documentation that rivals dedicated tools like Structurizr or Draw.io. This skill focuses on the architectural use cases that matter most to research teams: depicting multi-layer systems, data pipelines, deployment topologies, and complex experimental workflows.
Mermaid v11+ introduced a hand-drawn rendering mode (via the handDrawn look) that produces a sketch-like aesthetic similar to Excalidraw but with the convenience of text-based Markdown embedding. This makes it ideal for research proposals and informal documentation where a polished diagram would feel premature.
Research software systems often involve intricate interactions between data sources, processing pipelines, ML models, and visualization layers. The C4 model support in Mermaid allows teams to document these systems at multiple levels of abstraction -- from high-level context diagrams down to detailed component views -- all in version-controlled Markdown files.
Enable the sketchy, informal rendering style:
mermaid--- config: look: handDrawn theme: neutral --- flowchart LR A[Raw Data] --> B[Preprocessing] B --> C[Feature Engineering] C --> D[Model Training] D --> E[Evaluation] E -->|Poor| C E -->|Good| F[Deployment]
The handDrawn look applies rough.js-style rendering to all elements, giving them a natural sketched appearance. This is particularly useful for early-stage architecture discussions and research proposals.
mermaidC4Context title Research Platform - System Context Person(researcher, "Researcher", "Academic user conducting studies") Person(admin, "Platform Admin", "Manages skills and users") System(platform, "Wentor Platform", "AI-powered research assistant ecosystem") System_Ext(scholar, "OpenAlex", "Academic paper database") System_Ext(crossref, "CrossRef", "DOI resolution and metadata") System_Ext(github, "GitHub", "Code and skill repositories") Rel(researcher, platform, "Uses", "HTTPS") Rel(admin, platform, "Manages", "HTTPS") Rel(platform, scholar, "Queries papers", "REST API") Rel(platform, crossref, "Resolves DOIs", "REST API") Rel(platform, github, "Fetches skills", "REST API")
mermaidC4Container title Research Platform - Container View Person(researcher, "Researcher") Container_Boundary(platform, "Wentor Platform") { Container(web, "Web App", "React + UmiJS", "Browser-based UI") Container(api, "API Server", "FastAPI", "REST endpoints") Container(claw, "Research-Claw", "Node.js", "Local AI agent") ContainerDb(db, "Database", "PostgreSQL", "User data, skills, tokens") ContainerDb(cache, "Cache", "Redis", "Session and rate limit data") } System_Ext(llm, "LLM Provider", "Claude / GPT") Rel(researcher, web, "Browses", "HTTPS") Rel(researcher, claw, "Runs locally", "WS localhost") Rel(web, api, "Calls", "REST/JSON") Rel(api, db, "Reads/Writes", "SQL") Rel(api, cache, "Caches", "Redis protocol") Rel(claw, llm, "Sends prompts", "HTTPS")
mermaidflowchart TB subgraph ingestion ["Data Ingestion Layer"] direction LR A1[PubMed API] --> B1[Raw Store] A2[arXiv API] --> B1 A3[CrossRef API] --> B1 end subgraph processing ["Processing Pipeline"] direction LR C1[Text Extraction] --> C2[NER & Entity Linking] C2 --> C3[Citation Graph Construction] C3 --> C4[Embedding Generation] end subgraph serving ["Serving Layer"] direction LR D1[Search Index] --> D2[Recommendation Engine] D2 --> D3[REST API] end ingestion --> processing --> serving
mermaidflowchart TD Start([Begin Experiment]) --> Design[Study Design] Design --> IRB{IRB Approval?} IRB -->|Approved| Pilot[Pilot Study n=30] IRB -->|Revision needed| Design Pilot --> PilotCheck{Pilot Successful?} PilotCheck -->|Yes| FullStudy[Full Study n=300] PilotCheck -->|No| Redesign[Revise Protocol] Redesign --> Pilot FullStudy --> Analysis[Statistical Analysis] Analysis --> Results{Significant?} Results -->|p < 0.05| Write[Write Manuscript] Results -->|p >= 0.05| Explore[Exploratory Analysis] Explore --> Write Write --> Submit([Submit to Journal])
mermaidstateDiagram-v2 [*] --> Ideation Ideation --> ProposalDrafting : Concept validated state ProposalDrafting { [*] --> Writing Writing --> InternalReview InternalReview --> Writing : Revisions needed InternalReview --> Ready : Approved } ProposalDrafting --> Submitted : Submit to funder Submitted --> UnderReview : Acknowledged UnderReview --> Funded : Award UnderReview --> Rejected : Decline Rejected --> Ideation : Revise concept Funded --> Active : Project kickoff Active --> Reporting : Milestone due Reporting --> Active : Report accepted Active --> Completed : All deliverables met Completed --> [*]
mermaid%%{init: { 'theme': 'base', 'themeVariables': { 'primaryColor': '#1971c2', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#1864ab', 'lineColor': '#495057', 'secondaryColor': '#e03131', 'tertiaryColor': '#f8f9fa', 'fontFamily': 'Inter, sans-serif' } }}%% flowchart LR A[Input] --> B[Process] --> C[Output]
| Platform | Support | Notes | |----------|---------|-------| | GitHub Markdown | Native | Renders in README, issues, PRs | | GitLab | Native | Full Mermaid support | | Obsidian | Native | Real-time preview | | Notion | Via embed | Use mermaid.ink URL encoding | | LaTeX | Pre-render | Use mmdc CLI to export SVG/PDF | | Jupyter | Via plugin | mermaid-py or iframe rendering |
bash# Install Mermaid CLI npm install -g @mermaid-js/mermaid-cli # Render to SVG mmdc -i architecture.mmd -o architecture.svg -t neutral # Render with hand-drawn look mmdc -i architecture.mmd -o sketch.svg --configFile mermaid-config.json
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 40,804 | 36,296 | -11% | 1 | 1 | 0% | 1,960 | 2,865 | +46% | 0 | 0 | — |
case-02 | pass→pass | 16,249 | 12,497 | -23% | 1 | 1 | 0% | 2,824 | 3,697 | +31% | 0 | 0 | — |
case-03 | fail→pass | 12,077 | 14,684 | +22% | 1 | 1 | 0% | 2,233 | 4,040 | +81% | 0 | 0 | — |
case-04 | pass→pass | 8,138 | 4,908 | -40% | 1 | 1 | 0% | 1,215 | 2,685 | +121% | 0 | 0 | — |
case-05 | pass→pass | 9,883 | 8,661 | -12% | 1 | 1 | 0% | 1,876 | 3,408 | +82% | 0 | 0 | — |
case-06 | pass→pass | 41,328 | 9,492 | -77% | 1 | 1 | 0% | 1,795 | 3,231 | +80% | 0 | 0 | — |
case-07 | pass→pass | 12,684 | 9,283 | -27% | 1 | 1 | 0% | 2,213 | 3,402 | +54% | 0 | 0 | — |
case-08 | fail→pass | 10,471 | 5,681 | -46% | 1 | 1 | 0% | 1,703 | 2,722 | +60% | 0 | 0 | — |
case-09 | pass→pass | 13,264 | 11,952 | -10% | 1 | 1 | 0% | 2,022 | 3,722 | +84% | 0 | 0 | — |
case-10 | pass→pass | 2,799 | 3,338 | +19% | 1 | 1 | 0% | 483 | 2,172 | +350% | 0 | 0 | — |
case-11 | pass→pass | 5,663 | 3,656 | -35% | 1 | 1 | 0% | 1,159 | 2,377 | +105% | 0 | 0 | — |
case-12 | pass→pass | 20,490 | 17,775 | -13% | 1 | 1 | 0% | 2,881 | 4,756 | +65% | 0 | 0 | — |
case-13 | pass→pass | 14,939 | 13,785 | -8% | 1 | 1 | 0% | 2,689 | 4,305 | +60% | 0 | 0 | — |
case-14 | fail→fail | 20,258 | 21,058 | +4% | 1 | 1 | 0% | 3,631 | 5,527 | +52% | 0 | 0 | — |
case-15 | pass→pass | 10,244 | 10,021 | -2% | 1 | 1 | 0% | 1,739 | 3,645 | +110% | 0 | 0 | — |
case-16 | pass→pass | 5,962 | 2,590 | -57% | 1 | 1 | 0% | 1,045 | 2,216 | +112% | 0 | 0 | — |
case-17 | pass→pass | 7,638 | 6,614 | -13% | 1 | 1 | 0% | 1,297 | 2,703 | +108% | 0 | 0 | — |
case-18 | pass→pass | 6,425 | 2,137 | -67% | 1 | 1 | 0% | 1,138 | 2,133 | +87% | 0 | 0 | — |
case-19 | pass→pass | 9,583 | 6,621 | -31% | 1 | 1 | 0% | 1,648 | 2,929 | +78% | 0 | 0 | — |
case-20 | pass→pass | 6,155 | 5,001 | -19% | 1 | 1 | 0% | 925 | 2,344 | +153% | 0 | 0 | — |
case-21 | pass→pass | 14,994 | 14,430 | -4% | 1 | 1 | 0% | 2,330 | 4,052 | +74% | 0 | 0 | — |
case-22 | pass→pass | 14,326 | 18,793 | +31% | 1 | 1 | 0% | 2,737 | 5,765 | +111% | 0 | 0 | — |
case-23 | pass→pass | 16,227 | 27,279 | +68% | 1 | 1 | 0% | 3,200 | 7,627 | +138% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.