Ticket diagram

From FriendlyInternet/nuxt-crouton · View interactive version

Ticket diagram is an AI agent skill from the GitHub repository FriendlyInternet/nuxt-crouton. Attach a self-contained Excalidraw status diagram to a GitHub epic — read the epic + its sub-issue tree, render boxes-coloured-by-status with dependency arrows to a committed PNG that (a) renders on the GitHub mobile app and (b) has the editable Excalidraw scene embedded inside it, post it as a stic

How to use this skill

Skill file

Ticket diagram — an editable, mobile-legible status graph per epic

Turn a GitHub epic's sub-issue tree into a picture: **boxes coloured by status, dependency

arrows bound to the boxes, committed as a single PNG** that renders in the issue/PR body

on mobile and carries the editable Excalidraw scene embedded inside it — open that PNG

in Excalidraw and you get the live scene to rearrange and hand back.

This is workstream #2 of the human-readable-tickets epic (#479)

made concrete, tracked under epic #483. It

reuses the sign-off / revision loop of #310 (the same loop ui-proposal and schema-review

use): generate → post on the PR → iterate on feedback → approve.

Why Excalidraw + a PNG? Mermaid is disqualified: on the GitHub mobile app a

``` `mermaid ``` block shows raw code + a perpetual "Loading" spinner (confirmed on #479).

A committed PNG renders everywhere, including mobile, with no stall. The scene is **embedded in

the PNG** (Excalidraw's own "Embed scene" format), so the image is also the editable source —

no separate verbose .excalidraw file in the repo.

Artifacts (what gets committed)

Per diagram, in writeups/diagrams/:

This is the human-auditable record; git blame/diffs of what the epic is live here.

body on mobile; open it in Excalidraw to edit.

The loose <slug>.excalidraw is not committed (it's gitignored) — the scene rides inside the

PNG. Pass --excalidraw to the generator only if you want a loose copy locally.

The pipeline (two halves)

  YOU (over the GitHub MCP)            the GENERATOR (deterministic, offline)
  ────────────────────────            ──────────────────────────────────────
  read epic + get_sub_issues   ──▶    scripts/ticket-excalidraw.mjs <graph.json>
  build the graph JSON                  → writeups/diagrams/<slug>.graph.json   (semantic source)
                                        → writeups/diagrams/<slug>.png          (render + scene embedded)

The split matters: the agent does the GitHub I/O; the script does the graph→artifacts step

(no network at render time, byte-stable output → minimal diffs).

1 · Read the epic → build the graph JSON

For epic #NN: issue_read (get) the epic, then issue_read (get_sub_issues). For each child

read its title, state (open/closed), labels (status:*), and any Blocked-by: #x, #y

line in the body. Then build:

{
  "epic": 479,
  "slug": "make-tickets-human-readable",
  "title": "Make tickets human-readable",
  "feedbackUrl": "https://github.com/FriendlyInternet/nuxt-crouton/pull/487",
  "nodes": [{ "id": 454, "title": "Schemas + config", "status": "done" }],
  "edges": [{ "from": 454, "to": 455 }],
  "goal": { "label": "library-catalog.pmcp.dev" }
}

status:blocked → blocked · otherwise pending.

blocker to dependent; the generator lays blockers above dependents).

URL). Every terminal node wires into it; it's coloured violet.

issues, like an epic's workstreams before it's decomposed. Defaults to #<id>.

link; pass the PR URL. Defaults to the epic issue URL.

stays small and the sticky keeps pointing at the same files.

2 · Generate

node scripts/ticket-excalidraw.mjs /tmp/<slug>.graph.json --out-dir writeups/diagrams

Writes <slug>.graph.json + <slug>.png (PNG via the shared renderer

.claude/skills/ui-proposal/render.mjs, headless Chromium — same as schema-review; the scene is

then embedded into the PNG). Then commit both with /commit, referencing (#NN).

3 · Post the sticky comment & iterate (the #310 loop)

Post the PNG as a single sticky comment on the epic's PR, marked with an HTML anchor, and make

the image a link that opens the scene in Excalidraw:

<!-- ticket-diagram:make-tickets-human-readable -->
### 🗺️ Epic diagram — Make tickets human-readable
![epic diagram](https://raw.githubusercontent.com/FriendlyInternet/nuxt-crouton/<branch>/writeups/diagrams/make-tickets-human-readable.png)

**✏️ To edit:** download this PNG and **open it in Excalidraw** — the scene is embedded, so it
opens live; drag boxes (arrows follow), then **export it (Embed scene ON) and attach the PNG to a
comment here**. I'll pull your edits back in.

_Revisions:_
- r1: initial

Reference the PNG by its raw.githubusercontent.com URL on the branch so it renders on mobile.

The human reviews on the diff: they inline-comment, or they edit the scene and **attach the

exported PNG to a comment. Both are change requests. Ignore bot/self comments**

(user.type === 'Bot').

Approval = a comment containing approve/lgtm. (A 👍 reaction or a label does not

resume the pipeline — only issue_comment triggers resume-on-comment.yml, #572.) On approval,

mark the PR ready / merge per the epic flow.

4 · Round-trip a human edit back IN

When a human attaches an edited, scene-embedded PNG (or a .excalidraw) to a comment, grab its

URL and run the importer — it decodes the scene, re-renders the PNG from that scene (so boxes

they moved stay moved), re-embeds the scene, and writes the committed PNG:

node scripts/ticket-excalidraw-import.mjs <attachment-url-or-path> --slug <slug> --out-dir writeups/diagrams

Commit the PNG and refresh the sticky (append - rN: <what changed>). Pair this with

subscribe_pr_activity: a comment with an attached PNG → run the importer → commit → done.

5 · Keep it current (it's a live view, not a one-shot)

When the epic's children change — a new sub-issue, a child closes, a Blocked-by edge changes —

rebuild the graph JSON and regenerate. Same slug ⇒ the PNG updates in place and graph.json's diff

shows exactly what moved semantically. (Regenerating from graph.json re-lays-out the boxes; if a

human has hand-arranged the scene, prefer the importer in §4 to preserve their layout.)

Status palette

| status | colour | meaning |

|---|---|---|

| done | 🟩 green | child issue closed |

| in_progress | 🟦 blue | status:in-progress label |

| blocked | 🟥 red | status:blocked label |

| pending | 🟨 yellow | open, not started |

| goal | 🟪 violet | the epic's concrete acceptance artifact |

Files

re-rendered, re-embedded .png (the round-trip IN).

arrows + bound text + chrome), toSvg()/toHtml() (graph render), sceneToSvg()/sceneToHtml()

(faithful render of an edited scene). No dependencies.

embedScene() (Excalidraw's "Embed scene" tEXt format; Node zlib + manual chunk parsing).

Gotchas

client-rendered diagram (Mermaid/widget) in a GitHub body — it must be a committed image so it

shows on mobile.

.excalidraw, which we no longer commit. (If you want one-tap deep-link editing back, run the

generator with --excalidraw, commit the loose file, and link `https://excalidraw.com/#url=<raw

url>`.)

#483). Link …/?slug=<slug>&branch=<branch>&issue=<NN> — pass &issue=<NN> so each Save

posts a new comment on issue NN with that edit's diagram (a timeline of versions, not just

silent nuxt-harness[bot] commits) — that 📐 comment quotes the text you added; on a

status:blocked issue it also resumes the run (#3691). Requires the loose <slug>.excalidraw committed (generate

with --excalidraw), since the editor reads it.

raw.githubusercontent.com/<repo>/<branch>/…png URL re-renders whenever the file is later

edited (so a "proposal" comment's picture drifts); …/<commit-sha>/…png is immutable and frozen.

Post the proposal/sticky image pinned to the commit that produced it so the timeline reads

correctly (the editor's per-save comments already do this).

scene (it errors clearly).

W1…W5).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.