postgres-best-practices · davila7 — Claude Code skill: SQL and setup
This skill guides Claude Code through Postgres queries, schemas, and configuration. Use it when tuning indexes, reviewing RLS, or investigating database performance.
npx claude-code-templates@latest --skill development/postgres-best-practicesWhat postgres-best-practices does
postgres-best-practices gives Claude Code a structured set of Supabase guidance for Postgres work. It covers query tuning, connection handling, access control with RLS, schema choices, locking, data access, diagnostics, and advanced features. The categories are ranked so critical query and connection concerns come before lower-priority topics.
The package is organized as individual rule files. They explain the issue, contrast flawed and corrected SQL, and may include EXPLAIN output or Supabase-specific notes. The compiled reference is AGENTS.md; focused material includes rules/query-missing-indexes.md and rules/schema-partial-indexes.md. For a Postgres review, this makes the skill useful beyond query text: it also checks the surrounding schema and database setup.
What it helps with
- spot missing indexes in a Postgres query
- review a schema against access-control rules
- investigate locks between concurrent operations
- adjust connection pooling and scaling choices
- check database settings with diagnostic rules
Example prompts for the agent
- Review this Postgres query and suggest indexes using
postgres-best-practices. - Inspect the schema with RLS and connection management in mind.
- Compare this change with
rules/query-missing-indexes.mdandAGENTS.md.
How to install postgres-best-practices
1claude-code-templates
npx claude-code-templates@latest --skill development/postgres-best-practices2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill postgres-best-practices -a claude-code3Manually: put the files in place
~/.claude/skills/postgres-best-practices/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/postgres-best-practices/
Manually: put the files in place
.agents/skills/postgres-best-practices/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/postgres-best-practices/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates postgres-best-practices2Manually: put the files in place
.github/skills/postgres-best-practices/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/postgres-best-practicesManually: put the files in place
.devin/skills/postgres-best-practices/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about postgres-best-practices
How do I install postgres-best-practices in Claude Code?
Run npx claude-code-templates@latest --skill development/postgres-best-practices.
What does postgres-best-practices do?
It supplies Claude Code with Supabase guidance for Postgres queries, schemas, and configuration. The skill includes focused rules with SQL examples and review notes.
Does the skill cover Row-Level Security?
Yes. RLS appears in the security category, which has critical priority in the rule set.
Similar skills
All skills for Data and databases →postgres-best-practices by other authors comes first.