본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)7.1k · #13511

react-composition-patterns

하는 일

이 스킬은 AI가 확장하기 쉬운 React 인터페이스 컴포넌트를 설계하도록 안내합니다. 복합 컴포넌트와 컨텍스트 같은 패턴을 보여주고, 참/거짓 옵션을 쌓는 것을 피합니다. 재사용 가능한 컴포넌트 라이브러리를 만드는 개발자를 위한 것입니다.

사용하는 경우

  • ✓참/거짓 설정이 많아서 바꾸기 어려운 React 컴포넌트가 있을 때.
  • ✓다른 사람들이 쓸 재사용 가능한 컴포넌트 라이브러리를 만들 때.
  • ✓복합 부품이나 컨텍스트 프로바이더를 쓰도록 컴포넌트를 리팩터링해야 할 때.

스킬 링크

https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/react-composition-patterns/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/react-composition-patterns/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“참/거짓 props가 너무 많은 이 React 버튼 컴포넌트를 더 유연한 설계로 리팩터링해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 쌓인 설정 대신, 컨텍스트를 통해 상태를 공유하는 조합형 부품을 만들고, 해당되는 곳에서는 React 19 패턴을 따릅니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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
1 Component Architecture HIGH architecture-
2 State Management MEDIUM state-
3 Implementation Patterns MEDIUM patterns-
4 React 19 APIs MEDIUM react19-

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

자주 묻는 질문

React 앱 속도를 높이는 용도인가요?

아니요. 성능 최적화는 별도의 스킬이 다룹니다.

React 19와 함께 쓸 수 있나요?

네. 스킬에는 React 19 API 변경 사항이 포함되어 있습니다.

참/거짓 props를 왜 피하나요?

그런 옵션이 많으면 컴포넌트를 이해하고 바꾸기 어려워지므로, 조합 방식이 더 잘 확장됩니다.

상세 정보

작성자의 원본 설명

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. Do NOT use for React/Next.js performance optimization (use react-best-practices instead).

repo: tech-leads-club/agent-skills

인기도

GitHub 스타
7.1k
순위
#13511
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬