← ClaudeAtlas

postgreslisted

Use when user references PostgreSQL/Postgres, postgres:// or postgresql:// connection strings, asks for ad-hoc SELECT, EXPLAIN/ANALYZE plans, schema/index/lock inspection, or slow-query investigation. Read-only by default. Multi-database via PG_PROFILE.
tuannv14/claude-team-toolkit · ★ 1 · API & Backend · score 70
Install: claude install-skill tuannv14/claude-team-toolkit
# /postgres — read-mostly DB ops (multi-database) Wraps `psql`. Read-only by default; mutating SQL requires `--write` + typed confirm. Profile resolution: `--profile` → `PG_PROFILE` → `~/.postgres/active_profile` → `[default]`. ## Overview Wraps `psql` with read-only-by-default safety. Mutating SQL requires explicit `--write` flag plus typed database name confirmation. Profile-level `read_only=true` hard-refuses writes even with the flag (defense-in-depth). ## When to Use - Ad-hoc SELECT queries against dev/staging/prod - EXPLAIN plans for slow queries - Schema / index / lock inspection during incidents - Identifying slow queries via `pg_stat_statements` - Killing stuck backends (with `--force` + typed `KILL`) ## When NOT to Use - Application data writes → that's the app, not this skill - Migrations → use Rails / Alembic / Flyway with version control - Bulk data exports → `pg_dump` or `COPY` directly - Cross-database queries → use FDW or app-side joins ## Profile config `~/.postgres/credentials` (mode 600): ```ini [default] host = localhost port = 5432 database = myapp_development user = postgres password = postgres sslmode = prefer [prod] host = prod-db.example.com database = myapp_production user = readonly_user # defense-in-depth: physical RO at DB level password = xxxxxxxxxxxxxx sslmode = verify-full # min `require` for non-localhost read_only = true # hard refuse writes even with --write require_confirm = true ``` **SSL modes:** `disa