create-new-component

create-new-component is a command for Claude Code from PolicyEngine/policyengine-claude. It costs 24 tokens per session (2,033 once invoked), scanned A, original, MIT.

A workflow for adding new components to the PolicyEngine UI kit, a reusable library of interface elements.

In plain words
What is it for?
Use it to research similar components, build variants and states, validate styling tokens, write tests, create a visual preview, and open a pull request.
Why use it?
It helps ensure a new component follows existing designs, uses the project's design tokens, has tests, and is reviewed before merging.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: names the AskUserQuestion tool; mentions Claude Code.

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

Good fit Use it to research similar components, build variants and states, validate styling tokens, write tests, create a visual preview, and open a pull request.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/PolicyEngine/policyengine-claude
agentmods
npx agentmods add commands/policyengine/policyengine-claude/create-new-component

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 create-new-component

README.md
[![agentmods](https://agentmods.dev/badge/commands/policyengine/policyengine-claude/create-new-component/github.svg)](https://agentmods.dev/commands/policyengine/policyengine-claude/create-new-component)
Your own site
<a href="https://agentmods.dev/commands/policyengine/policyengine-claude/create-new-component"><img src="https://agentmods.dev/badge/commands/policyengine/policyengine-claude/create-new-component/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 create-new-component

Your own site · 80×15
<a href="https://agentmods.dev/commands/policyengine/policyengine-claude/create-new-component"><img src="https://agentmods.dev/badge/commands/policyengine/policyengine-claude/create-new-component.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 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,033 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.00024 $0.02033
Opus 5.5 $0.00010 $0.00813
Sonnet 5.5 $0.00005 $0.00407
Haiku 4.5 $0.00002 $0.00203

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

Security

Grade A, and why

create-new-component 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 1mo 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.

commands/create-new-component.md · 258 lines

How it starts

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

Create new component

Builds one or more new components for the @policyengine/ui-kit library. Handles the full lifecycle: research existing patterns, build with design tokens, validate token usage, write tests, preview visually, and open a PR.

Prerequisites

The policyengine-ui-kit repo must be cloned locally. If not found, clone it:

gh repo clone PolicyEngine/policyengine-ui-kit

All work happens in the policyengine-ui-kit repo directory.

Step 1: Gather requirements

Use AskUserQuestion to ask the user:

  1. Component description — What component(s) do you need? Describe their purpose, behavior, and any variants.

Parse the description to identify:

  • Component names (PascalCase, e.g., Tooltip, ProgressBar, Accordion)
  • Which category they belong to: primitives, layout, inputs, display, or charts
  • Expected props, variants, and states

Step 2: Research app-v2 for similar components

Before building from scratch, search PolicyEngine/policyengine-app-v2 for similar implementations:

# Search app-v2 for components with similar names or purposes
find /path/to/policyengine-app-v2/app/src -name "*.tsx" | xargs grep -li "COMPONENT_NAME_PATTERN"

# Check how app-v2 composes the same component type (radix-ui + Tailwind + CVA)
grep -r "COMPONENT_TYPE" /path/to/policyengine-app-v2/app/src --include="*.tsx" -l
grep -r "COMPONENT_TYPE" /path/to/policyengine-app-v2/website/src --include="*.tsx" -l

If similar components exist in app-v2:

  • Study their props interface, variant patterns, and behavior
  • Adapt the design and UX, rebuilt on the ui-kit's Tailwind v4 + CVA stack

If nothing similar exists in app-v2:

  • Research common patterns for that component type
  • Design props and variants that are consistent with existing ui-kit components

Step 3: Build the component(s)

Tech stack (mandatory):

  • React 19 with forwardRef
  • TypeScript with strict types
  • Tailwind CSS v4 with standard class names (no prefix)
  • CVA (class-variance-authority) for variant management
  • cn() utility from @/utils/cn for class merging
  • Design tokens from ui-kit's theme.css (colors, spacing, typography, radius)

Read the full file on GitHub · 258 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. 1mo ago First seen · 258 lines · 24 tokens per session scan A 6e4e0ee03e0a

Subscribe to this mod's changes

create-new-component is a command published in the GitHub repository PolicyEngine/policyengine-claude (32 stars, last pushed 2d ago), licensed MIT. It adds 24 tokens to every session and 2,033 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.