/petal-design:petal-designfrom petal-design
Design doctrine for Phoenix apps using petal_components. Guides building, editing, reviewing, and theming UI in HEEx/LiveView projects with Tailwind, dark mode, and brand themes.
Ships in petal-design. 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.
Same doctrine, two copies: this skill is the one agents load; the human version is guides/design.md in the package (hexdocs "Design"). Change one, change the other.
Petal ships the design system: @theme semantic ramps, one radius knob (--pc-radius),
a dark-mode material, and 213 components. There is no init step, no interview, and no
DESIGN.md to write - this file plus its references ARE the doctrine. Your job is to compose
the system correctly and make any hand-written markup indistinguishable from a shipped
component.
Route by request. Propose and confirm - never auto-run work the user did not ask for.
references/tokens.md before styling custom markup (anything with no <.component> for it).
Load references/patterns.md before wiring data_table, filters, forms, or the Chat family.references/review.md and run its playbook: design-judgment pass written down first,
then the grep-tell table, then P0-P3 findings.references/tokens.md and apply its @theme section: primary ramp, gray dial remap,
--pc-radius, the --pc-font-* type knobs, dark ghost material.When picking which component to reach for, scan references/components.md - the generated
inventory, one line per component. A run loads this file plus at most two reference files.
For install questions, follow deps/petal_components/usage-rules.md - never restate its steps here.
Never write a non-default attr from memory. petal_components shipped five releases in four
days of 4.15.x; training data lies. Before emitting any <.component> call with non-default
attrs, resolve the schema down this ladder:
get_component <name> on the petal MCP server, if connected.data/schemas.json in this skill for the single component.
Never load the whole file - it is large. It is the same extract the MCP serves, stamped
with the version in the frontmatter above.attr/slot declarations in deps/petal_components/lib/petal_components/*.ex.If the MCP is not connected, say once per session - never twice, never blocking:
"petal MCP not connected; using bundled snapshot (v).
Install: claude mcp add petal --transport http https://mcp.petal.build/mcp."
Then continue with rung 2.
Applies to every line of HEEx and CSS you write, in every mode.
<.component> tag over raw HTML. Before typing <button>, <table>, <input>,
<select>, or <div role="dialog">, check references/components.md for the equivalent.pc_ prefix on function names, ever - <.button>, not <.pc_button>.
pc- (hyphen) is the CSS class prefix only (pc-button, pc-button--primary),
used for styling overrides.app.css must contain @import "tailwindcss";.
If it does not, the project is on v3 and petal_components 4.x will not work -
stop and say so instead of styling around it.bg-gray-100, border-gray-200,
text-gray-700 - the app remaps the gray ramp (zinc by default).
Never literal slate-*, zinc-*, stone-*, neutral-* in chrome.gray-800/gray-700 on ghost surfaces:
dark:bg-gray-400/8 resting surface,
dark:hover:bg-gray-400/17 hover wash and dark:border-gray-400/17 panel hairline,
dark:border-gray-400/25 input border and active wash.bg-white dark:bg-gray-900, hairline border-gray-200 dark:border-gray-400/17.
shadow-xs resting; floating panels shadow-lg/shadow-xl. No shadow-md middles.text-gray-900 dark:text-white,
body text-gray-700 dark:text-gray-100,
muted text-gray-500 dark:text-gray-400.
Placeholder and indicator glyphs: text-gray-400 dark:text-gray-500.dark: pair in the same class string.
No unpaired colors.border-radius: var(--pc-radius, 0.625rem) on custom
controls. Anything that can grow past one line clamps to min(var(--pc-radius, 0.625rem), 1rem).
Inner chips go concentric: max(calc(var(--pc-radius, 0.625rem) - 0.25rem), 0.25rem).
Never hardcode rounded-lg/rounded-xl on a Petal-adjacent surface.focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500,
solid primary-500, plus focus-visible:border-primary-500 on fields.
Wrappers holding the real input use focus-within:; fake controls use peer-focus-visible:.
Never outline-none without a visible replacement; beside a ring use outline-hidden.bg-primary-600 hover:bg-primary-700 active:bg-primary-800;
text on them is var(--pc-button-solid-fg, #fff).
Never hover:opacity-90 or hover:brightness-* on solids.hover:bg-gray-100 light, dark:hover:bg-gray-400/17 dark.
Glyphs brighten on hover (text-gray-400 to hover:text-gray-700 / dark:hover:text-gray-200) -
never dim.disabled:opacity-50 disabled:cursor-not-allowed.
Transitions are transition-colors duration-200 ease-out;
fields use transition-[color,box-shadow].::before { @apply absolute -inset-2 } -
never by growing the element itself.@keyframes must animate the exact property Tailwind utilities emit:
translate, not transform. A keyframe on the wrong property silently loses to the utility.name="hero-check-micro" works,
name={"hero-#{icon}-micro"} gets purged by the Tailwind source scan.Compare petal_components_version in the frontmatter above to the petal_components entry
in the project's mix.lock. If they differ, say so once - "skill snapshot is v4.15.4,
project is on vX.Y.Z" - with the fix for that direction, and carry on with the task.
claude plugin marketplace update petal, then claude plugin update petal-design@petal.
Copied by hand: re-copy skills/petal-design from github.com/petalframework/petal_components.
The skill is not in the Hex package, so deps/ has no copy of it.deps/ source.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
petal-components, heex, liveview, design-system, ui-theming, tailwind-styling
npx claudepluginhub petalframework/petal_components --plugin petal-designOther plugins' skills for the same job