AGENT SKILL

k8s-cleanup

Remove ephemeral Kubernetes diagnostic leftovers the squad created — debug pods, throwaway run pods, one-off jobs, temporary configmaps/secrets — found by the omnis.dev/ephemeral=true label (well-known debug-pod name patterns are surfaced as confirm-first suspects). Removes only ephemeral resources, never real workloads. Use to sweep leftovers at the end of an investigation or on request.

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

01 前言 Front Matter

name
k8s-cleanup
metadata
{ "tags": "kubernetes, cleanup, hygiene, debug pods, ephemeral, playbook", "author": "blouargant@chapsvision.com" }
description
Remove ephemeral Kubernetes diagnostic leftovers the squad created — debug pods, throwaway run pods, one-off jobs, temporary configmaps/secrets — found by the omnis.dev/ephemeral=true label (well-known debug-pod name patterns are surfaced as confirm-first suspects). Removes only ephemeral resources, never real workloads. Use to sweep leftovers at the end of an investigation or on request.

02 资源文件 1

03 SKILL.md 正文

Kubernetes Cleanup

The playbook for sweeping the transient diagnostic resources the squad created and leaving every real workload untouched.

Every deletion is permission-gated — it prompts the user before it runs. Do not try to work around the prompt. If a call is denied, report it and stop.

The ephemeral-resource convention (shared across the squad)

Every transient resource any squad agent creates for diagnosis MUST carry:

  • omnis.dev/ephemeral=true — the primary cleaner selector.
  • omnis.dev/created-by=<agent> — provenance (e.g. k8s_investigator).

The cleaner treats these labels as the only automatic delete signal.

Procedure

  1. Confirm scope. kubectl config current-context; default to the namespace(s) under investigation. If the leader/user named a target context, thread it as --context=<ctx> on every command instead — never kubectl config use-context (it rewrites the shared kubeconfig). Sweep all namespaces (-A) only when explicitly asked, and never delete in a production namespace/context (prod, prd, production) without an explicit override.
  2. Discover labeled ephemerals (removable):
    kubectl get pods,jobs,cm,secret,svc,deploy -n <ns> -l omnis.dev/ephemeral=true -o wide
    
  3. Discover UNLABELED suspects (confirm-first — do NOT auto-delete):
    • kubectl debug leftovers: node-debugger pods (often node-debugger-* in default) and --copy-to copy pods.
    • throwaway kubectl run pods: common debug images (netshoot, busybox, alpine, curl, tmp-shell), or a run=<debug-name> label.
    • completed / failed one-off jobs and their pods. List each with age + owner so the leader/user can decide.
  4. Classify each as labeled-ephemeral / unlabeled-suspect / legitimate.
  5. Remove (each deletion prompts the user):
    • Labeled ephemerals — delete by label or name, e.g. kubectl delete pod,job -n <ns> -l omnis.dev/ephemeral=true.
    • Unlabeled suspects — do NOT delete; list them for the leader/user to confirm, then delete only the confirmed ones.
  6. Caveats:
    • Ephemeral containers added by kubectl debug pod/<p> cannot be removed individually; they clear only when the pod is recreated. Do NOT delete a user's real pod to clear a debug container without explicit approval — note it instead.
    • Client-side leftovers (a kubectl port-forward/proxy started via bash_background) are not cluster resources; report them so the leader can bg_cancel the task.
  7. Report: found / removed / left-for-confirmation / could-not-remove, with the exact kubectl delete commands run.

Hard rules

  • Delete ONLY resources positively identified as ephemeral (labeled) or explicitly confirmed. When in doubt, leave it and ask.
  • Prod protection: never delete in production namespaces/contexts without an explicit override.
  • Never delete real workloads, PVCs/PVs, namespaces, or anything with an owner reference to a controller you did not create.
  • RBAC denial → report the boundary, do not retry with a different identity.

Output rule

Always finish with a single line: Result: clean | removed-<N> | needs-confirmation | blocked.

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