.agent-os/skills/react/SKILL.md
# React Skill > Loaded by: Frontend Division agents | Version: 1.0 ## Best Practices ### Component Structure - Use functional components with hooks (no class components) - Keep components under 200 lines; one component per file - Co-locate related files (component, styles, tests, types) ### Hooks - Custom hooks for reusable logic (prefix with `use`) - `useState` for simple local state; `useReducer` for complex state - `useEffect` cleanup to prevent memory leaks - `useMemo`/`useCallback` on
npx skillsauth add ab-aswini/agent-kit-p1 .agent-os/skills/reactInstall 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.
Loaded by: Frontend Division agents | Version: 1.0
use)useState for simple local state; useReducer for complex stateuseEffect cleanup to prevent memory leaksuseMemo/useCallback only when measurably neededinterface UserCardProps {
name: string;
email: string;
onEdit?: () => void;
}
const UserCard: React.FC<UserCardProps> = ({ name, email, onEdit }) => (
<div className="user-card">
<h3>{name}</h3>
<p>{email}</p>
{onEdit && <button onClick={onEdit}>Edit</button>}
</div>
);
export default UserCard;
any typeuseEffect for derived stateany typesdevelopment
Web application testing principles. E2E, Playwright, deep audit strategies.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
testing
Advanced vulnerability analysis principles. OWASP 2025, Supply Chain Security, attack surface mapping, risk prioritization.
development
# Testing Skill > Loaded by: QA Division agents | Version: 1.0 ## Test Pyramid ``` / E2E \ <- Few, slow, expensive / Integr. \ <- Some, moderate / Unit \ <- Many, fast, cheap ``` ## Unit Test Pattern (Arrange, Act, Assert) ```python def test_user_creation(): # Arrange user_data = {"name": "Alice", "email": "[email protected]"} # Act user = UserService.create(user_data) # Assert assert user.name == "Alice" assert user.id is