Agent skill

Postgresql Optimization

by davila7 in davila7/claude-code-templates

PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management.

MITAuto-check passedDatabases

Install Postgresql Optimization

skills CLI
$ npx skills add davila7/claude-code-templates --skill postgresql-optimization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davila7/claude-code-templates postgresql-optimization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/database/postgresql-optimization .claude/skills/postgresql-optimization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
postgresql-optimization
GitHub stars
32k
Used in
4 other repos
Token cost
~951 tokens
SKILL.md length
324 words
Files
1
Skills in repo
477
Repo updated
First seen
Licence
MIT

At a glance

PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management.

  • Works in 7 steps: Performance Assessment → Query Analysis → Indexing Strategy → …
  • Tasks that involve Query optimization
  • SKILL.md covers Overview, When to Use This Workflow, Workflow Phases and Optimization Checklist, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Postgresql Optimization is an agent skill from davila7/claude-code-templates. PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management.

Its SKILL.md is about 950 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering Query optimization. It works with PostgreSQL. The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.

When your agent uses it

  • Tasks that involve Query optimization

Example prompts

  • “/postgresql-optimization”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Performance Assessment
  2. Query Analysis
  3. Indexing Strategy
  4. Query Optimization
  5. Configuration Tuning
  6. Maintenance
  7. Monitoring

What it can do on your machine

Read from SKILL.md and the folder at commit 4c82aba. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Postgresql Optimization loads about 951 tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 324 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~41
When it runs · the whole SKILL.md, loaded when a task matches
~951

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davila7/claude-code-templates at commit 4c82aba, republished under its MIT licence (© davila7). 324 words, ~951 tokens.

Download SKILL.mdSave it as .claude/skills/postgresql-optimization/SKILL.md (or your agent's skills folder).
name
postgresql-optimization
description
PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management.
category
granular-workflow-bundle
risk
safe
source
personal
date_added
2026-02-27

PostgreSQL Optimization Workflow

Overview

Specialized workflow for PostgreSQL database optimization including query tuning, indexing strategies, performance analysis, vacuum management, and production database administration.

When to Use This Workflow

Use this workflow when:

  • Optimizing slow PostgreSQL queries
  • Designing indexing strategies
  • Analyzing database performance
  • Tuning PostgreSQL configuration
  • Managing production databases

Workflow Phases

Phase 1: Performance Assessment
Skills to Invoke
  • database-optimizer - Database optimization
  • postgres-best-practices - PostgreSQL best practices
Actions
  1. Check database version
  2. Review configuration
  3. Analyze slow queries
  4. Check resource usage
  5. Identify bottlenecks
Copy-Paste Prompts
Use @database-optimizer to assess PostgreSQL performance
Phase 2: Query Analysis
Skills to Invoke
  • sql-optimization-patterns - SQL optimization
  • postgres-best-practices - PostgreSQL patterns
Actions
  1. Run EXPLAIN ANALYZE
  2. Identify scan types
  3. Check join strategies
  4. Analyze execution time
  5. Find optimization opportunities
Copy-Paste Prompts
Use @sql-optimization-patterns to analyze and optimize queries
Phase 3: Indexing Strategy
Skills to Invoke
  • database-design - Index design
  • postgresql - PostgreSQL indexing
Actions
  1. Identify missing indexes
  2. Create B-tree indexes
  3. Add composite indexes
  4. Consider partial indexes
  5. Review index usage
Copy-Paste Prompts
Use @database-design to design PostgreSQL indexing strategy
Phase 4: Query Optimization
Skills to Invoke
  • sql-optimization-patterns - Query tuning
  • sql-pro - SQL expertise
Actions
  1. Rewrite inefficient queries
  2. Optimize joins
  3. Add CTEs where helpful
  4. Implement pagination
  5. Test improvements
Copy-Paste Prompts
Use @sql-optimization-patterns to optimize SQL queries
Phase 5: Configuration Tuning
Skills to Invoke
  • postgres-best-practices - Configuration
  • database-admin - Database administration
Actions
  1. Tune shared_buffers
  2. Configure work_mem
  3. Set effective_cache_size
  4. Adjust checkpoint settings
  5. Configure autovacuum
Copy-Paste Prompts
Use @postgres-best-practices to tune PostgreSQL configuration
Phase 6: Maintenance
Skills to Invoke
  • database-admin - Database maintenance
  • postgresql - PostgreSQL maintenance
Actions
  1. Schedule VACUUM
  2. Run ANALYZE
  3. Check table bloat
  4. Monitor autovacuum
  5. Review statistics
Copy-Paste Prompts
Use @database-admin to schedule PostgreSQL maintenance
Phase 7: Monitoring
Skills to Invoke
  • grafana-dashboards - Monitoring dashboards
  • prometheus-configuration - Metrics collection
Actions
  1. Set up monitoring
  2. Create dashboards
  3. Configure alerts
  4. Track key metrics
  5. Review trends
Copy-Paste Prompts
Use @grafana-dashboards to create PostgreSQL monitoring

Optimization Checklist

  • Slow queries identified
  • Indexes optimized
  • Configuration tuned
  • Maintenance scheduled
  • Monitoring active
  • Performance improved

Quality Gates

  • Query performance improved
  • Indexes effective
  • Configuration optimized
  • Maintenance automated
  • Monitoring in place
  • database - Database operations
  • cloud-devops - Infrastructure
  • performance-optimization - Performance

© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in cli-tool/components/skills/database/postgresql-optimization of davila7/claude-code-templates.

Open the folder on GitHubat commit 4c82aba

Used in 4 other repositories

We found 13 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 4 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Postgresql Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Postgresql Optimization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Postgresql Optimization this skilldavila7/claude-code-templates32k4 repos~951Automated safety check: PassMIT
Postgres PatternsThibautBaissac/rails_ai_agents6657 repos~922Automated safety check: PassMIT
Postgres Expertcin12211/orca-q223—~5.5kAutomated safety check: PassMIT
Postgres ExpertRightNow-AI/openfang18k—~830Automated safety check: PassApache-2.0
Postgresql Optimizationgithub/awesome-copilot40k2 repos~2.8kAutomated safety check: PassMIT
Postgres Optimizationrohitg00/awesome-claude-code-toolkit2.7k—~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • Postgres Patterns

    ThibautBaissac/rails_ai_agents

    PostgreSQL database patterns for query optimization, schema design, indexing, and security.

    665 GitHub starsUsed in 7 repos~922 tokens
    DatabasesAuto-check passed
  • Postgres Expert

    cin12211/orca-q

    PostgreSQL query optimization, JSONB operations, advanced indexing strategies, partitioning, connection management, and database administration.

    223 GitHub stars~5.5k tokensUpdated 15 days ago
    DatabasesAuto-check passed
  • Postgres Expert

    RightNow-AI/openfang

    PostgreSQL expert for query optimization, indexing, extensions, and database administration

    18k GitHub stars~830 tokensUpdated 3 mo ago
    DatabasesAuto-check passed
  • Postgresql Optimization

    github/awesome-copilot

    Official

    PostgreSQL-specific development assistant focusing on unique PostgreSQL features, advanced data types, and PostgreSQL-exclusive capabilities.

    40k GitHub starsUsed in 2 repos~2.8k tokens
    DatabasesAuto-check passed
  • Postgres Optimization

    rohitg00/awesome-claude-code-toolkit

    PostgreSQL optimization including indexes, query plans, partitioning, JSONB operations, and connection pooling

    2.7k GitHub stars~1.1k tokensUpdated 4 mo ago
    DatabasesAuto-check passed
  • Performance

    kid-sid/claude-spellbook

    A skill your agent uses when diagnosing a slow HTTP endpoint or high-latency service — profiling, adding an application-level cache, offloading CPU-bound work to threads or workers, or defining a…

    189 GitHub stars~3.8k tokensUpdated 2 mo ago
    DatabasesAuto-check passed

More from davila7/claude-code-templates

All 477 skills in this repo
  • Perplexity Web Search

    davila7/claude-code-templates

    Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.

    32k GitHub starsUsed in 12 repos~3.5k tokens
    Auto-check: notes
  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    32k GitHub starsUsed in 10 repos~2.8k tokens
    Auto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    32k GitHub starsUsed in 9 repos~5.1k tokens
    Auto-check: notes
  • Brand Voice Content Creator

    davila7/claude-code-templates

    Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.

    32k GitHub starsUsed in 2 repos~1.9k tokens
    Auto-check passed
  • CAPA Officer

    davila7/claude-code-templates

    Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.

    32k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Fda Consultant Specialist

    davila7/claude-code-templates

    Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.

    32k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed

Works with

Categories

Questions about Postgresql Optimization

What does Postgresql Optimization do?

PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management. Postgresql Optimization is an agent skill from davila7/claude-code-templates. PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management.

When should I use Postgresql Optimization?

Postgresql Optimization fits situations like: tasks that involve Query optimization.

How do I install Postgresql Optimization in Claude Code?

Run `npx skills add davila7/claude-code-templates --skill postgresql-optimization -a claude-code`. Or copy the skill folder (cli-tool/components/skills/database/postgresql-optimization in davila7/claude-code-templates) into .claude/skills/postgresql-optimization in your project. Claude Code loads it when a task matches its description.

How do I install Postgresql Optimization in Codex?

Run `npx skills add davila7/claude-code-templates --skill postgresql-optimization -a codex`. Or copy the skill folder (cli-tool/components/skills/database/postgresql-optimization in davila7/claude-code-templates) into .agents/skills/postgresql-optimization in your project. Codex loads it when a task matches its description.

Can I use Postgresql Optimization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill postgresql-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/postgresql-optimization, .gemini/skills/postgresql-optimization, .github/skills/postgresql-optimization and .opencode/skills/postgresql-optimization in your project.

What does Postgresql Optimization need to run?

SKILL.md names no scripts, command-line tools or credentials: Postgresql Optimization is instructions for the agent only.

Does Postgresql Optimization access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Postgresql Optimization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Postgresql Optimization use?

Postgresql Optimization is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Postgresql Optimization use?

About 951 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Postgresql Optimization?

Skills that share tags, products or a category with Postgresql Optimization: Postgres Patterns (ThibautBaissac/rails_ai_agents, 665 stars), Postgres Expert (cin12211/orca-q, 223 stars), Postgres Expert (RightNow-AI/openfang, 18k stars) and Postgresql Optimization (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Postgresql Optimization?

davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,432 GitHub stars. The repository holds 477 skills in this directory. The repository was last updated on October 7, 2026.

Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.