new-primitive

new-primitive is a command for Claude Code from radix-ng/primitives. It costs 0 tokens per session (1,872 once invoked), scanned A, original, MIT.

A command that scaffolds a new headless Angular primitive, meaning a reusable component with behaviour but no fixed visual design.

In plain words
What is it for?
Use it to start primitives such as tabs, toggles, progress bars, or breadcrumbs, optionally composing an existing primitive or adding named parts.
Why use it?
It creates the starting files and structure according to the project's existing conventions, reducing repetitive setup work.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/radix-ng/primitives/new-primitive
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 new-primitive

README.md
[![agentmods](https://agentmods.dev/badge/commands/radix-ng/primitives/new-primitive.svg)](https://agentmods.dev/commands/radix-ng/primitives/new-primitive)
Your own site
<a href="https://agentmods.dev/commands/radix-ng/primitives/new-primitive"><img src="https://agentmods.dev/badge/commands/radix-ng/primitives/new-primitive.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,872 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.01872
Opus 5 $0.00000 $0.00936
Sonnet 5 $0.00000 $0.00374
Haiku 4.5 $0.00000 $0.00187

Measured 5d ago against content hash bb9c8de5246a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

new-primitive 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 5d 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/commands/new-primitive.md · 228 lines

How it starts

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

/new-primitive

Scaffold a new headless Angular primitive in packages/primitives/<name>/, following current project conventions (signals-first, no CDK, newer suffix-less naming).

Usage

/new-primitive <PrimitiveName> [--parts <part1,part2,...>] [--composes <existing-primitive>]

Arguments:

  • <PrimitiveName> — PascalCase name, e.g. Tabs, ProgressBar, Toggle
  • --parts — comma-separated list of parts beyond Root (defaults to common sense for the ARIA pattern)
  • --composes — existing primitive to build on via hostDirectives

Examples:

/new-primitive Tabs
/new-primitive Toggle --composes Checkbox
/new-primitive Breadcrumb --parts Item,Link,Separator

Conventions to follow (authoritative: CLAUDE.md + .claude/skills/project-knowledge/references/patterns.md)

  • Reference Base UI first for the component API/anatomy, Radix UI second.
  • Newer naming style (matches dialog/select/drawer): class Rdx<Name><Role> and file <name>-<role>.tsno Directive suffix, no .directive.ts. Selector [rdx<Name><Role>], exportAs rdx<Name><Role>.
  • No @angular/cdk. It is fully removed. Import BooleanInput / NumberInput / Direction from @radix-ng/primitives/core, not @angular/cdk/coercion. Use injectId() for ids, RdxLiveAnnouncer for announcements, isPlatformBrowser(inject(PLATFORM_ID)) for platform checks.
  • Signals-first lifecycle. Avoid ngOnInit / ngOnChanges / ngOnDestroy in src/** (ESLint warns). Use the constructor for DI/host-element work, effect() / computed() / linkedSignal() for input-driven logic, afterNextRender() / afterRenderEffect() for DOM work, inject(DestroyRef).onDestroy(...) for cleanup.
  • Headless state via host data-attributes, never inline styles (CSS custom properties for animation dimensions are the only exception). Remove an attribute with undefined.
  • Compose existing primitives via hostDirectives when --composes is given (e.g. Accordion Item composes CollapsibleRoot).

Read the full file on GitHub · 228 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. 5d ago First seen · 228 lines · 0 tokens per session scan A bb9c8de5246a

Subscribe to this mod's changes

new-primitive is a command published in the GitHub repository radix-ng/primitives (270 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,872 tokens. 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.