---
name: grafana-silence
description: Create a silence for a firing Grafana Cloud alert with a specified duration and comment. REQUIRES CONFIRMATION before execution. Use when the user wants to silence an alert, mute notifications, or suppress alert noise during maintenance.
user_invocable: true
---

# /grafana-silence — Create Alert Silence

Create a silence for a firing Grafana Cloud alert. This is a WRITE operation and requires explicit user confirmation.

## Steps

### 1. Confirm Details with User

Before creating the silence, present the following for approval:
- **Matcher:** Which alert(s) will be silenced (e.g., `alertname=HighCPU`)
- **Duration:** How long the silence will last
- **Comment:** Reason for the silence

Ask: "Shall I create this silence? (yes/no)"

### 2. Create Silence (only after user confirms)
```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/grafana/create_silence.sh" "alertname=HighCPU" 2 "Deploying fix, expected CPU spike"
```

Arguments:
- Arg 1: Matcher in `name=value` format
- Arg 2: Duration in hours
- Arg 3: Comment explaining the reason

### 3. Verify Creation

Parse the JSON output and confirm:
- Silence ID
- Start and end times
- Which alerts are now silenced
- Reminder to remove the silence early if the issue is resolved

## Notes
- **NEVER create a silence without explicit user confirmation**
- Show the user what will be silenced before executing
- Suggest checking current alerts first with `/grafana-alerts` if unsure which alert to silence
- Silences are temporary — always include an appropriate duration
