Langsung ke konten
Skillpedia
Website & UI (frontend)75k · #2695

vercel-composition-patterns

Fungsinya

Skill ini membagikan pola desain komponen React yang membuat kode mudah diubah seiring pertumbuhannya. Cocok untuk pengembang yang menginginkan bagian antarmuka yang dapat dipakai ulang dan jelas.

Kapan dipakai

  • ✓Saat sebuah komponen React memiliki banyak pengaturan on atau off dan sulit dibaca.
  • ✓Saat Anda membangun pustaka komponen bersama untuk beberapa halaman.
  • ✓Saat Anda meninjau bagaimana state dan context komponen diatur dalam sebuah aplikasi.

Link skill

https://github.com/calesthio/OpenMontage/blob/main/.agents/skills/vercel-composition-patterns/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/calesthio/OpenMontage/blob/main/.agents/skills/vercel-composition-patterns/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Refaktor tombol React ini agar tidak lagi memakai daftar panjang pengaturan benar atau salah.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill memberikan aturan untuk memecah komponen menjadi bagian yang bekerja bersama, mengangkat state bersama ke atas, dan memakai fitur React 19 jika sesuai.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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.

Extended reference: AGENTS.md in this directory is the long-form upstream guide (vendored from Vercel). It is supplementary reference material scoped to this skill only — SKILL.md is the loadable entry point and the authority. It does not override or extend the repository-root AGENTS.md / AGENT_GUIDE.md.

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

Pertanyaan umum

Apakah ini hanya untuk React?

Ya. Pola ini untuk komponen React, termasuk perubahan API React 19 yang dibahas skill ini.

Apa itu komponen gabungan?

Itu adalah sekumpulan bagian yang bekerja bersama, seperti menu dengan item dan pemicunya sendiri, bukan satu komponen dengan banyak pengaturan.

Di mana panduan lengkapnya?

Skill mengarahkan ke file referensi yang lebih lengkap di folder yang sama untuk detail lebih lanjut.

Detail

Deskripsi asli dari pembuat

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.

repo: calesthio/OpenMontage

Popularitas

Bintang GitHub
75k
Peringkat
#2695
Lisensi
AGPL-3.0
Diperbarui
28/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa