ui-component-architecture

Refactor React screens to reuse shared UI primitives from a monorepo package.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/darkmatter/skills --skill ui-component-architecture-darkmatter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ui-component-architecture
Source: https://github.com/darkmatter/skills/tree/main/skills/ui-component-architecture
Command: npx skills add https://github.com/darkmatter/skills --skill ui-component-architecture-darkmatter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents React screens from turning into oversized walls of duplicated Tailwind markup by helping you reuse existing shared UI primitives and extract genuinely reusable pieces into a monorepo's @repo/ui package.

Core Features & Use Cases

  • Reuse-first component selection: Checks what already exists in the shared UI package before writing new JSX so you do not rebuild buttons, cards, badges, inputs, dialogs, or empty states.
  • Thin screen composition: Keeps route and page files focused on data wiring and app-specific layout instead of embedding all presentation details directly in the screen.
  • Reusable primitive graduation: Identifies UI pieces that should move into @repo/ui when they are reused or clearly generic, while leaving one-off composition in the app.
  • Guardrails against over-extraction: Avoids creating shared components that are too app-specific, too early, or coupled to stores, routers, or API clients.
  • Use case: You are building a dashboard page with repeated card and stat patterns, and this Skill helps you compose the page from existing primitives, extract only the stable visual units, and keep the page readable.

Quick Start

Ask for help refactoring a React screen in a monorepo with a shared UI package so it reuses @repo/ui components and extracts only the reusable parts.

Frequently Asked Questions about ui-component-architecture

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

FAQPage Schema
How do I reduce duplicated React UI markup in a monorepo?

Reduce duplicated React UI markup in a monorepo by composing screens from existing shared primitives in a `@repo/ui` package. This keeps screens thin by separating reusable presentational components from app-specific layout and data wiring.

When should I extract a React component into a shared UI package?

Extract a React component into a shared UI package when it is reused across multiple screens or is clearly generic. Avoid extracting components too early if they are one-off compositions, too app-specific, or coupled to stores, routers, or API clients.

How do I keep React route and page files thin with Tailwind?

Keep React route and page files thin with Tailwind by focusing them on data wiring and app-specific layout. Reuse existing visual primitives like buttons, cards, and dialogs from your shared UI package instead of embedding all presentation details directly in the screen.

Can I refactor a dashboard page to use existing shared UI components?

Yes, you can refactor a dashboard page to use existing shared UI components by identifying available primitives like cards and stats before writing new JSX. This approach composes the page from existing components and extracts only the stable visual units.

What are the limitations of over-extracting React components into a monorepo?

The limitation of over-extracting React components into a monorepo is creating shared components that are too app-specific, too early, or coupled to stores, routers, or API clients. Guardrails prevent moving one-off composition into the shared `@repo/ui` package.

Does this approach work for React screens using @repo/ui imports?

Yes, this approach works for React screens using @repo/ui imports in projects with a shared `packages/ui` package. It applies to page, route, and screen development by identifying existing primitives and separating reusable presentational components from app-specific composition.