kjuhwa/skills-hub/alert-time-window-with-buffer
Claude Code and agent skill by kjuhwa/skills-hub
- community
Checking that the SKILL.md file is still in the repository.
Compute a query time window that covers the alert plus a 30-min buffer by parsing startsAt from various schemas (Alertmanager nested, top-level, annotations.timestamp), with a 60-min minimum and a sentinel "0001-01-01" guard.
Install
npx vskill@latest install kjuhwa/skills-hub/alert-time-window-with-bufferSKILL.md
The same SKILL.md was published earlier as kjuhwa/skills-hub/alert-time-window-with-buffer.
Alert Time Window with Buffer
When to use
Your agent queries Loki/Datadog/Grafana with a time_range_minutes parameter. Use the alert's own start time so the window covers the relevant period, but add a buffer so context before and after the alert is included. Multiple alert schemas put the timestamp in different places.
How it works
- Look for
startsAtin three places:alerts[0].startsAt(Alertmanager nested), top-levelstartsAt/timestamp, thenannotations.timestamp. - Parse with
datetime.fromisoformat(starts_at.replace("Z", "+00:00"))to handle the trailing-Z variant. - Treat year
< 2000as a zero-value sentinel ("0001-01-01" from Alertmanager when the field isn't populated). - Window =
max(60, (now - alert_time_minutes) + 35)so we always have at least an hour and always include 30+ min of post-alert context.
Example
Gotchas
datetime.fromisoformatin Python 3.11+ handles offset suffixes; for older Pythons, replace"Z"with"+00:00"first.- The minimum 60-min window matters — many backends (e.g. Loki) won't return useful data for a 1-min window even if the alert just fired.
- Always parse annotations as a fallback; some alert sources put
timestamponly in the human-readable annotations section.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/agent-sdk/alert-time-window-with-buffer/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kjuhwa/skills-hub/alert-time-window-with-buffer)