primitives: Command for Claude Code

.claude/commands/new-primitive.md

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

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 →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { tailwindDemoDecorator } from '../../storybook/tailwind-demo';.

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/commands/new-primitive.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 new-primitive

README.md
[![agentmods](https://agentmods.dev/badge/commands/radix-ng/primitives/new-primitive/github.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/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 new-primitive

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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.00000 $0.01872
Opus 5.5 $0.00000 $0.00749
Sonnet 5.5 $0.00000 $0.00374
Haiku 4.5 $0.00000 $0.00187

Measured 2mo ago against content hash bb9c8de5246a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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/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>.ts — no 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. 2mo 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 (277 stars, last pushed 2d ago), 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.

Related

new-primitive compared with commands from other repositories

new-primitive next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
new-primitiveradix-ng/primitivesCommand2772d agoMITA0Claude Code
initmahmoudilyan/marmouiCommand203mo agoMITA39Claude Code
overridemahmoudilyan/marmouiCommand203mo agoMITA56Claude Code
prototypemahmoudilyan/marmouiCommand203mo agoMITA36Claude Code
design-mdmahmoudilyan/marmouiCommand203mo agoMITA30Claude Code
marmo-buildmahmoudilyan/marmouiCommand203mo agoMITA27Claude Code
design-tutorialAdityaraj0421/naksha-studioCommand35319d agoMITA28Claude Code