postgres-health-check

postgres-health-check is a skill for Claude Code from fmflurry/settings-opencode. It costs 118 tokens per session (3,423 once invoked), scanned A, original, MIT.

A read-only health check for a PostgreSQL database instance running in Docker. It reports connectivity, sessions, storage-related statistics, maintenance risks, and container or volume state.

In plain words
What is it for?
Use it to inspect uptime, cache use, dead rows, autovacuum, transaction-ID age, long sessions, indexes, checkpoints, archiving, connections, and Docker health.
Why use it?
It helps identify database availability, capacity, maintenance, and configuration problems without changing the instance.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to inspect uptime, cache use, dead rows, autovacuum, transaction-ID age, long sessions, indexes, checkpoints, archiving, connections, and Docker health.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fmflurry/settings-opencode/postgres-health-check
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fmflurry/settings-opencode --skill postgres-health-check
Clone the repo
git clone --depth 1 https://github.com/fmflurry/settings-opencode

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postgres-health-check

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmflurry/settings-opencode/postgres-health-check/github.svg)](https://agentmods.dev/skills/fmflurry/settings-opencode/postgres-health-check)
Your own site
<a href="https://agentmods.dev/skills/fmflurry/settings-opencode/postgres-health-check"><img src="https://agentmods.dev/badge/skills/fmflurry/settings-opencode/postgres-health-check/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for postgres-health-check

Your own site · 80×15
<a href="https://agentmods.dev/skills/fmflurry/settings-opencode/postgres-health-check"><img src="https://agentmods.dev/badge/skills/fmflurry/settings-opencode/postgres-health-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,423 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00118 $0.03423
Opus 5.5 $0.00047 $0.01369
Sonnet 5.5 $0.00024 $0.00685
Haiku 4.5 $0.00012 $0.00342

Measured 27d ago against content hash 7cf09bedf35b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres-health-check scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 27d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/postgres-health-check/SKILL.md · 283 lines

How it starts

The opening of the file, as written. The whole thing — 283 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostgreSQL Instance Health Check

Target version: postgres:16-alpine — this repository's gc-platform-postgres container (db gcplatform, owner role gcplatform, runtime role gc_kourou_app_login).

Contract: every check below is a read-only diagnostic (SELECT against pg_stat_*/pg_catalog, pg_isready, docker read commands). Each check gives: query → interpretation → severity → remediation. Remediations that mutate state are emitted ONLY as ⚠️ HUMAN CONFIRMATION REQUIRED blocks — the postgres-dba agent never executes them.

Connection:

docker exec gc-platform-postgres psql -U gcplatform -d gcplatform -c "<query>"

Progressive disclosure: for the OPS side of applying EF Core migrations (lock windows at apply time, CREATE INDEX CONCURRENTLY vs the migration transaction, post-migration bloat/vacuum watch, live model-drift check), load reference-migration-ops.md in this skill's directory; code-side migration/schema correctness stays with database-reviewer.


1. Connectivity & uptime

SELECT version();
SELECT now() - pg_postmaster_start_time() AS uptime;
SELECT pg_is_in_recovery();
docker exec gc-platform-postgres pg_isready -U gcplatform -d gcplatform

Interpretation: pg_isready non-zero exit = server not accepting connections (CRITICAL). Very short uptime + no deploy = crash-loop (check docker logs --tail 200 gc-platform-postgres). pg_is_in_recovery() = true on the primary = unexpected (this stack has no replicas).

Severity: CRITICAL if unreachable; LOW note if uptime < 1h (statistics views were reset — treat other checks' counters cautiously).


2. Cache hit ratio

SELECT
  datname,
  blks_hit,
  blks_read,
  ROUND(blks_hit::numeric / NULLIF(blks_hit + blks_read, 0) * 100, 2) AS cache_hit_ratio_pct
FROM pg_stat_database
WHERE datname = current_database();

Interpretation: ratio = shared-buffer hits / (hits + disk reads). Healthy OLTP ≥ 99%. < 95% on a warm instance means working set exceeds shared_buffers (default 128MB here — no command: override in compose) or queries do large sequential scans. Stats accumulate since last reset — judge the trend, not a snapshot.

Read the full file on GitHub · 283 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 27d ago First seen · 283 lines · 118 tokens per session scan A 7cf09bedf35b

Subscribe to this mod's changes

postgres-health-check is a skill published in the GitHub repository fmflurry/settings-opencode (171 stars, last pushed yesterday), licensed MIT. It adds 118 tokens to every session and 3,423 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-20.

Related

Other skills, from other repositories

polar-local-environment

This skill should be used when setting up or managing Polar local development environment with Docker.

fcakyon/claude-codex-settings · 22 tokens

cnpg

Create and operate CloudNativePG (CNPG) Postgres databases on Kubernetes the GitOps/Flux way - on managed cloud (GKE + GCS via Workload Identity) OR self-hosted (K3s/bare-metal + any S3-compatible store via a credentials secret). Covers Cluster + ScheduledBackup manifests, barman WAL archiving, pgvector, PITR…

vanducng/skills · 155 tokens

postgres-operator-cloudnative-pg-migration

Migrate PostgreSQL clusters from the Zalando postgres-operator (acid.zalan.do postgresql CRs, Spilo/Patroni, WAL-G) to CloudNativePG (CNPG) on Kubernetes, incl. fully air-gapped clusters. Core knowledge: the two walls (Spilo↔CNPG glibc/collation divergence that corrupts physically-copied indexes; WAL-G↔Barman archive…

air-gapped/skills · 224 tokens

alloydb-omni-container

You're an expert in AlloyDB Omni running in a container. You can help users with related tasks such as starting, stopping, listing, connecting to AlloyDB Omni instance running in a container, and querying for logs.

gemini-cli-extensions/alloydb-omni · 51 tokens

express-prisma-coolify-image

Package an Express and Prisma API as a runtime-only image that migrates its Postgres database at start. Use when containerising a Node API with a database, or when migrations, readiness or shutdown misbehave in production.

KhaledSaeed18/dotclaude · 53 tokens

docker-dev-environment

Use when setting up local development services or running the project locally. Establishes the "stateful services in Docker, app runs native" pattern with Postgres, Redis, MinIO, and Mailpit.

martian56/claude-engineer · 46 tokens