component

A command that creates a new React user-interface component based on a specified component type or a nearby existing component.

In plain words
What is it for?
Use it to scaffold components such as selectable list rows, sidebar items, cards, and detail views in an existing React project.
Why use it?
It prevents incomplete starter code, guessed properties, and unnecessary styling. It also stops when there is not enough information to choose the right structure.

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/xiaolai/claudepot-app/component
Clone the repo
git clone --depth 1 https://github.com/xiaolai/claudepot-app

Made for: Claude Code.

Per session 34 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,385 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.00034 $0.02385
Opus 5 $0.00017 $0.01192
Sonnet 5 $0.00007 $0.00477
Haiku 4.5 $0.00003 $0.00238

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

Security

Grade A, and why

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 3d 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/component.md · 249 lines

How it starts

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

Scaffold Component

Create a new React component grounded in one of the kinds below. The scaffold emits only what the kind requires — no TODO placeholders, no speculative props, no "fill it in later" CSS. Subtraction from a full recipe produces vestigial code; we avoid that entirely.

Inputs

$ARGUMENTS must contain:

  1. Component name — PascalCase (ProjectDriftBanner, AccountRow, KeychainStatusBadge).
  2. Kind — one of the kinds in the table below, OR
  3. Nearest existing component — if no kind fits, name an existing component in src/components/, src/sections/, or src/shell/ that is the closest structural match.

If neither a kind nor a nearest-component is given, stop and ask. Do not pick a default — there is no default. An unspecified scaffold is the exact failure mode we're replacing.

Kinds

Every kind below points to a live paper-mono component in src/ that the scaffold must mirror.

Kind Live reference
list-row-selectable src/sections/projects/ProjectsTable.tsx
sidebar-item src/components/primitives/SidebarItem.tsx, src/shell/AppSidebar.tsx
card src/sections/accounts/AccountCard.tsx
detail-grid src/sections/SettingsSection.tsx (Kv rows)
banner src/components/PendingJournalsBanner.tsx, src/sections/accounts/AnomalyBanner.tsx
toolbar src/shell/ScreenHeader.tsx (actions slot)
filter-bar src/sections/AccountsSection.tsx, src/sections/ProjectsSection.tsx
segmented-control src/sections/SettingsSection.tsx (Appearance theme picker)
modal src/components/primitives/Modal.tsx, src/sections/accounts/AddAccountModal.tsx
confirm-destructive src/components/ConfirmDangerousAction.tsx
empty-state src/sections/SessionsSection.tsx
status-tag src/components/primitives/Tag.tsx
search-field src/sections/AccountsSection.tsx filter input
context-menu src/components/ContextMenu.tsx
collapsible-section src/components/CollapsibleSection.tsx
running-op-entry src/components/RunningOpStrip.tsx
usage-row src/sections/accounts/UsageBlock.tsx
action-card src/sections/accounts/ActionCard.tsx
screen-header src/shell/ScreenHeader.tsx

Read the full file on GitHub · 249 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. 3d ago First seen · 249 lines · 34 tokens per session scan A 60f98ab53f93

Subscribe to this mod's changes

component is a command published in the GitHub repository xiaolai/claudepot-app (118 stars, last pushed 4d ago), licensed ISC. It adds 34 tokens to every session and 2,385 once invoked, about $0.0002 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-30.