Skip to content

feat(kumo): add JSDoc to all components and AI usage guide#44

Open
stritt wants to merge 1 commit intomainfrom
chore/jsdoc-enrichment
Open

feat(kumo): add JSDoc to all components and AI usage guide#44
stritt wants to merge 1 commit intomainfrom
chore/jsdoc-enrichment

Conversation

@stritt
Copy link
Collaborator

@stritt stritt commented Feb 8, 2026

Summary

  • Adds comprehensive JSDoc to all 35 component source files — prop descriptions, @default tags, variant value explanations, and @example blocks. These flow through to .d.ts output so AI agents get rich documentation when consuming the package via TypeScript.
  • Creates ai/USAGE.md — a concise AI-readable guide covering CSS setup (including the critical @source directive), component reference table, semantic tokens, and common patterns.
  • Adds kumo ai CLI command that prints the usage guide to stdout, so any AI tool can run npx kumo ai to get the full reference.
  • Adds module-level JSDoc to src/index.ts and a JSDoc skeleton to the plop template for new components.

Test plan

  • pnpm build — verify .d.ts files contain JSDoc comments
  • pnpm test — no regressions
  • pnpm lint — no lint violations
  • Spot-check dist/src/components/button/button.d.ts for JSDoc
  • Run npx kumo ai and verify it prints USAGE.md

🤖 Generated with Claude Code

Enrich .d.ts output for AI agent consumption by adding comprehensive
JSDoc to all 35 component source files — prop descriptions, @default
tags, variant value explanations, and @example blocks sourced from
the component registry.

Also adds:
- ai/USAGE.md: concise AI-readable guide (CSS setup, component
  reference table, semantic tokens, common patterns)
- `kumo ai` CLI command to print the usage guide
- Module-level JSDoc on src/index.ts
- JSDoc skeleton in plop template for new components

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@import "tailwindcss";
```

- **`@source`** — Tells Tailwind to scan kumo's compiled JS for class names. Without this, kumo component internals will be unstyled. Adjust the relative path so it resolves to your project's `node_modules/`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an inconsistency between this and https://github.com/cloudflare/kumo/pull/42/changes#r2778794750. Which is correct?

Copy link

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great additions! This is super useful for humans too. There is one inconsistency in the usage between this and #42 which I've noted in both. I don't know which is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants