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
- Facta-Dev/beautifulqttheir own version, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 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.
- CLAUDE.mdCLAUDE.md
- onboard-harnessSkill
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
- Distinctive: line 26
If you find yourself re-implementing a transport bar, a tab row, or a timer, stop — that's the bug.
- Very specific: line 30
Put the view's data in site/src/data/<family>/<harness-or-topic>.json (mirror data/wire/, data/hooks/).
- Very specific: line 32
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 → …
- Very specific: line 36
Create site/src/<Name>View.tsx.
- Very specific: line 39
Layout via utilities: Use cluster / stack / existing classes, not hand-rolled flexbox.
- Very specific: line 42
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 …
- Very specific: line 47
Add the tab key to the ViewTab union type.
- Very specific: line 48
Add a tab to the computed availableTabs array — either globally (always shown) or conditionally under harness === 'claude-code' if it's …
- Very specific: line 49
Add a branch to the render switch that mounts <NameView />.
- Very specific: line 55
Add any new classes to site/src/styles.css, using Artificer tokens.
- Distinctive: line 72
Raw hex / bespoke spacing / one-off durations: Use Artificer tokens.
≈ “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.
Files
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:
| Need | Use | From |
| Step/play/pause/reset state + timed advance | usePlayerTimer(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 transition | edgeBetween(fromId, toId) | site/src/player.ts |
| The loaded specs / lookup / shared scenarios | specs, specByHarness, scenario, sharedScenarios | site/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 needtabIndex/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
usePlayerTimerinside the sub-component so it mounts/unmounts with that mode (this is why WireView's timer lives inLayersView, not the parent — it avoids stale state across mode switches).
Step 3 — Wire into the tabs
In site/src/App.tsx:
- Add the tab key to the
ViewTabunion type. - Add a tab to the computed
availableTabsarray — either globally (always shown) or conditionally underharness === 'claude-code'if it's CC-specific (like Wire/Hooks). - 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/darkConfirm: 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.
GraphModalowns thediagram | sideshell — 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.
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
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.

