Contributing
How to add components, patterns, and docs to KDS.
How to add to KDS. Full operational details live in
docs/CONTRIBUTING.md;
this page is the orientation.
Where to start
Before any task, read:
docs/PRD.md— the authoritative product spec. Identify which Phase the task belongs to.CLAUDE.md— the agent / contributor working rules.- The relevant skill in the Kalvner skill library (
crew/skills/).
Adding a new component
The full workflow lives in
docs/CONTRIBUTING.md and the storybook-component-doc skill.
Compressed:
- Pick the right category (one of the 9). Use the decision matrix
in
knowledge/ui/design-systems/storybook-structure.mdif ambiguous. - Add via shadcn CLI when applicable, then move to
packages/kds/src/primitives/<categoria>/<Component>/. - Replace any raw colour / spacing in the shadcn output with
semantic tokens (
bg-primary,text-foreground, etc.). - Write
<Component>.stories.tsx—Defaultfirst, individual variants, individual states, plus a composedrenderstory. AI components additionally getStreaming,Loading,Error. - Write the docs MDX in
apps/docs/content/primitives/<categoria>/<component>.mdx— all 11 sections in order. - Add the path-per-component entry to
packages/kds/package.jsonexports. - Run the audit checklist
(
crew/skills/storybook-component-doc/rules/audit-checklist.md). - Commit with conventional commits format
(
feat(kds): add <Component> primitive in <Categoria>).
Mandatory MDX structure
Every component MDX has these 11 sections, in this order:
- Header
- Preview hero
- Installation
- Anatomy
- Usage (when to use / not to use)
- Examples
- Composition (only if compound component)
- API Reference
- Accessibility (keyboard, ARIA, screen reader)
- Do / Don't
- Related
The 11-section structure is rigid. PRs that bypass it are blocked in review.
Stories must include
- Default — the smallest meaningful render (always first)
- Individual variants — one story per variant
- Individual states — one story per state
- Composta — one story with
rendershowing realistic composition - AI extras (AI components only):
Streaming,Loading,Error
What NOT to do
- Don't hardcode hex / oklch / rgb in components — always semantic tokens
- Don't generate single-story
<Button />Storybook entries - Don't render token pages as grids of swatch cards — always tables
- Don't skip the MDX — every component must have one
- Don't bypass the 11-section structure
- Don't add components without a category
- Don't use "Tailwind class" as a column header — always "Class"
- Don't invent theme names — always
default,amber-minimal,amethyst-haze,claude
Commits & PRs
- Conventional commits required:
feat(kds): add Button primitive,docs(content): add Tokens overview,chore(deps): bump turbo to 2.5.0, etc. - Scope from
docs/CONTRIBUTING.md:kds,docs,storybook,control,tooling,deps. - PR description must include:
- What changed
- Which Phase of the PRD it advances
- Any ADR if architecture-affecting
Releases
@kalvner/kds follows the schedule in PRD §10.7:
| Version | Scope |
|---|---|
v0.1.0 | Containers + Forms + Display + Feedback (core 50%) |
v0.2.0 | + Data, Navigation, Overlays |
v0.3.0 | + AI / Chatbot (18 components) |
v0.4.0 | + AI / Code (15 components) |
v0.5.0 | + Patterns / Layouts / Blocks |
v1.0.0 | Stable, public docs, control app live |
Bumps happen via pnpm changeset from the main branch — see
docs/CONTRIBUTING.md for the full release flow.