vercel-composition-patterns

โดย supabase

รูปแบบการจัดองค์ประกอบ React ที่ปรับขนาดได้ ใช้เมื่อปรับโครงสร้างคอมโพเนนต์ด้วย

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

Skills เพิ่มเติมจาก supabase

studio-e2e-tests
supabase
เขียนและรันการทดสอบ E2E ด้วย Playwright สำหรับ Supabase Studio ใช้เมื่อถูกถาม
official
vitest
supabase
เฟรมเวิร์กการทดสอบหน่วยความเร็วสูง Vitest ที่ขับเคลื่อนโดย Vite พร้อม API ที่เข้ากันได้กับ Jest ใช้เมื่อเขียนทดสอบ, สร้างม็อก, กำหนดค่าความครอบคลุม, หรือทำงานกับทดสอบ…
official
skill-creator
supabase
คู่มือที่ครอบคลุมสำหรับการสร้างสกิลแบบโมดูลาร์ที่ขยายความสามารถของ Claude ด้วยความรู้เฉพาะทางและเวิร์กโฟลว์ สกิลประกอบด้วยไฟล์ SKILL.md ที่จำเป็นพร้อม YAML frontmatter และคำแนะนำในรูปแบบ markdown รวมถึงทรัพยากรเสริมเพิ่มเติม (สคริปต์ เอกสารอ้างอิง สื่อต่างๆ) ที่จัดระเบียบตามวัตถุประสงค์และโหลดแบบค่อยเป็นค่อยไปเพื่อประหยัดบริบท ออกแบบสกิลโดยยึดตามตัวอย่างการใช้งานที่เป็นรูปธรรม ระบุสคริปต์ที่ใช้ซ้ำได้สำหรับงานที่กำหนดตายตัว ไฟล์อ้างอิงสำหรับความรู้เฉพาะโดเมน และสื่อต่างๆ สำหรับ...
official
supabase
supabase
ใช้เมื่อทำงานใดๆ ที่เกี่ยวข้องกับ Supabase ทริกเกอร์: ผลิตภัณฑ์ของ Supabase (ฐานข้อมูล, การยืนยันตัวตน, ฟังก์ชัน Edge, Realtime, พื้นที่จัดเก็บ, เวกเตอร์, Cron, คิว); ไคลเอนต์…
official
supabase-server
supabase
ใช้เมื่อเขียนโค้ดฝั่งเซิร์ฟเวอร์กับ Supabase — Edge Functions, แอป Hono, ตัวจัดการเว็บฮุค หรือแบ็กเอนด์ใดๆ ที่ต้องการการสร้างไคลเอนต์และการตรวจสอบสิทธิ์ของ 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
ใช้เมื่อตรวจสอบ PR ที่เกี่ยวข้องกับ packages/dev-tools/, packages/common/posthog-client.ts,
official
e2e-studio-tests
supabase
รันการทดสอบ e2e ในแอป Studio ใช้เมื่อถูกขอให้รันการทดสอบ e2e รันการทดสอบ studio การทดสอบ playwright หรือทดสอบฟีเจอร์
official