component-engineering
Skill11 starsChanged 9 days agoMITView on GitHub
Use when creating, refactoring or reviewing reusable UI components, component APIs, composition patterns, interaction states or component tests.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- adymire/CraftLayertheir own version, first seen Nov 15, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- adymire/CraftLayer★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- accessibility-automationSkill
- accessibility-reviewSkill
- accessible-componentsSkill
- accessible-motionSkill
- animation-performanceSkill
- anti-slop-uiSkill
- api-securitySkill
- authentication-sessionsSkill
- authorization-access-controlSkill
- core-web-vitalsSkill
- design-directionSkill
- design-system-architectureSkill
- document-head-seoSkill
- font-performanceSkill
- forms-and-validationSkill
- frontend-architectureSkill
- gsap-fundamentalsSkill
- icon-engineeringSkill
- image-asset-optimizationSkill
- independent-reviewSkill
- interactive-storytellingSkill
- javascript-performanceSkill
- keyboard-focusSkill
- modern-cssSkill
- motion-design-systemsSkill
- network-cachingSkill
- performance-auditingSkill
- performance-testingSkill
- premium-landing-pagesSkill
- quickstart-onboardingSkill
- rendering-performanceSkill
- responsive-engineeringSkill
- screen-reader-testingSkill
- scrolltrigger-experiencesSkill
- secrets-configurationSkill
- secure-application-designSkill
- secure-input-outputSkill
- security-reviewSkill
- security-testingSkill
- semantic-accessibilitySkill
- visual-design-reviewSkill
- visual-reference-analysisSkill
- wcag-auditingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 13 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Keep one-off page composition local unless reuse is demonstrated.
- Distinctive: line 20
Prefer composition and slots/children for variable content over a growing list of boolean flags.
- Distinctive: line 22
Document controlled versus uncontrolled behavior and callback semantics.
- Distinctive: line 23
Avoid exposing internal implementation details as public props.
- Distinctive: line 25
Use semantic HTML elements before custom roles or keyboard emulation.
- Distinctive: line 26
Keep state as close as practical to the component that owns it.
- Distinctive: line 33
Ensure focus indicators, contrast and non-color state cues.
- Distinctive: line 34
Use ARIA only when native semantics do not express the interaction.
- Distinctive: line 37
Use project tokens for color, type, spacing, radii and motion.
- Distinctive: line 38
Avoid leaking styles into unrelated components.
- Distinctive: line 42
Test observable behavior, not private implementation details.
- Distinctive: line 45
Test callbacks, controlled values and composition boundaries.
- Distinctive: line 46
Avoid snapshots as the only evidence for interactive behavior.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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 Engineering
Objective
Build components with clear contracts, predictable state, accessible semantics and focused tests. Reuse should reduce inconsistency without creating a generic component framework.
Workflow
- Confirm the use case
- Identify the repeated behavior or visual pattern and the consumers that need it.
- Inspect existing components, design tokens, naming conventions and test utilities.
- Keep one-off page composition local unless reuse is demonstrated.
- Define the contract
- Choose a small, typed public API with meaningful names and safe defaults.
- Prefer composition and slots/children for variable content over a growing list of boolean flags.
- Model mutually exclusive states as discriminated unions when supported by the language.
- Document controlled versus uncontrolled behavior and callback semantics.
- Avoid exposing internal implementation details as public props.
- Implement behavior
- Use semantic HTML elements before custom roles or keyboard emulation.
- Keep state as close as practical to the component that owns it.
- Support disabled, pending, error, empty and success states when relevant.
- Prevent duplicate submissions and stale asynchronous updates where applicable.
- Clean up subscriptions, listeners and asynchronous work according to the framework lifecycle.
- Build accessibility in
- Preserve native keyboard behavior and logical focus order.
- Provide visible labels and accessible names for interactive controls.
- Ensure focus indicators, contrast and non-color state cues.
- Use ARIA only when native semantics do not express the interaction.
- For dialogs, menus, tabs and other composite widgets, implement the expected keyboard and focus model rather than adding ARIA attributes alone.
- Style predictably
- Use project tokens for color, type, spacing, radii and motion.
- Avoid leaking styles into unrelated components.
- Support content growth, long labels, localization and zoom.
- Respect reduced-motion preferences.
- Test the contract
- Test observable behavior, not private implementation details.
- Cover default, variant, disabled, loading, error and keyboard paths that apply.
- Assert accessible names and roles where the test environment supports them.
- Test callbacks, controlled values and composition boundaries.
- Avoid snapshots as the only evidence for interactive behavior.
API review checklist
- Is the component solving a real repeated need?
- Are prop names explicit and types restrictive enough?
- Can consumers compose content without adding more flags?
- Are state ownership and event timing predictable?
- Does the component preserve native semantics?
- Are invalid prop combinations impossible or clearly handled?
- Are defaults safe and visually consistent?
- Is the component testable without mocking its entire implementation?
Common AI failure mode
Failure: The agent turns a single repeated pattern into a universal component with dozens of unrelated props and boolean combinations.
Symptoms:
- Boolean prop combinations make invalid or impossible states easy to express.
- The prop surface grows every time a new consumer adopts the component.
- Props expose open-ended implementation overrides (
className, inlinestyle, arbitrary padding/margin values) instead of bounded, enumerated variants. - Internal state setters or mutable internals are exposed as public API.
- Behavior differs across consumers in ways no single prop was designed to express.
- A change required by one consumer breaks another, and no test caught it.
Why it matters: Consumers inherit an unpredictable API, invalid states become easy to express, and every change risks breaking unrelated use cases. The abstraction increases maintenance cost instead of reducing inconsistency.
Prevention: Confirm that multiple consumers share the same behavior before extracting a component. Define a small typed contract, model mutually exclusive states explicitly, and use composition for variable content. Keep one-off composition local. Preserve native semantics, keep state ownership private, and test observable behavior—including keyboard and accessible-name paths—in a real consuming context.
Completion criteria
A component has a documented, minimal contract; predictable behavior; semantic and keyboard-accessible interactions; responsive styling; and tests that cover its meaningful states.
State and contract matrix
For complex reusable components, list supported variants and states. Include trigger, visible output, accessible name/role/state, keyboard behavior, emitted event and recovery behavior. Exclude impossible combinations from the public API rather than relying on undocumented conventions.
For asynchronous components, define request ownership, cancellation or stale-result handling, retry behavior and whether the component or parent owns pending state. Define which element receives public attributes, forwarded refs, accessible names and form participation.
Preserve native browser behavior, avoid nested interactive elements, and ensure empty, long and localized content do not break the contract. Verify the component in a real consuming context; isolated tests do not prove integration behavior.
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.

