Instruction file imported from blazerroadg/front-end-clean-arch (
.github/instructions/ui-package.instructions.md). Copyright stays with the author.
Rules for packages/ui
- MUI-first: Every atom MUST wrap a component from
@repo/ds-adapter. Do not create raw HTML atoms when MUI has a match. - No domain logic: This package has zero knowledge of features, customers, recommendations, or any product concept.
- No API calls: Never import from
@repo/utils/dataor callfetch/createApiClienthere. - No mock data: Mock data belongs in
apps/sales-cockpit/src/features/. - CSS Modules only: Use
*.module.cssfor styles. No inline styles, no Tailwind, no styled-components. - Semantic tokens: In CSS modules, use
var(--color-*),var(--radius-*),var(--spacing-*)— never hardcoded hex/rgb values. - Props use
type, notinterface. Includechildren?: ReactNodefor composition. "use client"required if the component uses any React hook.- File structure:
component-name/component-name.tsx,component-name.module.css,component-name.test.tsx. - Barrel exports: Each atom/molecule/organism/pattern folder has an
index.ts.
Hierarchy
- Atoms: wrap ONE component from
@repo/ds-adapter - Molecules: compose 2-3 atoms
- Organisms: full UI sections from atoms+molecules
- Patterns: layout compositions