Agent skill

DB Admin

by EliasOulkadi in EliasOulkadi/shokunin

PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication…

MITAuto-check: notesDatabases

Install DB Admin

skills CLI
$ npx skills add EliasOulkadi/shokunin --skill db-admin -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install EliasOulkadi/shokunin db-admin --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/EliasOulkadi/shokunin.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.pack/skills/db-admin .claude/skills/db-admin && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
db-admin
GitHub stars
114
Token cost
~2k tokens
SKILL.md length
439 words
Files
5 (incl. scripts, references, assets)
Skills in repo
49
Repo updated
First seen
Licence
MIT

At a glance

PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication…

  • Works in 5 steps: Run health check → Backup database → Set up scheduled backups → …
  • User asks to backup a database
  • SKILL.md covers Workflow, Error Handling, Production Checklist and Anti-Patterns, plus 3 more sections
  • Runs PowerShell scripts from its folder; calls psql

What it does

DB Admin is an agent skill from EliasOulkadi/shokunin. PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication (streaming, logical), vacuum/autovacuum tuning, and scheduled backups with retention. Use when user asks to backup a database, restore from backup, monitor database health, set up replication, or perform DBA tasks. Do NOT use for schema design (use db-sculptor), query optimization (use db-sculptor), or migration…

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts, reference files and assets (for example `references/postgres-admin.md`). Compatibility notes: opencode

It sits in Databases, covering Database administration and Backup and disaster recovery. It works with PostgreSQL. The repository describes itself as: 職人 Shokunin 62 AI agent skills for OpenCode, Claude Code, Cursor, Windsurf. ChromaDB memory, MCP servers, declarative self-updates. Multi-model, open source, zero cost. The licence is MIT.

When your agent uses it

  • User asks to backup a database
  • Restore from backup
  • Monitor database health
  • Set up replication

Example prompts

  • “/db-admin”

Requirements

  • PowerShell
  • Compatibility (from SKILL.md): opencode
  • Pre-approved tools (allowed-tools): Read, Bash, Write

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Run health check
  2. Backup database
  3. Set up scheduled backups
  4. Configure connection pooling
  5. Set up replication (if needed)

What it can do on your machine

Read from SKILL.md and the folder at commit 4c68e5b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash
    • Write

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (PowerShell), which the agent can run.

    Shell commands in SKILL.md call:

    • psql

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    opencode

    From compatibility in the SKILL.md frontmatter.

Context cost

DB Admin loads about 2k tokens when it runs, and up to ~4.9k if it reads all its reference files. Until then it costs about 137 tokens; SKILL.md has 439 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~137
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Bash, Write

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from EliasOulkadi/shokunin at commit 4c68e5b, republished under its MIT licence (© EliasOulkadi). 439 words, ~2,008 tokens.

Download SKILL.mdSave it as .claude/skills/db-admin/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
db-admin
description
PostgreSQL database administration — backup/restore (pg_dump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication (streaming, logical), vacuum/autovacuum tuning, and scheduled backups with retention. Use when user asks to backup a database, restore from backup, monitor database health, set up replication, or perform DBA tasks. Do NOT use for schema design (use db-sculptor), query optimization (use db-sculptor), or migration planning (use db-sculptor).
allowed-tools
Read, Bash, Write
compatibility
opencode
triggers
PostgreSQL backup, restore database, database backup, database administration, DBA, monitor database, pg_dump, PgBouncer, database replication, WAL archiving…
negatives
schema design, query optimization, Prisma, Drizzle, migration
license
MIT
metadata.workflow
operations
metadata.audience
devops
metadata.version
3.0.0
metadata.author
shokunin

Database Administrator

PostgreSQL production operations: backup, restore, monitoring, replication, and maintenance.

Workflow

Step 1: Run health check
powershell
scripts/monitor-db.ps1 -Database myapp

Checks 7 metrics:

MetricWarningFail
Connection count> 80% of max> 95% of max
Active queries> 10> 20
Long-running (>5m)Any> 3
Cache hit ratio< 99%< 95%
Dead tuple ratio> 20%> 40%
Index usage (unused)> 5> 10

If any metric is FAIL: investigate immediately. See references/postgres-admin.md for diagnosis and fix procedures.

Step 2: Backup database
powershell
# Full backup
scripts/backup-db.ps1 -Database myapp

# Custom output directory
scripts/backup-db.ps1 -Database myapp -OutputDir D:\backups

# Exclude large log tables
scripts/backup-db.ps1 -Database myapp -ExcludeTables @("audit_logs", "analytics_events")

The script creates: myapp_2026-05-13_143022.dump (custom format, compressed) and verifies the backup by restoring to a temp database and running a count query.

Step 3: Set up scheduled backups

See assets/backup-schedule-template.ps1 for the schedule template.

powershell
# Schedule daily backup at 2 AM
schtasks /Create /SC DAILY /TN "DBBackup-myapp" /TR "powershell.exe -File C:\scripts\backup-schedule.ps1" /ST 02:00

Retention policy:

  • Daily: keep 7
  • Weekly: keep 4 (Sundays)
  • Monthly: keep 3 (1st of month)
Step 4: Configure connection pooling
ini
# pgbouncer.ini for PostgreSQL pooling
[databases]
myapp = host=localhost port=5432 dbname=myapp

[pgbouncer]
listen_port = 6432
listen_addr = 127.0.0.1
auth_type = scram-sha-256
pool_mode = transaction
default_pool_size = 25
max_client_conn = 100
max_db_connections = 50
Step 5: Set up replication (if needed)

See references/postgres-admin.md for streaming and logical replication setup.

Decision:

NeedReplication type
Read scaling + HAStreaming replication
Selective table syncLogical replication
Upgrade with minimal downtimeLogical replication
Cross-version replicationLogical replication

Error Handling

ScenarioCauseFix
Backup fails with "out of memory"Work_mem too high for dumpReduce work_mem, increase maintenance_work_mem
PgBouncer rejects connectionspool_size exhaustedIncrease default_pool_size, add more connections
Replication lag growingWAL generation > apply rateAdd replicas, increase max_wal_size, tune apply workers
Long-running query blocking vacuumsnapshot held too longKill with pg_terminate_backend, tune idle_in_transaction_session_timeout
WAL directory filling diskarchive_command failing or wal_keep_size too highFix archiving, reduce wal_keep_size, increase max_wal_size
Show full SKILL.md (201 more words)Show less

Production Checklist

  • Automated daily backups with verification
  • Retention policy configured (7 daily, 4 weekly, 3 monthly)
  • PgBouncer with transaction pooling
  • Monitoring dashboard (connection count, cache hit, bloat)
  • Alerts for: connection > 80%, cache hit < 99%, replication lag > 60s
  • Autovacuum tuned (scale_factor, threshold, naptime)
  • WAL archiving for PITR
  • Connection limits per database
  • Statement timeout configured (30s default)
  • Backups stored in different location than DB server

Anti-Patterns

Anti-patternFix
No automated backupsSchedule pg_dump with retention
No backup verificationAlways restore-test backups
Default autovacuum settingsTune for your workload
Direct connections in productionAlways use PgBouncer
No replication monitoringCheck lag, WAL generation rate
Running out of disk for WALMonitor WAL directory, tune archiving

Streaming Replication Setup

Primary server (postgresql.conf)
wal_level = replica
max_wal_senders = 5
wal_keep_size = 1024    # MB of WAL to retain
hot_standby = on        # Allow read-only queries on replica
Primary server (pg_hba.conf)
host replication replicator 192.168.0.0/24 md5
Replica setup
bash
# 1. Create base backup
pg_basebackup -h primary_host -D /var/lib/postgresql/data -U replicator -P -R

# 2. Start replica
pg_ctl start -D /var/lib/postgresql/data

# 3. Verify replication
psql -c "SELECT client_addr, state, sync_state FROM pg_stat_replication;"
PITR (Point-in-Time Recovery)
bash
# On primary: configure WAL archiving
archive_mode = on
archive_command = 'cp %p /archive/%f'

# Take base backup
pg_basebackup -h localhost -D /backup/base -Ft -z -P

# Restore to point in time
# 1. Stop PostgreSQL
# 2. Restore base backup to data directory
# 3. Create recovery.signal file
# 4. Set recovery_target_time in postgresql.conf:
#    recovery_target_time = '2026-05-18 14:30:00'
# 5. Start PostgreSQL
Vacuum Strategy
sql
-- Check table bloat
SELECT schemaname, relname, n_live_tup, n_dead_tup,
       round(n_dead_tup * 100.0 / NULLIF(n_live_tup + n_dead_tup, 0), 2) AS dead_ratio
FROM pg_stat_user_tables
ORDER BY n_dead_tup DESC LIMIT 10;

-- Aggressive autovacuum for high-write tables
ALTER TABLE events SET (autovacuum_vacuum_scale_factor = 0.01, autovacuum_vacuum_cost_limit = 2000);

-- Manual VACUUM (non-blocking)
VACUUM (VERBOSE, ANALYZE) events;

-- VACUUM FULL (blocking, recovers disk space)
VACUUM FULL events;  -- Requires table lock. Only use during maintenance windows.
Monitoring Queries
sql
-- Active connections
SELECT state, count(*) FROM pg_stat_activity GROUP BY state;

-- Long-running queries (>5 min)
SELECT pid, now() - query_start AS duration, query
FROM pg_stat_activity WHERE state != 'idle' AND now() - query_start > INTERVAL '5 minutes';

-- Cache hit ratio (should be >95%)
SELECT sum(blks_hit) * 100.0 / NULLIF(sum(blks_hit) + sum(blks_read), 0) AS cache_hit_ratio
FROM pg_stat_database WHERE datname = current_database();

-- Dead tuples accumulating
SELECT relname, n_dead_tup, last_autovacuum
FROM pg_stat_user_tables WHERE n_dead_tup > 10000 ORDER BY n_dead_tup DESC;

Sources

  • PostgreSQL docs — Backup/Restore (postgresql.org/docs)
  • PgBouncer documentation
  • PostgreSQL wiki — Performance tuning
  • WAL archiving and PITR guide
  • Replication documentation
  • pganalyze — Monitoring and tuning

Checklist

  • Skill loads without errors in the AI agent
  • YAML frontmatter is valid (description, compatibility, audience)
  • Workflow section provides clear step-by-step instructions
  • Error handling section covers common failure modes
  • All referenced files (references/, scripts/, assets/) exist
  • Skill triggers correctly for intended use cases
  • No broken links or missing resources

© EliasOulkadi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references, assets) in .pack/skills/db-admin of EliasOulkadi/shokunin.

  • SKILL.md
  • assets/backup-schedule-template.ps1
  • references/postgres-admin.md
  • scripts/backup-db.ps1
  • scripts/monitor-db.ps1

Open the folder on GitHubat commit 4c68e5b

Compare with similar skills

DB Admin next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

DB Admin compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
DB Admin this skillEliasOulkadi/shokunin114—~2kAutomated safety check: NotesMIT
Database Backupssickn33/agentic-awesome-skills47k2 repos~3.1kAutomated safety check: NotesMIT
Alloydb Basicsgoogle/skills21k—~1.7kAutomated safety check: PassApache-2.0
Alloydb Basicsdavila7/claude-code-templates33k—~611Automated safety check: PassMIT
Postgresql Devsecsickn33/agentic-awesome-skills47k2 repos~2.5kAutomated safety check: NotesMIT
Automating Database Backupsjeremylongshore/tons-of-skills-marketplace2.8k—~1.5kAutomated safety check: PassMIT

Similar skills

  • Database Backups

    sickn33/agentic-awesome-skills

    Implement database backup strategies. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3.1k tokens
    DatabasesAuto-check: notes
  • Alloydb Basics

    google/skills

    Official

    Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations.

    21k GitHub stars~1.7k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Alloydb Basics

    davila7/claude-code-templates

    Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB MCP tools for automated database operations including AI-powered search and vector capabilities.

    33k GitHub stars~611 tokensUpdated today
    DatabasesAuto-check passed
  • Postgresql Devsec

    sickn33/agentic-awesome-skills

    Administer PostgreSQL databases. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~2.5k tokens
    DatabasesAuto-check: notes
  • Automating Database Backups

    jeremylongshore/tons-of-skills-marketplace

    Automate database backup processes with scheduling, compression, and encryption.

    2.8k GitHub stars~1.5k tokensUpdated today
    DatabasesAuto-check passed
  • Managing Database Recovery

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database operations. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~1.8k tokensUpdated today
    DatabasesAuto-check passed

More from EliasOulkadi/shokunin

All 49 skills in this repo
  • CI CD

    EliasOulkadi/shokunin

    Design CI/CD pipelines for GitHub Actions, GitLab CI, and CircleCI with matrix builds, test sharding, caching, Docker layer caching, OIDC auth, deployment strategies (rolling, blue-green, canary)…

    114 GitHub stars~3.4k tokensUpdated 5 days ago
    Auto-check: notes
  • Component Forge

    EliasOulkadi/shokunin

    Build production-grade components for React, Vue 3, and Svelte 5 with all states (loading, empty, error, success, idle), TypeScript strict, WCAG 2.2 accessibility, server components (RSC), and…

    114 GitHub stars~3.6k tokensUpdated 5 days ago
    Auto-check: notes
  • DB Sculptor

    EliasOulkadi/shokunin

    Design database schemas with Prisma/Drizzle, PostgreSQL index strategy (B-tree, GIN, GiST, BRIN, Hash), query optimization (EXPLAIN ANALYZE), migration safety (expand/contract, zero-downtime), and…

    114 GitHub stars~3.1k tokensUpdated 5 days ago
    Auto-check: notes
  • Docker

    EliasOulkadi/shokunin

    Optimize Docker images with multi-stage builds, distroless bases, BuildKit cache mounts, multi-arch builds, compose watch, security hardening (non-root, seccomp, capabilities drop), and…

    114 GitHub stars~3.8k tokensUpdated 5 days ago
    Auto-check: notes
  • Error Handler

    EliasOulkadi/shokunin

    Design error handling, structured logging, and observability with OpenTelemetry (traces, metrics, logs), error classification, recovery patterns (retry with jitter, circuit breaker, bulkhead…

    114 GitHub stars~3.6k tokensUpdated 5 days ago
    Auto-check: notes
  • Kubernetes

    EliasOulkadi/shokunin

    Deploy, manage, and debug Kubernetes in production — Deployments, Services, Gateway API, Service Mesh (Istio/Linkerd/Cilium), eBPF observability (Cilium Hubble), security hardening (Pod Security…

    114 GitHub stars~3.3k tokensUpdated 5 days ago
    Auto-check: notes

Works with

Categories

Questions about DB Admin

What does DB Admin do?

PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication…. DB Admin is an agent skill from EliasOulkadi/shokunin. PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication (streaming, logical), vacuum/autovacuum tuning, and scheduled backups with retention.

When should I use DB Admin?

DB Admin fits situations like: user asks to backup a database; restore from backup; monitor database health; set up replication.

How do I install DB Admin in Claude Code?

Run `npx skills add EliasOulkadi/shokunin --skill db-admin -a claude-code`. Or copy the skill folder (.pack/skills/db-admin in EliasOulkadi/shokunin) into .claude/skills/db-admin in your project. Claude Code loads it when a task matches its description.

How do I install DB Admin in Codex?

Run `npx skills add EliasOulkadi/shokunin --skill db-admin -a codex`. Or copy the skill folder (.pack/skills/db-admin in EliasOulkadi/shokunin) into .agents/skills/db-admin in your project. Codex loads it when a task matches its description.

Can I use DB Admin in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add EliasOulkadi/shokunin --skill db-admin -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/db-admin, .gemini/skills/db-admin, .github/skills/db-admin and .opencode/skills/db-admin in your project.

What does DB Admin need to run?

Going by SKILL.md and its folder, DB Admin needs PowerShell for the scripts in its folder and the command-line tools its instructions call (psql). Our summary lists: PowerShell. Its frontmatter pre-approves these tools: Read, Bash, Write. Compatibility (from SKILL.md): opencode.

Does DB Admin access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is DB Admin safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does DB Admin use?

DB Admin is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does DB Admin use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.9k tokens, read only when the agent opens those files.

What are the alternatives to DB Admin?

Skills that share tags, products or a category with DB Admin: Database Backups (sickn33/agentic-awesome-skills, 47k stars), Alloydb Basics (google/skills, 21k stars), Alloydb Basics (davila7/claude-code-templates, 33k stars) and Postgresql Devsec (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains DB Admin?

EliasOulkadi (a GitHub user) maintains it in EliasOulkadi/shokunin, which has 114 GitHub stars. The repository holds 49 skills in this directory. The repository was last updated on October 5, 2026.

Source: EliasOulkadi/shokunin on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.