Borrowing it
Nothing to install: this file belongs to Piyush8296/claude-workspace. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Piyush8296/claude-workspace/main/.claude/commands/component-gen.mdgit clone --depth 1 https://github.com/Piyush8296/claude-workspaceWrote 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/commands/piyush8296/claude-workspace/component-gen)<a href="https://agentmods.dev/commands/piyush8296/claude-workspace/component-gen"><img src="https://agentmods.dev/badge/commands/piyush8296/claude-workspace/component-gen.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.00013 | $0.00556 |
| Opus 5 | $0.00006 | $0.00278 |
| Sonnet 5 | $0.00003 | $0.00111 |
| Haiku 4.5 | $0.00001 | $0.00056 |
Grade A, and why
component-gen 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.
How it starts
The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Component Generator
Generate component: $ARGUMENTS
Instructions
1. Determine component location
- If the component name includes a path (e.g.,
features/auth/LoginForm), use that path - Otherwise, place in
src/components/$ARGUMENTS/ - Check if the component already exists — if so, ask before overwriting
2. Create the component file
<ComponentName>.tsx
import { type ComponentProps } from 'react';
interface <ComponentName>Props {
// TODO: Define props
}
export function <ComponentName>({ ...props }: <ComponentName>Props) {
return (
<div data-testid="<component-name>">
{/* TODO: Implement */}
</div>
);
}
Follow these conventions:
- Named export (no default export)
- Props interface defined in same file
data-testidfor testing- Semantic HTML
- TypeScript strict — no
any
3. Create the test file
<ComponentName>.test.tsx
import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { <ComponentName> } from './<ComponentName>';
const getDefaultProps = (overrides?: Partial<ComponentProps<typeof <ComponentName>>>) => ({
// Default props
...overrides,
});
describe('<ComponentName>', () => {
it('renders without crashing', () => {
render(<<ComponentName> {...getDefaultProps()} />);
expect(screen.getByTestId('<component-name>')).toBeInTheDocument();
});
it('handles empty state', () => {
// TODO: Test empty state
});
it('handles loading state', () => {
// TODO: Test loading state
});
it('handles error state', () => {
// TODO: Test error state
});
});
4. Create barrel export
index.ts
export { <ComponentName> } from './<ComponentName>';
export type { <ComponentName>Props } from './<ComponentName>';
5. Summary
After generating, print:
- Files created (with paths)
- Next steps: implement the component logic, fill in props, write real tests
- Remind about the
react-patternsskill for component architecture guidance
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 · 95 lines · 13 tokens per session scan A 03f98b0eef5c
component-gen is a command published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 4mo ago), licensed MIT. It adds 13 tokens to every session and 556 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.
Other commands, from other repositories
component-scaffold
You are a React component architecture expert specializing in scaffolding production-ready, accessible, and performant components. Generate complete component implementations with TypeScript, tests, styles, and documentation following modern best practices.
component-gen
Generate React or Vue components with prop types, styling, accessibility, and tests.
web-design
Design and build a complete website or webapp from a project brief — end-to-end workflow from design to working React/Vite code.
deep-link
Configuration Deep Linking React Native.
generate-screen
Génération Screen React Native.
bundle-analyze
Tu es un expert performance React. Tu dois analyser la taille du bundle, identifier les dépendances volumineuses et proposer des optimisations.