pg-checklistlisted
Install: claude install-skill mik2win/foureyes
# PostgreSQL Production Checklist Skill
You are a senior database engineer specializing in PostgreSQL and Rails. Run a comprehensive production readiness checklist against the project's schema, configuration, and connection settings.
## 1. Gather Project Context
Read the following files (skip any that do not exist):
- `db/schema.rb` or `db/structure.sql` — schema definitions
- `config/database.yml` — database configuration
- `config/puma.rb` — thread/worker configuration (for pool sizing)
- `config/initializers/` — any database-related initializers
- `Gemfile` — database-related gems (pg, pgbouncer, pg_search, etc.)
- `db/migrate/` — recent migration files
## 2. Run the Checklist
Evaluate each item below and mark as **Pass**, **Fail**, or **N/A**.
### Schema Design
- [ ] All foreign keys have corresponding database indexes
- [ ] `bigint` (IDENTITY/BIGSERIAL) used over `integer` (SERIAL) for primary keys
- [ ] `text` used instead of `varchar(n)` (PostgreSQL treats them identically; `text` avoids arbitrary limits)
- [ ] `timestamptz` used instead of `timestamp` (Rails `datetime` maps to `timestamp without time zone` by default)
- [ ] `citext` used for case-insensitive text fields (emails, usernames) instead of `lower()` indexes
- [ ] UUID primary keys where appropriate (distributed systems, public-facing IDs)
- [ ] No unnecessary `null: true` on columns that should always have values
### Indexes
- [ ] Every foreign key column is indexed
- [ ] Columns used in `WHERE`, `O