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.
npx agentmods add skills/muhammadusmangm/claude-code-best-practices/component-newnpx skills add MuhammadUsmanGM/claude-code-best-practices --skill component-newgit clone --depth 1 https://github.com/MuhammadUsmanGM/claude-code-best-practicesWrote 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.
[](https://agentmods.dev/skills/muhammadusmangm/claude-code-best-practices/component-new)<a href="https://agentmods.dev/skills/muhammadusmangm/claude-code-best-practices/component-new"><img src="https://agentmods.dev/badge/skills/muhammadusmangm/claude-code-best-practices/component-new.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00045 | $0.00521 |
| Opus 5 | $0.00023 | $0.00260 |
| Sonnet 5 | $0.00009 | $0.00104 |
| Haiku 4.5 | $0.00005 | $0.00052 |
Grade A, and why
component-new 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 6d 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.
What it actually says
Component New
Scaffold a new component. Ask once for name and placement if ambiguous; then create the files without further prompting.
Steps
- Pick a location.
- If the component is reusable and presentational →
src/components/<Name>/. - If it belongs to a feature →
src/features/<feature>/components/<Name>/. - If the project has neither folder, ask the user before creating new top-level structure.
- If the component is reusable and presentational →
- Read a sibling component in the target folder to match its style (props pattern, default vs. named export, test shape, hooks placement). If no sibling exists, use the shape below.
- Create three files:
<Name>.tsx— the component<Name>.test.tsx— a failing-first test with onetoBeInTheDocumentassertionindex.ts—export * from './<Name>';(only if the folder contains one)
- Do not add it to a barrel file in
src/unless one already exists. - Report the paths created. Stop.
Default shape (if no sibling to mirror)
// src/components/<Name>/<Name>.tsx
import type { ReactNode } from 'react';
export interface <Name>Props {
children?: ReactNode;
}
export function <Name>({ children }: <Name>Props) {
return <div>{children}</div>;
}
// src/components/<Name>/<Name>.test.tsx
import { render, screen } from '@testing-library/react';
import { <Name> } from './<Name>';
describe('<Name>', () => {
it('renders children', () => {
render(<<Name>>hello</<Name>>);
expect(screen.getByText('hello')).toBeInTheDocument();
});
});
Rules
- Never default-export. Named export only (per project convention).
- No
any. Useunknownor define the type. - Don't add third-party dependencies.
- Don't wire the component into any routes or parent components — that's a follow-up prompt.
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.
- 6d ago First seen · 65 lines · 45 tokens per session scan A d47e55b0ce95
component-new is a skill published in the GitHub repository MuhammadUsmanGM/claude-code-best-practices (78 stars, last pushed 2mo ago), licensed MIT. It adds 45 tokens to every session and 521 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.
Other skills, from other repositories
moai-design-tools
Design tool integration specialist covering Figma MCP, Pencil renderer, and Pencil-to-code export. Use when fetching design context from Figma, rendering Pencil designs, or exporting to React/Tailwind code.
moai-ref-react-patterns
React/Next.js component design patterns, state management strategies, and project structure reference for frontend development. Agent-extending skill that amplifies frontend domain work (spawned via Agent(general-purpose) with frontend instructions) with production-grade React patterns. NOT for: backend API design…
moai-domain-uiux
UI/UX design systems specialist covering accessibility, icons, theming, design tokens, and user experience patterns. Use when working on design systems, WCAG compliance, ARIA patterns, or dark mode theming.
moai-domain-frontend
Frontend development specialist covering React 19, Next.js 16, Vue 3.5, and modern UI/UX patterns with component architecture. Use when building web UIs, implementing components, optimizing frontend performance, or integrating state management.
software-frontend
Builds frontend applications across major web stacks. Use when implementing UI, fixing hydration or SSR issues, or setting up modern frontend architecture.
software-localisation
Implements production-grade i18n/l10n for React, Vue, Angular, and Next.js with ICU format and RTL support. Use when setting up or debugging localisation.