agentleFS
charles-adedotuncharles-adedotun/sre-plugin/skills/investigate/SKILL.md

investigate

Skill0 starsChanged 6 months agoMITView on GitHub

Investigate incidents and anomalies using live Prometheus and Loki data with infrastructure context. Use when the user reports "service is down", "high error rate", "latency spike", "pods crashing", "something is wrong", "investigate this alert", "help me debug", "why is X slow", "check service health", "what's happening with X", "run an incident investigation", or any operational problem requiring data-driven diagnosis.

128 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use pair-agent, plan-devex-review and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • seek888Skill

    pair-agent

    Pair a remote AI agent with your browser. One command generates a setup key and prints instructions the other agent can follow to connect. Works with OpenClaw, Hermes, Codex, Cursor, or any agent that can make HTTP requests. The remote agent gets its own tab with scoped access (read+write by default, admin on request). Use when asked to "pair agent", "connect agent", "share browser", "remote browser", "let another agent use my browser", or "give browser access". (gstack) Voice triggers (speech-to-text aliases): "pair agent", "connect agent", "share my browser", "remote browser access".

    Also in 10 projects that use this

  • seek888Skill

    plan-devex-review

    Interactive developer experience plan review. Explores developer personas, benchmarks against competitors, designs magical moments, and traces friction points before scoring. Three modes: DX EXPANSION (competitive advantage), DX POLISH (bulletproof every touchpoint), DX TRIAGE (critical gaps only). Use when asked to "DX review", "developer experience audit", "devex review", or "API design review". Proactively suggest when the user has a plan for developer-facing products (APIs, CLIs, SDKs, libraries, platforms, docs). (gstack) Voice triggers (speech-to-text aliases): "dx review", "developer experience review", "devex review", "devex audit", "API design review", "onboarding review".

    Also in 13 projects that use this

  • ShreyRaviSkill

    landing-report

    Read-only queue dashboard for workspace-aware ship. Shows which VERSION slots are currently claimed by open PRs, which sibling Conductor workspaces have WIP work likely to ship soon, and what slot /ship would pick next. No mutations — just a snapshot. Use when asked to "landing report", "what's in the queue", "show me open PRs", or "which version do I claim next". (gstack)

    Also in 7 projects that use this

  • ayudaySkill

    setup-deploy

    Configure deployment settings for /land-and-deploy. Detects your deploy platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom), production URL, health check endpoints, and deploy status commands. Writes the configuration to CLAUDE.md so all future deploys are automatic. Use when: "setup deploy", "configure deployment", "set up land-and-deploy", "how do I deploy with gstack", "add deploy config".

    Also in 14 projects that use this

  • ayudaySkill

    cso

    Chief Security Officer mode. Performs OWASP Top 10 audit, STRIDE threat modeling, attack surface analysis, auth flow verification, secret detection, dependency CVE scanning, supply chain risk assessment, and data classification review. Use when: "security audit", "threat model", "pentest review", "OWASP", "CSO review".

    Also in 17 projects that use this

  • ramybarsoumSkill

    document-release

    Post-ship documentation update. Reads all project docs, cross-references the diff, updates README/ARCHITECTURE/CONTRIBUTING/CLAUDE.md to match what shipped, polishes CHANGELOG voice, cleans up TODOS, and optionally bumps VERSION. Use when asked to "update the docs", "sync documentation", or "post-ship docs". Proactively suggest after a PR is merged or code is shipped.

    Also in 18 projects that use this

  • +1 more from seek888

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 115 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read .sre/baselines/<service>.yaml and query current values:

    line 28
  2. Very specific:

    Read .sre/topology.yaml and check upstream + downstream services:

    line 57
  3. Distinctive:

    If a downstream dependency is unhealthy, it's likely the root cause (not the reported service).

    line 68
  4. Very specific:

    If structured JSON logs (log_format: structured_json in service context):

    line 81
  5. Very specific:

    Read .sre/incidents/ for past incidents involving the same service.

    line 90
  6. Very specific:

    If the user confirms this is a real incident, write to .sre/incidents/<date>-<service>-<summary>.yaml:

    line 128

“Common” is measured: kept by at least 6 in 10 of the 115 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Incident Investigation

Investigate operational issues by correlating live metrics, logs, and infrastructure context. Unlike template-based runbooks, this skill uses .sre/ context to know your services, their baselines, and their dependencies — enabling reasoning, not just checklist execution.

Prerequisite: .sre/ context from the discover skill. Can work without it but is significantly more effective with context.

Phase 1: Understand the Symptom

Parse the user's report to identify:

  1. Affected service — match against .sre/services/ files
  2. Symptom type — one of: errors, latency, availability, resource exhaustion, unknown
  3. When it started — if known, use as time range; otherwise default to last 30 minutes

Phase 2: Triage — Compare Against Baselines

Read .sre/baselines/<service>.yaml and query current values:

Check Golden Signals

# Current CPU vs baseline
curl -s --get "${PROMETHEUS_URL}/api/v1/query" \
  --data-urlencode 'query=sum(rate(container_cpu_usage_seconds_total{namespace="<ns>",pod=~"<pattern>",container!=""}[5m]))'

# Current memory vs baseline
curl -s --get "${PROMETHEUS_URL}/api/v1/query" \
  --data-urlencode 'query=sum(container_memory_working_set_bytes{namespace="<ns>",pod=~"<pattern>",container!=""})'

# Recent restarts
curl -s --get "${PROMETHEUS_URL}/api/v1/query" \
  --data-urlencode 'query=sum(increase(kube_pod_container_status_restarts_total{namespace="<ns>",pod=~"<pattern>"}[30m]))'

# Pod count vs expected replicas
curl -s --get "${PROMETHEUS_URL}/api/v1/query" \
  --data-urlencode 'query=kube_deployment_status_replicas_available{namespace="<ns>",deployment="<name>"}'

Compare each value against the baseline. Flag anything that's:

  • CPU > 2× baseline
  • Memory > 1.5× baseline
  • Restarts > 0 in last 30m
  • Available replicas < desired replicas

Phase 3: Trace the Blast Radius

Read .sre/topology.yaml and check upstream + downstream services:

For each dependency:

# Quick health check: pod count and restart count
curl -s --get "${PROMETHEUS_URL}/api/v1/query" \
  --data-urlencode 'query=kube_deployment_status_replicas_available{namespace="<ns>",deployment="<dep>"}'
curl -s --get "${PROMETHEUS_URL}/api/v1/query" \
  --data-urlencode 'query=sum(increase(kube_pod_container_status_restarts_total{namespace="<ns>",pod=~"<dep>.*"}[30m]))'

If a downstream dependency is unhealthy, it's likely the root cause (not the reported service).

Phase 4: Pull Logs

Query Loki for recent error logs from the affected service:

curl -s --get "${LOKI_URL}/loki/api/v1/query_range" \
  --data-urlencode 'query={namespace="<ns>",container="<container>"} |= "error" or |= "Error" or |= "ERROR" or |= "fatal" or |= "panic"' \
  --data-urlencode 'limit=50' \
  --data-urlencode 'start=<30min_ago_epoch_ns>' \
  --data-urlencode 'end=<now_epoch_ns>'

If structured JSON logs (log_format: structured_json in service context):

curl -s --get "${LOKI_URL}/loki/api/v1/query_range" \
  --data-urlencode 'query={namespace="<ns>",container="<container>"} | json | severity=~"error|fatal|panic"' \
  --data-urlencode 'limit=50'

Phase 5: Check Incident History

Read .sre/incidents/ for past incidents involving the same service. Similar symptoms may indicate a recurring issue.

Phase 6: Generate Investigation Report

Structure the output as:

## Investigation Report: <service> — <symptom>
**Time:** <timestamp>
**Severity:** <estimated based on blast radius and deviation from baseline>

### Current State vs Baseline
| Signal | Current | Baseline | Status |
|--------|---------|----------|--------|
| CPU    | 0.8 cores | 0.3 cores | ⚠ 2.7× baseline |
| Memory | 512 MB | 450 MB | ✓ normal |
| Restarts | 3 | 0/hr | ✗ abnormal |
| Pods | 1/1 | 1 | ✓ |

### Blast Radius
- upstream: <service1> ✓, <service2> ✓
- downstream: <service3> ✗ (2 restarts in 30m), <service4> ✓

### Hypothesis
Based on the data:
1. <Most likely cause based on evidence>
2. <Alternative explanation>

### Evidence (Logs)
<relevant error log excerpts>

### Recommended Actions
1. <specific action based on evidence>
2. <specific action>

Phase 7: Record Incident (Optional)

If the user confirms this is a real incident, write to .sre/incidents/<date>-<service>-<summary>.yaml:

service: <name>
started_at: <ISO timestamp>
symptoms: [<list>]
root_cause: <if determined>
resolution: <if resolved>
signals:
  cpu_deviation: 2.7x
  restarts: 3
similar_to: []  # references to past incidents

This builds institutional memory — future investigations can reference past patterns.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.