build-react-codebase-guidelines

Guides implementation of maintainable React and TypeScript components, hooks, and state.

Updated Apr 28, 2026
One-click install
npx skills add https://github.com/GregM1991/skills --skill build-react-codebase-guidelines-gregm1991
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: build-react-codebase-guidelines
Source: https://github.com/GregM1991/skills/tree/main/skills/build-react-codebase-guidelines
Command: npx skills add https://github.com/GregM1991/skills --skill build-react-codebase-guidelines-gregm1991

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React codebases often accumulate maintainability problems—scattered state, hidden logic in hooks, leaked vendor types, and missing loading or error states—that only surface during painful reviews or refactors. This Skill provides proactive engineering guardrails so agents build React and TypeScript code that stays easy to change as it grows. ## Core Features & Use Cases - Decision rules for React primitives: Clear criteria for choosing between components, hooks, plain functions, local state, context, and global stores. - Explicit async UI modeling: Ensures loading, error, empty, success, disabled, and pending states are designed rather than improvised. - Dependency and adapter guidance: Wraps third-party SDKs, analytics, and browser APIs behind local seams to prevent vendor lock-in. - Use Case: When adding a new data-driven feature to a React app, the agent plans component seams, keeps state local, models async states explicitly, and verifies with behavior-focused tests before handoff. ## Quick Start Ask the agent to implement a new React feature, such as a paginated user list with loading and error states, following these codebase guidelines.

Frequently Asked Questions about build-react-codebase-guidelines

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

FAQPage Schema
How do I decide between a React hook and a plain function?▼

Use a plain function for pure transformations like formatting, filtering, and mapping that can run outside React. Use a hook only when the logic needs React state, lifecycle, effects, refs, context, or subscriptions. If a hook merely wraps a pure helper, delete the hook and export the helper.

When should I use local state vs context vs a global store in React?▼

Start with local state owned by one feature surface, then lift it to the nearest common owner when siblings need it. Use context for values many descendants read, and reserve a global store only for cross-route or cross-feature state with multiple real readers and writers.

Should I use useEffect to derive state in React components?▼

No. Values that can be computed from props, query data, or existing state should be derived during render, not stored via useEffect. Effects should synchronize with external systems like subscriptions, timers, and observers, with correct dependencies and cleanup.

Does this guidance apply to backend Node.js TypeScript projects?▼

No. The guidelines target React and TypeScript frontend codebases specifically. They explicitly exclude backend or Node-only TypeScript, non-React frontends, build and CI tooling, and pure CSS or styling tasks.

When should I add memoization in React?▼

Do not memoize by default. Memoize context provider values, expensive derived calculations, stable callbacks passed to memoized children, and objects or arrays whose identity affects effects or renders. Avoid default object or array literals in props that break stable identity.