new-component

new-component is a command for Claude Code from MohammadShehadeh/agent-skills. It costs 28 tokens per session (876 once invoked), scanned A, original, MIT.

A workflow for designing and building a React component according to an existing project's conventions. It considers the component's role, states, properties, composition, and placement before writing markup.

In plain words
What is it for?
Use it when creating a React component to search for reusable pieces, define the needed properties, choose a meaningful name, and build the component within the page's existing structure.
Why use it?
It helps prevent unnecessary shared components, confusing property APIs, duplicated UI primitives, and missing states such as loading, error, or disabled.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the agent-skills plugin — 6 skills, 6 commands, 1 agent shipped together

Good fit Use it when creating a React component to search for reusable pieces, define the needed properties, choose a meaningful name, and build the component within the page's existing structure.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/mohammadshehadeh/agent-skills/new-component
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.

Clone the repo
git clone --depth 1 https://github.com/MohammadShehadeh/agent-skills

Made for: Claude Code.

Or install agent-skills, the plugin that ships this one along with the rest of its 6 skills, 6 commands, 1 agent.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/mohammadshehadeh/agent-skills/new-component"><img src="https://agentmods.dev/badge/commands/mohammadshehadeh/agent-skills/new-component.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 876 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.00028 $0.00876
Opus 5 $0.00014 $0.00438
Sonnet 5 $0.00006 $0.00175
Haiku 4.5 $0.00003 $0.00088

Measured 9d ago against content hash 1febb8045090, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

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 9d 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/new-component.md · 44 lines

How it starts

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

Create a component: $ARGUMENTS

Load the agent-skills-conventions skill. Think through phases 1–3 before writing any markup.

1. Understand — role before markup

  • Place it in the tree: is this a page-level section, a block inside one, or a primitive? It must sit at page → section → primitive depth — if it only forwards props downward, it shouldn't exist.
  • Search first: an existing shadcn/ui primitive or house component may already do this. Compose or extend before creating; a new shared primitive is the last resort, only when no shared one fits.
  • Enumerate its states up front: default, hover/focus, loading, empty, error, disabled — whichever apply. Every visible state must trace to a prop or state in the design; discovering states mid-build is how boolean props sneak in.
  • Name it by business meaning: MessageRow, PlanCard — not ListItem2, Wrapper.

2. Design the props API — before the markup

  • Minimal: only the props today's call sites need. No speculative variants, sizes, or flags — the flexibility nobody asked for is the review comment you'll get.
  • Composition over configuration: children/slot props over render-config props; compound components over prop-heavy ones (Card + CardHeader, never <Card header={...} footer={...} />).
  • Variants are a typed union prop backed by a lookup map or CVA — never a pile of booleans (isPrimary, isLarge).
  • State stays with its owner: the component receives values and emits on* callbacks (onArchive, onSelect); it does not fetch or own state its siblings also need. Booleans read is/has/should; internal handlers are handle*.
  • Declare interface <Component>Props (no I prefix), destructured in the signature; children: React.ReactNode when composed.

3. Decide server vs client

  • Server component unless it needs interactivity — and then 'use client' at this leaf only, never hoisted.
  • Animation comes from the motion.tsx client boundary; icons import directly from the icon library as component objects (server-safe, no string keys, no sizing classes inside the component).

Read the full file on GitHub · 44 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. 9d ago First seen · 44 lines · 28 tokens per session scan A 1febb8045090

Subscribe to this mod's changes

new-component is a command published in the GitHub repository MohammadShehadeh/agent-skills (2 stars, last pushed 26d ago), licensed MIT. It adds 28 tokens to every session and 876 once invoked, about $0.0001 per session on Opus 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-31.

Related

Other commands, from other repositories