Imported from jose-codegourmet/fe-multi-web-template (
packages/ui/AGENTS.md). Install upstream withnpx skills add jose-codegourmet/fe-multi-web-template --skill ui. Copyright stays with the author.
Agent Instructions — packages/ui
Local agent instructions for the shared UI package. Read /AGENTS.md first, then this file.
Scope
packages/ui (@fe-template/ui) is the shared UI primitive library for both apps. It contains shadcn/Base UI style components, a DataTable, a ScrollReveal motion component, form helpers, and the cn() utility. It ships TypeScript/TSX source and has no build step.
- Workspace name:
@fe-template/ui - Filter:
pnpm --filter @fe-template/ui - Package name:
@fe-template/ui
Public entry points
| Entry | Path | What it provides |
|---|---|---|
. |
src/index.ts |
Barrel export of all components and cn |
./styles.css |
src/styles.css |
tw-animate-css import |
./* |
src/components/* |
Subpath access to individual components (not currently used by apps) |
Consumers
apps/web— marketing sections, layout, showcase.apps/admin— dashboard tables, dialogs, forms, layout, charts.
Both apps consume @fe-template/ui at runtime. No other workspace package (packages/db, packages/config) depends on it.
Important directories
| Directory | Purpose |
|---|---|
src/components/ |
One folder per component (63 today; see src/index.ts) |
src/components/table/data-table/ |
DataTable wrapper around TanStack Table |
src/components/motion/scroll-reveal/ |
ScrollReveal motion component |
src/lib/utils.ts |
cn() utility |
src/index.ts |
Public barrel export |
src/styles.css |
tw-animate-css import |
Validation commands
| Concern | Command |
|---|---|
| Type check | pnpm --filter @fe-template/ui typecheck |
| Lint (Biome) | pnpm --filter @fe-template/ui lint |
| Biome (repo-wide) | pnpm lint |
Restrictions and boundaries
- Preserve the public barrel in
src/index.tswhen adding or renaming components. Do not remove exports unless the component is being deleted. - Do not import app-specific code into this package. It must remain generic.
- Do not add app-specific business logic to components. Keep primitives composable.
- Keep peer dependencies minimal:
reactandreact-domare currently required. - Adding a new dependency here affects both apps. Prefer adding to a specific app if the dependency is not needed by both.
Common task routing
| Task | Read next |
|---|---|
| Add a new primitive | packages/ui/docs/development.md, docs/template/COMPONENTS.md, docs/component-guide.md |
| Change a component API | packages/ui/docs/api.md, then search consumers in both apps |
| Fix a styling issue | docs/styling-and-design-system.md |
Update cn() |
src/lib/utils.ts — changes affect both apps |
Documentation maintenance
Update this file and packages/ui/docs/ when:
- A new public export is added.
- A component API changes.
- A new consumer appears.
- The build or validation commands change.