kubernetes-cli
Skill8 starsChanged 7 months agoApache-2.0View on GitHub
Perform Kubernetes operations using the kubectl CLI. Use for inspecting, managing, and troubleshooting workloads, nodes, and cluster resources across contexts.
- Installs packages
In this repository54 other files it gives its agents.
- alibabacloud-cliSkill
- ansible-cliSkill
- appdynamics-cliSkill
- argocd-cliSkill
- aws-cliSkill
- aws-cloudwatch-cliSkill
- azure-cliSkill
- bash-lintingSkill
- betterstack-cliSkill
- bitbucket-cliSkill
- chef-cliSkill
- code-reviewSkill
- commit-codeSkill
- create-dockerfileSkill
- create-terraform-helm-upgrade-planSkill
- datadog-cliSkill
- digitalocean-cliSkill
- dockerfile-lintingSkill
- dynatrace-cliSkill
- elasticsearch-cliSkill
- gcp-cliSkill
- github-cliSkill
- gitlab-cliSkill
- go-lintingSkill
- grafana-cliSkill
- grafana-loki-cliSkill
- graylog-cliSkill
- helm-cliSkill
- hetzner-cliSkill
- huaweicloud-cliSkill
- jaeger-cliSkill
- jenkins-cliSkill
- jira-and-confluence-cliSkill
- kibana-cliSkill
- loggly-cliSkill
- maintenance-check-aws-eksSkill
- maintenance-create-ticket-on-jiraSkill
- ms-teams-cliSkill
- mysql-cliSkill
- newrelic-cliSkill
- oci-cliSkill
- packer-cliSkill
- papertrail-cliSkill
- postgresql-cliSkill
- prometheus-cliSkill
- python-lintingSkill
- rollbar-cliSkill
- salesforce-cliSkill
- sentry-cliSkill
- slack-cliSkill
- splunk-cliSkill
- terraform-cliSkill
- terraform-lintingSkill
- vault-cliSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use the context table and rules below when constructing all kubectl commands.
- Distinctive: line 12
Update the table below with your kubeconfig context names before using this skill:
- Distinctive: line 20
If the target environment is unclear, ask the user before running any command.
- Very specific: line 24
If kubectl is not installed or no context is configured for the target cluster, inform the user that setup is required and ask them to …
- Very specific: line 35
Always pass --context and --namespace explicitly — never rely on the current context or namespace set in kubeconfig:
- Distinctive: line 96
NEVER target a context not listed in the configuration table above.
- Very specific: line 97
Always pass --context and --namespace explicitly on every command — never rely on the current kubeconfig context, as this may silently …
- Distinctive: line 98
NEVER run commands in the "Never run" table above without explicit user instruction — this includes any command against a production …
- Very specific: line 99
If a resource name, namespace, or context looks unfamiliar, look it up with a read-only command first (get, describe) before mutating.
- Very specific: line 100
Prefer kubectl diff -f <file> before any apply to preview changes.
- Very specific: line 101
NEVER print, display, or store the contents of Secrets (kubectl get secret -o yaml exposes base64-encoded values) — if a Secret must be …
- Very specific: line 102
All list commands may be paginated or truncated by the API server for large clusters — use --chunk-size or narrow the query with label …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kubernetes CLI Skill
Use the context table and rules below when constructing all kubectl commands.
Configuration
Update the table below with your kubeconfig context names before using this skill:
| Environment | Context Name | Default Namespace |
| Production | <your-prod-context> | <your-prod-namespace> |
| Staging / Non-Prod | <your-nonprod-context> | <your-nonprod-namespace> |
| Sandbox / Dev | <your-sandbox-context> | <your-sandbox-namespace> |
If the target environment is unclear, ask the user before running any command.
Prerequisites (one-time setup by user)
If kubectl is not installed or no context is configured for the target cluster, inform the user that setup is required and ask them to complete the following steps manually. Do not perform these steps yourself.
brew install kubectl
aws eks update-kubeconfig --name <cluster-name> --profile <profile> --region <region> --alias <your-context-name>
# or for other providers, follow the provider-specific kubeconfig setup
kubectl config get-contextsCommand Format
Always pass --context and --namespace explicitly — never rely on the current context or namespace set in kubeconfig:
kubectl <command> --context <context-name> --namespace <namespace> [options]Examples
# Production
kubectl get pods --context <your-prod-context> --namespace <your-prod-namespace>
# Staging / Non-Prod
kubectl get pods --context <your-nonprod-context> --namespace <your-nonprod-namespace>Available Commands
Read-only (safe, no confirmation needed)
| Command | Description |
get <resource> [name] | List or show resources (pods, deployments, services, nodes, etc.) |
describe <resource> <name> | Show detailed information and recent events for a resource |
logs <pod> [-c container] [--previous] [--tail=N] | Show container logs |
top nodes / top pods | Show resource usage (requires metrics-server) |
get events --sort-by=.lastTimestamp | Show recent cluster events |
explain <resource> | Show API resource schema documentation |
api-resources / api-versions | List available resource types and API versions |
config get-contexts / config current-context | Inspect kubeconfig contexts |
version | Show client and server version |
cluster-info | Show cluster endpoint information |
diff -f <file> | Show what would change if a manifest were applied (dry run, no cluster mutation) |
get <resource> -o yaml/json | Dump full resource manifest |
Mutating operations (confirm with user before running)
| Command | Description |
apply -f <file> | Create or update resources from a manifest |
create -f <file> / create <resource> | Create a new resource |
patch <resource> <name> | Apply a strategic/JSON merge patch |
scale <resource> <name> --replicas=N | Scale a deployment/statefulset/replicaset |
rollout restart/undo <resource> <name> | Restart or roll back a deployment |
label / annotate | Add or modify labels/annotations |
cordon <node> / uncordon <node> | Mark a node unschedulable or schedulable |
Never run — requires explicit human approval
| Command | Reason |
delete <resource> <name> | Irreversible deletion of a resource |
delete namespace <name> | Deletes the namespace and everything inside it |
drain <node> | Evicts all pods from a node, affecting live workloads |
exec -it <pod> -- <command> | Opens an interactive shell/session inside a running container |
edit <resource> <name> | Opens an interactive editor against a live resource |
replace --force -f <file> | Force-deletes and recreates a resource, causing downtime |
taint <node> | Alters node scheduling behavior cluster-wide |
Rules
- NEVER target a context not listed in the configuration table above. If a command references an unfamiliar context, stop and ask the user to confirm.
- Always pass
--contextand--namespaceexplicitly on every command — never rely on the current kubeconfig context, as this may silently target the wrong cluster. - NEVER run commands in the "Never run" table above without explicit user instruction — this includes any command against a production context, even if listed as a mutating operation above.
- If a resource name, namespace, or context looks unfamiliar, look it up with a read-only command first (
get,describe) before mutating. - Prefer
kubectl diff -f <file>before anyapplyto preview changes. - NEVER print, display, or store the contents of Secrets (
kubectl get secret -o yamlexposes base64-encoded values) — if a Secret must be inspected, only confirm its existence and keys, not its values. - All list commands may be paginated or truncated by the API server for large clusters — use
--chunk-sizeor narrow the query with label selectors (-l) if results seem incomplete.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

