一键导入
generate-template
Use when the user asks to create a kubectl-status template for one or more Kubernetes resource kinds found in the current kubectl context.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when the user asks to create a kubectl-status template for one or more Kubernetes resource kinds found in the current kubectl context.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | generate-template |
| description | Use when the user asks to create a kubectl-status template for one or more Kubernetes resource kinds found in the current kubectl context. |
Generate kubectl-status Go template files for resource kinds and write them to
~/.kubectl-status/templates/<Kind>.tmpl.
CONVENTIONS.md — output philosophy, color rules, and all template design conventions. Read this first.pkg/plugin/templates/common.tmpl — all shared sub-templates and available functions.pkg/plugin/templates/ — built-in templates as style examples.~/.kubectl-status/templates/ — user CRD template examples.kubectl api-resources | grep -i <name>
Note the exact Kind string (case-sensitive — used as the template define name) and the APIVERSION column value.
kubectl get crd <full-crd-name> -o json | jq '.spec.versions[0].schema.openAPIV3Schema.properties'
Read spec and status sub-schemas in full — not just top-level keys. For each field, check its description to understand what it means. Use that meaning to decide whether it warrants inclusion, applying the output philosophy in CONVENTIONS.md.
Pay specific attention to:
true/false; emit a meaningful label only when the value is operationally interesting.kubectl get <resource> -A --no-headers | head -5
kubectl get <resource> <name> -n <ns> -o json
Cross-reference the schema against what is actually populated. Skip status fields that are never set and spec fields always at their default.
File: ~/.kubectl-status/templates/<Kind>.tmpl
Copy the define wrapper and bookend sections from any existing template. The GVK comment ({{- /* GVK: group/version, Kind=<Kind> */ -}}) must follow the gotype comment immediately after define. Section order and what status_summary_line already covers are in CONVENTIONS.md § Section order.
All design rules are in CONVENTIONS.md. Implementation pointers:
selector_with_health_summary from common.tmpl; only hand-roll when custom health logic is needed.HTTPRoute.tmpl has worked examples of both single-ref and list-of-refs forms.kubectl status <resource> <name> -n <ns>
Test at least two different instances to confirm optional fields appear and disappear correctly.