一键导入
component-naming
Enforces consistent React component naming conventions across the portfolio codebase. Use when creating, reviewing, or refactoring components.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Enforces consistent React component naming conventions across the portfolio codebase. Use when creating, reviewing, or refactoring components.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Maintains visual consistency across portfolio UI components. Use when creating or modifying components, styling pages, or ensuring design consistency. Includes coral colour tokens (OKLCH), typography scale, spacing rules, animations, and component patterns.
Encodes Ru Chern's personal writing voice for blog posts on ruchern.dev. Use when drafting, rewriting, or editing blog posts — not marketing copy. Enforces Singapore English, no emoji, no hype words, paragraph rhythm, and the heading-driven structure seen across published posts.
基于 SOC 职业分类
| name | component-naming |
| description | Enforces consistent React component naming conventions across the portfolio codebase. Use when creating, reviewing, or refactoring components. |
Use this guide when creating or modifying React components to ensure consistent naming across the portfolio.
All React components use PascalCase:
// ✅ Good
export const FeaturedPost = () => {};
export const TagFilter = () => {};
// ❌ Bad
export const featuredPost = () => {};
export const featured_post = () => {};
Combine domain context with component role for clarity:
// ✅ Good - Clear domain and role
export const FeaturedPost = () => {}; // Featured (domain) + Post (role)
export const TagFilter = () => {}; // Tag (domain) + Filter (role)
export const ReadingProgress = () => {}; // Reading (domain) + Progress (role)
export const MetricCard = () => {}; // Metric (domain) + Card (role)
export const HeroSection = () => {}; // Hero (domain) + Section (role)
// ❌ Bad - Too generic or unclear
export const Card = () => {}; // No domain context
export const Filter = () => {}; // No specificity
export const Section = () => {}; // Meaningless
Use dot notation for related subcomponents:
// ✅ Good - Compound component pattern
export const PostCard = () => {};
PostCard.Image = () => {};
PostCard.Title = () => {};
PostCard.Meta = () => {};
// Usage
<PostCard>
<PostCard.Image src={...} />
<PostCard.Title>...</PostCard.Title>
<PostCard.Meta date={...} />
</PostCard>
// ❌ Bad - Flat naming for related components
export const PostCardImage = () => {};
export const PostCardTitle = () => {};
export const PostCardMeta = () => {};
Never use these suffixes:
// ❌ Avoid these suffixes
export const CardContainer = () => {}; // -Container
export const PostWrapper = () => {}; // -Wrapper
export const DataComponent = () => {}; // -Component
export const ListElement = () => {}; // -Element
// ✅ Use clear domain + role instead
export const MetricCard = () => {};
export const PostList = () => {};
export const TagBadge = () => {};
Names should describe purpose, not appearance:
// ❌ Bad - Describes layout/styling
export const LeftSidebar = () => {};
export const BigHeader = () => {};
export const RedButton = () => {};
export const TwoColumnGrid = () => {};
// ✅ Good - Describes purpose
export const NavigationSidebar = () => {};
export const PageHeader = () => {};
export const DangerButton = () => {};
export const BentoGrid = () => {};
Files use kebab-case matching the component name:
| Component | File Name |
|---|---|
FeaturedPost | featured-post.tsx |
TagFilter | tag-filter.tsx |
ReadingProgress | reading-progress.tsx |
MetricCard | metric-card.tsx |
HeroSection | hero-section.tsx |
| Location | Purpose |
|---|---|
src/components/ | Reusable components |
src/components/auth/ | Authentication components |
src/app/components/ | App-level shared components |
src/app/(main)/about/components/ | About page components |
src/app/(main)/blog/components/ | Blog page components |
src/app/(main)/dashboard/components/ | Dashboard page components |
src/app/studio/media/components/ | Studio media components |
src/app/studio/posts/components/ | Studio posts components |
src/app/studio/series/components/ | Studio series components |
When reviewing component names:
Good patterns:
| Component | Domain | Role |
|---|---|---|
FeaturedPost | Featured | Post |
TagFilter | Tag | Filter |
ReadingProgress | Reading | Progress |
PostGrid | Post | Grid |
AuthorCard | Author | Card |
BentoGrid | Bento | Grid |
HeroSection | Hero | Section |
LatestPosts | Latest | Posts |
SkillsGrid | Skills | Grid |
ContactCta | Contact | Cta |
Anti-patterns to avoid:
Card, Grid, List, SectionLeftPanel, MainContent, TopSectionCardContainer, ListWrapper, PostComponent.claude/skills/design-language-system/SKILL.md - Design system guidelinessrc/components/ - Blog components