Files
agentic-dev/packages/core-ui/AGENTS.md
Danijel Martinek f77e6ea881 chore(template): clean-slate template snapshot from bb4a0c7
Curated, product-agnostic snapshot of the post-story-04 tree: demo
content deleted, auth-only reference feature, web-next shell, all gates
green. Product-specific docs, ADRs 027-029, PRDs/epics/archive, editor
library traces, and product naming are curated out; generic template
repairs (coverage provider devDeps, root test:coverage script, live
lint fixes, root-only release-please) are kept. See TEMPLATE.md for
provenance, curation list, and usage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016j8z4VHjedXDTjEDNg7qHK
2026-07-12 20:40:54 +02:00

2.3 KiB

AGENTS.md — core-ui

Design-system primitives organized by Atomic Design. Only generic components (atoms, molecules, generic organisms) live here. Feature-specific components live in their respective feature packages.

Responsibilities

  • Atoms — Single HTML elements: Button, Input, Label, Card
  • Molecules — Combinations: FormField (Label + Input), Badge, Avatar
  • Generic Organisms — Reusable complex layouts: Modal, Tabs, NavigationMenu, CommandPalette
  • Templates — Page layouts: AuthLayout, DashboardLayout, LandingLayout
  • Utilitiescn() for className merging, design tokens, Tailwind config

Feature-specific boundary

Feature-specific organisms (e.g., ArticleCard, ArticleList, HeaderNavMenu) live in their feature's ui/ folder, NOT here. This boundary keeps core-ui framework-agnostic and reusable.

Must NOT import

  • Any feature package (@repo/auth, @repo/blog, etc.)
  • Any app package
  • @repo/core-api, @repo/core-cms, @repo/core-trpc

Note: @repo/core-trpc is an optional package scaffolded via pnpm turbo gen core-package trpc. If not present, this constraint still applies to any future installation.

Public exports

From package.json:

  • . — all atoms, molecules, organisms, templates

Example usage:

import { Button, Input, Label } from "@repo/core-ui";
import { FormField } from "@repo/core-ui";
import { Modal, Tabs } from "@repo/core-ui";

Test conventions

  • Tests colocated: src/atoms/button/button.tsxsrc/atoms/button/button.test.tsx
  • Vitest environment: jsdom (React component testing)
  • Alias: @/ resolves to src/
  • Run: pnpm test --filter @repo/core-ui
  • Storybook stories colocated: src/atoms/button/button.stories.tsx

Structure

To scaffold a new component, use pnpm turbo gen core-ui-component rather than creating files manually. The generator emits the 4-file pattern below and splices the export into the tier barrel.

src/
  atoms/
    {name}/
      {name}.tsx             # Component
      {name}.test.tsx        # Tests
      {name}.stories.tsx     # Storybook story
      index.ts               # Barrel export
  molecules/
    {name}/
      ...
  organisms/
    {name}/
      ...
  templates/
    {name}/
      ...
  lib/
    utils.ts                 # cn() and helpers
  index.ts                   # Re-exports everything