Refactor remaining skills with resources pattern and allowed-tools
- k8s-quick-status: Add scripts/quick-status.sh, allowed-tools - sysadmin-health: Add scripts/health-check.sh, allowed-tools - usage: Add scripts/usage_report.py, simplify SKILL.md - programmer-add-project: Add allowed-tools All skills now: - Have executable scripts for main operations - Use allowed-tools to restrict capabilities - Have improved descriptions with trigger phrases - Follow the "Skill with Bundled Resources" pattern 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,43 +1,61 @@
|
||||
---
|
||||
name: k8s-quick-status
|
||||
description: Quick cluster health pulse check
|
||||
model: haiku
|
||||
description: Quick cluster health pulse check. Use when asked about cluster status, k8s health, or kubernetes overview.
|
||||
allowed-tools:
|
||||
- Bash
|
||||
- Read
|
||||
---
|
||||
|
||||
# K8s Quick Status Skill
|
||||
|
||||
Performs a lightweight health pulse check on the Raspberry Pi Kubernetes cluster.
|
||||
|
||||
## Quick Command
|
||||
|
||||
```bash
|
||||
~/.claude/skills/k8s-quick-status/scripts/quick-status.sh
|
||||
```
|
||||
|
||||
Or run individual checks:
|
||||
|
||||
```bash
|
||||
# Node status
|
||||
kubectl get nodes -o wide
|
||||
|
||||
# Unhealthy pods
|
||||
kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded
|
||||
|
||||
# Warning events
|
||||
kubectl get events -A --field-selector=type=Warning --sort-by='.lastTimestamp' | tail -10
|
||||
|
||||
# ArgoCD apps
|
||||
argocd app list
|
||||
```
|
||||
|
||||
## Checks Performed
|
||||
|
||||
### Node Status
|
||||
- Node readiness (`kubectl get nodes`)
|
||||
- Node conditions (MemoryPressure, DiskPressure, PIDPressure)
|
||||
|
||||
### Pod Health
|
||||
- Unhealthy pods (`kubectl get pods -A --field-selector=status.phase!=Running`)
|
||||
- High restart counts (pods with >5 restarts)
|
||||
|
||||
### Recent Events
|
||||
- Warning events in last hour (`kubectl get events -A --field-selector=type=Warning --sort-by='.lastTimestamp'`)
|
||||
|
||||
### ArgoCD Status
|
||||
- Application sync status (`argocd app list`)
|
||||
- Any OutOfSync or Degraded apps
|
||||
| Check | Command | What It Shows |
|
||||
|-------|---------|---------------|
|
||||
| Nodes | `kubectl get nodes` | Readiness, conditions |
|
||||
| Pods | `kubectl get pods -A` | Unhealthy pods |
|
||||
| Restarts | jsonpath query | Pods with >5 restarts |
|
||||
| Events | `kubectl get events` | Recent warnings |
|
||||
| ArgoCD | `argocd app list` | Sync status |
|
||||
|
||||
## Output Format
|
||||
|
||||
Report as structured summary with:
|
||||
- Overall status (healthy/warning/critical)
|
||||
- Node summary table
|
||||
- Unhealthy pods list (if any)
|
||||
- ArgoCD app status
|
||||
- Immediate concerns (if any)
|
||||
|
||||
## Autonomy
|
||||
|
||||
This skill is read-only and can run without confirmation.
|
||||
Report as structured summary:
|
||||
- **Overall status**: healthy/warning/critical
|
||||
- **Node summary**: table of nodes
|
||||
- **Issues**: unhealthy pods, high restarts
|
||||
- **ArgoCD**: sync status
|
||||
- **Concerns**: immediate action items
|
||||
|
||||
## When to Use
|
||||
|
||||
Use this skill for a quick pulse check. For comprehensive analysis with metrics and detailed recommendations, use the `/cluster-status` command which invokes the full `cluster-health-check` workflow.
|
||||
- Quick pulse check: use this skill
|
||||
- Comprehensive analysis: use `/cluster-status` command
|
||||
|
||||
## Autonomy
|
||||
|
||||
Read-only - runs without confirmation.
|
||||
|
||||
28
skills/k8s-quick-status/scripts/quick-status.sh
Executable file
28
skills/k8s-quick-status/scripts/quick-status.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# Quick Kubernetes cluster status check
|
||||
# Returns structured output for easy parsing
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "=== Node Status ==="
|
||||
kubectl get nodes -o wide 2>/dev/null || echo "Error: Cannot reach cluster"
|
||||
|
||||
echo ""
|
||||
echo "=== Unhealthy Pods ==="
|
||||
kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded 2>/dev/null | grep -v "^NAMESPACE" || echo "All pods healthy"
|
||||
|
||||
echo ""
|
||||
echo "=== High Restart Pods ==="
|
||||
kubectl get pods -A -o jsonpath='{range .items[?(@.status.containerStatuses[0].restartCount>5)]}{.metadata.namespace}/{.metadata.name}: {.status.containerStatuses[0].restartCount} restarts{"\n"}{end}' 2>/dev/null || echo "No high restart pods"
|
||||
|
||||
echo ""
|
||||
echo "=== Recent Warning Events ==="
|
||||
kubectl get events -A --field-selector=type=Warning --sort-by='.lastTimestamp' 2>/dev/null | tail -10 || echo "No warning events"
|
||||
|
||||
echo ""
|
||||
echo "=== ArgoCD Apps ==="
|
||||
if command -v argocd &>/dev/null; then
|
||||
argocd app list --output wide 2>/dev/null || echo "ArgoCD not accessible"
|
||||
else
|
||||
echo "ArgoCD CLI not installed"
|
||||
fi
|
||||
Reference in New Issue
Block a user