/polymorph:polymorph-themefrom Polymorph
Changes the look of a polymorph-themed app: colours, type, density, shape, motion, light/dark mode. Proposes a theme from plain words, validates it against theme laws, and saves it.
Ships in Polymorph. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
In polymorph, how an app looks is two JSON documents. A system decides how the product is
built: its design axes (geometry, depth, density, contrastTemperament, typePersonality, colorStrategy, motionTemperament and ornament), its fonts and its
defaults. A palette decides its colours, in a light and a dark mode. One system worn with one
palette is a pairing, chosen by data-system and data-palette on <html>. The members
read every value from the theme as --pm-* tokens, so the look changes when the documents change
and in no other way. Application code never writes a colour, a length, a font or a duration.
Every command in this skill starts with the same words, the polymorph tools run from a shell. An
MCP server named polymorph gives the same answers through get_theme_axes, propose_theme
and save_theme.
init wrote: src/theme/<system>.json and src/theme/<palette>.json, named in
vite.config by polymorphTheme({ systems, palettes }), which compiles them when the app
builds and again on each edit in development.src/polymorph/themes/systems/ and src/polymorph/themes/palettes/,
compiled by add into the sheets beside them. After a hand edit, run update: it keeps the
edited file and compiles the sheet from it. update --force puts the shipped document back and
compiles from that.public/polymorph/theme.css, compiled from a catalogue
system.npx -y @metamorph-labs/[email protected] axes
npx -y @metamorph-labs/[email protected] axes --values
axes lists the axes and their values, the shipped systems and palettes, the colour roles and the
scales. --values adds each system's token values with its own palette.
npx -y @metamorph-labs/[email protected] theme propose "calmer, warmer paper, more editorial"
npx -y @metamorph-labs/[email protected] theme propose "denser and cooler" --based-on plain/neutral
npx -y @metamorph-labs/[email protected] theme propose "geometry=crisp denser" --based-on plain/neutral
npx -y @metamorph-labs/[email protected] theme propose "denser and cooler" --save --dir design
The answer lists what each word moved, the words that moved nothing, and the verdict of the
theme's laws. Each move is a proposal: check it against the axis's values in axes.
axes prints. The same word again moves one more step, until the end.round, the roundest geometry.<axis>=<value> sets an axis to one of the values axes lists for it: geometry=crisp.
Use it for an exact value, and wherever a word would overshoot. An axis or a value axes does
not list moves nothing, and the answer names the lawful ones.round and reports "slightly". Name the value meant instead. "More" is read as the word
after it: "more editorial" is "editorial".plain has soft
geometry, one step under round.A typeface the app chooses and an exact colour are hand edits (step 4).
--based-on starts from a shipped pairing, such as desktop/azure, dew/verdigris, flint/cobalt; either half may be left out. It
takes a shipped name, not the app's own document: a change to a document the app already has is a
hand edit. --save writes the two documents into
<dir>/systems/ and <dir>/palettes/ (the directory design when --dir is left out), and
--overwrite replaces files already saved under the same names. --save writes only in a
project: a directory with a package.json or a polymorph.json. Then point the app at them: in an
app init wrote, name the two files in polymorphTheme in vite.config.
references/documents.md has every field a hand edit touches, with the values each takes.
| To change | Edit |
|---|---|
| Corners, shadows, density, contrast, type voice, tinted surfaces, motion, ornament | the system's axes |
| Typefaces | the system's fonts: body draws text, heading the headings and titles from text.lg up (in body when the system has no heading), and display only Hero's title |
| Text sizes, heading weights, one radius, space or control height step | the system's overrides |
| The accent hue, a gradient, the tint of the greys, how loud colour is | the palette's accentHue, gradientHue, neutralHue, neutralTint, chromaBudget |
| The exact colour of the main button, its label or the focus ring | the palette's pins, per mode |
| Colours for a reader who asks for more contrast | a second palette, named by moreContrast |
| Chart colours | the palette's accentHue: chart colours have no field |
| Dark mode | nothing: every palette derives both modes (step 7) |
A brand colour gives the palette its accentHue. theme hue reads the colour in OKLCH, the
space the engine derives every colour in, and prints the hue in whole degrees as accentHue
takes it:
npx -y @metamorph-labs/[email protected] theme hue "#1F4FD8"
Quote the colour, because a shell reads # as the start of a comment. A grey has no hue, so the
answer names no accentHue for it, and a palette whose chromaBudget is none draws its
accent from the greys. The hue alone does not put the brand's colour on the main button, because
the engine derives the fill's lightness and chroma: pin it (the reference has the whole palette).
A system or palette the app writes for itself, not from the catalogue, is a guest. It answers to the laws every shipped pairing answers to, and the reference lists them.
npx -y @metamorph-labs/[email protected] theme validate src/theme/<system>.json src/theme/<palette>.json
npx -y @metamorph-labs/[email protected] theme emit src/theme/<system>.json src/theme/<palette>.json --out theme.css
npx -y @metamorph-labs/[email protected] theme schema system --out src/theme/system.schema.json
theme validate admits a system and a palette under the laws every shipped pairing passes, in
both modes. A lawful pair prints lawful, the chart cap, the font packages to install and the
catalogue laws a guest is exempt from. Install each font package it names with the app's package
manager: the build imports them. A third path is the more-contrast partner the palette names;
without it, the partner is read from <name>.json beside the palette. theme emit prints the
stylesheet the pair compiles to, or writes it with --out, to read or hand to someone. It is not
how the app wears a theme: the build compiles the documents (step 1), and a copied sheet stops
following them. theme schema writes the JSON Schema of a system or a palette, for an editor,
which checks a document whose $schema key names it. theme validate and the Vite plugin
accept that key in either document and ignore it.
A refusal exits 1 and lists each fault with its law:
unlawful — 2 fault(s):
[contrast] acme/acme-blue (light): accent.contrast on accent.bgHover reached Lc 35.8, floor is 60. accent.contrast is chosen against accent.bg, which the palette pins in light mode.
[contrast] acme/acme-blue (light): accent.contrast on accent.bgActive reached Lc 31.3, floor is 60. accent.contrast is chosen against accent.bg, which the palette pins in light mode.
This palette pins a pale accent.bg and leaves its hover and pressed fills derived. Pinning
accent.bgHover and accent.bgActive near the pinned fill makes it lawful.
| Law | What failed | Change |
|---|---|---|
schema | A value off its range, a key the document does not take, a missing partner | The field the message names, as it says |
contrast, gradient, glass | A text or focus colour under its floor in one mode | The seed or pin the message names |
coherence, resolution | The derived values contradict an axis, or no colour reaches the floor | The axis or seed the message names |
The Vite plugin fails the build, and add fails, with the same messages. Answer a refusal in the
documents. A stylesheet or a --pm-* property written by the app is checked by no theme law, and
the red rules refuse it.
npx -y @metamorph-labs/[email protected] add theme:pastel --framework <framework>
npx -y @metamorph-labs/[email protected] add palette:orchid --framework <framework>
<framework> is the app's framework, as the polymorph-setup skill tells it. In a vendoring
project, add theme:<system> installs a shipped system with its own palette and its fonts, and
add palette:<name> a palette alone, which any installed system can wear. In a page with no
build, add theme:<system> compiles it into the theme sheet.
An app that compiles its theme with the Vite plugin wears the documents vite.config names. To
wear a shipped pairing there, save it as two documents of the app's own: words the table does not
know move nothing, so the proposal holds the shipped pairing's axes, fonts and colour seeds. Both
documents are saved under a name of their own, <system>-variant.json. Then name the two saved
files in polymorphTheme.
npx -y @metamorph-labs/[email protected] theme propose "as shipped" --based-on journal/umber --save --dir src/theme
Every pairing has a light and a dark mode, both derived from the one palette, so there is no dark
palette to write. The mode is data-mode on <html>, which the pre-paint script sets
before the first paint: to the reader's stored choice, or on a first visit to the system's
defaultMode. light and dark open a first visit in that mode whatever the operating
system's mode, and system follows the operating system's mode as it changes. Hydration applies
the same default and does not store it, so the reader wears it until they choose a mode. To open
an app dark, set defaultMode to dark in the system document; the Vite plugin and add
build the pre-paint script from it. In the catalogue, terminal opens dark, and every other system says system.
ModeSwitch: <ModeSwitch label="Appearance" /> offers
light, dark and system, and applies and stores the choice itself. It sits in a toolbar, a menu's
header or a settings row: in an AppShell, the trailing slot of its topbar,
not PageHeader's actions, which hold the page's own actions. In a
page with no build it is <poly-mode-switch label="Appearance">.setMode from @polymorph/engine/runtime
applies 'light', 'dark' or 'system', which follows the operating system again.
useMode, from the framework's foundation package, reads the current
choice.ToneScope with value="inverse".--pm-* property declared by
the app. A value the theme does not derive belongs in the system or palette document.theme emit installed as the theme. A
member's look is the documents'.DensityScope or ToneScope (the polymorph-rules skill).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub metamorph-labs/polymorph --plugin polymorph7 skills in this plugin
/polymorph-agent-bridgeLet an AI agent on a running page read and operate the polymorph members through the agent bridge, instead of scraping the DOM or clicking coordinates. Use when asked to let an in-app assistant or chatbot fill a form or operate a screen, make a page usable by an AI agent or a browser agent, expose a page’s actions as tools for a model, add WebMCP (document.modelContext) tools, keep a field such as a card number or an action such as placing an order from an agent (data-agent-key), ask the person before an agent acts, put data-agent on a page with no build, read the agent segment of the polymorph system card, or drive a page built with polymorph from an agent. Covers @polymorph/engine/agent (createAgentBridge, snapshot, query, act, confirm, the policy, secrets, agentTools, registerWebMCP), @polymorph/engine/webmcp (registerWebMCPOnCall, applyAgentSetting, AGENT_TOOL_DEFINITIONS), one bridge shared by an assistant and WebMCP and loaded on its first use, loadAgentBridge in polymorph.js, and testing a bridge./polymorph-nativeBuild or change a SwiftUI or Jetpack Compose screen with the polymorph design system's native members, or add them to a new or existing iOS or Android app. Use when Swift code imports PolymorphUI or PolymorphTokens, when Package.swift or an Xcode project names github.com/metamorph-labs/polymorph, when a Gradle build depends on com.github.metamorph-labs.polymorph (JitPack) or dev.polymorph and Kotlin imports dev.polymorph.ui, when pubspec.yaml names polymorph_tokens, or when asked to use polymorph on iOS, Android, SwiftUI, Compose or Flutter. Covers the Swift package and JitPack lines, the PM-prefixed names (PMButton, PMBadgeTone, PMDateRange) and where they are declared, the native screen contract (model, actions, a stateless view, four load states), emitting it from a spec, a list screen (ListPage, FilterBar, DataTable) with its store and navigation, installing a pairing with pmTheme or ProvidePMTheme and its fonts, the members and parts a platform adapts or lacks, and checking a screen no lint reads.Other plugins' skills for the same job