agentleFS
gabriellstgabriellst/codm/.claude/skills/primitive/SKILL.md

primitive

Skill4 starsChanged 2 months agoMITView on GitHub

Create a primitive UI component (design system entry point). Stateless, reusable, variant-driven via CVA. Routes through a react / astro child based on the working directory.

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are 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.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the path is ambiguous, ask the user once and don't proceed until they answer.

    line 17

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill 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
SKILL.md

Create Primitive (parent)

A primitive is a small, reusable visual unit shared across routes — Button, Card, Input, Dialog, Pill. It is stateless, has no business knowledge, and exposes variants via CVA.

Platform routing (READ FIRST)

Working file pathUse
packages/app/react/**./react/SKILL.md + ./react/registry.yaml — Base UI + Tailwind + HTML
packages/app/astro/**/*.astro or *.tsx./astro/SKILL.md + ./astro/registry.yaml — Astro components + React islands

If the path is ambiguous, ask the user once and don't proceed until they answer.

What "primitive" means (cross-platform)

A primitive is:

  1. Stateless — no internal data fetching, no business logic, no domain types. Controlled via props.
  2. Reusable — it has no knowledge of routes, queries, or features. The same primitive ships on every screen that needs it.
  3. Variant-driven — one primitive per family (one Button, not ChromeButton + GhostButton). Variations live in variant / size props.
  4. The design system entry point — primitives are the only files that read raw design tokens. Everything else consumes the primitive.

Shared principles (apply on ALL platforms)

  1. CVA for variants. Declare variant and size once via class-variance-authority and compose with the cn() helper so consumer className overrides win.
  2. One primitive per family. A button family is one Button with variant: 'chrome' | 'ghost' | 'destructive' | 'link' | .... Same for Card, Sheet/Dialog, Input, Pill.
  3. Named exports, no dot-notation. Subcomponents export individually (export { Card, CardHeader, CardBody }) — never Card.Header.
  4. PascalCase for component names and (on astro) file names.
  5. Tokens come from the design system. Colors / spacing / radius / type scales come from @codm/app-ui/tokens.css (react + astro). Never hardcode hex values or arbitrary pixel sizes.
  6. cn() everywhere a className is composed — react imports from @/lib/utils; astro authors the same helper inline or imports from a local lib/utils.ts.

When to use this skill

  • Building a reusable visual unit that doesn't own data or business logic.
  • Wrapping a Base UI / Astro element with project styling.

When NOT to use this skill

  • Route-scoped feature component → /component (in its react / astro variant).
  • Page route → /route.
  • Form input with state → /form (the form composes primitives; this skill builds the primitives).

Checklist (parent-level, before reading the child)

  • Platform identified from working directory (or asked the user).
  • Reading only the matching child SKILL + registry.
  • Stateless, variant-driven, named exports.
  • Tokens via the shared sheet / lib (no inline hex).

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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.