react-component
Skill1 starsChanged 25 days agoMITView on GitHub
Create or refactor a React component the way this project expects — typed props, named export, Tailwind tokens, accessibility, co-located test and the right layer. Use when asked to build, extract, split or clean up a component, hook or page.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- nateslabach/skillstheir own version, first seen Nov 8, 2026
- YangLingyu1/claude-skillstheir own version, first seen Oct 25, 2026
- minagayid/Agentstheir own version, first seen Jul 5, 2026
- PengEjeen/claude_skillstheir own version, first seen May 22, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- nateslabach/skills★ 6same name
- minagayid/Agents★ 1same name
- PengEjeen/claude_skills★ 0same name
- YangLingyu1/claude-skills★ 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 repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/rtv-architecture.mdcCursor rule
- .cursor/rules/rtv-code-style.mdcCursor rule
- .cursor/rules/rtv-design-system.mdcCursor rule
- .cursor/rules/rtv-git-workflow.mdcCursor rule
- .cursor/rules/rtv-testing.mdcCursor rule
- accessibility-auditSkill
- ci-cd-dockerSkill
- clean-code-reviewSkill
- dependency-upgradeSkill
- deployment-insightsSkill
- project-architectureSkill
- scaffold-featureSkill
- tailwind-design-systemSkill
- testing-vitestSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 77
Default export, one h1, composed from components.
≈ “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
React component
Where it goes
Decide the role first (skill project-architecture): reusable UI → @components, route-level → @pages, logic → @hooks. A component used by one page lives inside that page's folder (<pages>/<Page>/components/) until a second page needs it.
File layout
src/components/Button/
├── index.tsx # the component (named export)
└── Button.test.tsx # optional co-located unit test; page tests live in __tests__/pagesBarrel: add export * from './Button' to the folder's index.ts when one exists.
Shape
import type { ButtonHTMLAttributes, ReactNode } from 'react'
type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
variant?: 'primary' | 'secondary'
children: ReactNode
}
const variants: Record<NonNullable<ButtonProps['variant']>, string> = {
primary: 'bg-brand-600 text-white hover:bg-brand-500 focus-visible:outline-brand-600',
secondary:
'bg-white text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:bg-gray-900 dark:text-gray-100 dark:ring-gray-700',
}
export function Button({
variant = 'primary',
className = '',
type = 'button',
children,
...props
}: ButtonProps) {
return (
<button
type={type}
className={[
'inline-flex items-center justify-center rounded-md px-3 py-2 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2',
variants[variant],
className,
].join(' ')}
{...props}
>
{children}
</button>
)
}Rules of thumb:
- Props: a
type XProps; extend the native element's attributes when wrapping one;children: ReactNodewhen composition is expected; callbacks namedonX. - State stays as low as possible; lift it only when siblings need it. Derive values during render instead of mirroring them in state.
- Effects are for synchronising with the outside world (DOM, subscriptions, storage), never for computing state. Lint (
react-hooks/*) will flagsetStatein effects. - Data comes in through props or a hook from
@hooks; components never import@services. - Styling: Tailwind utilities with
brand-*tokens anddark:variants (ruledesign-system). AcceptclassNameto allow composition; put it last. - Accessibility: real elements (
button,a,label), accessible names for icon-only controls (sr-only),aria-*only when semantics are missing. - Size: under ~150 lines; split by responsibility (layout vs. content, container vs. presentational).
Pages
Default export, one h1, composed from components; __tests__/pages/<Page>.test.tsx renders it and asserts the heading. Register the route in src/App.tsx.
Hooks
useX in @hooks (or inside the page/slice while local). Return a small object; keep side effects inside; accept dependencies as parameters so they are testable. Lazy-initialise state (useState(() => read())) instead of effects that set state.
Checklist
- Right layer and alias imports (no
../) - Typed props, named export (default only for pages)
- Works in light and dark mode, mobile first
- Keyboard reachable with visible focus; icons
aria-hidden - Test added or updated;
npm run checkgreen
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.

