opsrv/skills-agents/react-conventions

Claude Code and agent skill by opsrv/skills-agents

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

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-conventions

Semi-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's CLAUDE.md first. If CLAUDE.md specifies 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) and useEffect discipline
Error Handling

See error-handling.md for rules on:

  • Error Boundary placement and granularity
  • Async try/catch in 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, DOMPurify required if approved
  • href / src with user input — validate protocol
  • For deep review: use agents/code-reviewer and skills/find-bugs
Async UI States

See async-ui-states.md for rules on:

  • Handling loading / error / empty / data states
  • useMutation pending 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 introducing React.createContext.
Composition Patterns

See composition-patterns.md for rules on:

  • Slot-like API (named ReactNode props for layout components)
  • Compound components (Tabs.Tab, Tabs.Panel) with scoped Context
  • children vs 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-engineer for 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 + filter over 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/opsrv/skills-agents/react-conventions/badge)](https://verified-skill.com/skills/opsrv/skills-agents/react-conventions)

Something wrong with this skill or its page? Tell us.