CtrlK
BlogDocsLog inGet started
Tessl Logo

metodologia-mermaid-diagramming

This skill should be used when the user asks to "create diagrams", "generate Mermaid", "visualize architecture", "diagram flows", "draw a sequence diagram", "create a C4 diagram", "add visual diagrams", or mentions diagramming, visualization, flowcharts, sequence diagrams, Mermaid syntax, architecture diagrams, or visual documentation. Use this skill to embed precise, syntactically valid Mermaid diagrams in any discovery deliverable.

The canonical home for this skill is metodologia-mermaid-diagramming in JaviMontano/mao-discovery-framework

SKILL.md
Quality
Evals
Security

Mermaid Diagramming Engine

Generates syntactically valid, semantically precise Mermaid diagrams for discovery deliverables. Every diagram earns its place — no decorative visuals. Each diagram must compress complexity into clarity, replacing paragraphs of prose with a single visual that a reader grasps in seconds.

Principio Rector

Un diagrama que no comprime complejidad en claridad no merece existir. Cada diagrama Mermaid debe reemplazar párrafos de prosa con una visual que el lector comprende en segundos. Decoración ≠ documentación — solo diagramas que ganan su lugar sobreviven.

Filosofía de Diagramación

  1. Densidad informativa. Si un diagrama no transmite más que 3 oraciones de texto, es ruido visual. Eliminar.
  2. Sintaxis impecable. Un diagrama que no renderiza es peor que ningún diagrama. Validación antes de entrega.
  3. Contexto > estética. Los nodos se nombran con significado de dominio, no con códigos. Las flechas llevan etiquetas. Los subgrafos agrupan con propósito.

Inputs ($ARGUMENTS)

ArgumentRequiredDescription
$CONTEXTYesSource material: deliverable content, code analysis, or structured data to visualize
$DIAGRAM_TYPENoSpecific type requested (auto-selected if omitted based on content)
$AUDIENCENoTarget reader: executive (simplified), technical (detailed), operational (actionable)

Parameters:

  • {MODO}: piloto-auto (default) | desatendido | supervisado | paso-a-paso
    • piloto-auto: Auto para selección de tipo y composición, HITL para validación de diagramas complejos (>15 nodos).
    • desatendido: Cero interrupciones. Diagramas generados automáticamente. Supuestos documentados.
    • supervisado: Autónomo con checkpoint al seleccionar tipo de diagrama.
    • paso-a-paso: Confirma tipo, composición, y validación de cada diagrama.
  • {FORMATO}: markdown (default, fenced code blocks) | html (pre class="mermaid") | dual
  • {VARIANTE}: ejecutiva (simplified, ≤10 nodes) | técnica (full detail, default)

When to Use

  • Any discovery deliverable needs architectural, flow, or relationship visualization
  • A concept is better understood visually than textually
  • Cross-references between components, stakeholders, or phases need mapping
  • Decision trees, timelines, or state machines need representation

When NOT to Use

  • The diagram would merely repeat what the text already says clearly
  • Data is better represented as a table (metrics, scores, comparisons)
  • The audience won't have Mermaid rendering capability (use ASCII fallback)

S1 — Diagram Type Selection

Analyze the content and select the optimal diagram type:

Content PatternDiagram TypeMermaid Syntax
System components + relationshipsC4 Context/ContainerC4Context / C4Container
Sequential process stepsFlowchartflowchart TD/LR
Actor interactions over timeSequence DiagramsequenceDiagram
Entity relationshipsEntity RelationshiperDiagram
State transitionsState DiagramstateDiagram-v2
Project timeline / phasesGantt Chartgantt
Hierarchical decompositionMindmapmindmap
2-axis positioning (e.g., risk vs impact)Quadrant ChartquadrantChart
Class/module structureClass DiagramclassDiagram
Git/decision branchingGitgraphgitGraph
User journey stepsUser Journeyjourney
Data flow / pipelineFlowchart with subgraphsflowchart LR + subgraph

Selection criteria: Choose the type that maximizes information density while minimizing cognitive load.

S2 — Diagram Composition Rules

  1. Syntax validity: Every diagram MUST render without errors in standard Mermaid renderers (GitHub, GitLab, Obsidian, Mermaid Live Editor).
  2. Node naming: Use descriptive IDs (authService not A1). Wrap display labels in quotes if they contain spaces.
  3. Edge labels: Every relationship/arrow carries a label explaining the connection.
  4. Subgraphs: Group related nodes. Name subgraphs meaningfully.
  5. Direction: Use TD (top-down) for hierarchies, LR (left-right) for flows/sequences.
  6. Color/styling: Use classDef for semantic coloring (e.g., classDef critical fill:#f96,stroke:#333). Max 4 style classes per diagram.
  7. Size discipline: Max 20 nodes per diagram. If more needed, split into multiple diagrams with cross-references.
  8. Accessibility: Include a 1-line text summary before each diagram for screen readers and non-rendering contexts.

S3 — Deliverable-Specific Diagram Catalog

Each discovery deliverable has recommended diagram types:

DeliverablePrimary DiagramSecondary Diagram
01_Stakeholder_MapQuadrant (influence × interest)Mindmap (org structure)
02_Brief_TecnicoMindmap (stack overview)Quadrant (health semaphore)
03_Analisis_AS-ISC4 Context + ContainerClass (module dependencies)
04_Mapeo_FlujosSequence (E2E flows)Flowchart (integration map)
05_EscenariosFlowchart (decision tree)Quadrant (score positioning)
06_Solution_RoadmapGantt (phase timeline)Flowchart (pivot decision tree)
07_Spec_FuncionalFlowchart (use case flows)ER (data model)
08_Pitch_EjecutivoMindmap (value pillars)Gantt (investment timeline)
09_HandoverFlowchart (governance flow)Gantt (90-day plan)

Minimum: 1 diagram per deliverable. Recommended: 2. Maximum: 4 (avoid visual overload).

S4 — Quality Validation

Every diagram passes through validation:

CriterionCheck
SyntaxRenders without errors in Mermaid Live Editor
SemanticsAccurately represents the source data
ReadabilityUnderstandable in <10 seconds for target audience
Information densityConveys info that would take ≥3 sentences in prose
ConsistencyUses same terminology as the surrounding document
Cross-referenceNode names match entity names used elsewhere in the deliverable

S5 — Output Format Integration

In Markdown deliverables (default):

> **Figure N**: [1-line description for accessibility]

```mermaid
[diagram code]
```

*Source: [CÓDIGO] / [DOC] / [INFERENCIA]*

In HTML deliverables (on demand): Embed Mermaid via <pre class="mermaid"> tag with Mermaid JS CDN include. Add alt attribute with text description.

Trade-off Matrix

DecisionEnablesConstrainsWhen to Use
Max 20 nodesReadability, quick comprehensionCannot show full system in one viewAlways — split complex diagrams
Max 4 style classesVisual clarityLimited visual differentiationAlways — more colors = more cognitive load
Descriptive IDsSource readability, self-documentingLonger Mermaid codeAlways — readability > brevity
Text summary before diagramAccessibility, fallback renderingMinor overhead per diagramAlways — non-negotiable for accessibility
C4 extension usageRich architecture notationLimited renderer supportWhen architecture visualization is primary

Assumptions

  • Target renderers support Mermaid v10+ syntax
  • Readers have basic familiarity with flowchart/diagram conventions
  • Diagrams supplement text, never replace it entirely

Limits

  • Cannot generate raster images (PNG/SVG) — output is Mermaid code only
  • C4 diagrams use Mermaid's C4 extension (may not render in all contexts)
  • Complex diagrams (>20 nodes) require decomposition into sub-diagrams
  • Animation/interactivity not supported in Mermaid

Edge Cases

  • If source data is insufficient for a meaningful diagram → skip diagram, note gap
  • If two diagram types are equally valid → prefer the one with fewer nodes
  • If diagram would contain sensitive data (credentials, internal IPs) → abstract to categories

Validation Gate

Before delivering any diagram:

  1. Paste into Mermaid Live Editor mentally — would it render? Fix syntax if not.
  2. Does it add information the text doesn't? If no, remove it.
  3. Can the target audience understand it without explanation? If no, simplify.
  4. Are all labels/names consistent with the document? If no, align.

Casos Borde

CasoEstrategia de Manejo
Requested diagram type is not supported by the target renderer (e.g., C4 extension in a basic Mermaid viewer)Fall back to flowchart with subgraphs that emulate C4 structure; document the fallback with a note to the reader
Source data would require >40 nodes for a complete representationDecompose into 2-3 sub-diagrams with explicit cross-reference labels (e.g., "see Diagram 2B for detail"); add an index diagram showing how sub-diagrams relate
Diagram contains node labels with special characters that break Mermaid syntax (quotes, brackets, pipes)Escape characters per Mermaid spec; use descriptive IDs without special characters; place full labels in quoted strings
Two equally valid diagram types for the same content (e.g., flowchart vs sequence for an API call chain)Prefer the type with fewer nodes; if equal, prefer the type that shows temporal ordering (sequence) over structural relationship (flowchart)

Decisiones y Trade-offs

DecisionAlternativa DescartadaJustificacion
Enforce max 20 nodes per diagram as a hard ruleAllow unlimited nodes with a "best effort" readability guidelineSoft guidelines are ignored under time pressure; the hard cap forces conscious decomposition decisions that improve every diagram
Require accessibility text summary before every diagramRely on diagram self-explanationScreen readers cannot parse Mermaid; non-rendering contexts (email, print) lose all information without text summaries; accessibility is non-negotiable
Use descriptive node IDs (authService, paymentDB) over short codes (A1, B2)Short IDs for compact Mermaid sourceDescriptive IDs make the raw Mermaid source self-documenting; when diagrams are reviewed in code, short IDs require cross-referencing a legend

Knowledge Graph

graph TD
    subgraph Core["Mermaid Diagramming Engine"]
        A["Type Selection"] --> B["Composition Rules"]
        B --> C["Syntax Validation"]
        C --> D["Quality Validation"]
    end
    subgraph Inputs["Inputs"]
        E["Source Content"] --> A
        F["Diagram Type Hint"] --> A
        G["Audience Level"] --> B
    end
    subgraph Outputs["Outputs"]
        D --> H["Mermaid Code Blocks"]
        D --> I["Accessibility Text"]
    end
    subgraph Related["Related Skills"]
        J["data-viz-storytelling"] -.-> A
        K["output-engineering"] -.-> H
    end

Output Templates

Markdown (default)

  • Filename: embedded within parent deliverable (e.g., 03_Analisis_ASIS_{cliente}_{WIP}.md)
  • Structure: Figure number > accessibility text summary > fenced mermaid code block > source evidence tag

HTML

  • Filename: embedded within parent HTML deliverable
  • Structure: <pre class="mermaid"> with CDN v10; alt attribute with accessibility text; responsive container; print fallback CSS

DOCX (bajo demanda)

  • Filename: {fase}_{entregable}_{cliente}_{WIP}.docx
  • Generado via python-docx con MetodologIA Design System v5. Portada con logo y metadatos, TOC automatico, headers/footers con nombre del skill y numeracion, tablas zebra, titulos Poppins navy, cuerpo Montserrat, acentos gold. Diagramas Mermaid exportados como imagen PNG e incrustados en el documento.

XLSX (bajo demanda)

  • Filename: {fase}_{entregable}_{cliente}_{WIP}.xlsx
  • Generado con openpyxl bajo MetodologIA Design System v5. Headers con fondo navy y tipografía Poppins blanca, formato condicional, auto-filtros activados, valores sin fórmulas. Hojas: Diagram Catalog (tipo, entregable, nodos, descripción), Validation Gate por diagrama, Deliverable-Diagram Matrix.

PPTX (bajo demanda)

  • Filename: {fase}_{entregable}_{cliente}_{WIP}.pptx
  • Generado via python-pptx con MetodologIA Design System v5. Slide master navy gradient, titulos Poppins, cuerpo Montserrat, acentos gold. Max 20 slides variante ejecutiva / 30 variante tecnica. Speaker notes con referencias de evidencia [DOC]/[INFERENCIA]/[SUPUESTO].

Evaluacion

DimensionPesoCriterio
Trigger Accuracy10%Descripcion activa triggers correctos sin falsos positivos
Completeness25%Todos los entregables cubren el dominio sin huecos
Clarity20%Instrucciones ejecutables sin ambiguedad
Robustness20%Maneja edge cases y variantes de input
Efficiency10%Proceso no tiene pasos redundantes
Value Density15%Cada seccion aporta valor practico directo

Umbral minimo: 7/10 en cada dimension para considerar el skill production-ready.

Cross-References

  • discovery-orchestrator — coordinates which diagrams each deliverable needs
  • All pipeline skills — embed diagrams in their output artifacts
  • brand-html / brand-html-extended — HTML embedding with Mermaid JS

Output Format Protocol

FormatDefaultDescription
markdown✅Rich Markdown + Mermaid diagrams. Token-efficient.
htmlOn demandBranded HTML (Design System). Visual impact.
dualOn demandBoth formats.

Default output is Markdown with embedded Mermaid diagrams. HTML generation requires explicit {FORMATO}=html parameter.

Output Artifact

Primary: Mermaid diagram code blocks ready to embed in Markdown or HTML deliverables. Each diagram includes accessibility text summary, source evidence tag, and figure numbering.

Supported diagram types: C4Context, C4Container, flowchart, sequenceDiagram, erDiagram, stateDiagram-v2, gantt, mindmap, quadrantChart, classDiagram, gitGraph, journey.

Autor: Javier Montaño | Última actualización: 12 de marzo de 2026

Repository
JaviMontano/mao-pm-apex
Last updated
First committed

Canonical home

JaviMontano/mao-discovery-framework
In sync

since Aug 28, 2026

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.