跳到正文
cccskills
免费在 GitHub 公开

vercel-composition-patterns

Refactor React components that have accumulated many boolean options. Apply component composition, meaning building interfaces from cooperating parts, and shared state patterns to design reusable component libraries and clearer APIs, with guidance specific to React 19.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

集成工具Vercel
查看安装方法

适用场景

  • Refactoring components with too many boolean props
  • Designing reusable component library APIs
  • Reviewing shared state and provider responsibilities
  • Checking component patterns during React 19 adoption

包含的文件(14)

  • SKILL.md2.8 KB
  • AGENTS.md21.9 KB
  • metadata.json530 B
  • README.md2.1 KB
  • rules/_sections.md821 B
  • rules/_template.md329 B
  • rules/architecture-avoid-boolean-props.md2.2 KB
  • rules/architecture-compound-components.md2.5 KB
  • rules/patterns-children-over-render-props.md1.8 KB
  • rules/patterns-explicit-variants.md2.3 KB
  • rules/react19-no-forwardref.md953 B
  • rules/state-context-interface.md4.9 KB
  • rules/state-decouple-implementation.md2.6 KB
  • rules/state-lift-state.md3.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

PriorityCategoryImpactPrefix
1Component ArchitectureHIGHarchitecture-
2State ManagementMEDIUMstate-
3Implementation PatternsMEDIUMpatterns-
4React 19 APIsMEDIUMreact19-

Quick Reference

1. Component Architecture (HIGH)

  • architecture-avoid-boolean-props - Don't add boolean props to customize behavior; use composition
  • architecture-compound-components - Structure complex components with shared context

2. State Management (MEDIUM)

  • state-decouple-implementation - Provider is the only place that knows how state is managed
  • state-context-interface - Define generic interface with state, actions, meta for dependency injection
  • state-lift-state - Move state into provider components for sibling access

3. Implementation Patterns (MEDIUM)

  • patterns-explicit-variants - Create explicit variant components instead of boolean modes
  • patterns-children-over-render-props - Use children for composition instead of renderX props

4. React 19 APIs (MEDIUM)

⚠️ React 19+ only. Skip this section if using React 18 or earlier.

  • react19-no-forwardref - Don't use forwardRef; use use() instead of useContext()

How to Use

Read individual rule files for detailed explanations and code examples:

rules/architecture-avoid-boolean-props.md
rules/state-context-interface.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Get a simulated peer review of a paper, abstract, or selected sections. Receive assessments of originality, methods, results, and writing, with specific revision suggestions, severity ratings, and a prioritized checklist for improving the manuscript.

中文简介正在准备中。当前显示英语简介。

  • Run a simulated peer review before submitting a paper
  • Check whether methods and conclusions are adequately supported
  • Review an abstract for novelty and clarity
zebbern/claude-code-guide46722026年10月20日 更新

Guide Windows domain penetration testing through Active Directory reconnaissance, credential attacks, privilege escalation, and certificate service checks. Use references for tools such as BloodHound and Impacket to examine attack paths and understand testing prerequisites.

中文简介正在准备中。当前显示英语简介。

  • Planning Active Directory penetration tests
  • Investigating attack paths with BloodHound
  • Reviewing Kerberos and NTLM authentication risks
zebbern/claude-code-guide46722026年10月20日 更新

Test REST, SOAP, and GraphQL APIs for authentication flaws, improper access to other users’ records, and unsafe input handling. Guides endpoint discovery and request variations to identify vulnerabilities and document evidence of unauthorized access.

中文简介正在准备中。当前显示英语简介。

  • Discovering API endpoints for security testing
  • Checking access to other users’ records
  • Assessing GraphQL schemas and query handling
zebbern/claude-code-guide46722026年10月20日 更新

Explores alternative APIs, the interfaces other code uses to call a module. Parallel sub-agents develop distinctly different designs, then present signatures, usage examples, and trade-offs to help choose or combine an approach before implementation.

中文简介正在准备中。当前显示英语简介。

  • Comparing API designs before implementation
  • Weighing simplicity against flexibility
  • Reviewing interfaces from the caller's perspective
zebbern/claude-code-guide46722026年10月20日 更新

Trace system behavior across code, APIs, authentication, data, and networks through an interactive workflow. Store steps, branches, and findings in SQLite, then export diagrams and documentation for security audits, debugging, architecture reviews, or incident analysis.

中文简介正在准备中。当前显示英语简介。

  • Documenting authentication flows for security audits
  • Tracing branches while debugging system behavior
  • Reviewing how system components interact
zebbern/claude-code-guide46722026年10月20日 更新

Compare login approaches and authentication providers, then use implementation examples and security checklists to plan or review an app’s login flow. Covers sessions, tokens, external login providers, passkeys, and common implementation mistakes.

中文简介正在准备中。当前显示英语简介。

  • Choose a login approach for a new app
  • Compare NextAuth / Auth.js, Clerk, and Supabase Auth
  • Review token storage and refresh behavior
zebbern/claude-code-guide46722026年10月20日 更新

查看 zebbern 的全部技能

报告此技能的问题