agentleFS
RidhuanDEVRidhuanDEV/claude-skills/shadow-observe/SKILL.md

shadow-observe

Skill1 starsChanged yesterdayMITView on GitHub

Production Observability & SRE. Use when defining SLIs/SLOs, error budget burn-rate alerts, OpenTelemetry distributed tracing, structured log correlation, or Prometheus/Loki/Grafana monitoring.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every production service must define explicit Service Level Indicators (SLIs) and Service Level Objectives (SLOs):

    line 14
  2. Very specific:

    Never create an alert that has no clear mitigation step.

    line 27
  3. Very specific:

    Ensure a single X-Request-Id / W3C traceparent flows unbroken across:

    line 38
  4. Very specific:

    Cardinality Cost Guardrail: Never attach unbounded values (userId, requestId, email, raw URL path with UUIDs) as Prometheus metric labels — …

    line 47
  5. Very specific:

    Diagnostic Handoff: When alerts or trace anomalies pinpoint a failing subsystem, hand off trace timeline + redacted logs to /shadow-debug …

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “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

Shadow Observe (/shadow-observe) — SLI/SLO, Error Budgets, Tracing & Actionable Alerting

While /shadow-ops provisions the monitoring stack (Prometheus, Loki, Grafana), /shadow-observe governs what to measure, when to page a human, and how to turn telemetry into fast root-cause diagnosis.


1. Defining Measurable SLIs, SLOs & Error Budgets

Every production service must define explicit Service Level Indicators (SLIs) and Service Level Objectives (SLOs):

SLI CategoryMetric FormulaStandard SLO Target (28-Day Window)Allowed Error Budget (28 Days)
Availability$\frac{\text{Total Valid Requests} - \text{5xx Responses}}{\text{Total Valid Requests}}$99.9%40.3 minutes downtime / 0.1% failed requests
Latency (Interactive API)Proportion of requests with duration $\le 400\text{ms}$ (p95) and $\le 900\text{ms}$ (p99)95% < 400ms, 99% < 900ms5% slow requests
Async / Queue FreshnessProportion of background jobs / ETL watermarks processed within < 5 minutes99.5% < 5m0.5% delayed jobs

2. Actionable Alerting & Escalation Rules (Zero Alert Fatigue)

  1. Every Paging Alert Must Link to a Runbook Action:
    • Never create an alert that has no clear mitigation step. Every alert annotation must include runbook_url or exact triage commands (docker compose logs, SELECT * FROM pg_stat_activity, rollback command).
  2. Multi-Window Burn Rate Alerting:
    • Critical Page (P1 — Immediate Action): Fast burn where > 2% of the 28-day error budget is consumed in 1 hour (and still burning over the last 5 minutes).
    • Warning Ticket (P2 — Next Business Hours): Slow burn where > 5% of the error budget is consumed in 6 hours.
  3. Symptom-First, Cause-Second:
    • Page on user-visible symptoms (5xx spike, latency breach, queue stall, disk < 15% free, TLS cert expiring < 14 days), not noisy transient CPU spikes.

3. End-to-End Trace & Log Correlation (requestId / traceId)

Ensure a single X-Request-Id / W3C traceparent flows unbroken across:

  1. Frontend UI Error Boundary / Toast -> displays Ref ID: req_01H... so a client reporting a bug on WhatsApp/Email gives the exact lookup key.
  2. Nginx / Reverse Proxy Access Log -> logs $http_x_request_id.
  3. Backend Structured JSON Log -> every log line includes "requestId": "req_01H...", "userId", "tenantId", "route", "durationMs".
  4. Database / Queue Worker -> passes requestId & traceparent across async queue headers (shadow-concurrency) and SQL comments (/* req_id=req_01H... */) for slow-query tracing.

4. Cardinality Controls, Redaction & Debugging Handoff

  • Cardinality Cost Guardrail: Never attach unbounded values (userId, requestId, email, raw URL path with UUIDs) as Prometheus metric labels — put high-cardinality IDs in OpenTelemetry spans and structured logs only.
  • Telemetry Redaction: Strip Authorization, cookies, NIK, and credentials before exporting spans or logs.
  • Diagnostic Handoff: When alerts or trace anomalies pinpoint a failing subsystem, hand off trace timeline + redacted logs to /shadow-debug for causal hypothesis falsification.

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.