Component and type design for TypeScript + React code. Use when planning new features, designing components and custom hooks, preventing primitive obsession, or when refactoring reveals need for new abstractions. Focuses on feature-based architecture and type safety.
View on GitHubbuzzdan/ai-coding-rules
ts-react-linter-driven-development
January 16, 2026
Select agents to install to:
npx add-skill https://github.com/buzzdan/ai-coding-rules/blob/main/ts-react-linter-driven-development/skills/component-designing/SKILL.md -a claude-code --skill component-designingInstallation paths:
.claude/skills/component-designing/# Component Designing
Component and type design for TypeScript + React applications.
Use when planning new features or identifying need for new abstractions during refactoring.
## When to Use
- Planning a new feature (before writing code)
- Refactoring reveals need for new components/hooks
- Linter failures suggest better abstractions
- When you need to think through component architecture
- Designing state management approach
## Purpose
Design clean, well-composed components and types that:
- Prevent primitive obsession (use branded types, Zod schemas)
- Ensure type safety with TypeScript
- Follow component composition patterns
- Implement feature-based architecture
- Create reusable custom hooks
## Workflow
### 0. Architecture Pattern Analysis (FIRST STEP)
**Default: Always use feature-based architecture** (group by feature, not technical layer).
Scan codebase structure:
- **Feature-based**: `src/features/auth/{LoginForm,useAuth,types,AuthContext}.tsx` ✅
- **Technical layers**: `src/{components,hooks,contexts}/auth.tsx` ⚠️
**Decision Flow**:
1. **Pure feature-based** → Continue pattern, implement as `src/features/[new-feature]/`
2. **Pure technical layers** → Propose: Start migration with `docs/architecture/feature-based-migration.md`, implement new feature as first feature slice
3. **Mixed (migrating)** → Check for migration docs, continue pattern as feature-based
**Always ask user approval with options:**
- Option A: Feature-based (recommended for cohesion/maintainability)
- Option B: Match existing pattern (if time-constrained)
- Acknowledge: Time pressure, team decisions, consistency needs are valid
**If migration needed**, create/update `docs/architecture/feature-based-migration.md`:
```markdown
# Feature-Based Architecture Migration Plan
## Current State: [technical-layers/mixed]
## Target: Feature-based structure in src/features/[feature]/
## Strategy: New features feature-based, migrate existing incrementally
## Progress: [x] [new-feature] (this