db-postgresql

Guides PostgreSQL schema design, migrations, and query review across project phases.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/jcg-admin/IACT-ui --skill db-postgresql-jcg-admin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: db-postgresql
Source: https://github.com/jcg-admin/IACT-ui/tree/main/.claude/skills/db-postgresql
Command: npx skills add https://github.com/jcg-admin/IACT-ui --skill db-postgresql-jcg-admin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams working on PostgreSQL-backed features often lack a consistent process for diagnosing database impact, specifying schemas, writing reversible migrations, and reviewing query performance, leading to inconsistent tables, missing indexes, and slow queries in production. ## Core Features & Use Cases - Phase-based database guidance: Provides checklists for diagnosing affected tables and relationships, specifying schemas with constraints and indexes, implementing migrations, and evaluating query performance. - Migration conventions: Enforces a recommended implementation order with UP and DOWN migrations verified via psql. - Query quality review: Requires EXPLAIN ANALYZE verification, forbids SELECT * in production code, and checks for duplicate indexes. - Use Case: When adding a new feature that stores call records, use this Skill during design to specify the table, foreign keys, and indexes, then during implementation to write and test reversible migrations, and finally during review to confirm no sequential scans on large tables. ## Quick Start Ask the AI to apply the db-postgresql skill to design the schema and migrations for the new feature you are specifying.

Frequently Asked Questions about db-postgresql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write reversible PostgreSQL migrations?▼

Write an UP migration that creates or modifies tables and indexes, then a DOWN migration that reverts every change from the UP step. Test by applying UP, verifying with \d table in psql, applying DOWN, and verifying again.

What should a database schema specification include?▼

For each new or modified table, specify the snake_case name, purpose, columns with types and constraints, foreign keys with ON DELETE and ON UPDATE behavior, and justified indexes. Also list the required UP and DOWN migrations.

How do I check if a PostgreSQL query is slow?▼

Run EXPLAIN ANALYZE on the query and look for sequential scans on large tables, which indicate missing indexes. New queries should be verified this way before closing a feature.

Why should I avoid SELECT * in production queries?▼

SELECT * fetches unnecessary columns, increases I/O and network cost, and breaks when the schema changes. Explicit column lists keep queries predictable and allow indexes to be used effectively.

When should I add an index to a PostgreSQL table?▼

Add indexes on columns frequently used in filters or ORDER BY clauses, with justification documented in the specification. Before creating one, verify it does not duplicate an existing index.