/ai-stuff:postgres-replication-hafrom ai-stuff
Set up, operate, and troubleshoot PostgreSQL replication and high availability: streaming replicas, replication slots and disk-filling WAL, lag monitoring, synchronous replication and synchronous_commit, hot standby query conflicts and hot_standby_feedback, read-replica routing and read-after-write, logical replication (publications, subscriptions, conflicts, failover slots), HA tools (Patroni, pg_auto_failover, CloudNativePG), split brain, and failback with pg_rewind. Use for any replica, failover, or logical replication task.
Ships in ai-stuff. 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.
A playbook distilled from Scaling Postgres and its replication tutorials. Evidence and version history are in reference.md. Related skills:
postgres-backup-recovery.postgres-upgrades.pg_basebackup -R (writes primary_conninfo and
standby.signal on PG12+).pg_hba.conf entry, and hot_standby = on.wal_log_hints = on or data checksums now if you ever want
pg_rewind.max_slot_wal_keep_size. An inactive slot otherwise retains
WAL until the disk fills and the primary stops.active = false.pg_wal by hand.-- on the primary
SELECT application_name, state, sync_state,
pg_wal_lsn_diff(pg_current_wal_lsn(), replay_lsn) AS replay_bytes,
write_lag, flush_lag, replay_lag
FROM pg_stat_replication;
SELECT slot_name, active,
pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) AS retained_bytes
FROM pg_replication_slots;
synchronous_standby_names = 'ANY 1 (a, b)') with standbys close to the
primary, because every commit waits for the round trip.synchronous_commit can be set per transaction or role, to match each
workload's durability. The ladder is off → local → remote_write → on
→ remote_apply.hot_standby_feedback = on reduces cancellations but moves bloat to the
primary.max_standby_streaming_delay trades replica lag for fewer cancellations.WAIT FOR LSN, or compare LSNs yourself).ALTER SUBSCRIPTION ... SKIP only deliberately.REPLICA IDENTITY for UPDATE/DELETE.target_session_attrs=read-write.pg_rewind (it needs
wal_log_hints or checksums) rather than a full re-clone. Expect lost
async transactions.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub pauldotsh/ai-stuff --plugin ai-stuff25 skills in this plugin
/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary./dispatching-parallel-agentsUse ONLY when the developer has explicitly told you to dispatch subagents — never infer or self-authorize it. Splits 2+ independent tasks across isolated subagents, assigns them cheap models, and polls at a per-harness cadence that preserves prompt cache (Claude Code vs Codex/opencode).Other plugins' skills for the same job