vercel-composition-patterns

Pola komposisi React yang dapat diskalakan. Gunakan saat merefaktor komponen dengan

npx skills add https://github.com/supabase/supabase --skill vercel-composition-patterns

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 these patterns if you're on 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

Lebih banyak skill dari supabase

studio-e2e-tests
supabase
Menulis dan menjalankan tes E2E Playwright untuk Supabase Studio. Gunakan saat diminta.
official
vitest
supabase
Kerangka kerja pengujian unit cepat Vitest yang didukung oleh Vite dengan API yang kompatibel dengan Jest. Gunakan saat menulis pengujian, mocking, mengonfigurasi cakupan, atau bekerja dengan pengujian…
official
skill-creator
supabase
Panduan komprehensif untuk membuat skill modular yang memperluas kemampuan Claude dengan pengetahuan dan alur kerja khusus. Skill terdiri dari file SKILL.md yang diperlukan dengan frontmatter YAML dan instruksi markdown, ditambah sumber daya opsional yang dibundel (skrip, referensi, aset) yang diorganisir berdasarkan tujuan dan dimuat secara progresif untuk menghemat konteks. Rancang skill berdasarkan contoh penggunaan konkret; identifikasi skrip yang dapat digunakan kembali untuk tugas deterministik, file referensi untuk pengetahuan domain, dan aset untuk...
official
supabase
supabase
Gunakan saat melakukan tugas apa pun yang melibatkan Supabase. Pemicu: produk Supabase (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); klien…
official
supabase-server
supabase
Gunakan saat menulis kode sisi server dengan Supabase — Edge Functions, aplikasi Hono, penangan webhook, atau backend apa pun yang memerlukan pembuatan klien dan autentikasi Supabase.…
official
clickhouse-logs-queries
supabase
Write, review, and migrate Supabase logs queries against the ClickHouse-backed `logs` table (the `logs.all.otel` analytics endpoint). Use this whenever a task…
official
dev-toolbar-review
supabase
Gunakan saat meninjau PR yang menyentuh packages/dev-tools/, packages/common/posthog-client.ts,
official
e2e-studio-tests
supabase
Jalankan tes e2e di aplikasi Studio. Gunakan saat diminta untuk menjalankan tes e2e, menjalankan tes studio, tes playwright, atau menguji fitur.
official