Auto-triggered Skill for querying PostgreSQL official documentation

version
1.0.0

Install

/plugin install postgresql-guide@psychquant-claude-plugins

Run it inside Claude Code after adding the marketplace with /plugin marketplace add PsychQuant/psychquant-claude-plugins.

Contents

Discovered from source

Skills 1

PostgreSQL Guide

This Skill queries official PostgreSQL documentation for accurate information.

When to Use

When the user asks about or the conversation involves:

  • PostgreSQL SQL syntax or commands
  • Data types, functions, operators
  • Database configuration (postgresql.conf, pg_hba.conf)
  • Performance tuning, query optimization
  • Backup, restore, high availability
  • Extensions, procedural languages

Execution Steps (IMPORTANT!)

You MUST WebFetch official documentation - never answer from memory!

Step 1: Identify Question Category

CategoryDescription
SQL CommandsCREATE, SELECT, INSERT, UPDATE, DELETE, ALTER, etc.
Data TypesINTEGER, VARCHAR, JSON, ARRAY, etc.
FunctionsString, Math, Date/Time, Aggregate, Window functions
Configurationpostgresql.conf, pg_hba.conf settings
AdministrationBackup, Restore, Replication, Monitoring
ProgrammingPL/pgSQL, Triggers, Rules

Step 2: WebFetch the Corresponding Documentation

Base URL: https://www.postgresql.org/docs/current/

Question TypeDocumentation URL
SQL Command Referencehttps://www.postgresql.org/docs/current/sql-commands.html
Specific SQL Commandhttps://www.postgresql.org/docs/current/sql-{command}.html (e.g., sql-select.html)
Data Typeshttps://www.postgresql.org/docs/current/datatype.html
Functions & Operatorshttps://www.postgresql.org/docs/current/functions.html
String Functionshttps://www.postgresql.org/docs/current/functions-string.html
Date/Time Functionshttps://www.postgresql.org/docs/current/functions-datetime.html
Aggregate Functionshttps://www.postgresql.org/docs/current/functions-aggregate.html
Window Functionshttps://www.postgresql.org/docs/current/functions-window.html
JSON Functionshttps://www.postgresql.org/docs/current/functions-json.html
Array Functionshttps://www.postgresql.org/docs/current/functions-array.html
Indexeshttps://www.postgresql.org/docs/current/indexes.html
Full Text Searchhttps://www.postgresql.org/docs/current/textsearch.html
Configurationhttps://www.postgresql.org/docs/current/runtime-config.html
Authenticationhttps://www.postgresql.org/docs/current/auth-pg-hba-conf.html
Backup & Restorehttps://www.postgresql.org/docs/current/backup.html
Replicationhttps://www.postgresql.org/docs/current/high-availability.html
PL/pgSQLhttps://www.postgresql.org/docs/current/plpgsql.html
Triggershttps://www.postgresql.org/docs/current/triggers.html
Performancehttps://www.postgresql.org/docs/current/performance-tips.html
EXPLAINhttps://www.postgresql.org/docs/current/using-explain.html
Error Codeshttps://www.postgresql.org/docs/current/errcodes-appendix.html

Step 3: For Specific SQL Commands

SQL command documentation follows the pattern:

https://www.postgresql.org/docs/current/sql-{command}.html

Examples:

CommandURL
SELECThttps://www.postgresql.org/docs/current/sql-select.html
CREATE TABLEhttps://www.postgresql.org/docs/current/sql-createtable.html
CREATE INDEXhttps://www.postgresql.org/docs/current/sql-createindex.html
ALTER TABLEhttps://www.postgresql.org/docs/current/sql-altertable.html
INSERThttps://www.postgresql.org/docs/current/sql-insert.html
UPDATEhttps://www.postgresql.org/docs/current/sql-update.html
DELETEhttps://www.postgresql.org/docs/current/sql-delete.html
GRANThttps://www.postgresql.org/docs/current/sql-grant.html
COPYhttps://www.postgresql.org/docs/current/sql-copy.html
VACUUMhttps://www.postgresql.org/docs/current/sql-vacuum.html
EXPLAINhttps://www.postgresql.org/docs/current/sql-explain.html

Step 4: Parse and Respond

Extract relevant information from WebFetch results and answer the user directly.

Common Questions Quick Reference

QuestionFetch URL
"How to create index?"sql-createindex.html
"JSON operators?"functions-json.html
"Window functions?"functions-window.html
"How to backup?"backup.html
"Connection config?"runtime-config-connection.html
"pg_hba.conf syntax?"auth-pg-hba-conf.html
"EXPLAIN ANALYZE?"using-explain.html
"PL/pgSQL syntax?"plpgsql.html

Important Reminder

Never answer PostgreSQL questions from memory!

PostgreSQL documentation is comprehensive and regularly updated. Always fetch the current documentation for:

  • Exact syntax (especially for complex commands)
  • Available options and parameters
  • Version-specific features
  • Best practices and warnings

Why not use a sub-agent?

Sub-agent responses require paraphrasing, which may cause information loss. Fetch the docs yourself for more direct and accurate information.

Sponsors

Details

Marketplace
PsychQuant/psychquant-claude-plugins
Source
plugins/postgresql-guide
Author
Che Cheng
Category
Development

More from PsychQuant/psychquant-claude-plugins

All 42