Create React Feature Skill
Description
Generates a complete set of files for a new React feature component, including the implementation, tests, and export definition, tailored for the Tepora Project stack (React 19, TypeScript, Tailwind CSS v4, Vitest).
Usage
Activate this skill when the user asks to create a new UI component, add a feature to the frontend, or scaffold a React component.
Dependencies
- React v19
- TypeScript
- Tailwind CSS v4
- Vitest
- Lucide React (for icons)
Instructions
When this skill is activated, follow these steps:
Clarify Requirements:
If not provided, ask the user for:
- Component Name (PascalCase, e.g.,
UserProfile, SettingsPanel).
- Target Directory (Default to
frontend/src/components/ui for generic UI or frontend/src/features/[feature-name] for specific features).
- Purpose/Functionality (Brief description of what it does).
Generate Files:
Create a new directory named after the component (or use existing) and generate the following files inside it.
File 1: [ComponentName].tsx
- Use Functional Component syntax with
export const.
- Define a Props interface
[ComponentName]Props.
- Use Tailwind CSS classes for styling.
- Implement basic structure based on the user's description.
- Import icons from
lucide-react if needed.
Template:
import React from 'react';
import { cn } from '@/lib/utils'; // Assuming a utility for class merging exists, otherwise use template literals
interface [ComponentName]Props {
className?: string;
// Add other props here
}
export const [ComponentName]: React.FC<[ComponentName]Props> = ({ className, ...props }) => {
return (
<div className={cn("p-4 bg-white rounded-lg shadow-sm border border-gray-100", className)} {...props}>
<h2 className="text-lg font-semibold text-gray-900">[ComponentName]</h2>
<p className="text-gray-500 mt-2">Component content goes here.</p>
</div>
);
};
File 2: [ComponentName].test.tsx
- Use
vitest and @testing-library/react.
- Include a basic render test and a snapshot test (optional) or checking for text presence.
Template:
import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { [ComponentName] } from './[ComponentName]';
describe('[ComponentName]', () => {
it('renders correctly', () => {
render(<[ComponentName] />);
expect(screen.getByText('[ComponentName]')).toBeInTheDocument();
});
});
File 3: index.ts
Template:
export * from './[ComponentName]';
Review:
Show the file paths to be created and ask for confirmation before writing, unless the user gave explicit "do it" permission.
Post-Creation:
After creating files, suggest running tests: npm run test or npx vitest.
Context Awareness
- Check
frontend/tsconfig.json for path aliases (e.g., @/) before importing.
- Check if
cn (classnames utility) exists in frontend/src/lib/utils.ts or similar. If not, use template literals or suggest creating it.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: create-react-feature3description: Generates a complete set of files for a new React feature component, including the implementation, tests, and export definition.4---56# Create React Feature Skill78## Description9Generates a complete set of files for a new React feature component, including the implementation, tests, and export definition, tailored for the Tepora Project stack (React 19, TypeScript, Tailwind CSS v4, Vitest).1011## Usage12Activate this skill when the user asks to create a new UI component, add a feature to the frontend, or scaffold a React component.1314## Dependencies15- React v1916- TypeScript17- Tailwind CSS v418- Vitest19- Lucide React (for icons)2021## Instructions2223When this skill is activated, follow these steps:24251. **Clarify Requirements**:26 If not provided, ask the user for:27 - **Component Name** (PascalCase, e.g., `UserProfile`, `SettingsPanel`).28 - **Target Directory** (Default to `frontend/src/components/ui` for generic UI or `frontend/src/features/[feature-name]` for specific features).29 - **Purpose/Functionality** (Brief description of what it does).30312. **Generate Files**:32 Create a new directory named after the component (or use existing) and generate the following files inside it.3334 **File 1: `[ComponentName].tsx`**35 - Use Functional Component syntax with `export const`.36 - Define a Props interface `[ComponentName]Props`.37 - Use Tailwind CSS classes for styling.38 - Implement basic structure based on the user's description.39 - Import icons from `lucide-react` if needed.4041 **Template:**42 ```tsx43 import React from 'react';44 import { cn } from '@/lib/utils'; // Assuming a utility for class merging exists, otherwise use template literals45 46 interface [ComponentName]Props {47 className?: string;48 // Add other props here49 }5051 export const [ComponentName]: React.FC<[ComponentName]Props> = ({ className, ...props }) => {52 return (53 <div className={cn("p-4 bg-white rounded-lg shadow-sm border border-gray-100", className)} {...props}>54 <h2 className="text-lg font-semibold text-gray-900">[ComponentName]</h2>55 <p className="text-gray-500 mt-2">Component content goes here.</p>56 </div>57 );58 };59 ```6061 **File 2: `[ComponentName].test.tsx`**62 - Use `vitest` and `@testing-library/react`.63 - Include a basic render test and a snapshot test (optional) or checking for text presence.6465 **Template:**66 ```tsx67 import { render, screen } from '@testing-library/react';68 import { describe, it, expect } from 'vitest';69 import { [ComponentName] } from './[ComponentName]';7071 describe('[ComponentName]', () => {72 it('renders correctly', () => {73 render(<[ComponentName] />);74 expect(screen.getByText('[ComponentName]')).toBeInTheDocument();75 });76 });77 ```7879 **File 3: `index.ts`**80 - Export the component.8182 **Template:**83 ```ts84 export * from './[ComponentName]';85 ```86873. **Review**:88 Show the file paths to be created and ask for confirmation before writing, unless the user gave explicit "do it" permission.89904. **Post-Creation**:91 After creating files, suggest running tests: `npm run test` or `npx vitest`.9293## Context Awareness94- Check `frontend/tsconfig.json` for path aliases (e.g., `@/`) before importing.95- Check if `cn` (classnames utility) exists in `frontend/src/lib/utils.ts` or similar. If not, use template literals or suggest creating it.9697---98> Converted and distributed by [TomeVault](https://tomevault.io/claim/coco4atjp) — claim your Tome and manage your conversions.99<!-- tomevault:4.0:skill_md:2026-04-14 -->