Design SystemAI

Working with Claude

A field guide to the durable systems that keep this repo coherent — the autonomy rules that govern commits and pushes, the one-way code→Figma colour sync, and the prime · wrap-up · checkup loop for capturing and resurfacing what we learn. Each section renders a contract whose canonical source lives in CLAUDE.md.

Skills

Three skills that compound

The repo learns. Every gnarly bug, every sharpened rule, every correction gets written down — but written-down knowledge only pays off if it resurfaces at the moment it's needed. Three skills close that loop: /prime reads the knowledge back before you work, /wrap-up writes new knowledge when a session ends, and /checkup keeps the surfaces they share consistent. None of them waits for the nightly cron.

The reinforcing loop

  /prime  ──read──▶  you work  ──▶  /wrap-up  ──write──▶  durable knowledge
     ▲                                                            │
     └──────────────────  feeds the next /prime  ────────────────┘

  /checkup keeps the shared surfaces consistent — so what /prime reads stays trustworthy

What each skill does

SkillRoleWhat it doesSay
/prime Read · before work Resurfaces the prior art for what you're about to touch — past bugs and their fixes, the governing rules, recent commits, related primitives, memories. A one-minute, read-only briefing so you start already knowing the traps. "/prime chip-avatar" · "what have we hit on overflow + shadows?"
/wrap-up Write · session end Distils a session's learnings — corrections, validated calls, diagnostic chases, refined rules — into their durable homes, then surfaces forward-looking follow-ups. Run before history clears. "wrap up the session" · "what should we remember?"
/checkup Maintain · on demand Runs the design-system health suite and acts on it — fixes the deterministic drift (doc anchors, exact token snaps, stale generated files), flags the judgment calls. The manual trigger for checks the nightly cron would otherwise miss. "run the checkup" · "what needs maintenance?"
Capture and resurface are one loop
/prime is only as good as what's been written down. Every /wrap-up that lands a bug-history entry or a rule makes the next /prime on that area sharper — and /checkup keeps those surfaces consistent so the recall stays trustworthy.

One loop, worked end to end

StepWhat happens
/prime says"We hit this before: mask-image clips box-shadow — hoist the filter to the unmasked parent."
YouSkip the four-version chase; reach for the parent-filter fix directly.
Mid-sessionFind a fresh wrinkle the entry didn't cover.
/wrap-upAppends the wrinkle to bug-history.md.
Next time/prime surfaces your wrinkle too — sharper than before.

Source of truth: CLAUDE.md → Maintenance skills — /wrap-up · /prime · /checkup plus each skill's SKILL.md. This page documents the loop; those files are canonical.

Git

When Claude commits, when Claude pushes

A trust ladder for git autonomy in this repo. Commit fires at coherent-unit boundaries without prompting; push needs the literal cue word. CLAUDE.md is the version Claude obeys each session — this page documents the same policy.

Commit — autonomous when all three hold

  1. Work is a coherent unit. TodoWrite all-completed · validator passes · preview renders. Mid-flow ("let me try X… ok actually Y") never commits.
  2. Diff under threshold. ≤ 8 files OR ≤ 500 lines. Above either, pause and ask whether to split into one commit per concern.
  3. No foreign-WIP collision. Files modified by another chat are left untouched. Stage selectively by path — never git add -A.

When all three hold, Claude commits to local main with no prompt. Message shape: DS: <subject> — <details>; the wrap-up reports Committed: … and Left untouched: … so every parallel chat's work is visible at the seam.

Trigger words

You sayClaude does
nothing — work hits a unit boundaryAuto-commit locally, no prompt
push · push itPull-rebase, then push to origin/main
ship · publish · looks goodDoes not push. Only the literal word does
revert that (unpushed)git reset --soft HEAD~1 — keeps changes staged
revert that (pushed)git revert <sha> — non-destructive
just commit everythingOverride multi-chat protection for this turn

Push — only on the literal cue

Push is the one irreversible action, so the literal command word is the only trigger. On push / push it: run git pull --rebase origin main, then git push. Rebase conflicts mean two sessions edited the same paths — abort and ask, never auto-resolve, never --force.

Hard refusals — never autonomous, even with full trust
  • git push --force (any force-push)
  • git reset --hard / git clean -fd on uncommitted work Claude didn't author
  • git rebase -i / amending pushed commits
  • --no-verify / --no-gpg-sign to skip hooks
  • Branch deletion, tag deletion, history rewrites
  • Anything touching shared refs beyond a normal git push origin main

Source of truth: CLAUDE.md → Git workflow — commit autonomy, push triggers, multi-chat hygiene. This page documents the policy; CLAUDE.md is what Claude obeys.

Figma

Code is the source, Figma is a rendering

The web design system's colours flow one way — out of styles.css into Figma variables, never back. Same canonical-source-vs-rendering contract as CLAUDE.md → catalog and the dashboard snapshot, extended to Figma. Colours have shipped; tokens, icons, and components follow the same framework as the phases land.

The one-way pipeline

  styles.css  ──export-color-tokens.mjs──▶  colors.json  ──use_figma──▶  Figma variables
  CANONICAL                                 manifest · sRGB             RENDERING (never the source)
One-way, never the reverse
Figma variables (and, later, components) are regenerated from the design system — never hand-edited in Figma as the source. A wrong colour in Figma is fixed in styles.css and re-synced. Values are rasterized from the live cascade, not copied from hex comments (which drift). The sync upserts by name — idempotent — and never reads Figma back into the codebase.

Three sync types · increasing difficulty

TypeSourceMechanismStatus
Tokens — colours, then spacing / radii / type / shadowstyles.cssrasterize → manifest → Figma variablesColours shipped
Icons / assets/icons/*.svgcreateNodeFromSvg → Figma components, one per filePlanned
Components — buttons, inputs, cards, chipsstyles.css + the catalogrender → spec → token-bind → use_figma component setsPlanned

Tokens come first because the manifests are the reverse-lookup tables that make components variable-bound — a computed rgb(35,53,206) resolves to Brand/Primary, not a flat fill. The component layer is a constrained code → Figma compiler, not a copy.

Phased roadmap · de-risk with tokens → one pilot → scale

PhaseScopeState
1 — Colours43 vars (brand identity [Ink · Sapphire · Pink · Paper · Slate], spectral, semantic, surface, text) × Dark / Light + swatch boardShipped
1.x — Token familiesspacing, radii, type scale, shadow → sibling variable collectionsPlanned
2 — Icons/icons/*.svg → Figma componentsPlanned
3 — Componentscatalog components → Figma component sets, bound to token variablesPlanned · the big one

Source of truth: CLAUDE.md → Figma colour sync — one-way from styles.css + design/figma-sync.md. This page documents the program; those files are canonical.