react-guidelines

Enforce React and TypeScript coding guidelines for components and hooks.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/roeibajayo/claude-tools --skill react-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-guidelines
Source: https://github.com/roeibajayo/claude-tools/tree/main/.claude/skills/react-guidelines
Command: npx skills add https://github.com/roeibajayo/claude-tools --skill react-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill codifies React frontend guidelines to reduce cognitive load during code reviews, prevent common pitfalls, and keep code consistent across teams.

Core Features & Use Cases

  • One file per hook/component: Every hook, component, or modal should have its OWN file to improve maintainability.
  • Don't use useState or useEffect directly in components: Always move stateful logic into dedicated custom hooks (e.g., useBot, useBacktesting).
  • Function components with default export: Components should be defined as functions and exported via default export.
  • Explicit TypeScript types: Avoid any and anonymous types; create explicit types when needed.
  • Quality checks on changes: Run type checks and linting when frontend changes are made.
  • Guidance for new pages: Follow the instructions in references to structure new pages.

Quick Start

Review a React file and apply the guidelines to identify violations and propose fixes, e.g.: Inspect 'src/components/Login.tsx' and ensure it uses a separate hook, proper file-per-component structure, and explicit types.

Frequently Asked Questions about react-guidelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure React components to follow best practices?

React components should be defined as default-exported functions in separate files, with stateful logic moved into dedicated custom hooks rather than using useState or useEffect directly in components. This separation improves maintainability and keeps components focused on rendering.

Why should I separate hooks from components into different files?

One file per hook or component reduces cognitive load during code reviews and prevents common pitfalls. Dedicated files for hooks like useBot or useBacktesting make stateful logic reusable, testable, and easier to maintain across your React codebase.

What TypeScript practices should I follow in React projects?

Avoid using any and anonymous types in React code. Instead, create explicit TypeScript types for props, state, and return values. This prevents runtime errors and makes your component interfaces clear to other developers during code reviews.

How do I enforce code quality when making frontend changes?

Run lint, type-check, and format checks whenever you modify React code. These automated quality gates catch violations of your React guidelines early and ensure consistency across your frontend codebase without manual review delays.

Can I use useState and useEffect directly in my React components?

No. React guidelines require moving all stateful logic into custom hooks. This pattern keeps components pure, focused on rendering, and makes hooks reusable across multiple components instead of duplicating logic.

What's the best way to structure new React pages?

Follow the prescribed structure for new pages: use default-exported function components, place each hook and component in its own file, use explicit TypeScript types, and ensure all changes pass lint and type checks before merging.