Skip to content

PostgreSQL Patterns Reference

Gives the agent PostgreSQL best practices for indexing, schema design, queries, and RLS

Repository
affaan-m/ECC
Stars
295,127
Licence
MIT
Files
1 file

What it does

When installed, the agent gets a quick-reference guide to PostgreSQL good practices, written in Spanish and based on Supabase guidance. When you ask it to write SQL, design a table, or diagnose a slow query, it can apply recommended choices such as which index type to use, safer data types (bigint IDs, timestamptz, numeric for money), cursor-based pagination instead of OFFSET, and wrapping auth.uid() in row level security policies. The file also includes ready-made SQL snippets for finding unindexed foreign keys, slow queries, and table bloat.

Great for

  • Developers writing or reviewing PostgreSQL schemas, migrations, or queries
  • Teams using Supabase who want a consistent set of database conventions
  • Anyone diagnosing slow queries who wants a checklist of common causes

Skip it if

  • Production databases changed without review: the snippets include ALTER SYSTEM and REVOKE statements that change server-wide settings and permissions, so they can affect other applications if run blindly
  • Non-PostgreSQL databases such as MySQL or SQL Server, where syntax and features differ
  • Deep performance tuning on complex workloads, since the file itself points to a separate reviewer agent for detailed guidance

Try asking

  • “Review this CREATE TABLE migration and suggest better data types and indexes”
  • “Why is this query slow? Check it against PostgreSQL indexing patterns”
  • “Write a cursor-based pagination query for my products table”
  • “Set up row level security so users only see their own orders”
Step-by-step guide: how to use PostgreSQL Patterns ReferenceInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    postgres-patterns.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip postgres-patterns.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip postgres-patterns.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Test suggested indexes and configuration changes on a staging copy before applying them to production, and check with EXPLAIN ANALYZE.
  • Give the agent your actual schema and query so it can apply the patterns to your case rather than generic examples.
  • The file refers to a database-reviewer agent and related skills; these are not included here, so expect only the quick reference unless you install them.

What's inside

  • SKILL.md

Redistributed unmodified from affaan-m/ECC under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.