elements / registry
AGENTS.md524 starsChanged 9 months agoMITView on GitHub
Component source of truth. All installable components live here. Owns the shadcn/ui registry schema and component implementations. Does NOT own: site UI, documentation content, or app routes. Each component follows this pattern: Use /create-element skill with logo-with-variants for logos that need icon/wordmark/full variants. For simple logos: 1. Create default/blocks/logos/{brand}-logo/ 2. Add registry-item.json with type: "registry:ui" 3. Add SVG component in components/elements/{brand}-logo.tsx This updates blocks.ts and index.ts from the default/blocks/ directory structure.
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 8
Does NOT own: site UI, documentation content, or app routes.
- Very specific: line 82
Add registry-item.json with schema
- Very specific: line 83
Add implementation in components/elements/{name}.tsx
- Very specific: line 84
Run bun generate to update blocks.ts and index.ts
- Very specific: line 88
Use /create-element skill with logo-with-variants for logos that need icon/wordmark/full variants.
- Very specific: line 92
Add registry-item.json with type: "registry:ui"
- Very specific: line 93
Add SVG component in components/elements/{brand}-logo.tsx
- Very specific: line 97
Never modify blocks.ts or index.ts manually (auto-generated)
- Distinctive: line 98
Don't put business logic in components (presentation only)
- Distinctive: line 99
Don't hardcode colors (use CSS variables)
- Distinctive: line 100
Never use hex/hsl colors (use OKLCH)
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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
Registry
Component source of truth. All installable components live here.
Purpose
Owns the shadcn/ui registry schema and component implementations. Does NOT own: site UI, documentation content, or app routes.
Structure
registry/
├── default/blocks/ # Component implementations by category
│ ├── ai/ # AI/LLM interface components (35+ components)
│ ├── devtools/ # Developer tool components
│ ├── github/ # GitHub data components
│ ├── logos/ # Brand SVG logos (40+ brands)
│ ├── theme-switcher/ # Theme toggle variants
│ ├── uploadthing/ # File upload components
│ ├── upstash/ # Rate limiting components
│ ├── polar/ # Payment components
│ ├── tinte/ # Theme editor
│ └── _bundles/ # Logo bundle collections
├── blocks.ts # Auto-generated imports from blocks/
├── examples.ts # Example registry items
├── index.ts # Main registry export (auto-generated)
└── utils.ts # Registry utilitiesComponent Structure
Each component follows this pattern:
{category}/{component-name}/
├── registry-item.json # REQUIRED: Schema definition
└── components/elements/
└── {component}.tsx # Implementationregistry-item.json Schema
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "component-name",
"type": "registry:ui",
"title": "Human Title",
"description": "What it does",
"registryDependencies": ["button", "other-component"],
"dependencies": ["external-package"],
"files": [{ "path": "...", "type": "registry:component" }],
"categories": ["ai", "form"]
}Contracts
registry-item.jsonmust be valid against shadcn schemaregistryDependenciesreference other Elements componentsdependenciesare npm packages- File paths relative to registry root
- Component names kebab-case, title case for display
Categories
| Category | Description | Examples |
ai | LLM/agent interfaces | ai-chat, ai-model-selector, ai-tool-call |
devtools | Developer debugging | json-viewer, cli-output, env-editor |
github | GitHub data display | github-stars, github-contributions |
logos | Brand SVG icons | clerk-logo, vercel-logo, anthropic-logo |
theme-switcher | Theme toggles | theme-switcher-button, theme-switcher-dropdown |
_bundles | Logo collections | ai-services, tech-giants |
Patterns
Adding a New Component
- Create directory:
default/blocks/{category}/{name}/ - Add
registry-item.jsonwith schema - Add implementation in
components/elements/{name}.tsx - Run
bun generateto updateblocks.tsandindex.ts
Adding a New Logo
Use /create-element skill with logo-with-variants for logos that need icon/wordmark/full variants.
For simple logos:
- Create
default/blocks/logos/{brand}-logo/ - Add
registry-item.jsonwithtype: "registry:ui" - Add SVG component in
components/elements/{brand}-logo.tsx
Anti-patterns
- Never modify
blocks.tsorindex.tsmanually (auto-generated) - Don't put business logic in components (presentation only)
- Don't hardcode colors (use CSS variables)
- Never use hex/hsl colors (use OKLCH)
Regenerating Registry
bun generateThis updates blocks.ts and index.ts from the default/blocks/ directory structure.
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 28,693 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 repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ai-elementsSkill
- create-elementSkill
- devtools-elementsSkill
- elementsSkill
- github-elementsSkill
- logo-with-variantsSkill
- polar-elementsSkill
- sfx-elementsSkill
- tech-logosSkill
- theme-elementsSkill
- uploadthing-elementsSkill
- upstash-elementsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

