component-naming

Enforce PascalCase domain+role naming for React components.

21|2|Updated Nov 5, 2023
One-click install
npx skills add https://github.com/sgcarstrends/sgcarstrends --skill component-naming
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-naming
Source: https://github.com/sgcarstrends/sgcarstrends/tree/main/.claude/skills/component-naming
Command: npx skills add https://github.com/sgcarstrends/sgcarstrends --skill component-naming

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces consistent React component naming using domain + role patterns to improve readability and maintainability.

Core Features & Use Cases

  • PascalCase naming convention.
  • Domain + Role patterns for clarity.
  • Compound components for related subparts.

Quick Start

Rename a generic Chart component to TrendChart to reflect its domain and role.

Frequently Asked Questions about component-naming

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

FAQPage Schema
How do I enforce consistent React component naming conventions across my codebase?

Enforce consistent React component naming by applying domain + role patterns in PascalCase—for example, renaming a generic Chart to TrendChart to reflect its domain and purpose. This improves readability and ensures names align with file conventions using kebab-case.

What is the domain + role pattern for naming React components?

The domain + role pattern combines the business domain (e.g., Trend, User) with the component's functional role (e.g., Chart, Form, Button). This naming approach clarifies what a component does and where it fits in your application's architecture.

How do I structure compound React components using naming conventions?

Use dot notation to name compound subcomponents—for example, Card.Header, Card.Body—keeping related parts semantically grouped. This maintains clarity while avoiding layout or styling suffixes in component names.

Why should React component names follow PascalCase instead of other conventions?

PascalCase signals to React that a symbol is a component rather than a regular HTML element. Combined with domain + role naming, it enforces a consistent, scannable codebase that improves code review speed and reduces naming ambiguity.

Can I use component naming conventions during pull request reviews?

Yes. Component naming conventions apply during pull requests, component creation, and refactoring to catch inconsistencies early. This ensures domain context and role semantics remain clear as your codebase grows.

Should file names match React component names?

File names should align with component names but use kebab-case—for example, TrendChart lives in trend-chart.jsx. This maintains consistency between imports and file structure while following JavaScript file naming best practices.