component-review
Skill0 starsChanged 2 months agoMITView on GitHub
A rigorous component API review checklist — prop design, composition over configuration, controlled vs uncontrolled, escaping hatches — runnable by an agent before shipping UI. Use when designing a new component or reviewing one for a library.
In this repository11 other files it gives its agents.
- api-contract-designSkill
- browser-debuggingSkill
- css-architectureSkill
- frontend-testing-strategySkill
- nextjs-performanceSkill
- performance-budgetSkill
- react-hooks-disciplineSkill
- state-managementSkill
- typescript-strictnessSkill
- vue3-compositionSkill
- web-a11ySkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run this checklist in order.
- Distinctive: line 12
If the pitch is "a table and a filter panel and export", it's three components wearing one badge.
- Distinctive: line 35
Prefer children/slots over prop-driven DOM:
- Distinctive: line 53
Every abstraction is wrong for someone.
- Very specific: line 59
If users need !important and DOM hacking, the API failed.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Component API review
Run this checklist in order. A "no" on the first five questions usually means redesign, not patching.
1. Can I describe the component in one sentence without "and"?
If the pitch is "a table and a filter panel and export", it's three components wearing one badge. Split.
2. Props: nouns not adjectives-soup
- Data props (what to render) vs behavior props (what to do) vs style props (rare).
5 booleans → the component has modes; extract variants or split components.
- Booleans named
isXxxDisabledWhenYyyare logic leaking into API — compute in the caller.
3. Controlled, uncontrolled, or both — declared explicitly
// the React idiom for "both"
const [value, setValue] = useControlled({
value: props.value,
defaultValue: props.defaultValue,
onChange: props.onChange,
})A component that is sometimes controlled and sometimes mutates internal state without saying so is a bug factory.
4. Composition over configuration
Prefer children/slots over prop-driven DOM:
// ❌ 12 layout props
<Card titleAlign="left" footerBorder={false} actionsPosition="top" ... />
// ✅ slots
<Card>
<Card.Header>Title</Card.Header>
<Card.Body>...</Card.Body>
<Card.Footer>...</Card.Footer>
</Card>Render props / children-as-function for cross-component coupling (render prop <Select>{(items) => ...}</Select>), never for trivial layout.
5. Escape hatches exist
Every abstraction is wrong for someone. Provide, in order of preference:
- className/styling hook — cosmetic overrides
- slot/render props — structural overrides
- a real escape:
asChild/Componentpolymorphism — behavioral overrides
If users need !important and DOM hacking, the API failed.
6. Events name outcomes, not gestures
onCollapse, onSelectionChange (intent) beat onClick, onMouseMove (raw gesture) — the latter belongs on the underlying element anyway.
7. Accessibility is part of the API
- The contract includes roles/keyboard behavior; document which ARIA pattern it implements.
- Slotting arbitrary children must not break semantics (a
<div>inside<ul>is a violation the component must prevent or sanitize).
8. Refs & SSR
- Forward refs; the DOM node is part of the contract.
- No
window/documentat module top or during render — guard for SSR.
Definition of done (agent checklist)
- One-sentence pitch, no "and"
- Controlled/uncontrolled story explicit
- Slots for structure, props for data, minimal booleans
- Escape hatch documented
- Keyboard + ARIA behavior documented and tested
- Ref forwarding + SSR safe
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

