harness/plugins/work-manager/common/skills/explore-flow-map/SKILL.md
Render an interactive single-page HTML that visualizes packages/components and the cross-package flows of named actions (e.g. "Invite new user", "todesktop build"). Driven by a JSON document. Use when the user says "flow map", "render flows", "interactive workflow html", "visualize package interactions", or has a flows.json from the `explore` skill they want to view.
npx skillsauth add popoffvg/dotfiles explore-flow-mapInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce one self-contained HTML file that:
kind on a dark canvas (ToDesktop-style architecture diagram).path:line.Input: a JSON document. Output: a single .html file.
{
"title": "MyApp — Architecture & Flows",
"packages": [
{
"id": "web", // unique slug used in edges
"label": "Web Frontend", // node title
"sub": "apps/web", // optional 2nd line under title
"kind": "actor|client|codebase|sdk|backend|external",
"description": "..." // shown in tooltips / steps if you add it
}
],
"flows": [
{
"id": "invite-user",
"label": "Invite new user",
"description": "...",
"edges": [
{
"from": "web", "to": "api",
"via": "POST /invites", // transport label
"payload": "{ email, role }", // 1-line summary
"source": "apps/web/src/Invite.tsx:84", // verifiable path:line
"notes": "..." // optional caveat
}
]
}
]
}
edges[] order is the temporal step sequence — the renderer numbers them 1, 2, 3, ….
kind taxonomy (drives swimlane columns)| kind | Column label | Tint |
| ---------- | ------------------------ | --------- |
| actor | ACTORS | #fbbf24 |
| client | CLIENT SURFACE | #60a5fa |
| codebase | BLOCK / FUNCTION CODEBASE| #34d399 |
| sdk | SDK / LIB | #a78bfa |
| backend | BACKEND PIPELINE | #f97316 |
| external | EXTERNAL SERVICES | #f87171 |
Free to extend — just pick a hex tint and a header label per new kind.
Default path <input-dir>/index.html next to the source JSON (or
${TMPDIR%/}/claude-flow-map/<basename>.html if input is outside a project).
${TMPDIR%/}/claude-explore/*/flows.json or */<input-dir>/flows.json in .notes/.edge.from/edge.to resolves to a known package.id.
Every flow.id is unique.mkdir -p if needed.Write tool.
Do NOT generate the HTML through a bash heredoc — see the bash trap below.open on macOS may fail under sandbox; tell
the user to open the file manually if it does.! history expansion mangles <!doctypeBash performs history expansion on ! even inside single-quoted heredocs
on some setups. Result: every <! becomes <\!, the browser stops parsing the
file as HTML, and you get a blank page with literal <\!doctype html> text at
the top.
Fix: never write the HTML through bash << 'EOF' or python3 -c "..."
piped through bash. Build the full HTML string in memory and pass it to the
Write tool. The Write tool bypasses the shell — bytes land verbatim.
Sanity-check after writing:
head -c 16 path/to/index.html # must print: <!doctype html>
</ inside an inlined JSON string closes the <script> tagWhen embedding a JSON literal between <script> tags, any </ substring in
your data terminates the script element. Either:
{ … } directly, not a
JSON string), or</ → <\/ in the resulting string.The first form is what this skill uses.
min-height:0 on its row track
and min-height:300px on #cy or Cytoscape draws nothing.'background-color': ele => … is brittle across
Cytoscape versions. Precompute the color into node data and use
'background-color': 'data(color)'.[email protected].open fails under the agent sandbox. That's not your bug; just print the
path.The skill's HTML is built around these ideas (paste/adapt — keep ~300 lines):
1fr 340px. Left = canvas, right = sidebar.#0a0a0a bg, #e5e7eb text, #fbbf24 accent, #262626
borders).kind), styled with a dashed border, a
small uppercase header label colored in the column tint, and
compound-sizing-wrt-labels: include.parent: <column-id>, fixed position: { x, y },
layout: { name: "preset" }. Columns auto-size to fit.curve-style: unbundled-bezier with control-point-distances
for the curved orange look. target-arrow-shape: triangle.text-background-color: #fbbf24, text-background-shape: round-rectangle,
text-background-padding: 4px, plus a dark text-border for contrast..loop class with loop-direction / loop-sweep.<div class="num">N</div> + a
block with from → to, the via label, payload (monospace), source
(smaller monospace), and notes (in #fde68a).cy.edges().remove(), recompute participants set, toggle
.hot / .dimmed on package nodes, add edges with num: String(i+1),
re-render the STEPS panel.A complete working copy lives at
~/Documents/git/mil/tasks/MILAB-6225-identity-propogation/.notes/<input-dir>/index.html
— copy-paste and swap the data block when bootstrapping new diagrams.
Re-run the skill — it overwrites the previous HTML in place. The JSON beside
it (flows.json) is the source of truth; keep them next to each other so the
user can edit JSON and re-render.
flow.edges participation order).payload field is a 1-line summary by design. Long structures belong in
the linked source.tools
Improve a whole CLAUDE.local.md — the private, per-project rules captured from user corrections. Wraps each conditional rule in a <task-relevant> block so it only surfaces for matching work, merges duplicates, generalizes one-off facts, drops stale entries, and routes raw project facts to engram. Use when the user says "improve claude.local", "clean up the local rules", "claude.local is bloated", or after the Stop hook has appended many rules.
testing
WM pipeline and conventions shared across all phases. Agents must read this before spec, impl, or verify work.
development
One entry point for spec writing, implementation, and bug fixing. Default is new (write spec → grill loop → produce notes → author TODO bodies). Other subcommands: verify (audit), revise (sync to shipped), prototype (settle a decision), code-map (diagram), impl (execute one TODO), fix (analyze cause, correct thoughts, fix behavior), help (this page). Invoke as /code <subcommand>.
development
Red-Green-Refactor cycle for bug fixes. Before fixing a bug, first write a failing test that reproduces it (Red), then make the minimal change to pass (Green), then clean up the code (Refactor). Use on any bug fix, error correction, failing test repair, or when user says "fix this bug".