AGENT SKILL

k8s-investigation

Gather read-only evidence about an unhealthy Kubernetes workload — the snapshot mechanics (get/describe/logs/events) that back a triage. Use whenever you need to collect cited kubectl evidence for a pod/deployment/service before diagnosing it, without mutating the cluster.

使用场景运维与部署
License 许可
MIT
所属仓库
blouargant/omnis
最近更新
2026-11-10
Stars
★ 0
Forks
0

01 前言 Front Matter

name
k8s-investigation
metadata
{ "tags": "kubernetes, investigation, evidence, kubectl, read-only, playbook", "author": "blouargant@chapsvision.com" }
description
Gather read-only evidence about an unhealthy Kubernetes workload — the snapshot mechanics (get/describe/logs/events) that back a triage. Use whenever you need to collect cited kubectl evidence for a pod/deployment/service before diagnosing it, without mutating the cluster.

03 SKILL.md 正文

Kubernetes Investigation

This skill is the read-only evidence-gathering procedure that backs a triage. It is the mechanics half of a K8s incident: how to snapshot a workload's state efficiently and report a compact, cited brief. The decision half — classifying the failure and proposing a fix — lives in the k8s-triage skill. This skill never mutates the cluster.

It assumes either:

  • a kubectl binary is reachable through the Bash tool, or
  • a Kubernetes MCP server is mounted (preferred — it gives structured output and respects permissions).

If neither kubectl nor Kubernetes MCP is available, stop command-based investigation and ask the user for manual evidence (for example: kubectl get output, describe pod, recent events, and the last 200 log lines).

Procedure

  1. Confirm the cluster context. If the caller (leader or user) named a target context, thread it as --context=<ctx> on every kubectl command below and quote it back. Otherwise run kubectl config current-context (or the MCP equivalent) and quote that. Never run kubectl config use-context — it rewrites the shared kubeconfig default and disturbs other sessions; the per-command --context=<ctx> flag is read-only, needs no approval, and is scoped to this investigation.

  2. Locate the workload. Namespace + name + selector. Ask if unknown.

  3. Snapshot the state. In one batch of read-only calls (prefix each with --context=<ctx> when a target context was chosen):

    • kubectl get deploy/sts/ds <name> -n <ns> -o wide
    • kubectl get pods -n <ns> -l <selector> -o wide
    • kubectl describe pod <pod> (the most recent unhealthy one)
    • kubectl logs <pod> --previous --tail=200
    • relevant kubectl get events -n <ns> --sort-by=.lastTimestamp | tail

    Bound output: use -o jsonpath/grep, --since/--tail and label selectors rather than dumping whole streams.

  4. Report a compact evidence brief, not a raw dump: findings, the exact commands run and the decisive output excerpts (pod phase, restart count, container state/reason, last event, probe failures, image-pull errors, OOMKilled, …), your confidence, and any open questions. Quote only the lines that matter. Do not classify or propose a fix — that is the triage/leader step.

When logs get large

If the investigation becomes log-heavy (log output exceeds about 5,000 lines or ~5 MB, no clear anchors after scanning at least 2,000 recent lines, or the same pod restarts 3+ times within 30 minutes), load k8s-log-investigation and follow its token-efficient anchor-first workflow.

Read boundary

  1. Never mutate. No apply, delete, scale, edit, patch, rollout, cordon, drain, replace, or write-exec. If a fix needs a mutation, list it under "recommended actions" for the caller to decide — do not execute it.
  2. Access boundaries. If RBAC denies a read, escalate — do not retry with a different account.

04 同仓库更多 Skills

blouargant
blouargant/omnis

skill-creator

Create or update a skill playbook (SKILL.md) for the agent. Use when the user wants to create a new skill, add a skill, define a new agent capability, update an existing skill, edit a skill, refine a skill playbook, or specialise the agent for a new domain.

Skill与智能体开发
★ 0
blouargant
blouargant/omnis

review

Review a body of work (source code, configuration, documents, infra manifests, …) for correctness, clarity, and obvious risks. Use this skill whenever the user asks for a review, audit or critique.

★ 0
blouargant
blouargant/omnis

pdf

Fallback PDF text extractor using pdftotext (poppler). Use ONLY when the preferred `liteparse` skill is unavailable or for a quick plain-text dump of a simple text PDF — for the best PDF parsing (scanned, multi-column, layout-heavy, or non-PDF formats) prefer the `liteparse` skill.

文档处理
★ 0
blouargant
blouargant/omnis

pandoc

This skill should be used when converting documents between formats (Markdown, DOCX, PDF, HTML, LaTeX, etc.) using pandoc. Use for format conversion, document generation, and preparing markdown for Google Docs or other word processors.

文档处理Skill与智能体开发
★ 0
blouargant
blouargant/omnis

liteparse

Preferred local parser for extracting text from PDFs, images, and scanned/layout-heavy documents (OCR, screenshots, complex PDFs) — far better than pdftotext. Use this FIRST for any PDF, image, or OCR text-extraction or conversion task. NOTE for Office documents (DOCX, PPTX, XLSX, ODT) — for plain text extraction prefer the `pandoc` skill, which needs no LibreOffice; only use LiteParse for Office docs when you need its layout/OCR/screenshot output. The `pdf` skill (pdftotext) is only a fallback for when LiteParse cannot be installed.

行政与办公人员文档处理演示文稿
★ 0
blouargant
blouargant/omnis

linux-admin

Safely make a change to a Linux workstation — install/remove packages, manage systemd services and timers, edit and validate configuration files, manage users/permissions and networking. Detect the distro and package manager, determine whether the target is package-managed or hand-maintained, preview or simulate every change, back up configs before editing, and prefer the package manager and drop-in overrides so the host stays consistent and secure. Use whenever a change to the local Linux host is required (install, remove, enable, disable, start, stop, edit a config, add a user, change permissions or networking).

★ 0