Agent skill
new-component
Creates new React components following project conventions. Scaffolds TypeScript types, MUI styling patterns, and named exports in src/components/. References Common component library to avoid duplication.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/new-component-gwpjp-web3-claude
SKILL.md
Create New Component
Create a new React component following project conventions.
Initialization
When invoked:
- Read
.claude/docs/component-reference.mdto check if a Common component already handles the need - Read
.claude/docs/project-rules.mdfor project conventions
Instructions
- Parse the component name from
$ARGUMENTS - Determine the file path:
- If name includes
/, treat the first part as a subfolder - Create in
src/components/
- If name includes
- Before creating: Check
docs/component-reference.mdto verify no existing Common component handles this use case - Create the component file with:
- Proper TypeScript types for props
- Functional component using React hooks if needed
- MUI styling patterns (use theme values, never hardcoded colors/fonts)
- Named export (not default)
- If the component needs types, add them to
src/types/or inline
Template
import { type FC } from "react";
import { Box } from "@mui/material";
interface ComponentNameProps {
// Add props here
}
export const ComponentName: FC<ComponentNameProps> = (props) => {
return <Box>{/* Component content */}</Box>;
};
Conventions
- Use
CommonButton(not rawButton),CTAButtonfor blockchain actions - Use Common input components (not raw
TextField) - Use theme palette references for colors (
color="text.secondary") - Use Typography variants for text (never inline
fontSize/fontWeight) - Use
NumberFormatterordisplayNumberfor formatted numbers
Verification
After creating the component:
yarn typecheck && yarn lint && yarn prettier && yarn build
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?