React & TypeScript Rules

Enforce React and TypeScript coding standards for imports, types, and state patterns.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/A-Hazzard/Casino-Manangement-System --skill react-typescript-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: React & TypeScript Rules
Source: https://github.com/A-Hazzard/Casino-Manangement-System/tree/main/.claude/skills/react-typescript-rules
Command: npx skills add https://github.com/A-Hazzard/Casino-Manangement-System --skill react-typescript-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps developers write clean, consistent React + TypeScript code by enforcing import conventions, type usage, and state management patterns across the project.

Core Features & Use Cases

  • Enforces direct React imports (no React namespace) to reduce bundle size and improve clarity.
  • Promotes type-first development with structured type organization and preferred 'type' over 'interface' in TypeScript.
  • Provides patterns for local state (useState), reducers (useReducer), and simple global state (Context/ Zustand) with examples.
  • Helps maintain consistency across components, improves maintainability, and reduces debugging time.

Quick Start

Refactor a sample component to use direct React imports and typed props with a dedicated type file.

Frequently Asked Questions about React & TypeScript Rules

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

FAQPage Schema
What are the best practices for organizing TypeScript types in a React component library?

Organizing TypeScript types in a React component library involves type-first development with structured type organization, preferring 'type' over 'interface' to ensure consistent, error-resistant frontend code across your project.

How do I enforce direct React imports to reduce bundle size?

To enforce direct React imports and reduce bundle size, apply coding standards that eliminate the React namespace, improving clarity and consistency across your React with TypeScript components.

When should I use useReducer versus useState for state management in React?

Use useReducer versus useState for state management in React based on complexity: useState handles local state, while useReducer manages reducers, with Context or Zustand for simple global state patterns.

Does this React TypeScript coding standard apply to both apps and component libraries?

Yes, these React TypeScript coding standards apply to both apps and component libraries that use React with TypeScript, enforcing import patterns, type discipline, and common state management patterns.

Why prefer 'type' over 'interface' for TypeScript component design?

Preferring 'type' over 'interface' for TypeScript component design promotes type-first development and structured type organization, ensuring consistent, error-resistant frontend code across your project.

How do I refactor a React component to use direct imports and typed props?

To refactor a React component to use direct imports and typed props, apply these coding standards to update import conventions and utilize a dedicated type file for structured type organization.