mcpField
R
react-component-architecture

react-component-architecture

github.com/aj-geddesDevelopment373677 installsUpdated 34w ago
Repository

About react-component-architecture

react-component-architecture is a skill for React developers building maintainable, scalable components. It covers functional components, hooks, composition patterns, and type safety with TypeScript.

Key features

  1. 01Use functional components and hooks
  2. 02Design reusable component patterns
  3. 03Develop custom hooks
  4. 04Organize interfaces with composition
  5. 05Apply TypeScript for type safety

Use cases

  1. 01Plan architecture for large React apps
  2. 02Design component libraries and reusable UI
  3. 03Develop custom hooks
  4. 04Improve component performance and maintainability

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill react-component-architecture

After installing, type/react-component-architecturein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
composition-pattern.md
custom-hooks-pattern.md
functional-component-with-hooks.md
higher-order-component-hoc.md
render-props-pattern.md
templates/
component-template.tsx

Details

From the project README

React Component Architecture

Table of Contents

Overview

Build scalable, maintainable React components using modern patterns including functional components, hooks, composition, and TypeScript for type safety.

When to Use

  • Component library design
  • Large-scale React applications
  • Reusable UI patterns
  • Custom hooks development
  • Performance optimization

Quick Start

Minimal working example:

// Button.tsx
import React, { useState, useCallback } from 'react';

interface ButtonProps {
  variant?: 'primary' | 'secondary' | 'danger';
  size?: 'sm' | 'md' | 'lg';
  disabled?: boolean;
  onClick?: () => void;
  children: React.ReactNode;
}

export const Button: React.FC<ButtonProps> = ({
  variant = 'primary',
  size = 'md',
  disabled = false,
  onClick,
  children
}) => {
  const variantStyles = {
    primary: 'bg-blue-500 hover:bg-blue-600',
    secondary: 'bg-gray-500 hover:bg-gray-600',
    danger: 'bg-red-500 hover:bg-red-600'
  };

  const sizeStyles = {
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Functional Component with HooksFunctional Component with Hooks
Custom Hooks PatternCustom Hooks Pattern
Composition PatternComposition Pattern
Higher-Order Component (HOC)Higher-Order Component (HOC)
Render Props PatternRender Props Pattern

Best Practices

✅ DO
  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying
❌ DON'T
  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

Comments

Markdown supported