Skill para la creación estandarizada de componentes React
60
75%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Use this skill when the task is to create a new React component from scratch. All new files live under one folder per component, grouped by category.
| Placeholder | Usage |
|---|---|
COMPONENT_NAME | Folder and file basename (e.g. chile-profile, user-card). Typically kebab-case or lowercase as your repo dictates. |
COMPONENT_NAME_CAP | PascalCase component identifier (e.g. ChileProfile, UserCard). Same logical name as COMPONENT_NAME, capitalized for JSX/type names. |
CATEGORY_NAME | Subfolder under src/components for the domain or slice (e.g. paises, v1, shared). |
Root path for all files:
src/components/CATEGORY_NAME/COMPONENT_NAME/COMPONENT_NAME.types.tsCreate a props interface named COMPONENT_NAME_CAPProps that:
?).children?: React.ReactNode only when the component must accept children (omit for a minimal placeholder component).onAction?: () => void when event-style callbacks are needed.Import React types as required (e.g. import type { ReactNode } from 'react' or rely on React.ReactNode with import React from 'react' depending on project style).
COMPONENT_NAME.tsxBuild a functional component:
React and COMPONENT_NAME_CAPProps from ./COMPONENT_NAME.types.const COMPONENT_NAME_CAP: React.FC<COMPONENT_NAME_CAPProps> = (props) => { ... } (or destructure props as needed).COMPONENT_NAME_CAP.className. Do not use inline style={{ ... }}.index.tsExport with:
export { default as COMPONENT_NAME_CAP } from './COMPONENT_NAME';
export type { COMPONENT_NAME_CAPProps } from './COMPONENT_NAME.types';Adjust export names to match the exact COMPONENT_NAME_CAP and file basenames in the repo.
src/components/CATEGORY_NAME/COMPONENT_NAME/COMPONENT_NAME.types.ts
src/components/CATEGORY_NAME/COMPONENT_NAME/COMPONENT_NAME.tsx
src/components/CATEGORY_NAME/COMPONENT_NAME/index.tsCOMPONENT_NAME.any; align with existing project conventions for React.FC vs plain functions if the codebase has a standard.className only.A consistent, importable component: types + default export + barrel file, under the correct CATEGORY_NAME path, ready for composition or for follow-up tasks (e.g. wiring a service).