Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:AI Builder Club Skills Diagram Specification

From Leeroopedia
Knowledge Sources
Domains Diagram_Generation, Documentation
Last Updated 2026-10-24 00:00 GMT

Overview

A declarative JSON specification format for describing flow diagrams with nodes, edges, themes, and animation, enabling reproducible rendering of both static PNG and animated GIF diagrams from a single source.

Description

Diagram specification separates the description of a flow diagram from its rendering. The spec is a JSON document with six top-level sections: canvas (dimensions, fps, frame count), theme (light/dark presets with color overrides), title (text, highlight, subtitle), nodes (each with id, type, position, size, label, body, color), edges (from/to or custom points, label, stroke, width, arrow, style), and animation (motion color, paths for moving particles, pulses for node halos). Node types include box, diamond (decision), note, and label. Edges can auto-route between node centers or use explicit multi-point paths with rounded corners. The spec is the single source of truth — both the static PNG and animated GIF render from it, ensuring visual consistency. Theme presets provide sensible defaults; individual colors can be overridden without defining a full palette.

Usage

Use this principle when turning source material (articles, architecture sketches, process descriptions) into flow diagrams. Author the spec from a template (light or dark), then render via the Pillow-based renderer with --verify --check.

Theoretical Basis

The principle follows declarative specification over imperative drawing: by describing what the diagram contains (nodes, edges, animation) rather than how to draw it (pixel operations), the spec becomes human-readable, editable, and renderable by any compatible renderer. The separation enables reproducibility — the same spec always produces the same output.

# Abstract spec model:
spec = {
    "canvas": {"width": 1280, "height": 800, "fps": 20, "frames": 48},
    "theme": "light",  # or {"name": "light", "blue": "#custom"}
    "title": {"text": "Main", "highlight": "Loop", "subtitle": "desc"},
    "nodes": [
        {"id": "a", "type": "box", "label": "Start", "x": 60, "y": 150, "w": 300, "h": 150, "color": "green"},
        {"id": "b", "type": "diamond", "label": "Check", "x": 400, "y": 150, "w": 200, "h": 150, "color": "blue"},
    ],
    "edges": [
        {"from": "a", "to": "b", "label": "feeds"},
        {"points": [[360, 225], [520, 280]], "label": "custom route"},
    ],
    "animation": {
        "motion_color": "#0077ff",
        "paths": [{"edge": 0}, {"points": [[360, 225], [520, 280]]}],
        "pulses": ["a", "b"],
    },
}

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment