agentleFS
crafter-stationcrafter-station/elements/registry/AGENTS.md

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
  1. Distinctive:

    Does NOT own: site UI, documentation content, or app routes.

    line 8
  2. Very specific:

    Add registry-item.json with schema

    line 82
  3. Very specific:

    Add implementation in components/elements/{name}.tsx

    line 83
  4. Very specific:

    Run bun generate to update blocks.ts and index.ts

    line 84
  5. Very specific:

    Use /create-element skill with logo-with-variants for logos that need icon/wordmark/full variants.

    line 88
  6. Very specific:

    Add registry-item.json with type: "registry:ui"

    line 92
  7. Very specific:

    Add SVG component in components/elements/{brand}-logo.tsx

    line 93
  8. Very specific:

    Never modify blocks.ts or index.ts manually (auto-generated)

    line 97
  9. Distinctive:

    Don't put business logic in components (presentation only)

    line 98
  10. Distinctive:

    Don't hardcode colors (use CSS variables)

    line 99
  11. Distinctive:

    Never use hex/hsl colors (use OKLCH)

    line 100

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 utilities

Component Structure

Each component follows this pattern:

{category}/{component-name}/
├── registry-item.json       # REQUIRED: Schema definition
└── components/elements/
    └── {component}.tsx      # Implementation

registry-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.json must be valid against shadcn schema
  • registryDependencies reference other Elements components
  • dependencies are npm packages
  • File paths relative to registry root
  • Component names kebab-case, title case for display

Categories

CategoryDescriptionExamples
aiLLM/agent interfacesai-chat, ai-model-selector, ai-tool-call
devtoolsDeveloper debuggingjson-viewer, cli-output, env-editor
githubGitHub data displaygithub-stars, github-contributions
logosBrand SVG iconsclerk-logo, vercel-logo, anthropic-logo
theme-switcherTheme togglestheme-switcher-button, theme-switcher-dropdown
_bundlesLogo collectionsai-services, tech-giants

Patterns

Adding a New Component

  1. Create directory: default/blocks/{category}/{name}/
  2. Add registry-item.json with schema
  3. Add implementation in components/elements/{name}.tsx
  4. Run bun generate to update blocks.ts and index.ts

Adding a New Logo

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

Anti-patterns

  • Never modify blocks.ts or index.ts manually (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 generate

This updates blocks.ts and index.ts from the default/blocks/ directory structure.

Download now (ZIP)

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.