From superpowers
Use this when writing any kind of UI components in any language (heex, react, web components, and so on). Helps with making them composable and flexible.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers:component-authoringThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Ask the LLM to reason about **what the component means**, not how it is rendered.
Ask the LLM to reason about what the component means, not how it is rendered.
watch-toggle, not watch-button)Prompt framing tip: “What is the intent of this component?” yields better results than “What should I call this button?”
Always clarify who owns what:
Ambiguity causes LLMs (and humans) to drift into inconsistent abstractions.
Good LLM prompts explicitly state: “Component X owns layout; Component Y owns behavior; slots belong to X.”
This separation consistently produced the cleanest outcomes.
Use slots when:
Use attributes/properties when:
pressed, disabled)mode, variant)price, base-price)LLMs reason best when this boundary is explicit in the prompt.
A recurring risk: mixing display text with computational inputs.
Rule: If a component computes, its inputs must be unambiguous.
When asking an LLM, explicitly ask: “What is the single source of truth here?”
Even if state is “internal” today, design for:
Expose:
change, toggle)LLMs tend to default to “self-contained”; steer them by stating future integration needs.
A strong pattern that emerged:
This avoids both over-configuration and dead-end APIs.
Ask LLMs: “What’s the default 80% case, and what’s the minimal escape hatch?”
Your examples worked because composition stayed in markup, not attributes.
Prefer:
<component>
<icon></icon>
<label></label>
</component>
over:
<component icon="plus" label="Add"></component>
LLMs give better architectural guidance when composition is treated as the primary tool.
Avoid deep nesting unless there is:
LLMs are good at spotting when a component is doing “too much” if you ask them to justify each layer’s responsibility.
Events should describe what happened, not how.
change, toggle, submit → goodbuttonClicked, iconPressed → leaky abstractionsAsk the LLM to name events from the consumer’s perspective.
This conversation improved sharply once you stated:
LLMs perform best when constraints are declared up front.
Good habit: Start prompts with a short “Constraints & Assumptions” list.
The most productive dynamic here was:
Use LLMs to:
Not to “invent” architecture in a vacuum.
The final step—asking for principles—is key.
LLMs are especially strong at:
Make this a standard closing move in design-heavy sessions.
If a design decision can’t be cleanly explained in:
…it probably isn’t finished yet.
A quick checklist:
[!NOTE] If a component’s design cannot be explained using ownership, source of truth, and composition vs configuration, you don’t understand it well enough.
npx claudepluginhub nocksock/superpowersGuides the design of props interfaces, composition models, and public APIs for reusable React/UI components using atomic design patterns and inversion of control. Helps avoid broken contracts and escape hatches.
Provides patterns and references for building composable, accessible UI components: composition APIs, polymorphism, design tokens, publishing to npm/registry, and documentation.
Front-loads UI construction decisions: component boundary, prop API, state placement, async data, UI states, responsive behavior, and accessibility by construction. For creating or refactoring components, pages, or design-system primitives.