agentleFS
grahambrooksgrahambrooks/infographic/CLAUDE.md

infographic

CLAUDE.md1 starsChanged 40 days agoMITView on GitHub

Skills and tools that make Claude reliably produce compelling, animated SVG infographics: technical explainers (patterns, processes, data flow) and, later, GitHub README headers. The entry point is the skill .claude/skills/infographic/, driven by a one-line request ("create an infographic for the circuit breaker pattern"). Claude designs from its own knowledge and writes a YAML spec. The Rust infographic CLI does all layout, timing, SVG emission and verification. Claude fixes findings in the spec, never in the emitted SVG. docs/design.md is the…

  • Installs packages
  • In this repositoryOne other file it gives its agents.

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every state and counter value is a pre-measured text alternative, so node boxes fit the widest one.

    line 65
  2. Very specific:

    A passing gate is not a good infographic: Always look at the storyboard PNG.

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this is

Skills and tools that make Claude reliably produce compelling, animated SVG infographics: technical explainers (patterns, processes, data flow) and, later, GitHub README headers.

The entry point is the skill .claude/skills/infographic/, driven by a one-line request ("create an infographic for the circuit breaker pattern"). Claude designs from its own knowledge and writes a YAML spec. The Rust infographic CLI does all layout, timing, SVG emission and verification. Claude fixes findings in the spec, never in the emitted SVG.

docs/design.md is the design: milestones, done-when criteria, and an explicit out of scope list. Don't build what it cuts without asking. Milestone 1 (circuit breaker end to end, readme profile, static gate) is implemented. The browser gate (milestone 2) and the interactive profile (milestone 3) are not.

Commands

cargo build
cargo test                                   # unit tests; the fixture is examples/circuit-breaker.yaml
cargo test timeline::tests::exactly_one      # a single test, by name filter
cargo clippy && cargo fmt
make check                                   # the CI check job (fmt, clippy -D warnings, test); run before pushing
make hooks                                   # install prek hooks (fast checks on commit, make check on push)
make release-dry                             # preview the CalVer tag `make release` would push
cargo install --path .                       # the skill expects `infographic` on PATH

infographic build examples/circuit-breaker.yaml -o /tmp/out [--frames]
infographic check any.svg [--profile readme|interactive] [--png out.png]

Both commands print a JSON report. Exit status is 0 if the gate passed, 1 on findings with severity error, and 2 if the command itself failed.

Browser verification (Node + Playwright, kept in spikes/, not in the crate):

infographic build <spec> -o <dir> --frames
cd spikes/embedding-modes && npm install && node verify.mjs <dir> <slug>

verify.mjs checks playback inside <img>. It also seeks Chromium, Firefox and WebKit to each storyboard frame's time, and asserts that the browser shows exactly the elements the timeline says, with tokens within 1.5px. It has been confirmed to fail on tampered output. Playwright is pinned (spikes/embedding-modes/package.json) to match the browser builds cached in ~/Library/Caches/ms-playwright.

Architecture

The pipeline is spec → layout → timeline → emit → check. It is built around two single sources of truth, and most bugs this project exists to prevent come from breaking one of them:

  • layout::Scene holds every position, including measured text runs. The emitter only ever reads it.
    • Tokens move along the drawn edge via <mpath href="#e-…">. Path data is never copied.
    • Every state and counter value is a pre-measured text alternative, so node boxes fit the widest one.
  • timeline::Timeline holds every time, as visibility intervals, token segments and shrinks over one cycle. Every SMIL animation gets dur = cycle and repeatCount="indefinite", and is placed by keyTimes. check::lint fails any SVG where durations differ.
  • The timeline looks up element ids from the Scene by value. Don't re-format! ids in two places.

One emitter, two modes. emit::Mode::Animated writes the deliverable. Mode::Frame(t) writes a still of the same scene at time t. The storyboard, the geometry checks and the contrast checks all run on frames, so they see every state alternative. verify.mjs compares frames against real browsers, so a frame and the animation can't silently disagree.

Checks run on SVG, not on the Scene (check::geometry via usvg with the pinned fonts). That way check also works on hand-written SVGs.

  • Emitted elements carry data-role (node, edge, token) and data-container (the element whose box a text must stay inside).
  • finding::describe maps ids back to spec names, so findings read node breaker, not n-breaker. Keep the id scheme in layout.rs and describe in sync.

Fonts. IBM Plex Sans (OFL, assets/fonts/) is compiled in. The same bytes are used for:

  • measuring text (rustybuzz);
  • the subset embedded in every SVG as base64 @font-face (fontcull, built without its C++ WOFF2 feature);
  • usvg rendering, with sans-serif mapped onto it.

The spike verified that embedded fonts apply inside <img> in all three engines.

Constraints and lessons that apply here

  • Emit real SVG <text>, never <foreignObject>. SVG-only consumers drop it silently (learned on mmd). Use presentation attributes, not a CSS cascade.
  • GitHub README embedding = <img> (spike, 2026-09-27, not yet through GitHub's camo proxy):
    • CSS and SMIL animation run in all engines;
    • :hover runs in none;
    • WebKit ignores prefers-color-scheme inside the SVG, so light/dark are two files switched by <picture> (the report's embed).
  • A passing gate is not a good infographic. Always look at the storyboard PNG. Conversely, when adding a check, confirm it fails on bad input.
  • Stack: pure Rust, one crate with directory modules. The one recorded exception is a browser for animation and hover verification. It is still Node/Playwright in spikes/; the design calls for chromiumoxide in the crate.

Workflow

Trunk-based: commit and push directly to main; no branches or PRs unless asked.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.