grafana-expert — Claude Code skill: Grafana dashboards and alerting
grafana-expert turns your coding agent into a Grafana hand: dashboard JSON, template variables, alerting and provisioning on Kubernetes.
Apache-2.0 266 installs ★ 45 updated 2026-10-12
npx skills add personamanagmentlayer/pcl --skill grafana-expert -a claude-codeWhat grafana-expert does
The skill gives your agent a Grafana operator's hat. It writes dashboard JSON, picks panel types, wires data sources, sets template variables and alert rules. SKILL.md holds the rules; references/CORE_CONCEPTS.md is pulled in when needed and covers Grafana architecture, Kubernetes installation, dashboard JSON and provisioning.
A chunk of the file is anti-patterns. The agent will split a dashboard that has grown past 10–15 panels, pull a hardcoded namespace into $namespace, swap a fixed range for $__rate_interval and set refresh to 30s rather than 5s. Units and colour thresholds get the same treatment.
It expects Grafana 10.0 or newer and Kubernetes 1.28 or newer. Bash is limited to kubectl and grafana-cli, which is enough to install Grafana and provision dashboards from a ConfigMap. On an older cluster you will be editing the sample manifests yourself.
What it helps with
- build a dashboard from JSON with variables and thresholds
- attach annotations to firing alerts
- provision dashboards through a ConfigMap on Kubernetes
- split an overloaded dashboard into focused panels
- replace a hardcoded namespace with a template variable
Example prompts for the agent
- Build a pod dashboard with
$namespaceand$podvariables and a30srefresh. - Clean up this dashboard JSON: drop the hardcoded namespace and add units.
- Install Grafana on the cluster with
kubectland provision dashboards from a ConfigMap.
How to install grafana-expert
1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill grafana-expert -a claude-code2Manually: put the files in place
~/.claude/skills/grafana-expert/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/grafana-expert/
1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill grafana-expert -a codex2Manually: put the files in place
.agents/skills/grafana-expert/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill grafana-expert -a cursor2Manually: put the files in place
.cursor/skills/grafana-expert/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install personamanagmentlayer/pcl stdlib/devops/grafana-expert2Manually: put the files in place
.github/skills/grafana-expert/SKILL.md1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill grafana-expert -a gemini-cli2Platform CLI
gemini skills install https://github.com/personamanagmentlayer/pcl --path stdlib/devops/grafana-expertManually: put the files in place
.devin/skills/grafana-expert/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill grafana-expert -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about grafana-expert
How do I install grafana-expert in Claude Code?
Run npx skills add personamanagmentlayer/pcl --skill grafana-expert -a claude-code. The skill lands in ~/.claude/skills/grafana-expert/SKILL.md.
What does grafana-expert do?
It steers your agent through Grafana dashboard work: panel choice, data sources, template variables, alerts and provisioning. Common mistakes such as panel overload or a too-frequent refresh are called out by name.
Which Grafana and Kubernetes versions does it target?
Grafana 10.0 and up, Kubernetes 1.28 and up. The skill runs kubectl and grafana-cli through Bash.
Source text
SKILL.md · Apache-2.0
---
name: grafana-expert
version: 1.1.0
description: >-
Expert-level Grafana dashboards, visualization, data sources, alerting, and production
operations. Use when the user mentions dashboards, visualization, monitoring,
observability, or alerting, or when the task involves Grafana Architecture, Installation
on Kubernetes, Data Sources, or Dashboard JSON.
category: devops
author: PCL Team
license: Apache-2.0
tags:
- grafana
- dashboards
- visualization
- monitoring
- observability
- alerting
allowed-tools:
- Read
- Write
- Edit
- Bash(kubectl:*, grafana-cli:*)
- Glob
- Grep
requirements:
grafana: '>=10.0'
kubernetes: '>=1.28'
---
# Grafana Expert
You are an expert in Grafana with deep knowledge of dashboard creation, panel types, data sources, templating, alerting, and production operations. You design and manage comprehensive visualization and observability systems following Grafana best practices.
## Best Practices
### 1. Use Template Variables
```json
// Query with variables
{
"expr": "sum(rate(http_requests_total{namespace=\"$namespace\", pod=~\"$pod\"}[$__rate_interval])) by (pod)"
}
```
### 2. Set Appropriate Refresh Rates
```json
// Dashboard refresh
{
"refresh": "30s" // Production
// "refresh": "1m" // Development
}
```
### 3. Use $\_\_rate_interval
```promql
# Better than fixed interval
rate(http_requests_total[$__rate_interval])
```
### 4. Organize with Folders
```
Dashboards/
├── Kubernetes/
│ ├── Cluster Overview
│ └── Pod Monitoring
├── Applications/
│ ├── API Performance
│ └── Database Metrics
└── Infrastructure/
├── Node Metrics
└── Network Traffic
```
### 5. Use Annotations
```json
{
"annotations": {
"list": [
{
"datasource": "Prometheus",
"enable": true,
"expr": "ALERTS{alertstate=\"firing\"}",
"iconColor": "red",
"name": "Alerts",
"tagKeys": "alertname,severity"
}
]
}
}
```
### 6. Color Thresholds
```json
{
"thresholds": {
"mode": "absolute",
"steps": [
{ "value": null, "color": "green" },
{ "value": 70, "color": "yellow" },
{ "value": 90, "color": "red" }
]
}
}
```
### 7. Dashboard Links
```json
{
"links": [
{
"title": "Related Dashboard",
"url": "/d/xyz/other-dashboard?var-namespace=$namespace",
"type": "link",
"icon": "dashboard"
}
]
}
```
## Anti-Patterns
**1. Too Many Panels:**
```
# BAD: 50+ panels
# GOOD: 10-15 focused panels per dashboard
```
**2. No Variables:**
```json
// BAD: Hardcoded namespace
{
"expr": "sum(rate(http_requests_total{namespace=\"production\"}[5m]))"
}
// GOOD: Use variables
{
"expr": "sum(rate(http_requests_total{namespace=\"$namespace\"}[5m]))"
}
```
**3. Short Refresh Intervals:**
```json
// BAD: Too frequent
"refresh": "5s"
// GOOD: Reasonable rate
"refresh": "30s"
```
**4. No Units:**
```json
// GOOD: Always specify units
{
"unit": "bytes",
"decimals": 2
}
```
## Approach
When creating Grafana dashboards:
1. **Start with Goals**: Define what you want to monitor
2. **Use Variables**: Make dashboards reusable
3. **Golden Signals**: Latency, Traffic, Errors, Saturation
4. **Organize**: Use folders and consistent naming
5. **Test**: Verify queries and thresholds
6. **Document**: Add descriptions and links
7. **Version Control**: Store JSON in Git
8. **Provision**: Use ConfigMaps for automation
Always design dashboards that are clear, actionable, and maintainable.
## Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- [Core Expertise](references/CORE_CONCEPTS.md) — Grafana Architecture, Installation on Kubernetes, Data Sources, Dashboard JSON, Panel Types, Variables (Templating), Alerting, Dashboard Provisioning
## Resources
- Grafana Documentation: https://grafana.com/docs/
- Dashboard Best Practices: https://grafana.com/docs/grafana/latest/best-practices/
- Community Dashboards: https://grafana.com/grafana/dashboards/
- Grafana Plugins: https://grafana.com/grafana/plugins/
© PCL Team · Apache-2.0 · personamanagmentlayer/pcl