/polymorph:polymorph-rulesfrom Polymorph
Resolves polymorph red-rule violations (polymorph/no-raw-styles, polymorph/no-raw-interactive, polymorph/no-app-css) by walking the exception ladder. Use when ESLint or Stylelint reports a polymorph/ rule before adding any eslint-disable comment.
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.
The red rules are lint rules that keep design decisions out of application code. Exceptions are
allowed when they are declared: a declared exception names its reason, where a reviewer can read
it. A silenced rule is not allowed. Never add eslint-disable, eslint-disable-next-line
or stylelint-disable for a polymorph rule, and never change a lint config to turn one off.
Every command in this skill starts with the same words, the polymorph tools run from a shell.
<framework> is the app's: the polymorph-screen skill says how to tell it. An MCP server
named polymorph does the same jobs through validate and fix, given the framework as
framework, and get_component.
npx -y @metamorph-labs/[email protected] validate src/App.tsx --framework <framework>
Each violation is a line with the file, the position, the rule and its message. Under it:
fix: a rewrite with exactly one lawful answer.use: the members, props and tokens the message names, each with its rung.climb: every rung of the ladder that answers this rule.npx -y @metamorph-labs/[email protected] fix src/App.tsx --dry-run --framework <framework>
npx -y @metamorph-labs/[email protected] fix src/App.tsx --framework <framework>
The first prints the fixed code, and the second writes it. The project's own eslint --fix
applies the same rewrites. A violation left after the fix is a decision: take the next step.
Take the first rung that works. Each rung is more governed than the next.
DensityScope, ToneScope): A subtree re-assigns a named decision such as density or tone.patch): One instance re-assigns semantic tokens, never raw values.Bespoke, ThirdParty): A declared boundary for genuinely one-off composition, or around another library's component.references/ladder.md has each rung's procedure, with code.
| Rule | What it holds | Rungs |
|---|---|---|
polymorph/danger-last | A danger Button comes last in its group of Buttons, or stands in a group of its own. | 1, 4 |
polymorph/no-app-css | Application code may not contain or import stylesheets. | 1, 4 |
polymorph/no-app-member-selectors | Application CSS never restyles a member through data-member. | 1, 5 |
polymorph/no-app-theme-selectors | Application CSS never branches on the theme's attributes. | 1, 2 |
polymorph/no-external-dataviz | Chart physics is borrowed by the chart engine and by nothing else. | 1, 4 |
polymorph/no-external-icons | Icons are referenced by semantic role, not imported as glyphs. | 1, 4, 5 |
polymorph/no-external-motion | Motion is owned by the vocabulary and never imported by app code. | 1, 4 |
polymorph/no-motion-outside-vocabulary | Motion binds to component state and is never declared by application CSS. | 1, 4 |
polymorph/no-raw-interactive | Interactive elements come from the vocabulary, never from raw HTML. | 1, 4 |
polymorph/no-raw-styles | Application code composes the vocabulary and binds content; it does not express style. | 1, 3, 4 |
polymorph/no-root-font-size | Application CSS never sets the root font size. | 2 |
polymorph/no-token-declarations | Application CSS reads --pm-* tokens and never declares one. | 1, 2, 3 |
polymorph/one-main-button | A dialog or a section holds one main Button: one solid accent action. | 1, 4 |
polymorph/one-opener | A page composes exactly one opener — PageHeader or Hero, never both. | 1 |
polymorph/scoped-token-owners | Pattern-scoped tokens are referenced only by their owning pattern. | none |
polymorph/trailing-icon | A Button's trailing icon is a direction or a disclosure. | 1, 4 |
Common cases:
component <Name>,
such as Button's variant and tone or
Stack's gap. A spacing the scale lacks for one instance is a
patch (rung 3). A one-off illustration is a Bespoke zone (rung 4).Button, Checkbox, Select, Input and Textarea.
search finds it by what it does.<svg>: Icon with a role from the card as its
name. A glyph no role names is a Bespoke zone until the vocabulary adds
a role.Bespoke zone
when the file draws it by hand, or in ThirdParty around a library that draws it.Bespoke zone.ThirdParty.ThirdParty
(rung 4).A patch or a zone that recurs is promoted into the vocabulary or deleted (rung 5). That is a decision for whoever owns the design system: tell the person you are working for, with the zones and their reasons. Do not build a private copy of a member.
What SKILL.md sets; muted values are Claude Code's defaults
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