kumo-astro / kumo-docs-astro
AGENTS.md4 starsChanged 9 months agoMITView on GitHub
Astro documentation site for Kumo. React islands architecture. Deployed to Cloudflare Workers at kumo-ui.com. Parent: See root AGENTS.md for monorepo context. Demo extraction relies on exact naming: Wrong naming = function not extracted = missing from component registry. Pattern: DocLayout (title, sourceFile) → ComponentSection → ComponentExample → <DemoComponent client:visible /> Imports: ~/layouts/DocLayout.astro, ~/components/docs/ComponentExample.astro, ~/components/demos/{Name}Demo ComponentExample supports `vrS
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ci/AGENTS.mdAGENTS.md
- packages/kumo/AGENTS.mdAGENTS.md
- packages/kumo-astro/AGENTS.mdAGENTS.md
- packages/kumo-blocks/AGENTS.mdAGENTS.md
- packages/kumo-figma/AGENTS.mdAGENTS.md
- packages/kumo-figma/src/generators/AGENTS.mdAGENTS.md
- packages/kumo-screenshot-worker/AGENTS.mdAGENTS.md
- packages/kumo/src/components/AGENTS.mdAGENTS.md
- packages/kumo-studio/AGENTS.mdAGENTS.md
- index-knowledgeSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 72
Do NOT mix them.
- Very specific: line 96
dist/is gitignored: If dist/demo-metadata.json is missing, codegen:registry produces incomplete output
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Docs Site (@cloudflare/kumo-docs-astro)
Astro documentation site for Kumo. React islands architecture. Deployed to Cloudflare Workers at kumo-ui.com.
Parent: See root AGENTS.md for monorepo context.
STRUCTURE
kumo-docs-astro/
├── src/
│ ├── pages/
│ │ ├── index.astro # Homepage (HomeGrid showcase)
│ │ ├── components/{name}.astro # 38 component doc pages
│ │ ├── blocks/{name}.astro # 2 block doc pages
│ │ └── api/ # JSON endpoints (version, component-registry)
│ ├── components/
│ │ ├── demos/ # 49 files: *Demo.tsx (feed into registry!)
│ │ ├── docs/ # Doc components (PropsTable, CodeBlock, etc.)
│ │ └── kumo/ # Installed blocks (via CLI, not package imports)
│ ├── layouts/ # BaseLayout → MainLayout → DocLayout
│ ├── lib/
│ │ ├── vite-plugin-kumo-colors.ts # virtual:kumo-colors
│ │ ├── vite-plugin-kumo-registry.ts # virtual:kumo-registry
│ │ ├── vite-plugin-kumo-hmr.ts # Dev-only: rewires @cloudflare/kumo → source
│ │ └── component-registry.ts # Server-side registry access
│ └── styles/global.css # Tailwind entry + @source to kumo dist
├── scripts/
│ └── extract-demo-examples.ts # Parses demos → dist/demo-metadata.json
├── astro.config.mjs # React + Tailwind + 3 custom Vite plugins
└── wrangler.jsonc # CF Workers deployment (static assets)WHERE TO LOOK
| Task | Location | Notes |
| Component doc page | src/pages/components/{name}.astro | Uses DocLayout + ComponentExample |
| Demo examples | src/components/demos/{Name}Demo.tsx | Naming is load-bearing (see below) |
| Props table | src/components/docs/PropsTable.astro | Server-rendered from registry |
| Layout/nav | src/layouts/, src/components/SidebarNav.tsx | Nav items are hard-coded |
| Color tokens page | src/pages/colors.astro + ColorsDemo.tsx | Uses virtual:kumo-colors |
| Registry viewer | src/pages/registry.astro + RegistryDemo.tsx | Uses virtual:kumo-registry |
| Installed blocks | src/components/kumo/{block}/ | Installed via kumo add, not pkg |
CONVENTIONS
Demo File Naming (CRITICAL)
Demo extraction relies on exact naming:
- File:
{Component}Demo.tsx(e.g.,ButtonDemo.tsx) - Exports: Functions ending in
Demosuffix (e.g.,export function ButtonPrimaryDemo()) - Both forms work:
export function FooDemo()andexport const FooDemo = () => - JSDoc on demos becomes the
descriptionfield in metadata
Wrong naming = function not extracted = missing from component registry.
Hydration Directives
| Directive | When |
client:visible | Most component demos (lazy) |
client:load | Interactive: Dialog, Search, Toast, Registry |
client:only="react" | SSR mismatch: ThemeToggle, HomeGrid |
client:idle | Low priority: CopyPageButton |
Two Registry Access Patterns
- Server-side (
.astrofiles): Import from~/lib/component-registry.ts - Client-side (React demos): Use
virtual:kumo-registryVite module - Do NOT mix them.
Page Template
Pattern: DocLayout (title, sourceFile) → ComponentSection → ComponentExample → <DemoComponent client:visible />
Imports: ~/layouts/DocLayout.astro, ~/components/docs/ComponentExample.astro, ~/components/demos/{Name}Demo
Visual Regression
ComponentExample supports vrSection and vrTitle props for screenshot targeting by visual regression tests.
ANTI-PATTERNS
| Pattern | Why | Instead |
Demo function without Demo suffix | Won't be extracted for registry | Always suffix with Demo |
| Manually updating PropsTable | Data comes from registry | Registry auto-generated at build time |
Forgetting @source in global.css | Tailwind misses kumo classes | Keep @source "../../../kumo/dist/**/*" |
Using system prefers-color-scheme | Site uses data-mode attribute | Use ThemeToggle / localStorage.theme |
NOTES
- Build order:
codegen:demosruns first inbuildscript; producesdist/demo-metadata.jsonconsumed by kumo registry codegen dist/is gitignored: Ifdist/demo-metadata.jsonis missing,codegen:registryproduces incomplete output- SidebarNav is manual: Adding a component page requires updating
SidebarNav.tsxarrays (staticPages,componentItems,chartItems,blockItems) - HomeGrid is manual: New components need adding to the showcase grid +
componentRoutes - Search uses CommandPalette: Client-side search powered by component registry API; works in dev mode without build step
- BaseLayout has blocking inline script: Reads
localStorage.themesynchronously to prevent dark mode FOUC global.css:@custom-variant darkoverrides Tailwind dark to match[data-mode="dark"]- HMR plugin dev-only: In development,
@cloudflare/kumoimports are rewritten to source for instant HMR - Dual theme code blocks: Shiki uses github-light/vesper themes, switches via
[data-mode]CSS - Installed blocks:
src/components/kumo/page-header/andresource-list/are blocks installed viakumo add
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

