Create React/Vue component with TypeScript, tests, and styles. Auto-invoke when user says "create component", "add component", "new component", or "build component".
Generates production-ready React/Vue components with TypeScript, tests, and styles. Auto-invokes when you say "create component" or "add component" to scaffold complete component files.
/plugin marketplace add alekspetrov/navigator/plugin install navigator@navigator-marketplaceThis skill is limited to using the following tools:
examples/Button.tsxexamples/SearchBar.tsxfunctions/component_generator.pyfunctions/name_validator.pyfunctions/props_interface_generator.pyfunctions/style_generator.pyfunctions/test_generator.pytemplates/component-simple-template.tsxtemplates/style-template.module.csstemplates/test-template.test.tsxGenerate production-ready React/Vue components with TypeScript, tests, and styles following modern best practices.
Auto-invoke when user mentions:
Ask user for component details:
Component name: [PascalCase name, e.g., UserProfile]
Component type:
- simple (basic functional component)
- with-hooks (useState, useEffect, etc.)
- container (data fetching component)
Styling approach:
- css-modules (default)
- styled-components
- tailwind
Props needed: [Optional: describe expected props]
Validate component name:
functions/name_validator.pyBased on component type and requirements:
Use predefined function: functions/props_interface_generator.py
# Generates TypeScript interface based on component requirements
python3 functions/props_interface_generator.py \
--name "UserProfile" \
--props "userId:string,onUpdate:function,isActive:boolean"
Output:
interface UserProfileProps {
userId: string;
onUpdate?: () => void;
isActive?: boolean;
children?: React.ReactNode;
className?: string;
}
Use appropriate template based on type:
Simple component:
Use template: templates/component-simple-template.tsx
Component with hooks:
Use template: templates/component-with-hooks-template.tsx
Container component:
Use template: templates/component-container-template.tsx
Use predefined function: functions/component_generator.py
python3 functions/component_generator.py \
--name "UserProfile" \
--type "simple" \
--props-interface "UserProfileProps" \
--template "templates/component-simple-template.tsx" \
--output "src/components/UserProfile/UserProfile.tsx"
Template substitutions:
${COMPONENT_NAME} → Component name (PascalCase)${PROPS_INTERFACE} → Generated props interface${STYLE_IMPORT} → CSS module import${DESCRIPTION} → Brief component descriptionUse predefined function: functions/test_generator.py
python3 functions/test_generator.py \
--component-name "UserProfile" \
--component-path "src/components/UserProfile/UserProfile.tsx" \
--template "templates/test-template.test.tsx" \
--output "src/components/UserProfile/UserProfile.test.tsx"
Test template includes:
Template substitutions:
${COMPONENT_NAME} → Component name${IMPORT_PATH} → Relative import path${TEST_CASES} → Generated test cases based on propsUse predefined function: functions/style_generator.py
python3 functions/style_generator.py \
--name "UserProfile" \
--approach "css-modules" \
--template "templates/style-template.module.css" \
--output "src/components/UserProfile/UserProfile.module.css"
CSS Modules template:
.container {
/* Component wrapper styles */
}
.title {
/* Title styles */
}
/* Add more classes as needed */
Styled Components alternative:
// Generated if --approach "styled-components"
import styled from 'styled-components';
export const Container = styled.div`
/* Component wrapper styles */
`;
export const Title = styled.h2`
/* Title styles */
`;
Create index.ts for clean imports:
Write(
file_path: "src/components/UserProfile/index.ts",
content: "export { UserProfile } from './UserProfile';\nexport type { UserProfileProps } from './UserProfile';\n"
)
Allows usage:
import { UserProfile } from '@/components/UserProfile';
Display generated files and usage:
✅ Component Created: UserProfile
Structure:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📁 src/components/UserProfile/
├── UserProfile.tsx (Component)
├── UserProfile.test.tsx (Tests)
├── UserProfile.module.css (Styles)
└── index.ts (Exports)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Props Interface:
interface UserProfileProps {
userId: string;
onUpdate?: () => void;
isActive?: boolean;
}
Usage:
import { UserProfile } from '@/components/UserProfile';
<UserProfile
userId="123"
onUpdate={() => console.log('Updated')}
isActive={true}
/>
Next Steps:
1. Customize component implementation
2. Run tests: npm test UserProfile
3. Import and use in your feature
Validates component naming conventions.
Usage:
python3 functions/name_validator.py --name "UserProfile"
Checks:
Returns: Valid name or error message
Generates TypeScript props interface from user input.
Usage:
python3 functions/props_interface_generator.py \
--name "UserProfile" \
--props "userId:string,onUpdate:function,isActive:boolean"
Supported types:
string, number, booleanfunction (becomes () => void)array (becomes any[])object (becomes Record<string, any>)react-node (becomes React.ReactNode)Returns: TypeScript interface string
Generates component file from template with substitutions.
Usage:
python3 functions/component_generator.py \
--name "UserProfile" \
--type "simple" \
--props-interface "UserProfileProps" \
--template "templates/component-simple-template.tsx" \
--output "src/components/UserProfile/UserProfile.tsx"
Parameters:
--name: Component name (PascalCase)--type: Component type (simple/with-hooks/container)--props-interface: Props interface name--template: Template file path--output: Output file pathReturns: Generated component code
Generates test file with React Testing Library.
Usage:
python3 functions/test_generator.py \
--component-name "UserProfile" \
--component-path "src/components/UserProfile/UserProfile.tsx" \
--template "templates/test-template.test.tsx" \
--output "src/components/UserProfile/UserProfile.test.tsx"
Generates tests for:
Returns: Generated test code
Generates style file (CSS Modules or Styled Components).
Usage:
python3 functions/style_generator.py \
--name "UserProfile" \
--approach "css-modules" \
--template "templates/style-template.module.css" \
--output "src/components/UserProfile/UserProfile.module.css"
Supported approaches:
css-modules (default)styled-componentstailwind (generates className utilities)Returns: Generated style code
Basic functional component template.
Placeholders:
${COMPONENT_NAME} - Component name${PROPS_INTERFACE} - Props interface definition${STYLE_IMPORT} - CSS import statement${DESCRIPTION} - Component descriptionComponent template with useState, useEffect examples.
Additional placeholders:
${HOOKS} - Hook declarations${HANDLERS} - Event handler functionsContainer component template with data fetching.
Additional placeholders:
${API_IMPORT} - API function import${DATA_TYPE} - Data type definition${FETCH_LOGIC} - Data fetching implementationReact Testing Library test template.
Placeholders:
${COMPONENT_NAME} - Component name${IMPORT_PATH} - Import path${TEST_CASES} - Generated test casesCSS Modules template.
Placeholders:
${COMPONENT_NAME_KEBAB} - Component name in kebab-case${BASE_STYLES} - Base container stylesSee examples/ directory for reference implementations:
Each example includes:
any type (use unknown if needed)Problem: Generated component throws errors
Solutions:
Problem: Generated tests don't pass
Solutions:
--verbose flagProblem: CSS modules not loading
Solutions:
This skill succeeds when:
Auto-invoke this skill when creating React components to ensure consistency and save time ⚛️
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.