Use this skill whenever the user needs to operate a Kubernetes cluster — list/inspect pods, deployments, statefulsets, daemonsets, replicasets, jobs, cronjobs, services, ingresses, endpoints, configmaps, secrets (names/keys only), PVCs/PVs/storageclasses, nodes, namespaces, and events; read pod logs; describe pods/nodes; pod/node top (metrics); read-only diagnostics / RCA (pod-health, workload-readiness); scale deployments/statefulsets; rollout status/history/undo/pause/resume and set image; delete pods/deployments/jobs; create/delete namespaces; and cordon/uncordon/drain nodes. Works with any kubeconfig-reachable cluster (standard Kubernetes, k3s, EKS, GKE, AKS). Always use this skill for "list k8s pods", "scale deployment", "kubernetes pod logs", "describe pod", "why is my pod crashing", "diagnose pods", "which deployments are unhealthy", "rollout undo", "set image", "top pods", "drain node", "cordon node", "restart deployment", "k3s", or "kubectl"-style tasks when the context is exp
Memory
container-host-aiops
Try itUse this skill whenever the user needs to operate a single container host through the Docker Engine API, Portainer, or Podman — a one-shot host overview; container reads (list/inspect, logs tail, CPU/memory stats, top processes, restart summary); image reads (list, inspect with history, dangling, disk usage); volume reads (list, inspect, dangling); network reads (list, inspect); system reads (info, version, df disk-usage, recent events); Portainer stacks + endpoints; Compose-project rollups (list_compose_stacks, docker+podman); Podman pods (list_pods, podman-only); three flagship analyses — restart-loop RCA (crash-looping containers + cause/action), resource-pressure analysis (CPU/memory vs limits), and image & volume bloat (prune candidates + reclaimable bytes); and eight guarded writes (restart/stop/start/remove a container, prune images/volumes, update resource limits, recreate a Portainer stack). Always use this skill for "Docker host overview", "which containers are crash-looping"
What it does
Use this skill whenever the user needs to operate a single container host through the Docker Engine API, Portainer, or Podman — a one-shot host overview; container reads (list/inspect, logs tail, CPU/memory stats, top processes, restart summary); image reads (list, inspect with history, dangling, disk usage); volume reads (list, inspect, dangling); network reads (list, inspect); system reads (info, version, df disk-usage, recent events); Portainer stacks + endpoints; Compose-project rollups (list_compose_stacks, docker+podman); Podman pods (list_pods, podman-only); three flagship analyses — restart-loop RCA (crash-looping containers + cause/action), resource-pressure analysis (CPU/memory vs limits), and image & volume bloat (prune candidates + reclaimable bytes); and eight guarded writes (restart/stop/start/remove a container, prune images/volumes, update resource limits, recreate a Portainer stack). Always use this skill for "Docker host overview", "which containers are crash-looping", "restart loop", "why does this container keep restarting", "container CPU/memory usage", "docker logs", "which containers are near their limits", "resource pressure", "dangling images/volumes", "reclaim disk", "prune images", "stop/start/restart a container", "update a container's memory limit", "Portainer stacks", "compose stacks", "Podman pods" when the context is a Docker, Portainer, or Podman container host. Do NOT use when the target is a cluster orchestrator, a hypervisor, a storage appliance, a backup product, network device config, or OT/industrial equipment — route those to the appropriate other AIops-tools skill. This is for NON-orchestrator container hosts. Governed Docker/Portainer/Podman container-host operations with a built-in governance harness (audit, policy, token budget, undo, risk-tiers). Exercised against a live Docker Engine 27.5.1 daemon (doctor, overview, the three flagship analyses, and a governed stop_container with audit + undo recorded); the Portainer and
The skill document
Container Host AIops
Disclaimer: Community-maintained open-source project, not affiliated with, endorsed by, or sponsored by Docker, Inc., Portainer.io, or any container-platform vendor. Product and trademark names belong to their owners. Source at github.com/AIops-tools/Container-Host-AIops under the MIT license.
Governed Docker + Portainer + Podman container-host operations — 38 MCP tools, every one wrapped with the bundled @governed_tool harness: a local unified audit log under ~/.container-host-aiops/ (MCP + CLI alike), a runaway/budget safety guard, and undo-token recording. It records every operation; whether a write is permitted is the agent's or the account's call, not the skill's. A Docker target speaks the Docker Engine API over a unix socket or TCP; a Portainer target speaks the Portainer API (and proxies Docker); a Podman target speaks over its rootful/rootless socket (Docker-compat + libpod). The Portainer API token is stored encrypted (~/.container-host-aiops/secrets.enc, Fernet + scrypt) — never plaintext on disk; a local Docker/Podman socket needs no secret.
Standalone: the governance harness is bundled in the package (
container_host_aiops.governance) — container-host-aiops has no external skill-family dependency. Verification: Exercised against a live Docker Engine 27.5.1 daemon (doctor, overview, the three flagship analyses, and a governed stop_container with audit + undo recorded); the Portainer and Podman API paths are covered by the mock suite only. Seedocs/VERIFICATION.md.
What This Skill Does
| Domain | Tools | Count | Read or Write |
|---|---|---|---|
| Overview | one-shot host health | 1 | 1 read |
| Containers | list/inspect, logs, stats, top, restart summary | 6 | 6 read |
| Images | list, inspect (+history), dangling, disk usage | 4 | 4 read |
| Volumes | list, inspect, dangling | 3 | 3 read |
| Networks | list, inspect | 2 | 2 read |
| System | info, version, df, events | 4 | 4 read |
| Stacks | endpoints, stacks, stack detail (Portainer), compose-stack rollup (docker+podman) | 4 | 4 read |
| Pods (Podman) | list pods (libpod) | 1 | 1 read |
| Analyses (flagship) | restart-loop RCA, resource pressure, image/volume bloat | 3 | 3 read |
| Writes | remove container, prune images, prune volumes, recreate stack | 4 | 4 write (high) |
| restart, stop, start, update container | 4 | 4 write (medium) |
The three analyses accept injected data for offline analysis, or pull live from a configured target. Portainer endpoints/stacks require a portainer target; list_compose_stacks works on docker or podman; list_pods requires a podman target.
Quick Install
uv tool install container-host-aiops
container-host-aiops init # interactive wizard: Docker/Podman socket or Portainer target
container-host-aiops doctor
When to Use This Skill
- Triage a host (
overview): version + container state rollup + disk headline - Find crash-looping containers (
analyze restart-loop/restart_loop_rca): ranked by restart count with a likely cause and action from the exit code, plus a log tail - Spot resource pressure (
analyze resource-pressure/resource_pressure_analysis): CPU%/mem% vs each container's limits, worst first, with a recommendation - Reclaim disk (
analyze bloat/image_and_volume_bloat): dangling images + volumes + build cache as prune candidates with reclaimable bytes - List/inspect containers, images, volumes, networks; tail logs; read stats/top
- Restart/stop/start a container, update its resource limits (reversible), remove a container, prune images/volumes, or recreate a Portainer stack — all with dry-run + double-confirm
Do NOT use when the target is a cluster orchestrator, a hypervisor, a storage appliance, a backup product, network device config, or OT/industrial equipment.
Related Skills — Skill Routing
| If the user wants… | Use |
|---|---|
| Docker / Portainer single-host container ops | container-host-aiops (this skill) |
| A cluster orchestrator's workloads/rollouts | a cluster ops skill |
| Hypervisor VM lifecycle (power, snapshot, migrate) | a hypervisor ops skill |
| OT / industrial edge (Modbus, OPC-UA, PLC) | the industrial-aiops line |
Common Workflows
1. A container is crash-looping
container-host-aiops doctor→ confirm the socket/endpoint is reachable before you trust any read.container-host-aiops analyze restart-loop→ containers ranked by restart count, each with a likely cause read off the real exit code (137 OOM/SIGKILL, 143 SIGTERM, 139 segfault, 127 bad entrypoint, …), a recommended action, and a log tail.container-host-aiops container logs --tail 200→ read the actual crash output;container-host-aiops container inspect→ confirm the exit code, restart policy, and configured limits the RCA cited.- If the cause is memory:
container-host-aiops analyze resource-pressure --mem 75→ see how close the container runs to its ceiling, thencontainer-host-aiops manage update '{"Memory": 1073741824}' --dry-runand re-run without--dry-run(double-confirm; the write captures the prior limits as its undo descriptor). container-host-aiops manage restart→ bring it up on the new limit, then re-runanalyze restart-loopto confirm the loop stopped.- Failure branch: if it still loops, the limit was not the cause — reverse the
change with
container-host-aiops undo list→undo apply(restores the prior limits, not a guess) and go back to step 3 with the fresh log tail. If the container will not stop at all,manage remove --force --dry-runfirst: force-remove is high-risk and irreversible, so read the dry-run before committing.
2. The host is out of disk
container-host-aiops system df→ where the space actually went (images vs containers vs volumes vs build cache).container-host-aiops analyze bloat→ dangling images, dangling volumes, and build cache as ranked prune candidates with reclaimable bytes per item.container-host-aiops image danglingandcontainer-host-aiops volume dangling→ eyeball the concrete list before deleting anything. A "dangling" volume holding data you still want is the classic way this goes wrong.container-host-aiops manage prune-images --dry-run→ exactly what would be removed; re-run without--dry-run(double-confirm, high risk).container-host-aiops manage prune-volumes --dry-run→ read this one carefully; volume pruning destroys data and records no undo. Note that Docker's default prune removes only ANONYMOUS unused volumes — the preview reports the named unused ones it will not touch asalsoUnusedNamed*; add--allto include them. Only then re-run for real.container-host-aiops system dfagain → confirm the space came back.- Failure branch: pruning is not reversible. If you removed a volume you needed, the undo store cannot help — restore from your backup. The dry-run in steps 4–5 is the only safety net, which is why both are separate confirm-gated steps.
3. "Everything on this box is slow"
container-host-aiops overview→ one-shot: platform/version, container counts by state, and the headline resource picture.container-host-aiops analyze resource-pressure --cpu 80 --mem 80→ running containers ranked against their own limits, each row citing the measured percentage rather than a verdict.container-host-aiops container statsandcontainer-host-aiops container top→ confirm the top offender at the process level before you act on it.container-host-aiops system events→ correlate the pressure with what changed (a recent deploy, restart storm, or image pull).- Act on the worst offender:
manage update '{"NanoCpus": 2000000000}'to cap it (dry-run first, undo-recorded), ormanage stopto shed it entirely. - Failure branch: if capping the top container just moves the pressure elsewhere,
the host is genuinely undersized rather than misconfigured — reverse your change with
undo applyso you are not left with a half-applied limit, and take the sizing result to whoever owns capacity.
4. Stack drift after a bad deploy (Portainer)
container-host-aiops stack endpoints→ the endpoints this Portainer manages;container-host-aiops stack list→ the stacks on the one you care about.container-host-aiops stack detail→ the stack's current definition;container-host-aiops stack compose→ the compose file it is running from.container-host-aiops container list --runningandcontainer-host-aiops container restarts→ which of the stack's containers are actually unhealthy versus merely restarted.container-host-aiops manage recreate-stack --dry-run→ preview the redeploy; re-run without--dry-run(double-confirm, high risk).- Validate with
container-host-aiops overviewandanalyze restart-loop. - Failure branch:
recreate-stackredeploys from the stack's stored definition — if that definition is itself the broken thing, recreating will faithfully reproduce the breakage. Fix the compose source in Portainer first, and usecontainer-host-aiops undo listto check what the session already changed before layering another write on top.
Offline analysis (no live host)
Pass data straight to the analysis tools — restart_loop_rca(containers=[...]), resource_pressure_analysis(samples=[...]), or image_and_volume_bloat(dangling_images=..., dangling_volumes=..., df=...) — to analyse an exported dataset without connecting to a host.
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 (a read-only Docker socket, a Portainer account without write scope — 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
~/.container-host-aiops/audit.db(relocatable viaCONTAINER_HOST_AIOPS_HOME): params, result, status, duration, and the risk tier. The CLI writes the same row the MCP path does. CONTAINER_HOST_AUDIT_APPROVED_BY/CONTAINER_HOST_AUDIT_RATIONALEare 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
CONTAINER_HOST_RUNAWAY_MAX=0. - Writes support
--dry-run/dry_run=Trueand double confirmation at the CLI; prune previews list what would be removed + reclaimable bytes. - Mutating/reversible writes fetch the real before-state and record an inverse descriptor (stop→start, update_container→restore prior limits); irreversible ops record only the before-state.
References
references/capabilities.md— full tool + field referencereferences/cli-reference.md— CLI command referencereferences/setup-guide.md— onboarding, credentials, and connectivity
Related skills
Use this skill whenever the user needs to manage VMs and containers on Proxmox VE — list/inspect/configure VMs, power and lifecycle (start/stop/shutdown/reboot/reconfigure/clone/delete/migrate), snapshots (create/delete/list/rollback), disk grow/move, vzdump backups (create/list/restore), LXC containers (list/start/stop), cluster/node status, cluster resource inventory, async task polling + logs, free-VMID lookup, HA status, resource pools, firewall inspection, guest-agent ping, and storage listing. Also use it to diagnose cluster health — rank nodes by CPU/memory/disk pressure and scan guests for saturation (read-only RCA). Always use this skill for "list proxmox vms", "start proxmox vm", "stop proxmox vm", "proxmox snapshot", "proxmox backup", "restore proxmox vm", "resize proxmox disk", "proxmox vm status", "migrate proxmox vm", "proxmox container", "proxmox ha", "proxmox pool", "proxmox firewall", "list proxmox storage", "proxmox node pressure", or "why is proxmox slow" when the co
Use this skill whenever the user needs to operate a self-hosted observability stack on Prometheus (HTTP API + PromQL), Alertmanager, Grafana, or Grafana Loki (logs) — a one-shot overview, PromQL instant/range queries, label + series metadata, scrape-target health (up/down + why) and dropped targets, recording/alerting rule health, firing/pending alerts, Alertmanager alerts + silences, Grafana dashboards/datasources/folders, bounded Loki LogQL log reads (labels, query, error-tail), five flagship analyses (firing-alert RCA, target-scrape-health, alert-noise/flap, log-error-burst RCA, log-volume/cardinality) plus an alert->log cross-signal, and guarded writes (create/expire silence, create annotation, update/delete dashboard, reload Prometheus config). Always use this skill for "Prometheus", "PromQL", "Alertmanager", "Grafana", "Loki", "LogQL", "logs", "which targets are down", "scrape failing", "why is this alert firing", "root cause this alert", "firing alerts", "silence this alert", "n
Use this skill whenever the user needs to operate a managed-endpoint fleet (thin clients, VDI endpoints, centrally-managed devices) — a one-shot fleet health overview, endpoint inventory (list/get), a composite per-endpoint health score (which endpoints are worst?), login & boot sessions, login-storm analysis (detect morning login storms and rank the slowest login/boot contributors), patch/config drift (which endpoints deviate from the fleet baseline), and two guarded writes (assign a config profile, reboot an endpoint). Always use this skill for "endpoint fleet overview", "list managed endpoints", "which endpoints are worst", "endpoint health score", "rank endpoints by risk", "why is login slow this morning", "login storm", "boot time analysis", "patch drift", "config drift", "which endpoints are behind on patches", "assign a profile to an endpoint", or "reboot a thin client" when the context is an endpoint-management fleet. Do NOT use when the target is OT / industrial equipment (Mod
Use this skill whenever the user needs compliance evidence from the audit trails their governed AIops agents already write — mapping AI-agent infra-ops activity to HIPAA §164.312, PCI-DSS v4.0, SOC 2 TSC, or GDPR controls, producing a change-approval report, a gap analysis, an exceptions/anomaly report, or a hash-chain-sealed, tamper-evident evidence bundle. Always use this skill for "compliance evidence", "HIPAA / PCI-DSS / SOC 2 / GDPR evidence", "audit trail report", "coverage for control X", "which controls are we short on / gap analysis", "who approved this change / change-management evidence", "denied or errored ops / anomaly evidence", "seal / sign an evidence bundle", "prove this bundle wasn't altered", or "detect deleted audit rows". Do NOT use to scan or operate infrastructure and do NOT treat it as a GRC platform — it reads the local audit databases the OTHER AIops-tools write and converts them to evidence; for platform operations use those other AIops-tools. Evidence, not c
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