opsrv/skills-agents/react-conventions
Claude Code and agent skill by opsrv/skills-agents
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Use when writing, reviewing, or refactoring React code. Defines project-specific component patterns, typing, state management, hooks, and code quality conventions.
Install
npx vskill@latest install opsrv/skills-agents/react-conventionsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as opsrv/skills-agents/react-conventions.
React Conventions
Core principle: Explicit, readable components over clever abstractions.
Portability note: This skill defines universal React patterns. Specific library choices (state manager, form library, bundler, package manager) are project-specific — check the project'sCLAUDE.mdfirst. IfCLAUDE.mdspecifies a library, use it. If not, the recommendations below are sensible defaults — but always ask the user before installing.
Conventions
Components, TypeScript & File Structure
See component-patterns.md for rules on:
- Functional component structure (arrow functions +
export const) - Props typing and default values
- Directory layout, one entity per file, barrel exports policy
- Constants grouping by domain
Coding Style
See coding-style.md for rules on:
- Naming conventions (PascalCase, camelCase, UPPER_SNAKE_CASE, boolean prefixes)
- File naming by type
- Prettier config and ESLint plugins
- Import order
State Management & Hooks
See state-and-hooks.md for rules on:
- Local vs global state boundaries
- Server state management
- Custom hooks for logic extraction
- Memoization (
useMemo,useCallback) anduseEffectdiscipline
Error Handling
See error-handling.md for rules on:
- Error Boundary placement and granularity
- Async
try/catchin event handlers - Error states in UI (see also async-ui-states.md)
Approval required before adding Error Boundaries or restructuring error handling.
Forms
See forms.md for rules on:
- Form library usage (match what the project uses; ask if none present)
- Schema-based validation (
zod/yup) - Field-level errors, submit state, disabled button during submission
Approval required before installing a form library or changing form architecture.
Security
See security.md for rules on:
dangerouslySetInnerHTML— forbidden by default,DOMPurifyrequired if approvedhref/srcwith user input — validate protocol- For deep review: use
agents/code-reviewerandskills/find-bugs
Async UI States
See async-ui-states.md for rules on:
- Handling loading / error / empty / data states
useMutationpending and error states- Suspense — only if already adopted in the project
Context API
See context-api.md for rules on:
- When Context is appropriate (theme, auth, compound components)
- Provider + typed hook co-location pattern
- What NOT to use Context for (server state, high-frequency updates)
Approval required before introducingReact.createContext.
Composition Patterns
See composition-patterns.md for rules on:
- Slot-like API (named
ReactNodeprops for layout components) - Compound components (
Tabs.Tab,Tabs.Panel) with scoped Context childrenvs named props vs compound components decision table
Testing
Follow `skills/test-driven-development` -- no production code without a failing test first.
- Jest + React Testing Library for component behavior (not implementation details)
- E2E: Playwright for critical scenarios (by request)
- Unit tests for hooks and utilities
- Use
agents/test-engineerfor test generation
Red Flags
Agent MUST NOT do any of the following without explicit approval:
- Deviate from the agreed plan
- Make "nice to have" changes outside the scope
- Install packages not specified in the plan
- Configure or use a global state manager without confirmed need
Performance
See performance.md for rules on:
- Algorithmic complexity (Map/Set over nested loops)
- Derived state, memoization, large collections, inline objects
Code Quality
- Declarative style:
map+filterover manual loops - Comments only for non-obvious logic
- Custom hooks for any repeated logic
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/react-conventions/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/opsrv/skills-agents/react-conventions)