This file is injected automatically as context for all agents working in this project.
Keep it minimal — detailed workflows live in skills (skills/).
Stack-and-Flow Design System — open-source, educational React component library.
| Key | Value |
|---|---|
| Package | @stack-and-flow/design-system |
| Repo | https://github.com/Stack-and-Flow/design-system |
| Storybook | https://sf-design-system.netlify.app/ |
| Guidelines | docs/GUIDELINES.md |
| Contributing | docs/CONTRIBUTING.md |
| Visual Design | docs/DESIGN.md |
Stack: React 19 · TypeScript strict · Tailwind v4 @theme · Radix UI · CVA · Storybook 8 · Biome · Lefthook · Vite · pnpm 10.34.1
Available tooling:
pnpm run build— builds the publishable package and sanitizes generated declarationspnpm run verify:package— builds, packs, and verifies real React 18 + React 19 consumerspnpm run storybook— starts Storybook with hot reloadpnpm run test— runs Vitest unit testspnpm run test:coverage— runs tests with coverage report
Components live in src/components/{atoms|molecules|organisms}/{kebab-name}/ with exactly 6 files:
| File | Role |
|---|---|
ComponentName.tsx |
Presentational — JSX only, consumes the hook |
useComponentName.ts |
Logic — state, effects, handlers, CVA class calls |
types.ts |
Types + CVA variants |
ComponentName.test.tsx |
Complete test suite (hook + component tests) |
ComponentName.stories.tsx |
Storybook stories (documentation only, no tests) |
index.ts |
Public API re-exports |
typealways — neverinterface- Never
any— useunknownor narrow properly - Never hardcode colors, spacing or fonts — use tokens from
src/styles/theme.css - Use Tailwind token classes directly — NEVER
[var(--token)]when the token exists in@theme(e.g.text-brand-light,rounded-pill,bg-red-tint-subtle) var()is FORBIDDEN in component source files (src/components/**/*.ts,src/components/**/*.tsx)- If a token or mixed visual treatment does not exist, define it centrally in
src/styles/theme.cssorsrc/styles/base.cssas a reusable token-backed utility/class, then consume that class from the component - If a token does not exist for a value, CREATE it in
theme.cssfirst — never use rawrgba(), hex, or px values inline var()is only acceptable inside the style system (src/styles/theme.css,src/styles/base.css) to define reusable utilities such asbg-gradient-*,shadow-glow-*, or semantic component helper classes- Token reference:
docs/DESIGN.md— read it before building any component - Never modify
theme.csswithout explicit user confirmation - Never add dependencies without explicit user confirmation
- Repo package manager contract is
pnpm@10.34.1; when docs, scripts, or workflows pin pnpm, use the exact version, not only10 - For package-facing changes (package output, exports, generated declarations, peer ranges, React major upgrades, or CI/package distribution policy), require
pnpm run build; requirepnpm run verify:packagewhen published output or consumer compatibility can change. Tests/Storybook alone are not enough for React major upgrades. - Generated declarations must not leak internal path aliases or CSS side-effect imports into the published
.d.tsoutput - English only — code, comments, stories
- Paired repository docs are bilingual: base
*.mdfiles are Spanish and matching*.en.mdfiles are English. When editing docs underdocs/or root README files, preserve that split, update both language variants when the content changes, and never replace the Spanish base file with English prose. - Commit messages must follow the commitlint-enforced Conventional Commit format:
<type>(<optional scope>): <description>. PR titles should follow the same format for review consistency. Allowed types:build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test. Use scopes for domains such asa11y,tokens, orinfrainstead of inventing custom types.
Load the relevant skill for detailed workflows:
| Trigger | Skill |
|---|---|
| Contributor shares a GitHub issue URL or component spec and asks to implement it | component-contributor |
| User provides a HeroUI/reference component and wants an implementation-ready spec before coding | component-spec-proposer |
| Reviewing an existing component — code quality, visual states, tokens, accessibility | components-auditor |
| Auditing the design system package — token architecture, folder structure, npm distributable standards | system-auditor |
| External project wants to use Stack-and-Flow as a base and customize its tokens | bootstrapping |
| Contributor asks if their PR is ready for review, or agent must validate implementation before handoff, including package evidence when package-facing changes exist | pr-reviewer |
| Creating or auditing GitHub Project board tasks — issues, fields, phases, team assignments | github-project-tasks |
| Creating a release, bumping versions, generating changelogs, publishing to npm | release-changeset |
| Preparing or auditing package distribution policy — exports map, package.json hygiene, package verification, consumer compatibility, TypeScript declarations | npm-architect |
| Visual review — component states, glow, transitions, focus rings, contrast, accessibility visuals | visual-review |
| Creating git worktrees or isolated writer checkouts for this repo | worktree-location |