shredbx logo
shredbx shredbx shredbx shredbx Personal
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
AClaude
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
Andrei Solovev
Knowledge
Search knowledge... ⌘K
Knowledge · Guidelines · go

Go Yaml To Mermaid Diagram

Generate Mermaid diagrams from YAML model files using raw map parsing and DSL string building

Andrei Solovev

Metadata

go go

Description

Pattern for reading YAML model files (package.yml, entity.yml) and auto-generating Mermaid diagram DSL. Two diagram types: 1. Class diagrams — from exports.types + exports.functions - Types become class boxes with description annotations - Functions assigned as methods via TypeName.MethodName prefix matching - Standalone functions grouped into a utility class - Dependencies rendered as dotted dependency arrows 2. Sequence diagrams — from user_stories BDD scenarios - Actor from actor_ref, participants from package name (UI/API/SVC) - Step routing by verb detection (Click/Navigate → UI, Call/Invoke → API) - HTTP method extraction from expected text (GET/POST/PUT/DELETE) - Service method resolution from affected_layers.md - Postconditions as Mermaid notes Key design decisions: - Raw map[string]interface{} parsing avoids struct coupling to YAML schema - sanitizeMermaid() escapes characters that break Mermaid syntax - String truncation prevents oversized labels - Only first scenario per story generates a diagram (multiple scenarios = multiple stories)
shredbx logo shredbx shredbx shredbx shredbx Andrei Solovev

Solution Architect & Lead Software Engineer

ExperiencePortfolioResearch & ExperimentsEducationCertificationSkills
GitHub ↗LinkedIn ↗Email ↗
AVAILABLE FOR NEW PROJECTS
// MY LATEST BEATS
Hobby & Interests

Lab

  • The Lab
  • Framework
  • Components
  • Packages
  • Games
  • Process (SDLC)
  • Knowledge
  • Blog

Andrei

  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
  • Lifestyle

Team

  • Team
  • Andrei
  • Claude

Legal

  • Privacy
  • Terms
  • Cookies
© 2026 shredbx.com. All rights reserved. — Andrei Solovev |