agentleFS
cameronsjocameronsjo/agentic-harnesses/.claude/skills/add-view/SKILL.md

add-view

Skill1 starsChanged 6 months agoMITView on GitHub

Use when adding a new visualizer view to the site/ SPA (a new tab like Compare, Sequence, Wire, or Hooks). Covers the data-spec-first pattern, the shared controls/timer/graph infrastructure to reuse, and wiring into the nav.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Facta-Dev/beautifulqt★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If you find yourself re-implementing a transport bar, a tab row, or a timer, stop — that's the bug.

    line 26
  2. Very specific:

    Put the view's data in site/src/data/<family>/<harness-or-topic>.json (mirror data/wire/, data/hooks/).

    line 30
  3. Very specific:

    If the view is a new *projection* of existing loop specs (like Sequence is), write a pure projector in a .ts module (see sequence.ts → …

    line 32
  4. Very specific:

    Create site/src/<Name>View.tsx.

    line 36
  5. Very specific:

    Layout via utilities: Use cluster / stack / existing classes, not hand-rolled flexbox.

    line 39
  6. Very specific:

    Own your timer where it's used: If only a sub-mode steps through, call usePlayerTimer inside the sub-component so it mounts/unmounts with …

    line 42
  7. Very specific:

    Add the tab key to the ViewTab union type.

    line 47
  8. Very specific:

    Add a tab to the computed availableTabs array — either globally (always shown) or conditionally under harness === 'claude-code' if it's …

    line 48
  9. Very specific:

    Add a branch to the render switch that mounts <NameView />.

    line 49
  10. Very specific:

    Add any new classes to site/src/styles.css, using Artificer tokens.

    line 55
  11. Distinctive:

    Raw hex / bespoke spacing / one-off durations: Use Artificer tokens.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill 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
SKILL.md

Add a Visualizer View

Add a new tab to the site/ app. The rule that keeps this repo honest: a view renders a JSON spec, it does not hardcode data. If your view shows facts about a harness, those facts live in a JSON file under site/src/data/, the same way loop specs, wire specs, and hook specs do.

Announce at start: "Using add-view to add the <name> view."

Reuse before you build

This is the heart of the skill. The infrastructure already exists — a new view should be mostly composition. Grep these before writing anything new:

NeedUseFrom
Step/play/pause/reset state + timed advanceusePlayerTimer(length, resetKey?)site/src/player.ts
Reset / Play·Pause·Replay / Step buttons + counter<TransportBar player={...} playLabel counterLabel total />site/src/controls.tsx
A row of pill tabs (harness / scenario / mode picker)<TabPicker items active onSelect ariaLabel className? />site/src/controls.tsx
Node/edge graph of a loop spec<LoopGraph spec activeNodeId activeEdge badges? onNodeClick? />site/src/LoopGraph.tsx
Enlarge a diagram to a modal<ExpandButton onClick /> in the .graph-pane, paired with <GraphModal open onClose title diagram side /> (it owns the two-column diagram | side shell)site/src/controls.tsx, site/src/GraphModal.tsx
Active-edge helper for a step transitionedgeBetween(fromId, toId)site/src/player.ts
The loaded specs / lookup / shared scenariosspecs, specByHarness, scenario, sharedScenariossite/src/data.ts

If you find yourself re-implementing a transport bar, a tab row, or a timer, stop — that's the bug. Those were deduplicated into shared modules on purpose; adding a sixth copy regresses it.

Step 1 — Back the view with a data spec

Put the view's data in site/src/data/<family>/<harness-or-topic>.json (mirror data/wire/, data/hooks/). Import it in the component with a typed assertion, the same pattern the existing views use. Hardcoding the data inline is the one thing that breaks the "single source of truth" guarantee this project sells.

If the view is a new projection of existing loop specs (like Sequence is), write a pure projector in a .ts module (see sequence.ts → projectScenario) instead of a data file — it derives from the loop spec, so it can't drift either.

Step 2 — Build the component

Create site/src/<Name>View.tsx. Conventions to honor:

  • Theme via tokens only. Colors, spacing, radii, motion come from Artificer CSS variables (var(--accent-bright), var(--s-md), etc.). No hardcoded hex, no bespoke durations. The visualizer is dark-first.
  • Layout via utilities. Use cluster / stack / existing classes, not hand-rolled flexbox.
  • A11y. Tab groups get role="group" + aria-label (TabPicker does this for you). Interactive SVG nodes need tabIndex/role="button"/keyboard handlers — copy LoopGraph's pattern.
  • SVG marker IDs must be per-instance. url(#id) resolves document-scope, so two diagrams on one page collide. Namespace markers by harness/scenario (e.g. seq-arrow-${harness}-${scenarioId}) — LoopGraph and SequenceView both do this.
  • Own your timer where it's used. If only a sub-mode steps through, call usePlayerTimer inside the sub-component so it mounts/unmounts with that mode (this is why WireView's timer lives in LayersView, not the parent — it avoids stale state across mode switches).

Step 3 — Wire into the tabs

In site/src/App.tsx:

  1. Add the tab key to the ViewTab union type.
  2. Add a tab to the computed availableTabs array — either globally (always shown) or conditionally under harness === 'claude-code' if it's CC-specific (like Wire/Hooks).
  3. Add a branch to the render switch that mounts <NameView />.

Decide whether the Legend shows for your view (the view !== 'wire' guard controls this today).

Step 4 — Style

Add any new classes to site/src/styles.css, using Artificer tokens. Keep them adjacent to the related view's styles.

Step 5 — Verify

cd site && npm run build   # validate + tsc + vite — must exit 0
npm run dev                # click the new tab; step through it; toggle light/dark

Confirm: the new tab renders, the transport controls drive it, light/dark both look right (the ThemeToggle drives data-theme), and nothing else regressed.

Anti-patterns

  • Re-implementing the transport bar / tab row / timer / expand button. Reuse controls.tsx (TransportBar, TabPicker, ExpandButton) + player.ts.
  • Hand-building the expand-modal layout. GraphModal owns the diagram | side shell — pass the two fragments as props, don't re-type .graph-modal__layout.
  • Hardcoding harness facts in the component. Back it with a JSON spec or a pure projector.
  • Static SVG marker ids. Namespace per instance or diagrams collide.
  • Raw hex / bespoke spacing / one-off durations. Use Artificer tokens.
  • A parent-owned timer for a mode-switched sub-view. Own the timer in the sub-view so it resets on switch.

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.