Source profileQuality 95/100

event4u-app/agent-config/src/skills/ui-component-architect/SKILL.md

ui-component-architect

Use when shaping a UI component tree — composition vs inheritance, slot patterns, prop API design, controlled vs uncontrolled, polymorphic — even on 'split this component'.

Source repository stars
9
Declared platforms
0
Static risk flags
0
Last source update
2026-08-28
Source checked
2026-08-28

Decision brief

What it does: where it fits

Decide the shape of a component tree before the markup is written. Picks composition over inheritance, names the slot contract, draws the controlled/uncontrolled axis, and stops prop bags from growing into god-components. Stack-agnostic — the same lens applies to Blade, Livewire…

Best for

  • A new component / screen is being designed and the boundary
  • An existing component has 10 props, conditional rendering
  • A primitive (button, card, dialog) is being added to the design

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/ui-component-architect"
Safe inspection promptEditorial

Inspect the Agent Skill "ui-component-architect" from https://github.com/event4u-app/agent-config/blob/6a5670b7881a676c0da90d2afb950298087c4ccb/src/skills/ui-component-architect/SKILL.md at commit 6a5670b7881a676c0da90d2afb950298087c4ccb. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Procedure

    Read DESIGN.md § Owned components first — it is the project's own inventory of what it already owns (component, status, story file, registry item), filled from the story files rather than from memory by design-system-capture. It is the cheapest possible prior-art check: one tabl…

    Controlled — caller passes value + onChange. Caller ownsUncontrolled — component owns state internally; caller readsControlled with default — both APIs supported via
  2. 02

    When to use

    A new component / screen is being designed and the boundary

    A new component / screen is being designed and the boundaryAn existing component has 10 props, conditional renderingA primitive (button, card, dialog) is being added to the design
  3. 03

    Componentization threshold — ≥4 repeats AND real state

    Extract a stateful component only when an element repeats 4× or more AND carries real props/state (the stateful-component bar of the per-class canon, abstraction-thresholds — it does not lower the code-level two-repetition bar). One or two repeats, or a repeat with no varying pr…

    Extract a stateful component only when an element repeats 4× or more AND carries real props/state (the stateful-component bar of the per-class canon, abstraction-thresholds — it does not lower the code-level two-repetit…
  4. 04

    1. Inspect prior art, state the responsibility in one sentence

    Read DESIGN.md § Owned components first — it is the project's own inventory of what it already owns (component, status, story file, registry item), filled from the story files rather than from memory by design-system-capture. It is the cheapest possible prior-art check: one tabl…

    Read DESIGN.md § Owned components first — it is the project's own inventory of what it already owns (component, status, story file, registry item), filled from the story files rather than from memory by design-system-ca…Then review existing components in the codebase for the same responsibility — extend rather than rebuild when a match is found.A new component's workshop is part of its design, on every React lane and not only react-shadcn. When the extraction is agreed, the story set comes from storybook-workshop — one story per concept off the state-coverage…
  5. 05

    2. Pick composition over inheritance

    Composition trades verbose call-sites for a tiny, stable component. Inheritance trades short call-sites for ABI fragility.

    Composition trades verbose call-sites for a tiny, stable component. Inheritance trades short call-sites for ABI fragility.

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score95/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars9SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
event4u-app/agent-config
Skill path
src/skills/ui-component-architect/SKILL.md
Commit
6a5670b7881a676c0da90d2afb950298087c4ccb
License
MIT
Collected
2026-08-28
Default branch
main
View the original SKILL.md

ui-component-architect

Decide the shape of a component tree before the markup is written. Picks composition over inheritance, names the slot contract, draws the controlled/uncontrolled axis, and stops prop bags from growing into god-components. Stack-agnostic — the same lens applies to Blade, Livewire, React, or Vue trees. Pair with existing-ui-audit first; never invent components that already exist.

When to use

  • A new component / screen is being designed and the boundary between parent and children is unclear.
  • An existing component has > 10 props, conditional rendering trees nested ≥ 3 deep, or a variant-prop with > 4 values.
  • A primitive (button, card, dialog) is being added to the design system and its API will be reused across teams.
  • German triggers: "wie schneide ich die Komponente?", "Slots oder Props?", "controlled oder uncontrolled?".

Do NOT use when:

  • The component is a one-off, used in one place, and unlikely to be reused — over-architecting hurts more than it helps.
  • The question is styling, not shape — route to tailwind-engineer.
  • The audit step has not run — route to existing-ui-audit first; reusing beats inventing.

Componentization threshold — ≥4 repeats AND real state

Extract a stateful component only when an element repeats ~4× or more AND carries real props/state (the stateful-component bar of the per-class canon, abstraction-thresholds — it does not lower the code-level two-repetition bar). One or two repeats, or a repeat with no varying props, is not a component — inline it (a props-only shell earns extraction at 3+ uses). A long single-file body is normal, not a smell; premature extraction (a "component" used once, or a pure-markup fragment split for tidiness) adds indirection without reuse and is the more common mistake than under-splitting. Meet BOTH conditions before you extract.

Procedure

1. Inspect prior art, state the responsibility in one sentence

Read DESIGN.md § Owned components first — it is the project's own inventory of what it already owns (component, status, story file, registry item), filled from the story files rather than from memory by design-system-capture. It is the cheapest possible prior-art check: one table, and a deprecated row tells you not to reach for something that still exists in the tree. Absent or empty → fall through to existing-ui-audit, which reads the codebase itself.

Then review existing components in the codebase for the same responsibility — extend rather than rebuild when a match is found.

A new component's workshop is part of its design, on every React lane and not only react-shadcn. When the extraction is agreed, the story set comes from storybook-workshop — one story per concept off the state-coverage matrix below, which is what makes the component agent-readable and its contrast floor checkable before it reaches a page. That skill is stack-agnostic and ships in engineering-base, so a plain-react project receives it exactly as a react-shadcn one does. If none exists, write the new component's purpose: "Renders a labelled input with inline error and hint." If the sentence has an "and" joining two unrelated jobs, the component is two components. Reject the draft and split before continuing.

2. Pick composition over inheritance

Rules of thumb:

PatternWhen
Compound components (Card.Header, Card.Body)Multiple slots with order semantics
Children + named slotsOne main child, plus 1–2 optional regions
Render props / function-as-childrenCaller controls rendering of internal state
Polymorphic (as prop)Same shell, different semantic element
Inheritance / class-extensionAlmost never — last resort for legacy adapters

Composition trades verbose call-sites for a tiny, stable component. Inheritance trades short call-sites for ABI fragility.

3. Draw the controlled / uncontrolled axis

For every piece of state (open, value, selected, expanded), pick:

  • Controlled — caller passes value + onChange. Caller owns state. Use when state must sync across siblings or persist.
  • Uncontrolled — component owns state internally; caller reads via ref or onChange callback. Use for ephemeral state local to the component.
  • Controlled with default — both APIs supported via defaultValue + optional value. The most flexible, also the most code; reserve for design-system primitives.

Mixing controlled / uncontrolled in the same prop without a default is the single largest source of "why doesn't my component update?" tickets.

4. Cap the prop API

Prop budget per component:

TierCap
Primitive (Button, Input)≤ 6 props + ...rest to underlying element
Composite (Card, Dialog)≤ 8 props; prefer slots for variants
Page section / feature shell≤ 4 props; everything else via context

Over-budget is a prompt to look, not a verdict. Extract a config object, push state into context, or split into compound parts — or record why the count is right for this component.

THE CAPS ABOVE ARE ADVISORY. THEY ARE NOT A GATE AND MUST NOT BECOME ONE
WITHOUT A NEW MEASUREMENT. NOTHING COMPUTES THE TIER, SO NOTHING CAN APPLY THEM
AUTOMATICALLY EVEN IF IT WANTED TO.

Why advisory, measured rather than asserted (2026-08-24, one production component library: 55 atoms, 3 molecules, 2 organisms):

componentits levelpropscap hereover
file-uploadatom1963.2×
date-navigatormolecule1882.25×
picker-sheetorganism1443.5×
duration-inputmolecule1381.6×
steppermolecule48

The budget is INVERTED, and that is the finding rather than a calibration error. This table tightens as granularity rises. Reality goes the other way: a higher-level component legitimately surfaces every label, callback and test id of the pattern it orchestrates, so a cap that shrinks with tier flags the components that are correctly built and clears the one that is 3.2× over.

And for most components the number does not exist. Between 45 % and 72 % of that library declares no root prop interface at all, depending on how you count — React.ComponentProps<'div'> & VariantProps<cva> is the dominant idiom. A cap over an uncountable quantity is not a lenient rule; it is no rule.

The tier itself is not computable. Composition depth, state, sub-component count and prop count were each tested as a discriminator between the three levels. Every one overlapped completely, and several inverted. Sub-component count is the tempting replacement and fails the same way: atoms/combobox exports 16, more than every molecule (1, 1, 2) and more than one of the two organisms. So there is no measurement that could assign the tier a cap would be applied to.

Revisit-if: a corpus of levelled libraries — plural, and not four days old — yields a discriminator that separates the tiers without overlap, at which point the caps can be re-derived against it rather than restated. Until then these numbers are a conversation starter for a human reviewer, which is the only role the evidence supports.

5. Name the slot contract

For every slot, document: required vs optional, expected element type or component, default rendering when absent, accessibility implications (does the slot become the accessible name?). Slots without contracts become "stuff a div in there and pray".

Output format

Return:

  1. Responsibility + composition pick — single-sentence purpose, chosen pattern (compound / slots / render-props / polymorphic) with the one-line trade-off.
  2. State + prop API — controlled / uncontrolled / both per state piece, prop list with type and purpose, slot inventory with a11y notes.
  3. Anti-case list — the combinations the component refuses to support (the explicit "no" surface that callers can rely on).

Concrete shape:

Component:        <Name>
Responsibility:   <one sentence — reject if "and" joins two jobs>
Pattern:          <compound | slots | render-props | polymorphic>
State:            value=<controlled|uncontrolled|both>; open=<...>; ...
Props (≤ tier):   [name: type — purpose]
Slots:            [name: required? default? a11y note]
Children:         <count, kind>
Anti-cases:       <combinations the component refuses to support>

Gotcha

  • variant props with > 4 values are usually two components in a trench coat — split when the rendering branches diverge.
  • as polymorphism is cheap in TypeScript when typed via generics, expensive without — the type cost is invisible in plain JS.
  • Compound components share state via context; nesting two compound trees of the same family in one parent silently crosses contexts — namespace the context per instance or refuse the nesting.
  • "Render props" + memoization fight; if the function changes every render, the child re-renders too. Stabilize via useCallback or hoist.

Cross-task design memory

Before proposing a component, check the project root for DESIGN.md (written by design-system-capture). If present, apply its captured visual conventions (radius/shadow/motion/spacing) to the new component rather than deriving them from scratch. Flag any new design decision (e.g., a first-use of a new elevation tier) for capture: "Suggest adding to DESIGN.md: [decision]."

Do NOT

  • Do NOT design a component without running existing-ui-audit first. Reinventing primitives is the #1 source of design drift.
  • Do NOT use inheritance when composition fits — class-extension hierarchies in UI age badly.
  • Do NOT ship a "kitchen-sink" prop (config={...}) just to dodge the prop cap — that hides the API instead of taming it.
  • Do NOT push the architecture into the tracker as code AC — output is a design note for refinement, not implementation steps.

Frequently asked questions

What to verify before installation and use

What does the ui-component-architect source document cover?

Decide the shape of a component tree before the markup is written. Picks composition over inheritance, names the slot contract, draws the controlled/uncontrolled axis, and stops prop bags from growing into god-components. Stack-agnostic — the same lens applies to Blade, Livewire…

How do I install ui-component-architect?

The source record exposes this install command: npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/ui-component-architect". Inspect the command and pinned source before running it.

Alternatives

Compare before choosing

Computed 10045,960

coreyhaines31/marketingskills

ab-testing

When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program

Computed 100147

oaustegard/claude-skills

featuring

Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre

Computed 1009

event4u-app/agent-config

existing-ui-audit

Use BEFORE writing or editing any non-trivial UI — inventories components, design tokens, shadcn primitives, and reusable patterns into state.ui_audit. Hard gate for the ui directive set.

Computed 1009

event4u-app/agent-config

fe-design

Frontend design heuristics — and, outside the ticket engine, the loop that applies them: audit, brief, inventory, build, review. Use when building or changing any UI, not only when planning one.