/postgresql-skills:postgres-config-tuningfrom PostgreSQL Diagnostics and Review
Reviews and optimizes PostgreSQL 18/19 server configuration (postgresql.conf, ALTER SYSTEM, parameter groups) with evidence-backed changes, apply/verify/rollback steps. Use for tuning memory, connections, WAL, autovacuum, planner, I/O, parallelism, JIT, logging, or timeouts.
Ships in PostgreSQL Diagnostics and Review. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
ハードウェア・ワークロード・観測した根拠に合わせて設定の変更案を作る。万能の推奨値を当てはめない。変更は案として示し、許可された範囲でだけ適用する。
前提を確認する: PostgreSQLが使えるメモリとvCPU、ストレージ種別(ローカルSSD/ネットワーク/HDD)、自前運用かmanaged serviceか、ワークロード(OLTP/分析/混在)、pool後の同時実行数、データ量、レプリケーション構成、許容できるデータ損失と復旧時間。分からない値は推測で埋めず、その項目を評価対象外として示す。
現在の設定を取得する: スキルフォルダからpsql -X -qAt --set=instance_id=prod-primary --file sql/settings.sql > settings.json。全pg_settingsを、資格情報・コマンド・パスを伏せてJSONで出す。sourceで既定値か設定済みかを、pending_restartで再起動待ちの変更を確認する。アプリと同じ接続ロール・DBで取得し、適用元とoverrideを確認する。
根拠を集める: 設定変更の必要性は症状から判断する。postgres-performance-diagnosticsスキルの区間レポート(analyze.py --format json)があれば使う。checkpointの要求数と原因ログ、WAL量とFPI、temp量、JIT時間、平均アクティブセッション数を読む。手動CHECKPOINTも要求数に含まれるため、その比率だけでWAL不足と判断しない。
レビューする:
python scripts/review_config.py settings.json --ram-gb 64 --cpus 16 --storage ssd \
--workload oltp --max-active-connections 80 --interval-report interval.json --output review.md
出力は条件付きの調査・変更候補であり、数値の閾値は最適値や原因の証明ではない。並列workerの設定上限と実稼働数も区別する。parameters.mdで各パラメータの考え方と例外を確認し、環境に合わせて値を決める。
変更計画を作り、検証する: apply-and-verify.mdに従い、反映方法(reload/restart/ロール単位)、順序、確認指標、切り戻しを示す。
fsync、full_page_writes、synchronous_commit)を性能のために緩める案は既定にしない。work_mem等のセッション単位の値は、全体の既定値より、必要なロール・処理に限定して上げることを先に検討する。shared_buffers、同時実行のwork_mem、maintenance系、OSのページキャッシュの合計で考える。単一の値だけを最適化しない。最初に優先度の高い変更(安全性、明らかな誤設定、根拠のある性能改善)を示す。追加証拠が必要な候補は推奨値を未定(JSONではnull)として次の調査を示す。各変更に、現在値と推奨値、理由と根拠、反映に必要な操作(reload/restart)、リスク、確認する指標、切り戻し手順を添える。評価できなかった項目と、追加で必要な情報も示す。適用用のSQL・設定ファイルの差分は、レビューのための草案として示す。
代表負荷の再生とSLOの判定にはpostgres-workload-validationを使う。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/postgres-performance-diagnosticsDiagnose PostgreSQL 18 and 19 performance using wait-event sampling, cumulative statistics, execution plans, and logs. Use for slow queries, high CPU, wait events, I/O, spills, locking, index design (missing or redundant), excessive calls, vacuum backlog, WAL, replication, and resource contention; produce evidence-backed candidates and validation plans./postgres-schema-reviewReview PostgreSQL table design for missing constraints, naming inconsistencies, mixed lifecycles and responsibilities, mutable facts, nullable or flag semantics, and contention. Use to report refactoring candidates from schema snapshots, domain contracts and observed writes./postgres-security-reviewReview PostgreSQL roles, row level security, authentication, TLS, deployment privileges and security updates. Use to assess exposure, propose scoped remediation, or verify security changes using catalog snapshots, access contracts and staging tests./postgres-workload-validationCompare PostgreSQL SQL, index, or configuration changes under a reproducible workload. Use for benchmark design, pgbench replay, capacity and latency regressions, and accept, investigate, or roll back decisions.npx claudepluginhub soudai/postgresql-use-improve-agents-skill --plugin postgresql-skillsOther plugins' skills for the same job