cnpg

cnpg is a skill for Claude Code, Codex from Aidas-dev/k8s-agent-skills. It costs 49 tokens per session (1,204 once invoked), scanned A, original, MIT.

Guidance for running PostgreSQL, a relational database, on Kubernetes using CloudNativePG, a Kubernetes operator that manages database clusters. It covers clusters, backups, scheduled backups, connection pooling, replication, and related settings.

In plain words
What is it for?
Use it when creating or troubleshooting CloudNativePG resources such as PostgreSQL clusters, backups, backup schedules, poolers, and image catalogs.
Why use it?
It helps avoid guessing at the Kubernetes resources and settings needed to run PostgreSQL reliably. It also provides a reference for storage, bootstrapping, backups, and failover.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or troubleshooting CloudNativePG resources such as PostgreSQL clusters, backups, backup schedules, poolers, and image catalogs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aidas-dev/k8s-agent-skills/cnpg
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 Aidas-dev/k8s-agent-skills --skill cnpg
Clone the repo
git clone --depth 1 https://github.com/Aidas-dev/k8s-agent-skills

Made for: Claude Code, Codex.

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 cnpg

README.md
[![agentmods](https://agentmods.dev/badge/skills/aidas-dev/k8s-agent-skills/cnpg.svg)](https://agentmods.dev/skills/aidas-dev/k8s-agent-skills/cnpg)
Your own site
<a href="https://agentmods.dev/skills/aidas-dev/k8s-agent-skills/cnpg"><img src="https://agentmods.dev/badge/skills/aidas-dev/k8s-agent-skills/cnpg.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,204 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.00049 $0.01204
Opus 5 $0.00024 $0.00602
Sonnet 5 $0.00010 $0.00241
Haiku 4.5 $0.00005 $0.00120

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

Security

Grade A, and why

cnpg 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 7d 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.

skills/cnpg/SKILL.md · 131 lines

How it starts

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

CloudNativePG (CNPG)

Overview

CloudNativePG operator manages HA PostgreSQL clusters on Kubernetes. API: postgresql.cnpg.io/v1. Deployed via Helm chart (latest: 0.28.2 \u2192 operator 1.29.1).

CRD Reference

CRD Purpose
Cluster HA PostgreSQL cluster (core resource)
Backup On-demand backup
ScheduledBackup Cron-based backup schedule
Pooler PgBouncer connection pooler
Database Database-level management within cluster
Publication / Subscription Logical replication
ImageCatalog / ClusterImageCatalog Extension image management (v1.29+)
FailoverQuorum Quorum-based failover settings

Cluster Spec (Key Fields)

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
spec:
  instances: 1                    # Replicas (1 = standalone primary)
  imageName: ghcr.io/cloudnative-pg/postgresql:18

  storage:
    size: 10Gi
    storageClass: ceph-block      # Omit or null for cluster default
    resizePVC: true               # Allow storage resize via Helm upgrade

  walStorage:                     # Optional \u2014 separate WAL volume
    size: 5Gi
    storageClass: ceph-block

  bootstrap:
    initdb:
      database: app               # Default DB name
      owner: app                  # Default owner user
      postInitSQL:                # Run after init
        - CREATE EXTENSION vector;

  affinity:
    nodeSelector:
      kubernetes.io/hostname: worker-01
    podAntiAffinity:
      type: preferred             # required or preferred
      topologyKey: kubernetes.io/hostname

  postgresql:
    parameters:
      shared_preload_libraries: vector  # Extensions
    pg_hba:                             # Custom pg_hba (v1.29+ use podSelectorRefs)

  primaryUpdateStrategy: unsupervised   # unsupervised (default) or switchover
  primaryUpdateMethod: restart          # restart or switchover

  monitoring:
    enablePodMonitor: true              # Generates Prometheus PodMonitor

  backup:
    volumeSnapshot:
      snapshotClass: csi-ceph-block     # CSI snapshot class

Read the full file on GitHub · 131 lines

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. 7d ago First seen · 131 lines · 49 tokens per session scan A e88f36272401

Subscribe to this mod's changes

cnpg is a skill published in the GitHub repository Aidas-dev/k8s-agent-skills (2 stars, last pushed 24d ago), licensed MIT. It adds 49 tokens to every session and 1,204 once invoked, about $0.0002 per session on Opus 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-08-31.

Related

Other skills, from other repositories

cloud-sql-basics

This file generates or explains Cloud SQL resources. Use this file when the user asks to create a Cloud SQL instance or database for MySQL, PostgreSQL, or SQL Server. Cloud SQL manages third-party MySQL, PostgreSQL, and SQL Server instances as resources in Cloud SQL. For example, when Cloud SQL creates an open-source…

google/skills · 108 tokens

moai-platform-database-cloud

Cloud database platform specialist covering Neon (serverless PostgreSQL), Supabase (PostgreSQL 16 with real-time), and Firebase Firestore (NoSQL with offline sync). Use when choosing or setting up cloud databases.

modu-ai/moai-adk · 51 tokens

aws-rds

Manage Amazon RDS for fully managed relational databases. Provision MySQL, PostgreSQL, and Aurora instances with automated backups and patching. Configure read replicas for scaling, snapshots for recovery, and Aurora Serverless for variable workloads.

TerminalSkills/skills · 52 tokens

huawei-cloud-rds-smart-service

Huawei Cloud RDS (Relational Database Service) full-scenario intelligent service covering all database engines (MySQL, PostgreSQL, SQL Server, MariaDB, GaussDB for MySQL, TaurusDB). Provides six capability domains: (1) Basic intelligent Q&A for RDS product features, best practices, and specifications; (2) SQL…

huaweicloud/huaweicloud-skills · 330 tokens

add-backup-db

Add automated Neon database backups to the current project. Registers the project as a snapshot target of the unified shared Cloudflare Worker "hypervibe-jobs" (one Worker per account for ALL background jobs, reused across projects) that creates point-in-time Neon branch snapshots every 2 weeks. Retention - rolling (2…

flavien-ia/hypervibe-harness · 129 tokens

postgres

Configure DigitalOcean Managed Postgres with bindable variables or schema isolation. Use when setting up databases, creating users, managing permissions, configuring multi-tenant schemas, or troubleshooting database connectivity on App Platform.

digitalocean-labs/do-app-platform-skills · 42 tokens