Postgres AIops

SKILL运维和基础设施
运维和基础设施 未标注权限 许可证不明确 已核验
安装这个技能

Use this skill whenever the user needs to operate or troubleshoot a PostgreSQL server/cluster as a DBA — a one-shot cluster health overview; server reads (version/uptime, settings, extensions, databases, roles); activity (sessions, idle-in-transaction, long-running queries, locks); query stats (pg_stat_statements top-N, EXPLAIN a statement); index health (unused indexes, missing-index hints, bloat, invalid/duplicate); table health (sizes, dead-tuple bloat, autovacuum status); replication (standby lag, replication slots, WAL); three flagship analyses — slow-query RCA (worst pg_stat_statements entry + EXPLAIN → cause/action), bloat & vacuum analysis (dead tuples + autovacuum lag → recommendation), and blocking lock-chain RCA (build the wait-for tree, name the root blocker); and guarded writes (terminate a backend, cancel a query, VACUUM/ANALYZE, create/drop an index, REINDEX, ALTER SYSTEM SET a parameter, reset query stats). Always use this skill for "postgres health check", "why is this query slow", "pg_stat_statements top queries", "EXPLAIN this", "table/index bloat", "which indexes are unused", "missing index", "autovacuum status", "who is blocking whom", "kill the backend holding the lock", "replication lag", "replication slots", "VACUUM this table", "create/drop an index", or "ALTER SYSTEM SET work_mem" when the context is a PostgreSQL database. Do NOT use when the target is OT / industrial equipment (Modbus, OPC-UA, PLCs — use industrial-aiops), a hypervisor, a storage appliance, a backup product, a container/cluster orchestrator, or a non-PostgreSQL database (negative routing hints only). Covers common PostgreSQL DBA operations with a built-in governance harness (audit, token budget, undo, risk-tiers). Beyond the mock suite, the reads plus a governed write and its undo have been exercised against a live PostgreSQL 16.14 instance (see docs/VERIFICATION.md).

一句话选型结论

按资料字段整理

Postgres AIops是运维和基础设施类的 Agent Skill,安装方式:ClawHub 市场,权限级别未标注,许可证不明确,有可直接复制的安装命令。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类运维和基础设施 安装方式ClawHub 市场 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 未标注 仓库 未标注
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

ClawHub 市场
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
skillhub install user_993b98b1/postgres-aiops
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    执行上面的命令安装;也可以把仓库里的 SKILL.md 手动放进客户端的 skills 目录。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

运维和基础设施
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方user_993b98b1仓库 未标注 · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式ClawHub 市场安装包 clawhub
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 1791737589
正文体量15.5 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
查服务与日志

按现象定位服务状态与日志线索。

写部署与巡检脚本

把重复的部署、巡检写成脚本。

故障排查

按步骤排查网络、依赖与配置。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 已做过站内核验,页面字段与仓库对得上。
  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在运维和基础设施场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
Postgres AIops当前 未标注权限 ClawHub 市场 未标注 未标注 有
Azure 部署 调用外部服务 GitHub 仓库 664.2 万 Codex、Claude、Cursor 有
Azure diagnostics 问题管理 调用外部服务 GitHub 仓库 657.6 万 Codex、Claude、Cursor 有
Azure aigateway 部署 调用外部服务 GitHub 仓库 655.3 万 Codex、Claude、Cursor 有
Azure AI 搜索 调用外部服务 GitHub 仓库 651.4 万 Codex、Claude、Cursor 有
Azure Cloud migrate 部署 调用外部服务 GitHub 仓库 650.7 万 Codex、Claude、Cursor 有

SKILL.md 全文

15.5 KB
模型实际读到的说明书原文,来自技能仓库

Postgres AIops

> Disclaimer: Community-maintained open-source project, not affiliated with, endorsed by, or sponsored by the PostgreSQL Global Development Group or any vendor. "PostgreSQL" and related trademarks belong to their owners. Source at github.com/AIops-tools/Postgres-AIops under the MIT license.

Governed PostgreSQL DBA operations — 35 MCP tools, every one wrapped with the bundled @governed_tool harness: a local unified audit log under ~/.postgres-aiops/, token/runaway budget guard, undo-token recording, and descriptive risk-tier labels. The role password is stored encrypted (~/.postgres-aiops/secrets.enc, Fernet + scrypt) — never plaintext on disk.

> Standalone: the governance harness is bundled in the package (postgres_aiops.governance) — postgres-aiops has no external skill-family dependency. Beyond the mock suite, the reads plus a governed write and its undo have been exercised against a live PostgreSQL 16.14 instance (see docs/VERIFICATION.md).

What This Skill Does

Domain Tools Count Read or Write
Overview cluster health snapshot 1 1 read
Server version, settings, extensions, databases, roles 5 5 read
Activity sessions, long-running queries, locks 3 3 read
Queries top-N (pg_stat_statements), EXPLAIN 2 2 read
Indexes unused, missing hints, bloat, invalid/duplicate 4 4 read
Tables sizes, dead-tuple bloat, autovacuum status 3 3 read
Replication status/lag, slots, WAL 3 3 read
Analysis (flagship) slow-query RCA, bloat/vacuum, blocking chains 3 3 read
Writes terminate, cancel, drop-index 3 3 write (high)
vacuum, analyze, create-index, reindex, ALTER SYSTEM, reset-stats 6 6 write (medium)

The flagship analyses accept injected records for pure/offline analysis, or pull live from a configured target. top_queries / slow_query_rca require the pg_stat_statements extension; the read role should have pg_monitor.

Quick Install

uv tool install postgres-aiops
postgres-aiops init       # interactive wizard: connection + encrypted password
postgres-aiops doctor

Or as an OpenClaw plugin, which installs this skill and its MCP server together:

openclaw plugins install clawhub:@zw008/postgres-aiops
openclaw skills info postgres-aiops          # expect: Visible to model: yes

Needs uvx on PATH: the MCP server is fetched with uv, pinned to this release.

When to Use This Skill

  • Triage a cluster (overview): version/uptime, connections by state, idle-in-transaction, longest query, worst bloat, replica lag
  • Root-cause a slow query (analyze slow-query / slow_query_rca): the worst pg_stat_statements entry + EXPLAIN → cited cause and action
  • Decide what to vacuum (analyze bloat-vacuum / bloat_and_vacuum_analysis): tables ranked by dead-tuple ratio + autovacuum lag
  • Untangle a lock pile-up (analyze blocking / blocking_lock_chain_rca): the wait-for tree with the root blocker named
  • Find unused / missing / bloated indexes; check autovacuum status and table sizes; inspect replication lag and slots
  • Terminate/cancel a backend, VACUUM/ANALYZE, create/drop an index (reversible), REINDEX, or ALTER SYSTEM SET — all with dry-run + double-confirm

Do NOT use when the target is OT/industrial equipment (use industrial-aiops), a hypervisor, a storage appliance, a backup product, a container cluster, or a non-PostgreSQL database.

Related Skills — Skill Routing

If the user wants… Use
PostgreSQL DBA-ops: slow queries, bloat, locks, index/vacuum maintenance postgres-aiops (this skill)
OT / industrial edge (Modbus, OPC-UA, PLC, PROFINET) the industrial-aiops line
Hypervisor VM lifecycle (power, snapshot, migrate) a hypervisor ops skill
Container/cluster lifecycle a cluster ops skill

Common Workflows

"The app got slow this afternoon" — root-cause and add the missing index

  1. postgres-aiops overview → one-shot cluster picture: connections, database sizes, obvious saturation
  2. postgres-aiops analyze slow-query → the worst pg_stat_statements entry with cited findings (seq scan, low cache-hit ratio, temp spill, high call count) and a concrete action for each
  3. postgres-aiops query explain "<sql>" → confirm the plan yourself; a Seq Scan on a large table is the index signal
  4. postgres-aiops index missing → the tool's own index hints, to cross-check that step 3's conclusion is not a one-off
  5. postgres-aiops remediate create-index <table> <col> --concurrently --dry-run → preview the exact DDL; then run without --dry-run (double confirmation). create_index is reversible — an inverse drop_index is recorded
  6. postgres-aiops query reset then re-run analyze slow-query after a while → confirm the query actually dropped out of the top, rather than assuming
  7. Failure branch: if the new index does not help, or --concurrently left an INVALID index (postgres-aiops index invalid), roll it back with postgres-aiops undo list → postgres-aiops undo apply <id>. An invalid index still costs writes — drop it rather than leaving it behind.

Reclaim table bloat and retire a redundant index (reversible)

  1. postgres-aiops analyze bloat-vacuum → tables ranked by dead-tuple ratio and autovacuum lag, each citing the measured numbers
  2. postgres-aiops table autovacuum → check whether autovacuum is simply behind (last run, thresholds) before doing it by hand
  3. postgres-aiops remediate vacuum <table> --analyze --dry-run → preview; then run for real to VACUUM ANALYZE (double confirmation)
  4. postgres-aiops index unused and postgres-aiops index bloat → find indexes that cost writes and return nothing
  5. postgres-aiops remediate drop-index <name> --concurrently --dry-run, then for real → the tool captures pg_get_indexdef before dropping and records an inverse recreate descriptor
  6. Failure branch: dropped the wrong index — postgres-aiops undo apply <id> recreates it from the captured definition (not a guess). Note --full on remediate vacuum takes an exclusive lock and rewrites the table; it has no undo, so never reach for it as a first response on a live table.

Break a blocking pile-up during an incident

  1. postgres-aiops analyze blocking → the wait-for chain, naming the root blocker pid rather than the visible victims
  2. postgres-aiops activity locks → the raw lock rows behind the chain; confirm the blocker is what the RCA says it is
  3. postgres-aiops activity long --min-seconds 60 → how long the blocker has actually been running, and whether it is idle-in-transaction
  4. postgres-aiops remediate cancel <pid> --dry-run → preview; then for real. Cancel before terminate — cancel ends the query, terminate kills the whole backend and rolls back its transaction
  5. Only if cancel does not clear it: postgres-aiops remediate terminate <pid> (double confirmation)
  6. Failure branch: both cancel_query and terminate_backend declare no undo — a killed session cannot be restored. The audit row in ~/.postgres-aiops/audit.db captures the prior query text and state for the incident write-up. If the same blocker reappears, the fix is upstream (application transaction scope), not another terminate.

Tune a parameter and prove it moved the needle (reversible)

  1. postgres-aiops server settings work_mem → the current value and where it came from
  2. postgres-aiops analyze slow-query → confirm a temp-spill finding is what actually motivates the change
  3. postgres-aiops remediate set work_mem 64MB --dry-run → preview the ALTER SYSTEM SET; then run for real (double confirmation) — the prior value is captured and an inverse update_setting is recorded
  4. Reload/restart per the parameter's context, then postgres-aiops server settings work_mem to confirm the value took effect
  5. Failure branch: if the change causes memory pressure, postgres-aiops undo apply <id> restores the prior value. ALTER SYSTEM only writes postgresql.auto.conf — a parameter with context = postmaster needs a restart, so a "successful" write that did not change behaviour usually means the restart is still pending, not that the tool failed.

Offline analysis (no live cluster)

  1. Export pg_stat_statements, table-bloat, and blocking-pair rows to JSON
  2. Feed them straight to the analysis tools — slow_query_rca(statements=[...]), bloat_and_vacuum_analysis(tables=[...]), blocking_lock_chain_rca(pairs=[...]) — no connection or credentials required
  3. Failure branch: a tool that rejects the injected rows means the export is missing the columns the analysis needs (calls/total_time/rows, dead-tuple counts, blocked/blocking pids) — re-export rather than hand-editing, so the findings stay traceable to the cluster.

Governance & Safety

The skill delivers reads and writes and records them; it does not decide whether a write is
permitted. That is your agent's judgement, or the permission of the account you connect it with
(connect with a PostgreSQL role that has no write privileges (a read-only role, or one without
INSERT/UPDATE/DELETE/DDL) — writes then fail at the server). There is no read-only switch, policy
file, or approval gate.

  • Audit is the guarantee, and it is not bypassable. Every operation — MCP and CLI alike — is logged to ~/.postgres-aiops/audit.db (relocatable via POSTGRES_AIOPS_HOME): params, result, status, duration, and the risk tier. The CLI writes the same row the MCP path does.
  • POSTGRES_AUDIT_APPROVED_BY / POSTGRES_AUDIT_RATIONALE are optional annotations recorded on the audit row (who/why); they are never required and never block.
  • Runaway guard — a safety backstop, not authorization: the same call looped in a tight window trips a circuit breaker. Disable with POSTGRES_RUNAWAY_MAX=0.
  • Writes support --dry-run / dry_run=True and double confirmation at the CLI.
  • Reversible writes fetch the real before-state and record an inverse descriptor; irreversible ops (terminate/cancel, vacuum/analyze, reindex, reset stats) record prior stats only.
  • All values are bound query parameters; identifiers that cannot be parameterised are validated and quoted.

References

  • references/capabilities.md — full tool + field reference
  • references/cli-reference.md — CLI command reference
  • references/setup-guide.md — onboarding, credentials, and connectivity

常见问题

5 问
答案由本站依据条目字段整理
Postgres AIops怎么安装?

在支持 Skills 的客户端里执行:skillhub install user_993b98b1/postgres-aiops。安装方式为ClawHub 市场。装完刷新技能列表或重开客户端。

Postgres AIops支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

Postgres AIops权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

Postgres AIops收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

Postgres AIops用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。