frontend-component-style

Enforces component file structure, naming conventions, and layer separation for React frontend code.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/arndvs/ctrlshft --skill frontend-component-style-arndvs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: frontend-component-style
Source: https://github.com/arndvs/ctrlshft/tree/main/skills/frontend-component-style
Command: npx skills add https://github.com/arndvs/ctrlshft --skill frontend-component-style-arndvs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Frontend codebases drift into inconsistent structures: oversized single-file components, inline data mixed with presentation, vague names like Card or utils.ts, and formatting logic buried in JSX. This Skill gives the agent a deterministic decision framework for where each piece of code lives and what it is named when creating, refactoring, splitting, or promoting components. ## Core Features & Use Cases - Prototype vs Production mode detection: Chooses between a single self-contained TSX file with inline data and a four-layer production structure based on explicit user words, file location signals, or a clarifying question. - Four-layer production architecture: Separates code into Data (*-content.ts), Logic (verb-noun .ts), Primitive (.tsx), and Composed (.tsx) layers with a one-directional dependency arrow. - Naming and SRP enforcement: Applies kebab-case file naming, specific component noun phrases, verb-led function names, and a one-sentence single-responsibility test. - Promote workflow: Converts a prototype into production code by extracting content, logic, and subcomponents into separate typed files. - Use Case: Ask the agent to refactor a 300-line dashboard component; it extracts dashboard-metrics-content.ts, format-metric-trend.ts, trend-badge.tsx, and metric-card.tsx with correct imports and naming. ## Quick Start Ask the agent to build a new React component or refactor an existing one, and it will declare the mode and apply the matching structure and naming rules.

Frequently Asked Questions about frontend-component-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a React component for production?▼

Split production components into four layers: a *-content.ts data file, verb-noun logic files like format-metric-trend.ts, single-element primitive TSX files, and composed TSX files that assemble primitives. Dependencies flow one direction: page view to composed to primitive to logic and data.

How to decide between a single-file component and splitting into multiple files?▼

Use explicit words in the request first: prototype, sketch, or draft means one self-contained TSX file; production, ship, or refactor means the four-layer split. If unclear, check file location signals like prototypes/ versus src/components/, or ask the user directly.

When should I not split a React component into smaller files?▼

Do not extract a formatter used in exactly one place that is three lines long, a primitive with a single consumer and no testing need, or a one-off EmptyState. Extract only when there is a second consumer, non-trivial logic, or a real testing need.

What naming conventions should React components and files follow?▼

Files use kebab-case named after what they render or do, components use specific noun phrases like MetricTrendBadge, and functions use verb-led names like formatCurrency or handlePlanUpgrade. Avoid generic names like Card, utils.ts, handleClick, or Props.

How do I promote a prototype component to production code?▼

Extract the inline componentData object into a typed *-content.ts file, move formatting functions into verb-noun logic files, give each nested subcomponent its own file, and re-aim the original file as a composed view importing only content and primitives.