.agents/skills/react-component-dev/SKILL.md
# React Component Development — Skill **Name:** `react-component-dev` **Purpose:** Build reusable, accessible React components with predictable APIs and ref forwarding. Use this skill when creating or refactoring components. **Applies when:** Building new components, refactoring UI components, or defining component APIs. **Do not use when:** Only editing styles or content in existing components without API changes. ## Rules - **Composition over configuration:** Prefer `children`/slots over m
npx skillsauth add asymmetric-al/core .agents/skills/react-component-devInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Name: react-component-dev
Purpose: Build reusable, accessible React components with predictable APIs and ref forwarding.
Use this skill when creating or refactoring components.
Applies when: Building new components, refactoring UI components, or defining component APIs. Do not use when: Only editing styles or content in existing components without API changes.
children/slots over many boolean props.forwardRef.forwardRef for DOM-rendering components.import * as React from "react";
type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
variant?: "default" | "ghost";
};
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ variant = "default", className, ...props }, ref) => {
return (
<button
ref={ref}
className={[
variant === "ghost" ? "bg-transparent" : "bg-black text-white",
className,
]
.filter(Boolean)
.join(" ")}
{...props}
/>
);
},
);
Button.displayName = "Button";
export function Card({ children }: { children: React.ReactNode }) {
return <div className="rounded-lg border p-4">{children}</div>;
}
export function CardHeader({ children }: { children: React.ReactNode }) {
return <div className="mb-2 font-semibold">{children}</div>;
}
export function CardBody({ children }: { children: React.ReactNode }) {
return <div>{children}</div>;
}
forwardRef on input-like componentsdiv for buttons/linksdevelopment
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
testing
Use when CI tests fail on main branch after PR merge, or when investigating flaky test failures in CI environments
tools
Use when new translation keys are added to packages to generate new translations strings
data-ai
Pointer to the canonical agent instruction and skill system for this monorepo