claudemd-design-adopt

claudemd-design-adopt is a command for Claude Code from sdsrss/claudemd. It costs 145 tokens per session (1,315 once invoked), scanned A, original, MIT.

A command that creates a DESIGN.md file from a user-interface project's existing design tokens, such as its colors and spacing, and links that file from CLAUDE.md. It only proceeds when those real token sources exist.

In plain words
What is it for?
Use it to adopt, check, or remove design guidance in a UI project without changing unrelated CLAUDE.md content.
Why use it?
It gives coding agents a written reference to the project's existing visual rules, reducing invented colors or spacing in UI work.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions CLAUDE.md.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the claudemd plugin — 16 commands, 6 hooks shipped together

Good fit Use it to adopt, check, or remove design guidance in a UI project without changing unrelated CLAUDE.md content.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add sdsrss/claudemd
Claude Code
/plugin install claudemd

Made for: Claude Code.

Or install claudemd, the plugin that ships this one along with the rest of its 16 commands, 6 hooks.

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 claudemd-design-adopt

README.md
[![agentmods](https://agentmods.dev/badge/commands/sdsrss/claudemd/claudemd-design-adopt/github.svg)](https://agentmods.dev/commands/sdsrss/claudemd/claudemd-design-adopt)
Your own site
<a href="https://agentmods.dev/commands/sdsrss/claudemd/claudemd-design-adopt"><img src="https://agentmods.dev/badge/commands/sdsrss/claudemd/claudemd-design-adopt/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for claudemd-design-adopt

Your own site · 80×15
<a href="https://agentmods.dev/commands/sdsrss/claudemd/claudemd-design-adopt"><img src="https://agentmods.dev/badge/commands/sdsrss/claudemd/claudemd-design-adopt.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 145 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,315 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00145 $0.01315
Opus 5 $0.00072 $0.00658
Sonnet 5 $0.00029 $0.00263
Haiku 4.5 $0.00015 $0.00131

Measured 2d ago against content hash b23cd684729e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

claudemd-design-adopt 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 2d 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.

commands/claudemd-design-adopt.md · 72 lines

How it starts

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

Usage: /claudemd-design-adopt | /claudemd-design-adopt check | /claudemd-design-adopt remove

Step 0 — detect (deterministic)

Run: node ${CLAUDE_PLUGIN_ROOT}/scripts/design-detect.js --json (add --cwd=PATH to target another dir). The detector is stateless — it reads the filesystem and prints a verdict, writing nothing.

If --cwd is passed and names something that is not an existing directory (or is empty), the detector exits 2 with a stderr line instead of printing a verdict. That is not a finding about the project — report the bad path and stop; do not relay it as no-ui.

  • no-ui / ui-no-tokens → report one line (nothing to adopt: <verdict>) and STOP. Never create DESIGN.md for a token-less project — generation would require inventing values, which this command forbids.
  • configured → report "already wired" + the DESIGN.md path. Offer check instead; regenerate only if the user explicitly asks.
  • adoptable / unwired → continue.
  • error → report the failure; do not write anything.

check mode (no writes)

Read the existing DESIGN.md; for every repo-file reference in it, verify the file exists. Report resolvable vs broken pointers, then STOP.

remove mode

Delete the <!-- claudemd-design:begin<!-- claudemd-design:end --> block from project CLAUDE.md (everything else untouched; show the diff first). Do NOT delete DESIGN.md — report that it stays for the user to remove.

Step 1 — read the real sources

Read every tokenSources[].path from step 0 (first ~200 lines each), plus — when present — whatever injects them (vite css.preprocessorOptions.additionalData, tailwind content, the main.* style import chain). You are extracting FACTS: token names, semantic-color variables, spacing scale, radii, fonts, dark-mode mechanism, reusable mixins / utility classes, contrast annotations.

Step 2 — draft DESIGN.md (thin pointer, facts only)

Contract — every line must trace to something Read in step 1:

  1. Header: values live in the source files ("以 <file> 为准"); DESIGN.md never duplicates full value tables (single source of truth, no drift).
  2. 事实源与加载机制: each token-source path + its load mechanism only if verified (e.g. vite additionalData global injection ⇒ "$vars/mixins are available in every SFC — do not @use the file again").
  3. 硬规则 — evidence-gated menu. Include ONLY rules whose evidence appeared in step 1:
    • semantic color variables exist → "use semantic vars, never hardcode hex"
    • dark-mode signals → name the mechanism (html.dark / prefers-color-scheme / darkMode: 'class') + "develop and verify in that theme"
    • spacing tokens (≥4) → grid rule stating the actual base (e.g. 8px multiples)
    • mixin / utility inventory → reuse-first rule listing the real names
    • mono font token → "numeric columns use the mono token"
    • WCAG / contrast comments → "contrast annotations are commitments; keep them true"

Read the full file on GitHub · 72 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. 2d ago Changed · +2 lines b23cd684729e
  2. 9d ago First seen · 70 lines · 145 tokens per session scan A 9e0e1b0ff786

Subscribe to this mod's changes

claudemd-design-adopt is a command published in the GitHub repository sdsrss/claudemd (2 stars, last pushed today), licensed MIT. It adds 145 tokens to every session and 1,315 once invoked, about $0.0007 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-31.