Skip to main content
skill CX Codex

k8s-diagnostics — Claude Code skill: what it does, how to install

k8s-diagnostics — a skill that has the agent pull pod and node metrics, run cluster health checks and diff two namespaces using kubectl-mcp-server tools.

MIT-0 1 installs ★ 976 updated 2026-10-22

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add rohitg00/kubectl-mcp-server --skill k8s-diagnostics -a claude-code
Open on GitHub

What k8s-diagnostics does

The skill maps 10 tools for the agent: health_check, kubectl_top, get_nodes_summary, compare_namespaces, kubectl_get, get_api_resources, kubeconfig_view, list_contexts, plus kubectl_logs and kubectl_describe when something breaks. It fires when you mention metrics, a health check, capacity or the difference between two environments.

Three workflows cover most of it. A cluster overview runs the health check, the node summary and the events list. A pre-release pass reads kubectl_top on production, pulls the node summary and diffs staging against production deployments. After an incident the agent collects events, logs from the previous container and a describe of the pod.

Start kubectl-mcp-server with the diagnostics and multicluster toolsets: --toolsets default,diagnostics,multicluster or MCP_TOOLSETS=default,diagnostics,multicluster. Metrics need metrics-server running in the cluster, and without it kubectl_top returns nothing useful.

What it helps with

  • read CPU and memory numbers for pods and nodes
  • run a health check before a rollout
  • diff deployments between staging and production
  • gather events and previous-container logs after a crash
  • list CRDs and discovered API resources

Example prompts for the agent

  • Check cluster health and show the top pods by memory in production.
  • Compare staging and production deployments before the release.
  • A pod just crashed — pull events, logs from the previous container and kubectl_describe.

How to install k8s-diagnostics

1Skills CLI (Vercel)

npx skills add rohitg00/kubectl-mcp-server --skill k8s-diagnostics -a claude-code

2Manually: put the files in place

~/.claude/skills/k8s-diagnostics/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/k8s-diagnostics/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about k8s-diagnostics

How do I install k8s-diagnostics in Claude Code?

Run npx skills add rohitg00/kubectl-mcp-server --skill k8s-diagnostics -a claude-code; the skill lands in ~/.claude/skills/k8s-diagnostics/SKILL.md.

What does k8s-diagnostics do?

It tells the agent which kubectl-mcp-server tools to call for metrics, cluster health, namespace comparisons and post-incident data collection.

What has to be running for the skill to work?

A kubectl-mcp-server started with the diagnostics and multicluster toolsets, and metrics-server in the cluster for anything metric-related.

Source text

SKILL.md · MIT-0
---
name: k8s-diagnostics
description: Kubernetes diagnostics for metrics, health checks, resource comparisons, and cluster analysis. Use when analyzing cluster health, comparing environments, or gathering diagnostic data.
license: MIT-0
metadata:
  author: rohitg00
  version: "2.0.0"
  tools: 10
  category: observability
---

# Kubernetes Diagnostics

Analyze cluster health and compare resources using kubectl-mcp-server's diagnostic tools.

> Requires the `diagnostics`, `multicluster` toolsets: start kubectl-mcp-server with `--toolsets default,diagnostics,multicluster` (or `MCP_TOOLSETS=default,diagnostics,multicluster`).

## When to Apply

Use this skill when:
- User mentions: "metrics", "health check", "compare", "analysis", "capacity"
- Operations: cluster health assessment, environment comparison, resource analysis
- Keywords: "how much", "usage", "difference between", "capacity planning"

## Priority Rules

| Priority | Rule | Impact | Tools |
|----------|------|--------|-------|
| 1 | Check metrics-server before using metrics | CRITICAL | `kubectl_top` |
| 2 | Run health check before deployments | HIGH | `health_check` |
| 3 | Compare staging vs prod before release | MEDIUM | `compare_namespaces` |
| 4 | Document baseline metrics | LOW | `get_nodes_summary` |

## Quick Reference

| Task | Tool | Example |
|------|------|---------|
| Cluster health | `health_check` | `health_check()` |
| Pod metrics | `kubectl_top` | `kubectl_top(namespace)` |
| Node summary | `get_nodes_summary` | `get_nodes_summary()` |
| Compare envs | `compare_namespaces` | `compare_namespaces(ns1, ns2, type)` |
| List CRDs | `kubectl_get` | `kubectl_get(resource_type="crds")` |

## Resource Metrics

```python
kubectl_top(namespace="default")

kubectl_top(resource="nodes")

kubectl_top(resource="pods", namespace="default", sort_by="cpu")

kubectl_top(resource="pods", namespace="default", sort_by="memory")
```

## Cluster Health Check

```python
health_check()

health_check()
```

## Compare Environments

```python
compare_namespaces(
    namespace1="staging",
    namespace2="production",
    resource_type="deployment"
)

kubectl_get(resource_type="deployments", namespace="default", context="staging-cluster")
kubectl_get(resource_type="deployments", namespace="default", context="prod-cluster")
```

## API Discovery

```python
get_api_resources()

kubectl_get(resource_type="crds", name="certificates.cert-manager.io")

kubectl_get(resource_type="crds")
```

## Resource Analysis

```python
get_nodes_summary()

kubeconfig_view()

list_contexts()
```

## Diagnostic Workflows

### Cluster Overview

```python
health_check()
get_nodes_summary()
kubectl_get(resource_type="events", namespace="")
kubectl_get(resource_type="crds")
```

### Pre-deployment Check

```python
kubectl_top(namespace="production")
get_nodes_summary()
compare_namespaces(namespace1="staging", namespace2="prod", resource_type="deployment")
```

### Post-incident Analysis

```python
kubectl_get(resource_type="events", namespace)
kubectl_logs(name, namespace, previous=True)
kubectl_top(namespace)
kubectl_describe(name)
```

## Related Skills

- [k8s-troubleshoot](../k8s-troubleshoot/SKILL.md) - Debug issues
- [k8s-cost](../k8s-cost/SKILL.md) - Cost analysis
- [k8s-incident](../k8s-incident/SKILL.md) - Incident response

© rohitg00 · MIT-0 · rohitg00/kubectl-mcp-server

Similar skills

All skills for DevOps and infrastructure →

From the same set5

Project sponsors

Companies that keep this analytics open