Use when long-lived agents, project memories, system prompts, or playbooks are repeatedly summarized, rewritten, or optimized and risk losing domain detail, provenance, or execution learnings.
日本語の概要は準備中です。原文の説明を表示しています。
Use when PostgreSQL logical replication slots retain WAL, become orphaned or invalid after switchover, or must be proven synchronized and usable before failover.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Diagnose logical-slot ownership, WAL retention, and failover readiness without turning an uncertain slot into data loss. Start read-only. A slot that looks inactive may still belong to a stopped consumer; a synchronized standby slot may exist but still be temporary or invalidated.
wal_status, safe_wal_size, synced, or invalidation_reason indicate risk.pg_replication_slots columns do not match this runbook; use version-specific documentation first.Run on each relevant PostgreSQL 17+ node and preserve timestamps:
SELECT slot_name, slot_type, database, active, active_pid,
restart_lsn, confirmed_flush_lsn, wal_status, safe_wal_size,
failover, synced, temporary, inactive_since,
conflicting, invalidation_reason
FROM pg_replication_slots
ORDER BY slot_name;
Measure retained WAL on a writable primary or demoted primary:
SELECT slot_name,
pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)::numeric AS retained_wal_bytes
FROM pg_replication_slots
WHERE slot_type = 'logical' AND restart_lsn IS NOT NULL;
Do not infer deletion safety from active = false. Correlate slot name, database, plugin, publication/subscription, consumer deployment, and the consumer's durable offset.
For a redacted offline classification:
python3 scripts/analyze_slots.py --input observations/slot-snapshot.json
The helper never connects to PostgreSQL and always reports mutation_permitted: false.
Record UTC timestamp, node identity, server role, PostgreSQL version, timeline, cluster manager, recent promotion/demotion, disk free bytes, WAL generation rate, and every logical consumer. Capture the query above on all relevant nodes before changing traffic or slots.
Completion: each node and slot has a unique identity, role, timestamp, and expected consumer owner.
Measure retained_wal_bytes, filesystem free bytes, and WAL growth at least three times. safe_wal_size estimates bytes that can be written before a slot risks becoming lost when retention is bounded; NULL is not automatically safe because it can also occur for an already-lost slot. Interpret it with wal_status and invalidation_reason.
Classify:
reserved or extended: WAL is still retained, but extended is already beyond max_wal_size.unreserved: required WAL is no longer guaranteed and may be removed at the next checkpoint.lost or non-NULL invalidation_reason: the slot is unusable for normal continuation.Completion: record a measured disk-exhaustion deadline and a separate slot-loss boundary; do not substitute one for the other.
For every inactive slot, identify the subscriber, connector, job, or application that created it. Compare configured slot names and durable consumer offsets. Check whether the consumer is intentionally stopped, restarting, migrated, or pointed at the new primary.
An inactive, unowned, WAL-retaining slot is only an orphan candidate. It is not deletion authorization.
Completion: ownership is confirmed, explicitly denied by all plausible owners, or marked unresolved with escalation contacts.
On the subscriber, inventory the primary slot and table-synchronization slots required by that subscriber. On the standby, require every required slot to exist and satisfy:
synced = true AND temporary = false AND invalidation_reason IS NULL
Also verify the standby is ahead of the subscriber as required by the official failover procedure. Slot synchronization is asynchronous; existence alone is insufficient. A synchronized standby slot cannot be used for logical decoding or manually dropped while it remains a synced standby slot.
Completion: the complete required-slot set passes the readiness predicate and position check on the intended promotion target.
| Evidence | Classification | Safe next step |
|---|---|---|
| Demoted primary, inactive, owner unknown, retained WAL grows | Orphan candidate | Identify owner; protect disk; require approval before mutation |
| Standby slot missing, unsynced, temporary, or invalidated | Failover not ready | Stop planned promotion for that consumer; repair synchronization |
wal_status=lost or invalidation reason set | Unusable slot | Use the consumer's approved re-snapshot/recovery path |
| Owner confirmed but consumer stopped | Inactive owned | Restore/reconcile consumer before considering slot action |
| Healthy primary slot lacks failover enablement | Not failover enabled | Plan and test failover-slot configuration before switchover |
Completion: every logical slot has one classification, supporting fields, and a named decision owner.
Never automatically drop or advance a slot, alter a subscription, promote a standby, or copy slot state by filesystem manipulation.
Completion: recovery has a bounded window, rollback, owner, and evidence that consumer data continuity is preserved.
Re-capture all slot rows and positions. Confirm the consumer resumes from the intended point, retained WAL decreases or stabilizes, no slot becomes invalidated, disk headroom recovers, and old-primary slots are reconciled by the cluster manager's supported lifecycle.
Completion: representative changes arrive exactly once at the downstream system, WAL remains within the documented reserve under normal traffic, and a repeated failover drill passes.
{
"schema_version": 1,
"server_role": "demoted_primary",
"warning_threshold_bytes": 1073741824,
"slots": [{
"slot_name": "orders_cdc",
"slot_type": "logical",
"active": false,
"failover": true,
"synced": false,
"temporary": false,
"invalidation_reason": null,
"wal_status": "extended",
"safe_wal_size": 2147483648,
"retained_wal_bytes": 42949672960,
"consumer_owner_confirmed": false
}]
}
Use only redacted metadata. Do not include connection strings, credentials, captured row data, or consumer secrets.
pg_wal, copy replication-slot directories, or edit PostgreSQL system catalogs.Pass only when all are true:
synced AND NOT temporary AND invalidation_reason IS NULL and the position check.active=false means no process currently streams the slot; it does not mean the slot is abandoned.synced=true alone does not prove failover readiness.safe_wal_size=NULL is context-dependent; inspect wal_status and invalidation.See references/evaluations.md for normal, difficult-edge, and should-not-activate prompts with deterministic assertions.
Sourced facts about failover-slot synchronization, readiness, and pg_replication_slots fields come from PostgreSQL 18 documentation, accessed 2026-07-29. Factual demand evidence comes from CloudNativePG and Debezium issue reports. The classification table, evidence sequence, thresholds, snapshot schema, and helper are original operational recommendations, not PostgreSQL guarantees.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Use when long-lived agents, project memories, system prompts, or playbooks are repeatedly summarized, rewritten, or optimized and risk losing domain detail, provenance, or execution learnings.
日本語の概要は準備中です。原文の説明を表示しています。
Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.
日本語の概要は準備中です。原文の説明を表示しています。
Adds educational comments to a code file so it becomes a learning resource, asking for the file (with a list of close matches) if none is given. Use when preparing code for learners, onboarding, or teaching.
日本語の概要は準備中です。原文の説明を表示しています。
Write, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX). Use when creating or modifying scripts that manipulate documents, layers, paths, text frames, colors, symbols, artboards, or any Illustrator DOM objects. Covers the complete JavaScript object model, coordinate system, measurement units, export workflows, and scripting best practices.
日本語の概要は準備中です。原文の説明を表示しています。
Patterns and techniques for adding governance, safety, and trust controls to AI agent systems. Use this skill when: - Building AI agents that call external tools (APIs, databases, file systems) - Implementing policy-based access controls for agent tool usage - Adding semantic intent classification to detect dangerous prompts - Creating trust scoring systems for multi-agent workflows - Building audit trails for agent actions and decisions - Enforcing rate limits, content filters, or tool restrictions on agents - Working with any agent framework (PydanticAI, CrewAI, OpenAI Agents, LangChain, AutoGen)
日本語の概要は準備中です。原文の説明を表示しています。
Check any AI agent codebase against the OWASP Agentic Security Initiative (ASI) Top 10 risks. Use this skill when: - Evaluating an agent system's security posture before production deployment - Running a compliance check against OWASP ASI 2026 standards - Mapping existing security controls to the 10 agentic risks - Generating a compliance report for security review or audit - Comparing agent framework security features against the standard - Any request like "is my agent OWASP compliant?", "check ASI compliance", or "agentic security audit"
日本語の概要は準備中です。原文の説明を表示しています。