theme-swap

theme-swap is a command for Claude Code from Manavarya09/design-extract. It costs 59 tokens per session (566 once invoked), scanned A, original, MIT.

A command that changes an extracted website’s main brand colour while preserving its neutral colours, typography, spacing and animation settings. It generates a side-by-side preview and updated design-token files.

In plain words
What is it for?
Use it to test a new brand colour, compare the old and new palettes, review changed colours and export tokens for DTCG, Tailwind, shadcn or Figma.
Why use it?
It avoids manually recolouring every part of a design and helps prevent unrelated visual changes. You can review the before-and-after result before using the new tokens.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the designlang plugin — 2 skills, 14 commands shipped together

About the project

design-extract is a command-line tool that examines live websites with a headless browser and turns their visual and interaction rules into design-system files. It is used by developers and designers to extract tokens, component details, responsive behavior, accessibility findings, and platform-specific outputs, while the catalogue commands, skills, plugin, and rule expose that process to coding agents.

Manavarya09/design-extract · 4,048 stars · on GitHub · designlang.app

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 commands/manavarya09/design-extract/theme-swap
Clone the repo
git clone --depth 1 https://github.com/Manavarya09/design-extract

Made for: Claude Code.

Or install designlang, the plugin that ships this one along with the rest of its 2 skills, 14 commands.

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 theme-swap

README.md
[![agentmods](https://agentmods.dev/badge/commands/manavarya09/design-extract/theme-swap.svg)](https://agentmods.dev/commands/manavarya09/design-extract/theme-swap)
Your own site
<a href="https://agentmods.dev/commands/manavarya09/design-extract/theme-swap"><img src="https://agentmods.dev/badge/commands/manavarya09/design-extract/theme-swap.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 566 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.1 $0.00059 $0.00566
Opus 5 $0.00030 $0.00283
Sonnet 5 $0.00012 $0.00113
Haiku 4.5 $0.00006 $0.00057

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

Security

Grade A, and why

theme-swap 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 6d 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/theme-swap.md · 43 lines

What it actually says

Take any extracted site and swap its brand primary to the user-provided hex. The whole palette rotates around that hue while neutrals and structural tokens stay put.

npx designlang theme-swap $ARGUMENTS

If $ARGUMENTS doesn't contain both a URL and --primary <hex>, ask the user for the missing piece.

After the run completes, all output goes to ./design-extract-output/:

  • *.themeswap.html — editorial side-by-side preview (open this)
  • *.themeswap.md — markdown diff table
  • *.themeswap.json — structured before→after deltas
  • *.themeswap.tokens.json — recoloured DTCG token set you can drop into a project

After the command finishes:

  1. Read *.themeswap.md to summarise the swap (from → to, hue shift, count of changed colours).
  2. Show the user the verdict line ("X colours changed, neutrals preserved, type/spacing/motion untouched").
  3. Offer to open the HTML preview (--open does this automatically).
  4. Suggest the recoloured token files as drop-ins for an existing Tailwind / shadcn project.

Useful flags

Flag Effect
--primary <hex> required. Target brand colour (e.g. "#ff4800").
--from <hex> Override the auto-detected source primary when the extractor misclassifies (e.g. a neutral got promoted by usage count).
--format html|md|json|tokens|all Pick the output(s). Default all.
--out <dir> Output directory. Default ./design-extract-output.
--open Open the HTML preview in your default browser.

Pairs nicely with

  • /grade <url> — grade the recoloured site by feeding the same target through /extract then /grade.
  • /pack <url> — bundle the recoloured tokens as a downloadable design-system folder.
  • /remix <url> --as <vocab> — full vocabulary swap (brutalist, art-deco, cyberpunk…) instead of just brand colour.
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. 6d ago First seen · 43 lines · 59 tokens per session scan A c41b45006bac

Subscribe to this mod's changes

theme-swap is a command published in the GitHub repository Manavarya09/design-extract (4,048 stars, last pushed 5d ago), licensed MIT. It adds 59 tokens to every session and 566 once invoked, about $0.0003 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.