design-system-audit

design-system-audit is a cursor rule for Cursor from jrpease/throughline. It costs 116 tokens per session (1,906 once invoked), scanned A, original, MIT.

A process for measuring an existing design system before adapting it to shared design tokens. A design system is the reusable set of visual rules and components used across a product.

In plain words
What is it for?
It is for auditing a mature codebase and an existing Figma file before a design-system retrofit. It records code matches, design inventory, and a percentage showing how closely the two sides align.
Why use it?
It shows how much of the codebase and design file already follows the system, helping decide whether to rename existing pieces or rewrite them.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/jrpease/throughline/design-system-audit
Clone the repo
git clone --depth 1 https://github.com/jrpease/throughline

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for design-system-audit

README.md
[![agentmods](https://agentmods.dev/badge/rules/jrpease/throughline/design-system-audit.svg)](https://agentmods.dev/rules/jrpease/throughline/design-system-audit)
Your own site
<a href="https://agentmods.dev/rules/jrpease/throughline/design-system-audit"><img src="https://agentmods.dev/badge/rules/jrpease/throughline/design-system-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 116 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,906 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00116 $0.01906
Opus 5 $0.00058 $0.00953
Sonnet 5 $0.00023 $0.00381
Haiku 4.5 $0.00012 $0.00191

Measured 4d ago against content hash 1dc9749b6f7d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

design-system-audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

adapters/cursor/.cursor/rules/design-system-audit.mdc · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Design-system audit (brownfield front door)

Measures both sides of a pre-existing system so a retrofit can be right-sized, before anything is built or changed. It is the brownfield analog of /design-system-status: where status reports a local manifest, this assesses an external, mature system — a real codebase and an already-populated Figma file.

This is a brownfield skill. Before doing anything, read .throughline/references/brownfield-retrofit.md — especially the read-discipline principle (never assert absence without a verified read) and the audit phase of the safe sequence. Greenfield builds skip this skill entirely.

Calibrate

Read user.codingLevel (.throughline/references/coding-level.md) and scale explanation accordingly. The audit surfaces grep counts and a percentSemantic number — for new users explain what each means and why it matters (it decides rename-vs-rewrite); for comfortable users be terse. The measurements are identical across levels.

Prerequisites

Read the manifest. This skill needs Figma connected (figma.connected: true) for the inventory step, and a repo path for the code-surface step (workspace.localPath). If Figma isn't connected, offer to run figma-environment-setup first. The code-surface step works on any repo regardless of workspace.stage.

Step 1 — Size the code surface

Measure how many color decisions live in the codebase. Run the color-usage grep scaffold against the user's repo:

node .throughline/scripts/grep-color-usage.mjs --root <workspace.localPath>

It counts five categories: SCSS color vars, Tailwind color classes, Colors.* JS usages, raw hex + rgba() literals, and SVG hardcoded fills — producing the case-study worklist shape.

Tune the patterns to the actual repo, and say what you assumed (read discipline + §11). The shipped patterns are defaults, not ground truth. Before trusting the counts:

  1. Look at the repo's real conventions — open a few SCSS/TS files, check the actual color-variable prefixes ($primary-*, $grey-*, a custom prefix), the Tailwind color-class names, and whether colors come through a Colors.* object or some other accessor.
  2. If the defaults don't fit, write a --config <patterns.json> of { "<category>": { "files": "<regex>", "pattern": "<regex>" } } tuned to this repo and re-run with it.
  3. Report which categories used the assumed defaults vs. a tuned pattern — never present default-pattern counts as if they were measured. The script prints this; pass it through to the user so partial coverage is visible, not hidden.

Read the full file on GitHub · 147 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 147 lines · 116 tokens per session scan A 1dc9749b6f7d

Subscribe to this mod's changes

design-system-audit is a cursor rule published in the GitHub repository jrpease/throughline (76 stars, last pushed 3d ago), licensed MIT. It adds 116 tokens to every session and 1,906 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.