THE VIRTUOUS LOOP

Six steps that make the system tighter each pass
Each step catches signals that improve the next cycle. Drift gets caught. Inconsistency gets surfaced. The system compounds — it doesn't rot.
via Tokens Studio + html.to.design FIRST IMPORT VIRTUOUS LOOP COMPOUNDING 1 OBSERVE in production 2 DESIGN in Figma 3 TOKENIZE tokens.json 4 BUILD main.css 5 SHIP 4 subdomains 6 DOCUMENT design-system.html
Clockwise forward flow — each step leaves the system stronger than it found it.
1

Observe

Do — by hand

Watch production. Click through live pages. Notice what looks off, what's missing, what real users hit.

Or — run it as a Claude routine

Observation is a repeatable task, which means Claude can do it on a schedule. Set up a weekly run via the schedule skill, or trigger ad-hoc when you're about to ship a change. A good routine for this project:

  • Visit 5–10 live pages via Chrome MCP and screenshot each
  • Compare against design-system.html — flag visual drift
  • Grep the repo for undefined classes (the alert bug pattern) and report gaps
  • Diff Figma Variables against tokens.json to catch designer-code divergence
  • Dump a short report: what needs design attention this week

You stay the human-in-the-loop for deciding what to actually fix; Claude just surfaces the list.

Signals that feed forward

"Login looks like Google, not Thios." "Alerts aren't styled." "Handbook chapters render as plain divs." — these become the brief for step 2.

Chrome MCP schedule skill smoke tests user reports
2

Design — first import, then iterate

First pass: copy the code's brand into Figma, without retyping it

Because there's already a working brand in main.css — colors, type, spacing, components — you do not start Figma from a blank canvas. You let plugins read the code and recreate it in Figma automatically. From that point on, Figma and code are looking at the same values instead of drifting apart.

Tokens Studio plugin — reads tokens.json and creates Figma Variables one-for-one. No retyping of hex codes, no human-error drift. Each of the three collections (primitive / semantic / surface) becomes its own Figma Variable Collection. When you change a value in Figma later, Tokens Studio can push it back out to tokens.json for you.

html.to.design (Divriots) — optional. Point it at thios.co/design-system.html and it pulls the live page in as flat Figma frames. Use those frames as visual reference while you rebuild components properly — don't convert the imported frames into components directly, they'll be messy.

Figma Variables (native import) — Figma itself can import JSON as a fallback. Stricter about format than Tokens Studio, so useful for sanity-checking.

Ongoing: iterate

Once the first import is done, design new components in Figma knowing every variable maps to a real token the code understands. Changes you make in Figma flow back to tokens.json via Tokens Studio — no manual copy-paste.

Signals that feed forward

Discovers missing tokens ("we need a warning color"). Surfaces visual conflicts ("store's hero and handbook's hero shouldn't use the same .hero-content"). Forces explicit decisions.

Figma Variables Tokens Studio html.to.design
3

Tokenize

Do

Export Figma decisions to lib/styles/tokens.json (W3C format). Primitive → Semantic → Surface layers make intent explicit.

Signals that feed forward

Exposes structural ambiguity: "is this an accent or a warning?" Catches two-value drift (e.g., main.css said #F0B800 while design said #E8AF00).

tokens.json W3C format 212 tokens
4

Build

Do

Implement in main.css. Minify. Run make sync-css to copy across blog + store bundles.

Signals that feed forward

make check-css-sync fails the pre-deploy gate if any subdomain drifts. Undefined classes surface as rendering bugs — fed back into tokens or design.

main.css clean-css-cli Makefile
5

Ship

Do

Deploy all four surfaces via SSH + tarball. make deploy-check gates on hurl tests + smoke + security + CSS sync before shipping.

Signals that feed forward

Deploy failures surface environmental drift. Post-deploy smoke tests catch regressions. Live site becomes the next Observe target.

deploy_main_fast.sh smoke tests DreamHost
6

Document

Do

Update design-system.html with every pattern you just built. Self-contained page — shows the real classes with live demos.

Signals that feed back to start

Writing the doc exposes inconsistencies ("wait, .alert--success in docs vs .alert-success in code"). Forces naming discipline. Loops back into Observe — "what's documented vs what's used?"

design-system.html live examples

The "first import" plugins, in detail

Two Figma plugins that do most of the heavy lifting in step 2.

Tokens Studio

tokens.studio — formerly "Design Tokens for Figma"

Keeps design tokens in sync between Figma Variables and your code's JSON. This is the plugin that makes “one source of truth” actually possible.

What it does

  • Reads tokens.json in the W3C Design Tokens format
  • Creates Figma Variables one-for-one from each token — no retyping of hex codes
  • Pushes edits made in Figma back out to the JSON file
  • Supports modes per collection (e.g. configurator light / dark)
  • Handles references — {primitive.color.teal.600} stays linked
  • Typography composites bundle family + size + weight + line-height as single tokens

Workflow on thios.co

  • Install plugin → Import → upload lib/styles/tokens.json
  • You get three Variable Collections: primitive, semantic, surface
  • Design components using the semantic variables
  • When you change a value, plugin offers to push the diff back to JSON
Free tier: full import/export, unlimited tokens, all formats. Fine for a solo founder.
Pro (~$5/mo): Git integration (auto-PRs back to the repo), team sync, themes.

html.to.design

by Divriots — makers of Backlight & Iles

Imports a live web page into Figma as editable frames. Lets you see your production UI as Figma objects without screenshotting or tracing.

What it does

  • Takes a URL (e.g. thios.co/design-system.html) or local HTML file
  • Renders the page headlessly, captures computed CSS
  • Outputs editable Figma frames with real layout, text, and color
  • Images come in as actual image fills, not flattened screenshots
  • Text stays editable — fonts, sizes, line-heights preserved
  • Supports auto-layout hints where the source CSS used flex/grid

Workflow on thios.co

  • Point at thios.co/design-system.html → get a staging page in Figma
  • Use it as a visual reference beside the component you're building
  • Rebuild components cleanly using Tokens Studio variables — do not convert imported frames directly, they'll be messy and un-componentized
Free tier: 3 imports/day, basic fidelity. Enough for a one-time reference pull.
Pro (~$14/mo): unlimited imports, higher fidelity, password-protected pages, auth cookies, Storybook import.

What compounds each cycle

The "virtuous" part — what actually gets better over time

Brand fidelity

Each pass catches a drift: a wrong hex, an off-brand font, a page that doesn't match. Over time, production converges on the single source of truth.

Naming discipline

Documentation forces you to name things consistently. BEM vs. single-dash? Pick once, the loop enforces it everywhere.

Drift prevention

Automated checks (make check-css-sync) fail the deploy gate when things go out of sync. You can't silently rot anymore.

Pattern reuse

Each cycle adds patterns to the doc. Next time you build, you reach for a documented class instead of inventing inline styles.

Decision archaeology

Commit messages + the tokens.json history tell you when gold became #E8AF00, when primary-light was corrected. No more "why is this color like this?"

Speed

The more patterns that live in the system, the faster new pages compose. A novel page should be 80% existing classes, 20% new thinking.