本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)48k · #4224

composition-patterns

できること

このツールは、ソフトウェアのコンポーネントを、より効率的で分かりやすく整理し、構築する手助けをします。プロジェクトが大きくなっても管理しやすいように、コードをシンプルにする方法を提案します。

使う場面

  • ✓動作を変えるための「はい/いいえ」の設定が多数あるコンポーネントを扱うとき。
  • ✓複数の場所で使うためのコンポーネント群を作るとき。
  • ✓ソフトウェアのさまざまな部分がどのように連携するかを考えるとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/composition-patterns/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/composition-patterns/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“再利用しやすく、理解しやすいように、インターフェースのコンポーネントをどう整理すればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、コンポーネントの作り方を分析し、関連するコンポーネントをまとめたり、重要な情報を中央の一か所に集めたりするパターンを提案します。これにより、各コンポーネントに個別の多数の設定を用意する必要がなくなります。

技術的な内容(元の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 Use

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

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
よくある質問

「boolean prop proliferation(真偽値プロパティの増殖)」とは何ですか?

コンポーネントの動作を変えるための「はい」か「いいえ」の選択肢が多すぎて、使い方が複雑になってしまう状態のことです。

「compound components(複合コンポーネント)」とは何ですか?

チームのように連携して動くコンポーネントのことです。たとえば、複数の入力欄が互いに情報をやり取りする一つのフォームなどが該当します。情報や文脈を共有しながら動作します。

コンポーネントを整理することが大切なのはなぜですか?

整理されたコンポーネントは、理解、利用、修正がしやすくなります。とくに大規模なプロジェクトでは、時間の節約やミスの防止につながります。

詳細

作者による元の説明

Use when working with composition-patterns tasks or workflows

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#4224
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル