agentleFS
qyndexqyndex/claude-init/.claude/skills/observability/SKILL.md

observability

Skill2 starsChanged 5 months agoMITView on GitHub

Scaffold structured logs, metrics, and trace spans for any new endpoint or service. Verify emissions in PR diffs. Enforce the observability rules from .claude/rules/backend.md mechanically (not just aspirationally).

87 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use gitops, background-jobs 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.
  • kcns008Skill

    gitops

    GitOps Agent (Flow) — manages ArgoCD applications, Helm charts, Kustomize overlays, deployment strategies (canary, blue-green, rolling), multi-cluster GitOps, and drift detection for Kubernetes and OpenShift clusters.

    Also in 4 projects that use this

  • YepAPISkill

    background-jobs

    Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

    Also in 4 projects that use this

  • Mushfiqur-Rahman-RobinSkill

    rag-systems

    Best practices for building Retrieval-Augmented Generation systems — chunking, embedding, hybrid retrieval, reranking, indexing, caching, evaluation, observability — plus a catalog of RAG patterns and when each applies.

    Also in 3 projects that use this

  • YepAPISkill

    data-pipelines

    ETL patterns, cron scheduling, queue-based processing, and batch jobs with Inngest/BullMQ.

    Also in 4 projects that use this

  • wpankSkill

    caching

    Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.

    Also in 5 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 13 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 70 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every new endpoint emits: one structured log + one latency metric + one error-rate metric + one trace span.

    line 11
  2. Distinctive:

    Use field-level redaction at the logger level (structlog processors, Pino redact, etc.).

    line 57
  3. Distinctive:

    No silent error swallow: If you catch, you log (with stack) AND re-raise OR explicit suppression note.

    line 75

“Common” is measured: kept by at least 6 in 10 of the 70 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

Observability

Every new endpoint emits: one structured log + one latency metric + one error-rate metric + one trace span. Enforced, not aspired.

Per-endpoint checklist

# Python (FastAPI / Django) example pattern — adapt per stack
import structlog
from opentelemetry import trace
from prometheus_client import Histogram, Counter

log = structlog.get_logger()
tracer = trace.get_tracer(__name__)
latency = Histogram("endpoint_latency_seconds", "Endpoint latency", ["endpoint", "method", "status"])
errors = Counter("endpoint_errors_total", "Endpoint errors", ["endpoint", "method", "error_class"])

async def handler(request):
    with tracer.start_as_current_span("endpoint.foo") as span:
        span.set_attribute("user_id", request.user_id)
        try:
            with latency.labels("foo", "GET", "200").time():
                result = await do_work()
            log.info("foo.success", user_id=request.user_id, duration_ms=...)
            return result
        except Exception as e:
            errors.labels("foo", "GET", type(e).__name__).inc()
            log.error("foo.failure", user_id=request.user_id, error=str(e), exc_info=True)
            raise

Required emissions (PR-verified)

TierWhatWhy
1Structured INFO log (timestamp, request_id, user_id, endpoint, duration_ms, status)Trace per-request
2ERROR log with stack + request_idDebug failures
3Latency Histogram per endpointSLO measurement
4Error counter per (endpoint, error_class)SLO + alerting
5Trace span with endpoint name + key attrsCross-service tracing

PII redaction

Never log:

  • password, raw token, API key, session cookie
  • full credit card, full SSN, raw OAuth refresh token
  • raw email body, raw chat message content

Use field-level redaction at the logger level (structlog processors, Pino redact, etc.).

Verification (mechanical)

The verify-loop skill checks for these emissions in the diff:

# Look for log.info / log.error / increment / span starts in new endpoint code
rg -A 5 -B 2 'async def \w+_handler|^def \w+_handler' new_files \
  | rg -q 'log\.(info|error)|span\.|latency\.labels|errors\.labels' || \
  echo "MISSING: endpoint has no observability emissions"

For TypeScript: equivalent ripgrep on logger.info/error, metrics.increment, tracer.startSpan.

Hard rules

  • No new endpoint without observability emissions. Enforced at verify-loop.
  • No PII in logs. Enforced by /pii-audit and structlog/Pino field redaction.
  • No silent error swallow. If you catch, you log (with stack) AND re-raise OR explicit suppression note.
  • Tier 1 services emit traces too. T2/T3 can emit just logs + metrics.

References

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.