.claude/skills/kagent/SKILL.md
Kubernetes-native AI agent framework for building, deploying, and managing AI agents on Kubernetes. This skill should be used when deploying AI agents as Kubernetes resources, analyzing cluster health with AI, and automating complex K8s operations. Use this skill for Phase IV advanced AIOps and agent-based cluster management.
npx skillsauth add anasahmed07/doit kagentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Kagent is a Kubernetes-native framework for building, deploying, and managing AI agents. It uses Custom Resource Definitions (CRDs) to define agents as Kubernetes resources, enabling declarative AI agent management with full K8s integration.
┌─────────────────────────────────────────────────────┐
│ Kubernetes Cluster │
│ ┌─────────────────┐ ┌─────────────────────────┐ │
│ │ Kagent │ │ Custom Resources │ │
│ │ Controller │───▶│ - Agent │ │
│ │ │ │ - Tool │ │
│ │ │ │ - Model │ │
│ └─────────────────┘ └─────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ AI Agent Pods │ │
│ │ - Execute kubectl commands │ │
│ │ - Analyze resources │ │
│ │ - Report findings │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘
# Install CRDs and controller
kubectl apply -f https://raw.githubusercontent.com/kagent-dev/kagent/main/dist/install.yaml
# Clone repository
git clone https://github.com/kagent-dev/kagent.git
cd kagent/go
# Install CRDs
make install
# Deploy controller
make deploy
# Generate consolidated install.yaml
make build-installer
Kagent agents can execute standard kubectl commands:
# Resource listing
kubectl get pods -n namespace
kubectl get deployments -n namespace
kubectl get services -n namespace
# Detailed listing
kubectl get pods -n namespace -o wide
kubectl get nodes -o wide
# Describe resources
kubectl describe pod podname -n namespace
kubectl describe deployment deployname -n namespace
kubectl describe service servicename -n namespace
# Get full YAML
kubectl get configmap configname -n namespace -o yaml
kubectl get secret secretname -n namespace -o yaml
# Component health
kubectl get componentstatuses
kubectl get nodes -o wide
# Resource status
kubectl get deployments -n namespace -o wide
kubectl get pods -n namespace -o wide
# Node management
kubectl drain <node>
kubectl cordon/uncordon <node>
# Port forwarding
kubectl port-forward svc/my-service 8080:80
# Authorization checks
kubectl auth can-i create pods
# Debugging
kubectl debug pod/my-pod --image=busybox
Kagent agents have access to:
| Tool | Purpose |
|------|---------|
| crictl | Container runtime interface |
| kubelet logs | Node-level logs |
| journalctl | System logs |
| tcpdump | Network diagnostics |
| netstat | Connection status |
Use kagent to analyze overall cluster health before deployment:
kagent "analyze the cluster health and report any issues"
kagent "check if there are sufficient resources for 5 new pods"
kagent "identify pods without resource limits"
kagent "find over-provisioned deployments"
kagent "recommend resource adjustments based on actual usage"
kagent "find pods running as root"
kagent "identify services exposed without ingress"
kagent "check for secrets mounted as environment variables"
kagent "why are pods in namespace X failing?"
kagent "analyze network connectivity between services"
kagent "find the root cause of OOMKilled pods"
apiVersion: kagent.dev/v1alpha1
kind: Agent
metadata:
name: cluster-analyzer
namespace: kagent-system
spec:
model:
provider: openai
name: gpt-4
tools:
- kubectl
- helm
systemPrompt: |
You are a Kubernetes cluster analyzer.
Focus on identifying resource issues and optimization opportunities.
apiVersion: kagent.dev/v1alpha1
kind: Tool
metadata:
name: kubectl-tool
spec:
type: kubectl
permissions:
- get
- list
- describe
namespaces:
- default
- production
Kagent complements kubectl-ai:
| Tool | Best For | |------|----------| | kubectl-ai | Ad-hoc commands, quick operations | | kagent | Persistent agents, complex analysis, automation |
# Use kubectl-ai for immediate operations
kubectl-ai "scale api to 3 replicas"
# Use kagent for analysis and recommendations
kagent "analyze if scaling to 3 replicas is sustainable given current cluster resources"
Refer to references/agent-patterns.md for common agent configurations.
development
Use when building real-time communication systems with WebSockets or Socket.IO. Invoke for bidirectional messaging, horizontal scaling with Redis, presence tracking, room management.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.