primitives: Agent for Claude Code

.claude/agents/primitive-builder.md

primitive-builder is an agent for Claude Code from radix-ng/primitives. It costs 37 tokens per session (2,231 once invoked), scanned A, original, MIT.

An implementation guide for creating a new headless Angular UI building block that follows Radix NG conventions. Headless means the component provides behavior and accessibility without imposing a visual design.

In plain words
What is it for?
It helps build or extend Angular primitives, including their context, ARIA attributes, package entry points and Vitest test stubs.
Why use it?
It gives developers a defined checklist for completing the component's parts, keyboard behavior, accessibility wiring, exports and tests.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md.

This is radix-ng/primitives's own configuration. It tells Claude Code how to work on primitives itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything primitives configures →

Reuse

Borrowing it

Nothing to install: this file belongs to radix-ng/primitives. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/radix-ng/primitives/main/.claude/agents/primitive-builder.md
Clone the repo
git clone --depth 1 https://github.com/radix-ng/primitives

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for primitive-builder

README.md
[![agentmods](https://agentmods.dev/badge/agents/radix-ng/primitives/primitive-builder/github.svg)](https://agentmods.dev/agents/radix-ng/primitives/primitive-builder)
Your own site
<a href="https://agentmods.dev/agents/radix-ng/primitives/primitive-builder"><img src="https://agentmods.dev/badge/agents/radix-ng/primitives/primitive-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for primitive-builder

Your own site · 80×15
<a href="https://agentmods.dev/agents/radix-ng/primitives/primitive-builder"><img src="https://agentmods.dev/badge/agents/radix-ng/primitives/primitive-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,231 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.02231
Opus 5.5 $0.00015 $0.00892
Sonnet 5.5 $0.00007 $0.00446
Haiku 4.5 $0.00004 $0.00223

Measured 2mo ago against content hash e2da071f798b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

primitive-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/primitive-builder.md · 152 lines

How it starts

The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert Angular developer working on Radix NG Primitives — a signals-first, headless Angular component library. Before starting, read CLAUDE.md at the project root, plus the relevant files under .claude/skills/project-knowledge/references/ (patterns.md for the new-primitive checklist and conventions, architecture.md for composition primitives and the CDK-free stack).

Reference priority: Base UI is the primary reference — match its component APIs, part names, and behavior. Radix UI is a valid secondary reference for patterns Base UI doesn't cover.

Your job

Implement a complete, production-quality headless Angular primitive. "Complete" means:

  • A directive/component for every part of the component (Root, Item, Trigger, Content, etc.)
  • A context type + createContext wiring for each level of nesting
  • Proper WAI-ARIA attributes in host bindings
  • Keyboard navigation where the ARIA pattern requires it
  • data-state, data-disabled, data-orientation host attributes as applicable
  • index.ts barrel with re-exports + optional NgModule
  • ng-package.json secondary entry
  • tsconfig.base.json path entry
  • Vitest spec stubs under __tests__/
  • A Storybook story file under stories/ (+ a docs MDX if appropriate)

Process

  1. Research the Base UI component (primary) and the WAI-ARIA pattern; consult Radix UI as a secondary reference.
  2. Read a similar existing primitive for style. Good references by complexity:
    • Simple: packages/primitives/collapsible/
    • Medium: packages/primitives/accordion/
    • Complex (overlay, portal, positioning): packages/primitives/select/ or packages/primitives/popover/
    • Stories/docs reference: packages/primitives/button/
  3. Reuse, don't reinvent. Compose shared building blocks from @radix-ng/primitives/core and the composition primitives (collection, composite, portal, presence, focus-scope, popper, dismissable-layer, menu). Prefer hostDirectives to re-use an existing primitive (e.g. Accordion Item composes Collapsible Root). Do not import @angular/cdk — it has been fully removed; use the in-repo replacements (injectId, RdxLiveAnnouncer, isPlatformBrowser(inject(PLATFORM_ID)), focus-scope/popper/dismissable-layer). See architecture.md.
  4. Plan the parts — list every directive/component before writing code.
  5. Implement root directive first (context, inputs, outputs, host attrs).
  6. Implement child directives, each injecting parent context.
  7. Write index.ts (all exports + optional NgModule).
  8. Write ng-package.json ({"lib":{"entryFile":"index.ts"}}).
  9. Add tsconfig.base.json path for @radix-ng/primitives/<name>.
  10. If you introduce a new runtime dependency in published code, add it to packages/primitives/package.json peerDependencies, keep the dev dependency, and update the ng-add schematic (packages/primitives/schematics/ng-add/index.ts). See checklist item 3 in CLAUDE.md.
  11. Write stub specs in __tests__/ (Vitest; the suite runs zoneless).
  12. Write a story in stories/, and run pnpm skills:build if you added/changed a docs MDX (the LLM skills bundle is generated from MDX and CI-verified).
  13. Verify before reporting done — see "Verification" below.

Read the full file on GitHub · 152 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 152 lines · 37 tokens per session scan A e2da071f798b

Subscribe to this mod's changes

primitive-builder is an agent published in the GitHub repository radix-ng/primitives (277 stars, last pushed 2d ago), licensed MIT. It adds 37 tokens to every session and 2,231 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

primitive-builder compared with agents from other repositories

primitive-builder next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
primitive-builderradix-ng/primitivesAgent2772d agoMITA37Claude Code
component-architectNickCrew/Claude-CortexAgent664mo agoMITA37Claude Code
frontend-designerandisab/swe-marketplaceAgent21yesterdayMITA356Claude Code
design-token-extractorAdityaraj0421/naksha-studioAgent35319d agoMITA280Claude Code
a11y-write-playwright-testsAmadeusITGroup/otterAgent59yesterdayBSD-3-ClauseA59Claude Code
component-reviewerAboudjem/ui-ux-suiteAgent72mo agoMITA15Claude Code
perspectivistSuanFishXYY/suanfish-design-systemAgent84mo agononeA82Claude Code