vercel-composition-patterns

仓库创建 2025年6月22日最近提交 1 天前SkillHot 收录 21 天前
▸ 精选理由

适合重构组件库、减少布尔 props 污染并提升可组合性。

这个 Skill 做什么

提供可扩展的 React 组件组合模式与实践指南。

把零散、难维护的 React 组件重构成可组合、好扩展的结构,能有效解决布尔 prop 爆炸的问题。适合在改造组件库、设计可复用 API 或用 compound components、render props、context 时参考。还包含对 React 19 新 API 的说明,方便升级兼容。

▸ 展开 SKILL.md 英文原文

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

开发编程React组合模式组件架构通用
4.4k
Stars
448
Forks
40
仓库内 Skill
+70
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/zebbern/claude-code-guide/main/skills/composition-patterns/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/zebbern/claude-code-guide/main/skills/composition-patterns/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# React Composition Patterns

Composition patterns for building flexible, maintainable React components. Avoid
boolean prop proliferation by using compound components, lifting state, and
composing internals. These patterns make codebases easier for both humans and AI
agents to work with as they scale.

## When to Apply

Reference these guidelines when:

- Refactoring components with many boolean props
- Building reusable component libraries
- Designing flexible component APIs
- Reviewing component architecture
- Working with compound components or context providers

## Rule Categories by Priority

| Priority | Category                | Impact | Prefix          |
| -------- | ----------------
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有