Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问clear审计通过

component-naming组件命名

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,152

周安装

49

GitHub Stars

20

下载量

404
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:component-naming(组件命名)
来源仓库:https://github.com/sgcarstrends/sgcarstrends
仓库路径:skills/component-naming
安装命令:
npx skills add https://github.com/sgcarstrends/sgcarstrends --skill component-naming
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/sgcarstrends/sgcarstrends --skill component-naming

简介

用于统一 React 组件命名规范,确保代码库一致性。

  • 强制使用 PascalCase 命名,并推荐领域+角色命名模式。
  • 适用于新建组件、PR 审查或重构现有组件时校验名称。
  • 安装前建议确认项目是否已有自定义命名约定。
  • 提供命名规则示例和常见错误对照说明。component-naming 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Component Naming Conventions Skill

This skill helps you enforce consistent React component naming conventions across the codebase.

When to Use This Skill

  • Creating new React components
  • Reviewing component names in PRs
  • Refactoring existing components
  • Ensuring codebase consistency

Naming Rules

1. PascalCase

All React components use PascalCase:

// ✅ Good
export const TrendChart = () => {};
export const HeroPost = () => {};

// ❌ Bad
export const trendChart = () => {};
export const trend_chart = () => {};

2. Domain + Role Pattern

Combine domain context with component role for clarity:

// ✅ Good - Clear domain and role
export const TrendChart = () => {};       // Trend (domain) + Chart (role)
export const HeroPost = () => {};         // Hero (domain) + Post (role)
export const MetricCard = () => {};       // Metric (domain) + Card (role)
export const LatestCoePremium = () => {}; // LatestCoe (domain) + Premium (role)

// ❌ Bad - Too generic or unclear
export const Chart = () => {};            // No domain context
export const Data = () => {};             // Meaningless
export const Item = () => {};             // No specificity

3. Compound Components for Subparts

Use dot notation for related subcomponents:

// ✅ Good - Compound component pattern
export const HeroPost = () => {};
HeroPost.Image = () => {};
HeroPost.Title = () => {};
HeroPost.Meta = () => {};

// Usage
<HeroPost>
  <HeroPost.Image src={...} />
  <HeroPost.Title>...</HeroPost.Title>
  <HeroPost.Meta date={...} />
</HeroPost>

// ❌ Bad - Flat naming for related components
export const HeroPostImage = () => {};
export const HeroPostTitle = () => {};
export const HeroPostMeta = () => {};

4. Avoid Problematic Suffixes

Never use these suffixes:

// ❌ Avoid these suffixes
export const MetricCardContainer = () => {};  // -Container
export const ChartWrapper = () => {};         // -Wrapper
export const DataComponent = () => {};        // -Component
export const ListElement = () => {};          // -Element

// ✅ Use clear domain + role instead
export const MetricCard = () => {};
export const TrendChart = () => {};
export const RegistrationList = () => {};

5. Avoid Layout/Styling Descriptions

Names should describe purpose, not appearance:

// ❌ Bad - Describes layout/styling
export const LeftSidebar = () => {};
export const BigHeader = () => {};
export const RedButton = () => {};
export const TwoColumnLayout = () => {};

// ✅ Good - Describes purpose
export const NavigationSidebar = () => {};
export const PageHeader = () => {};
export const DangerButton = () => {};
export const ComparisonLayout = () => {};

File Naming Convention

Files use kebab-case matching the component name:

ComponentFile Name
TrendCharttrend-chart.tsx
HeroPosthero-post.tsx
MetricCardmetric-card.tsx
LatestCoePremiumlatest-coe-premium.tsx

Validation Checklist

When reviewing component names:

  • Uses PascalCase
  • Has clear domain context (not just "Card", "List", "Item")
  • Has clear role (Chart, Card, List, Banner, etc.)
  • No -Container, -Wrapper, -Component suffixes
  • No layout/styling descriptions (Left, Big, Red, TwoColumn)
  • File name matches component in kebab-case
  • Related subcomponents use compound pattern

Examples from Codebase

Good patterns found:

  • TrendAreaChart - Trends domain + Area Chart role
  • MarketShareDonut - Market Share domain + Donut role
  • TopMakesChart - Top Makes domain + Chart role
  • PremiumBanner - Premium domain + Banner role
  • MetricCard - Metric domain + Card role
  • LatestCoePremium - Latest COE domain + Premium role

Anti-patterns to avoid:

  • Generic names: Chart, Card, List, Data
  • Layout names: LeftPanel, MainContent, TopSection
  • Suffix pollution: CardContainer, ListWrapper, ItemComponent

Related Files

  • apps/web/CLAUDE.md - Web app component conventions
  • apps/web/src/components/ - Web app components
  • apps/web/src/app/admin/components/ - Admin interface components

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.15%
按下载量换算122

Antigravity

24.13%
按下载量换算97

OpenCode

17.96%
按下载量换算73

windsurf

11.68%
按下载量换算47

github-copilot

8.43%
按下载量换算34

trae

3.12%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills