component-designing

Plan React component architectures with feature-based structure and typed boundaries.

4|1|Updated Oct 13, 2025
One-click install
npx skills add https://github.com/buzzdan/ai-coding-rules --skill component-designing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-designing
Source: https://github.com/buzzdan/ai-coding-rules/tree/main/ts-react-linter-driven-development/skills/component-designing
Command: npx skills add https://github.com/buzzdan/ai-coding-rules --skill component-designing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing React + TypeScript UI at scale often leads to architecture drift, primitive obsession, and tangled component boundaries. This skill provides a clear approach to plan domain types, component boundaries, and feature-based structure before coding, helping teams create cohesive, maintainable interfaces.

Core Features & Use Cases

  • Feature-based architecture with vertical slices under src/features to keep related code together.
  • Clear separation of presentational and container components to improve testability and reuse.
  • Custom hooks and strongly typed boundaries (e.g., branded types or Zod schemas) to prevent primitive obsession.
  • Tests colocated with feature code and public exports via feature index files to improve discoverability.
  • Use cases include planning new features, extensive refactoring, and architecture reviews.

Quick Start

Plan a new UI feature by outlining the feature's domain types, component hierarchy, and hook design following a feature-based structure.

Frequently Asked Questions about component-designing

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

FAQPage Schema
How do I structure React components to avoid primitive obsession in TypeScript?

To avoid primitive obsession in React components, apply self-validating types like branded types or Zod schemas to enforce strongly typed boundaries. This prevents untyped primitives from passing deeply into your component hierarchy and centralizes domain validation.

What is feature-based architecture in React and when should I use it?

Feature-based architecture in React organizes code into vertical slices under src/features, colocating related components, hooks, and tests together. Use this structure for scalable TypeScript projects to improve maintainability, discoverability, and prevent architecture drift across UI modules.

How do I plan a scalable React component hierarchy before coding?

Plan a scalable React component hierarchy by defining domain types, separating presentational and container components, and designing custom hooks upfront. Codify these boundaries and feature-based file structures during feature planning or architecture reviews to ensure testability and reuse.

Does this React component design approach work for refactoring existing TypeScript projects?

Yes, this React component design approach works for refactoring existing TypeScript projects by applying architecture reviews to untangle component boundaries. It guides migrating code into feature-based vertical slices with colocated tests and clear public exports via feature index files.

How do I separate presentational and container components with custom hooks in React?

Separate presentational and container components in React by extracting business logic into custom hooks, leaving presentational components purely for UI rendering. This pattern improves testability and reuse while maintaining strongly typed boundaries across your feature-based architecture.

What is the best way to organize tests in a feature-based React architecture?

The best way to organize tests in a feature-based React architecture is colocating them with feature code inside src/features. This keeps related tests, components, and hooks together, improving discoverability and ensuring tests evolve alongside the feature's public exports.