AgentSkillsCN

naming-convention-enforcer

强制推行统一的命名规范:文件采用 kebab-case 命名,组件采用 PascalCase 命名,变量采用 camelCase 命名,常量采用 SCREAMING_SNAKE_CASE 命名,自定义 Hook 使用 use* 前缀,事件处理器使用 handle* 前缀。适用于新建文件或变量时,或在发现命名不一致时使用。

SKILL.md
--- frontmatter
name: naming-convention-enforcer
description: Enforces consistent naming: kebab-case files, PascalCase components, camelCase variables, SCREAMING_SNAKE constants, use* hooks, handle* handlers. Use when creating files/variables or when inconsistency is detected.

Naming Convention Enforcer

When to Trigger

  • Creating new files/variables
  • Inconsistent naming detected

What to Do

  • Files: kebab-case (e.g. booking-card.tsx).
  • Components: PascalCase (e.g. BookingCard).
  • Variables/functions: camelCase (e.g. bookingCount, getBooking).
  • Constants: SCREAMING_SNAKE_CASE (e.g. API_URL, MAX_PAGE_SIZE).
  • Hooks: Prefix use (e.g. useBooking, useAuth).
  • Event handlers: handle* or on* for props (e.g. handleSubmit, onBookingDelete).
  • Booleans: is*, has*, can*, should* (e.g. isLoading, hasPermission).

Align with project .cursorrules. Suggest renames with concrete replacements.