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
- Distinctive: line 17
If the path is ambiguous, ask the user once and don't proceed until they answer.
≈ “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.
Files
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 path | Use |
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:
- Stateless — no internal data fetching, no business logic, no domain types. Controlled via props.
- Reusable — it has no knowledge of routes, queries, or features. The same primitive ships on every screen that needs it.
- Variant-driven — one primitive per family (one
Button, notChromeButton+GhostButton). Variations live invariant/sizeprops. - 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)
- CVA for variants. Declare
variantandsizeonce viaclass-variance-authorityand compose with thecn()helper so consumerclassNameoverrides win. - One primitive per family. A button family is one
Buttonwithvariant: 'chrome' | 'ghost' | 'destructive' | 'link' | .... Same forCard,Sheet/Dialog,Input,Pill. - Named exports, no dot-notation. Subcomponents export individually (
export { Card, CardHeader, CardBody }) — neverCard.Header. - PascalCase for component names and (on astro) file names.
- 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. cn()everywhere a className is composed — react imports from@/lib/utils; astro authors the same helper inline or imports from a locallib/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).
In this repository45 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agentSkill
- bounded-contextSkill
- clean-branchSkill
- commitSkill
- componentSkill
- controllerSkill
- db-modellingSkill
- ddd-modelingSkill
- ddd-specSkill
- design-systemSkill
- desktop-shellSkill
- e2eSkill
- entitySkill
- enumSkill
- errorsSkill
- eventSkill
- formSkill
- grill-with-docsSkill
- handlerSkill
- handoffSkill
- middlewareSkill
- migrateSkill
- prdSkill
- projectionSkill
- projectorSkill
- querySkill
- repositorySkill
- reviewSkill
- routeSkill
- saas-researchSkill
- schedulerSkill
- schemaSkill
- sdkSkill
- serviceSkill
- spec-reviewSkill
- storeSkill
- storybookSkill
- task-breakdownSkill
- testSkill
- trace-analysisSkill
- ui-compositionSkill
- usecaseSkill
- user-storiesSkill
- value-objectSkill
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.

