@mammothb/pi-mermaid

Pi skill that teaches the LLM to write Mermaid diagram syntax

Packages

Package details

skill

Install @mammothb/pi-mermaid from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@mammothb/pi-mermaid
Package
@mammothb/pi-mermaid
Version
0.1.0
Published
Jun 18, 2026
Downloads
not available
Author
mammothb
License
MIT
Types
skill
Size
46.9 KB
Dependencies
1 dependency · 0 peers
Pi manifest JSON
{
  "skills": [
    "./skills"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@mammothb/pi-mermaid

Pi extension that renders Mermaid diagrams as ASCII art in the TUI, plus a skill that teaches the LLM to generate Mermaid syntax.

Features

  • Extension: Auto-detects ```mermaid blocks in assistant responses and renders them as ASCII diagrams
  • Width-aware: Selects from 4 rendering presets (default/compact/tight/squeezed) based on terminal width
  • Validation: Parses Mermaid syntax via the official parser and reports errors
  • Collapsible: Large diagrams show first 10 lines with an expand hint
  • Command: /pi-mermaid manually re-renders the last assistant message
  • Skill: Teaches the LLM to write correct Mermaid syntax across 12+ diagram types

Supported Diagram Types

  • Flowchart, Sequence, Class, State, ER, Gantt, Pie, Git Graph, Mindmap, Timeline, C4, User Journey

Install

pi install npm:@mammothb/pi-mermaid

Usage

Just include Mermaid blocks in your prompts — the extension auto-renders them:

```mermaid
flowchart TD
    A[Start] --> B{Ready?}
    B -->|Yes| C[Go]
    B -->|No| D[Wait]
```

Or use the command to render the last assistant message:

/pi-mermaid