Token导航 LogoToken导航

Agent Skill · 研究检索

components-standards(零部件标准)

components-standards 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

components-standards 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 18,239。

总安装 6,192周安装 221GitHub Stars 1,598下载 2,013核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/maxritter/claude-codepro --skill 'Components Standards'

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

建立小型、专注的单职责组件构建标准,支持复杂 UI 组合。适用于 .jsx/.tsx/.vue 等组件文件的创建与维护场景。强调 Props 接口定义、状态管理与组件组合最佳实践。需配合项目现有组件库结构调整具体实现方式。

components-standards 属于研究检索类 Skill,可作为该场景下的辅助能力补充。提供按钮、表单、卡片等基础元素的复用规范。

来源仓库内路径:skills/components-standards

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/maxritter/claude-codepro --skill 'Components S…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

components-standards 怎么安装?

在终端执行 npx skills add https://github.com/maxritter/claude-codepro --skill 'Components Standards'。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

components-standards 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

components-standards 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

components-standards 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

components-standards 用的人多吗?

公开数据是累计安装 6,192 次,近一周安装 221 次,下载 2,013 次,GitHub 1,598 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

components-standards 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 来源仓库有 1,598 星,维护活跃度相对可查。

先想清楚的地方

  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
components-standards

零部件标准 · 本页

6,1921,598需要联网MIT未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Components Standards

Core Rule: Build small, focused components with single responsibility. Compose complex UIs from simple pieces.

When to use this skill

  • When creating new component files (.jsx,.tsx,.vue,.svelte, etc.)
  • When modifying existing components in component directories (components/, ui/, lib/)
  • When defining component props, interfaces, or prop types
  • When implementing component composition to build complex UIs from simpler components
  • When managing component-level state and deciding when to lift state up
  • When creating reusable UI elements like buttons, forms, cards, modals, or layouts
  • When documenting component APIs, props, and usage examples
  • When refactoring monolithic components into smaller, focused components
  • When designing component interfaces for team adoption
  • When implementing encapsulation to keep internal component details private

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle frontend components.

Component Design Principles

Single Responsibility

Each component does one thing well. If you need "and" to describe it, split it.

Bad:

// UserProfileCardWithEditFormAndNotifications - does too much
function UserProfile() {
  return (
    <>
      <ProfileDisplay />
      <EditForm />
      <NotificationList />
    </>
  )
}

Good:

// Three focused components
function UserProfileCard({ user }) { /* display only */ }
function UserEditForm({ user, onSave }) { /* editing only */ }
function UserNotifications({ userId }) { /* notifications only */ }

Composition Over Configuration

Build complex UIs by combining simple components, not by adding props.

Bad - Configuration:

<Card
  showHeader
  showFooter
  headerAlign="left"
  footerAlign="right"
  headerColor="blue"
>
  Content
</Card>

Good - Composition:

<Card>
  <Card.Header align="left" color="blue">Title</Card.Header>
  <Card.Body>Content</Card.Body>
  <Card.Footer align="right">Actions</Card.Footer>
</Card>

Minimal Props

Keep props under 5-7. More props = component doing too much.

When you have many props:

  1. Group related props into objects
  2. Split component into smaller pieces
  3. Use composition instead of configuration

Example - Group related props:

// Bad
function Button({ textColor, bgColor, borderColor, hoverColor }) {}

// Good
function Button({ colors: { text, bg, border, hover } }) {}

Component Interface Design

Explicit Prop Types

Always define prop types with TypeScript interfaces or PropTypes.

React/TypeScript:

interface ButtonProps {
  variant?: 'primary' | 'secondary' | 'danger'
  size?: 'sm' | 'md' | 'lg'
  disabled?: boolean
  onClick: () => void
  children: React.ReactNode
}

function Button({
  variant = 'primary',
  size = 'md',
  disabled = false,
  onClick,
  children
}: ButtonProps) {
  // Implementation
}

Vue:

<script setup lang="ts">
interface Props {
  variant?: 'primary' | 'secondary' | 'danger'
  size?: 'sm' | 'md' | 'lg'
  disabled?: boolean
}

const props = withDefaults(defineProps<Props>(), {
  variant: 'primary',
  size: 'md',
  disabled: false
})
</script>

Sensible Defaults

Provide defaults for optional props. Component should work with minimal configuration.

// User only needs to provide required props
<Button onClick={handleClick}>Save</Button>

// But can customize when needed
<Button variant="danger" size="lg" onClick={handleDelete}>Delete</Button>

State Management

Keep State Local

State lives in the component that uses it. Only lift state when multiple components need it.

Decision tree:

Does only this component need the state?
├─ YES → Keep it local with useState/ref
└─ NO → Do multiple children need it?
    ├─ YES → Lift to common parent
    └─ NO → Do unrelated components need it?
        └─ YES → Use global state (context/store)

Example:

// Local state - only this component needs it
function SearchInput() {
  const [query, setQuery] = useState('')
  return <input value={query} onChange={e => setQuery(e.target.value)} />
}

// Lifted state - parent and siblings need it
function SearchPage() {
  const [query, setQuery] = useState('')
  return (
    <>
      <SearchInput value={query} onChange={setQuery} />
      <SearchResults query={query} />
    </>
  )
}

Avoid Prop Drilling

If passing props through 3+ levels, use composition or context instead.

Bad - Prop drilling:

<Page user={user}>
  <Layout user={user}>
    <Sidebar user={user}>
      <UserMenu user={user} />
    </Sidebar>
  </Layout>
</Page>

Good - Context:

<UserContext.Provider value={user}>
  <Page>
    <Layout>
      <Sidebar>
        <UserMenu /> {/* Reads from context */}
      </Sidebar>
    </Layout>
  </Page>
</UserContext.Provider>

Naming Conventions

Components: PascalCase, descriptive noun or noun phrase

  • Button, UserCard, SearchInput, NavigationMenu
  • Avoid: MyComponent, Component1, Wrapper, Container

Props: camelCase, descriptive

  • onClick, isDisabled, userName, maxLength
  • Boolean props: is*, has*, should*, can*

Event handlers: on* for props, handle* for internal functions

function Form({ onSubmit }) {
  const handleSubmit = (e) => {
    e.preventDefault()
    onSubmit(data)
  }
  return <form onSubmit={handleSubmit}>...</form>
}

Encapsulation

Keep implementation details private. Only expose what consumers need.

Bad - Exposing internals:

function DataTable({ data, sortColumn, sortDirection, setSortColumn, setSortDirection }) {
  // Consumer must manage sorting state
}

Good - Encapsulated:

function DataTable({ data, onSort }) {
  const [sortColumn, setSortColumn] = useState('name')
  const [sortDirection, setSortDirection] = useState('asc')
  // Component manages its own sorting state
}

Component Organization

File structure:

components/
├── Button/
│   ├── Button.tsx          # Component implementation
│   ├── Button.test.tsx     # Tests
│   ├── Button.stories.tsx  # Storybook stories (if used)
│   └── index.ts            # Export

Or for simple components:

components/
├── Button.tsx
└── Button.test.tsx

Documentation Requirements

Every reusable component needs:

  1. TypeScript types/interfaces - Self-documenting props
  2. JSDoc comments - For complex props or behavior
  3. Usage example - In comments or Storybook

Example:

/**
 * Primary button component for user actions.
 *
 * @example
 * <Button variant="primary" onClick={handleSave}>
 *   Save Changes
 * </Button>
 */
interface ButtonProps {
  /** Visual style variant */
  variant?: 'primary' | 'secondary' | 'danger'
  /** Size of the button */
  size?: 'sm' | 'md' | 'lg'
  /** Disables interaction */
  disabled?: boolean
  /** Click handler */
  onClick: () => void
  /** Button content */
  children: React.ReactNode
}

When to Split Components

Split when:

  • Component exceeds 200-300 lines
  • Component has multiple responsibilities
  • Part of component is reusable elsewhere
  • Component has complex conditional rendering
  • Testing becomes difficult due to complexity

Example - Before split:

function UserDashboard() {
  // 400 lines of profile display, settings, notifications, activity feed
}

After split:

function UserDashboard() {
  return (
    <DashboardLayout>
      <UserProfile />
      <UserSettings />
      <NotificationPanel />
      <ActivityFeed />
    </DashboardLayout>
  )
}

Testing Components

Every component needs tests for:

  • Rendering with default props
  • Rendering with all prop variations
  • User interactions (clicks, input, etc.)
  • Conditional rendering logic
  • Error states

Example:

describe('Button', () => {
  it('renders with default props', () => {
    render(<Button onClick={jest.fn()}>Click me</Button>)
    expect(screen.getByRole('button')).toBeInTheDocument()
  })

  it('calls onClick when clicked', () => {
    const handleClick = jest.fn()
    render(<Button onClick={handleClick}>Click me</Button>)
    fireEvent.click(screen.getByRole('button'))
    expect(handleClick).toHaveBeenCalledTimes(1)
  })

  it('is disabled when disabled prop is true', () => {
    render(<Button onClick={jest.fn()} disabled>Click me</Button>)
    expect(screen.getByRole('button')).toBeDisabled()
  })
})

Common Mistakes to Avoid

God components: Components that do everything. Split them.

Prop drilling: Passing props through many levels. Use composition or context.

Premature abstraction: Don't create reusable components until you need them in 2+ places.

Too many props: More than 7 props usually means component does too much.

Unclear naming: Container, Wrapper, Component don't describe purpose.

Missing prop types: Always define prop types for type safety and documentation.

Decision Checklist

Before completing component work:

  • Component has single, clear responsibility
  • Props are typed with TypeScript/PropTypes
  • Sensible defaults provided for optional props
  • State is as local as possible
  • Component name clearly describes purpose
  • Internal implementation details are private
  • Component is tested
  • Usage is documented (types + example)
  • No prop drilling beyond 2 levels
  • Component is under 300 lines (or split if larger)

平台分布

Claude Code

27.59%
按下载量换算555

OpenCode

23.16%
按下载量换算466

Cursor

15.75%
按下载量换算317

Codex

11.29%
按下载量换算227

windsurf

7.85%
按下载量换算158

trae

3.43%
按下载量换算69

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills