supabase/agent-skills
Agent Skills to help developers using AI agents with Supabase
https://skillcdn.ai/gh/supabase/agent-skills내 AI에 이 주소를 연결하면 이 스킬들을 쓸 수 있어요. 연결 방법 보기
- 기본 브랜치
main - 커밋
c9be0e9 - 라이선스
MIT - 검색단어와 의미
저장소 둘러보기
스킬과 문서의 원문에서 단어와 의미로 찾습니다. 화면용 번역은 검색되지 않아요.
문서
- Writing Guidelines for Postgres ReferencesThis document provides guidelines for creating effective Postgres best practice references that work well with AI agents and LLMs.skills/supabase-postgres-best-practices/references/_contributing.md
- Section DefinitionsThis file defines the rule categories for Postgres best practices. Rules are automatically assigned to sections based on their filename prefix.skills/supabase-postgres-best-practices/references/_sections.md
- Clear, Action-Oriented Title (e.g., "Use Partial Indexes for Filtered Queries")[1-2 sentence explanation of the problem and why it matters. Focus on performance impact.]skills/supabase-postgres-best-practices/references/_template.md
- Use tsvector for Full-Text SearchLIKE with wildcards can't use indexes. Full-text search with tsvector is orders of magnitude faster.skills/supabase-postgres-best-practices/references/advanced-full-text-search.md
- Index JSONB Columns for Efficient QueryingJSONB queries without indexes scan the entire table. Use GIN indexes for containment queries.skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md
- Configure Idle Connection TimeoutsIdle connections waste resources. Configure timeouts to automatically reclaim them.skills/supabase-postgres-best-practices/references/conn-idle-timeout.md
- Set Appropriate Connection LimitsToo many connections exhaust memory and degrade performance. Set limits based on available resources.skills/supabase-postgres-best-practices/references/conn-limits.md
- Use Connection Pooling for All ApplicationsPostgres connections are expensive (1-3MB RAM each). Without pooling, applications exhaust connections under load.skills/supabase-postgres-best-practices/references/conn-pooling.md
- Use Prepared Statements Correctly with PoolingPrepared statements are tied to individual database connections. In transaction-mode pooling, connections are shared, causing conflicts.skills/supabase-postgres-best-practices/references/conn-prepared-statements.md
- Batch INSERT Statements for Bulk DataIndividual INSERT statements have high overhead. Batch multiple rows in single statements or use COPY.skills/supabase-postgres-best-practices/references/data-batch-inserts.md
- Eliminate N+1 Queries with Batch LoadingN+1 queries execute one query per item in a loop. Batch them into a single query using arrays or JOINs.skills/supabase-postgres-best-practices/references/data-n-plus-one.md
- Use Cursor-Based Pagination Instead of OFFSETOFFSET-based pagination scans all skipped rows, getting slower on deeper pages. Cursor pagination is O(1).skills/supabase-postgres-best-practices/references/data-pagination.md
- Use UPSERT for Insert-or-Update OperationsUsing separate SELECT-then-INSERT/UPDATE creates race conditions. Use INSERT ... ON CONFLICT for atomic upserts.skills/supabase-postgres-best-practices/references/data-upsert.md
- Use Advisory Locks for Application-Level LockingAdvisory locks provide application-level coordination without requiring database rows to lock.skills/supabase-postgres-best-practices/references/lock-advisory.md
- Prevent Deadlocks with Consistent Lock OrderingDeadlocks occur when transactions lock resources in different orders. Always acquire locks in a consistent order.skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md
- Keep Transactions Short to Reduce Lock ContentionLong-running transactions hold locks that block other queries. Keep transactions as short as possible.skills/supabase-postgres-best-practices/references/lock-short-transactions.md
- Use SKIP LOCKED for Non-Blocking Queue ProcessingWhen multiple workers process a queue, SKIP LOCKED allows workers to process different rows without waiting.skills/supabase-postgres-best-practices/references/lock-skip-locked.md
- Use EXPLAIN ANALYZE to Diagnose Slow QueriesEXPLAIN ANALYZE executes the query and shows actual timings, revealing the true performance bottlenecks.skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md
- Enable pg_stat_statements for Query Analysispg_stat_statements tracks execution statistics for all queries, helping identify slow and frequent queries.skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md
- Maintain Table Statistics with VACUUM and ANALYZEOutdated statistics cause the query planner to make poor decisions. VACUUM reclaims space, ANALYZE updates statistics.skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md
- Create Composite Indexes for Multi-Column QueriesWhen queries filter on multiple columns, a composite index is more efficient than separate single-column indexes.skills/supabase-postgres-best-practices/references/query-composite-indexes.md
- Use Covering Indexes to Avoid Table LookupsCovering indexes include all columns needed by a query, enabling index-only scans that skip the table entirely.skills/supabase-postgres-best-practices/references/query-covering-indexes.md
- Choose the Right Index Type for Your DataDifferent index types excel at different query patterns. The default B-tree isn't always optimal.skills/supabase-postgres-best-practices/references/query-index-types.md
- Add Indexes on WHERE and JOIN ColumnsQueries filtering or joining on unindexed columns cause full table scans, which become exponentially slower as tables grow.skills/supabase-postgres-best-practices/references/query-missing-indexes.md
- Use Partial Indexes for Filtered QueriesPartial indexes only include rows matching a WHERE condition, making them smaller and faster when queries consistently filter on the same condition.skills/supabase-postgres-best-practices/references/query-partial-indexes.md
- Add Constraints Safely in MigrationsPostgreSQL does not support ADD CONSTRAINT IF NOT EXISTS. Migrations using this syntax will fail.skills/supabase-postgres-best-practices/references/schema-constraints.md
- Choose Appropriate Data TypesUsing the right data types reduces storage, improves query performance, and prevents bugs.skills/supabase-postgres-best-practices/references/schema-data-types.md
- Index Foreign Key ColumnsPostgres does not automatically index foreign key columns. Missing indexes cause slow JOINs and CASCADE operations.skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md
- Use Lowercase Identifiers for CompatibilityPostgreSQL folds unquoted identifiers to lowercase. Quoted mixed-case identifiers require quotes forever and cause issues with tools, ORMs, and AI assistants that may not recognize them.skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md
- Partition Large Tables for Better PerformancePartitioning splits a large table into smaller pieces, improving query performance and maintenance operations.skills/supabase-postgres-best-practices/references/schema-partitioning.md
- Select Optimal Primary Key StrategyPrimary key choice affects insert performance, index size, and replication efficiency.skills/supabase-postgres-best-practices/references/schema-primary-keys.md
- Apply Principle of Least PrivilegeGrant only the minimum permissions required. Never use superuser for application queries.skills/supabase-postgres-best-practices/references/security-privileges.md
- Enable Row Level Security for Multi-Tenant DataRow Level Security (RLS) enforces data access at the database level, ensuring users only see their own data.skills/supabase-postgres-best-practices/references/security-rls-basics.md
- Optimize RLS Policies for PerformancePoorly written RLS policies can cause severe performance issues. Use subqueries and indexes strategically.skills/supabase-postgres-best-practices/references/security-rls-performance.md