← 返回 Skills 市场
eaveluo

Building Components

作者 Eave Luo · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
336
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install building-components
功能描述
React component building and composition best practices. Use when creating, reviewing, or refactoring React components. Covers component structure, props pat...
使用说明 (SKILL.md)

Building React Components

Best practices for building reusable, maintainable React components.

When to Apply

Reference these guidelines when:

  • Creating new React components
  • Reviewing component structure and API design
  • Refactoring components for better reusability
  • Implementing component composition patterns
  • Designing props interfaces

Core Principles

1. Single Responsibility

Each component should do one thing well. Split large components into smaller, focused pieces.

2. Composition Over Inheritance

Prefer composing components together rather than complex inheritance hierarchies.

// ✅ Good: Composition
function Page() {
  return (
    \x3CLayout>
      \x3CHeader />
      \x3CMain>
        \x3CArticle />
      \x3C/Main>
      \x3CFooter />
    \x3C/Layout>
  );
}

// ❌ Avoid: Deep nesting
function Page() {
  return \x3CLayoutWithHeaderAndFooter>\x3CMainContent />\x3C/LayoutWithHeaderAndFooter>;
}

3. Props Design

  • Use TypeScript for props typing
  • Keep props interfaces simple and focused
  • Prefer many small props over few large objects
  • Use children prop for content composition

4. Component Structure

// ✅ Recommended structure
import { FC } from 'react';

interface Props {
  title: string;
  children?: React.ReactNode;
}

export const Card: FC\x3CProps> = ({ title, children }) => {
  return (
    \x3Cdiv className="card">
      \x3Ch2>{title}\x3C/h2>
      {children}
    \x3C/div>
  );
};

5. State Management

  • Keep state as close to where it's used as possible
  • Lift state up only when necessary
  • Consider custom hooks for reusable state logic

Common Patterns

Compound Components

For flexible APIs like Select/Option, Tabs/TabList/Tab/TabPanel.

Render Props

For sharing behavior while keeping rendering control.

Hooks

For sharing stateful logic across components.

Related Skills

  • vercel-react-best-practices
  • next-best-practices
  • vercel-composition-patterns
安全使用建议
This skill is an offline best-practices document and poses minimal technical risk: it won't install software or request credentials. The only non-technical concern is that the source is listed as "unknown" while the metadata author is 'vercel' — if provenance matters to you, verify the author or use an official Vercel/React style guide instead. Otherwise it's safe to use as a reference for component design and reviews.
功能分析
Type: OpenClaw Skill Name: building-components Version: 1.0.0 The skill bundle contains standard documentation and best practices for React component development, covering topics like composition, props design, and state management. There is no executable code, suspicious network activity, or prompt-injection attempts in SKILL.md or _meta.json.
能力评估
Purpose & Capability
The name/description (React component best practices) match the actual content: a prose guideline (SKILL.md) about component structure, props, composition, and state. Nothing requested or declared (no env vars, no binaries) is out of place.
Instruction Scope
The SKILL.md contains only guidance and example code snippets. It does not instruct the agent to run shell commands, access files, read environment variables, or transmit data to external endpoints.
Install Mechanism
There is no install spec and no code files. As an instruction-only skill, it writes nothing to disk and does not fetch external code.
Credentials
The skill declares no environment variables, credentials, or config paths — appropriate for a static best-practices guide.
Persistence & Privilege
always is false and the skill does not request persistent presence or modify agent/system settings. Default autonomous invocation is allowed but the skill's instructions do not perform privileged actions.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install building-components
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /building-components 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of building-components skill, providing React component best practices: - Covers guidelines for structure, props patterns, and composition techniques. - Emphasizes single responsibility, composition over inheritance, and clean props design. - Includes recommended component structure with TypeScript. - Outlines state management and common patterns (compound components, render props, hooks).
元数据
Slug building-components
版本 1.0.0
许可证
累计安装 2
当前安装数 2
历史版本数 1
常见问题

Building Components 是什么?

React component building and composition best practices. Use when creating, reviewing, or refactoring React components. Covers component structure, props pat... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 336 次。

如何安装 Building Components?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install building-components」即可一键安装,无需额外配置。

Building Components 是免费的吗?

是的,Building Components 完全免费(开源免费),可自由下载、安装和使用。

Building Components 支持哪些平台?

Building Components 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Building Components?

由 Eave Luo(@eaveluo)开发并维护,当前版本 v1.0.0。

💬 留言讨论