agentleFS
jimtinjimtin/production-ai/skills/error-logging-instrumentation/SKILL.md

error-logging-instrumentation

Skill1 starsChanged 5 months agoMITView on GitHub

Vercel-first, provider-aware review and remediation workflow for web app error logging. Use when a user asks to audit, add, fix, harden, or verify logging, error capture, runtime observability, error boundaries, structured logs, correlation IDs, alerting evidence, or production debuggability in an existing web app.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Start from repo truth: instructions, package scripts, routes, API handlers, server actions, jobs, auth, upload/parsing surfaces, deployment …

    line 14
  2. Very specific:

    Use $full-app-review for broad non-mutating app audits.

    line 15
  3. Very specific:

    Use Vercel observability patterns first when the repo is Vercel/Next.js based.

    line 16
  4. Distinctive:

    Do not add Sentry, Datadog, Axiom, Logtail, Honeycomb, or another provider unless the repo already uses it or the user explicitly approves.

    line 17
  5. Distinctive:

    Do not log secrets, PII, raw document/file contents, raw prompts, tokens, cookies, session IDs, payment details, or full provider payloads.

    line 18
  6. Very specific:

    Before push-readiness, run $security-threat-model for logging/privacy surfaces, dependency audit, and a repo-root scoped gitleaks scan.

    line 20
  7. Distinctive:

    Read repo instructions and canonical local/container gates.

    line 25
  8. Very specific:

    Run scripts/logging_inventory.py <repo> --format markdown when useful for a static first pass.

    line 27
  9. Very specific:

    Prefer existing logger/error-reporting wrappers.

    line 42
  10. Very specific:

    Keep logging close to the boundary that knows the useful context: route/action/job/webhook/provider adapter.

    line 43
  11. Distinctive:

    Add redaction/normalization before logs leave the process.

    line 44
  12. Distinctive:

    Add retries, timeouts, dead-letter capture, or alert routing only when the current failure mode needs it.

    line 46
  13. Very specific:

    Read references/remediation-patterns.md and references/privacy-redaction.md before editing.

    line 47
  14. Distinctive:

    Run focused tests for changed failure paths before the full local/container gate.

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Error Logging Instrumentation

Purpose

Use this skill to decide whether an existing web app has enough error logging to debug production failures safely, then patch gaps when the user asks for remediation. The default stance is Vercel-first and provider-aware: prefer the app's existing logging/error provider and Vercel runtime patterns before proposing a new vendor.

Operating Rules

  • Start from repo truth: instructions, package scripts, routes, API handlers, server actions, jobs, auth, upload/parsing surfaces, deployment config, tests, and existing logging code.
  • Use $full-app-review for broad non-mutating app audits. Use this skill for the deeper observability/error-logging workstream or for remediation.
  • Use Vercel observability patterns first when the repo is Vercel/Next.js based. Use vercel:observability for Vercel-specific logs, drains, OpenTelemetry, dashboards, and production log checks when available.
  • Do not add Sentry, Datadog, Axiom, Logtail, Honeycomb, or another provider unless the repo already uses it or the user explicitly approves.
  • Do not log secrets, PII, raw document/file contents, raw prompts, tokens, cookies, session IDs, payment details, or full provider payloads.
  • For code changes, add targeted unit, integration, and browser/E2E coverage for each changed failure path. Run $test-readiness-preflight before expensive gates.
  • Before push-readiness, run $security-threat-model for logging/privacy surfaces, dependency audit, and a repo-root scoped gitleaks scan.

Workflow

  1. Baseline the app.
    • Read repo instructions and canonical local/container gates.
    • Identify framework, deployment target, route tree, API/server actions, background jobs, auth, storage, uploads, external providers, admin paths, and tests.
    • Run scripts/logging_inventory.py <repo> --format markdown when useful for a static first pass. Treat it as evidence collection only, not a sufficiency decision.
  2. Map critical failure surfaces.
    • Use references/coverage-matrix.md.
    • Include client routes, API handlers, server actions, webhooks, cron/jobs, admin mutations, uploads/parsers, payments, auth callbacks, database migrations, provider calls, and deployment/runtime failures.
    • For each surface, record the failure, user impact, operator question, current logging/capture evidence, and missing proof.
  3. Evaluate sufficiency. Logging is sufficient only when an operator can identify what failed, where it failed, why it likely failed, affected category/scope, retry/dead-letter status where relevant, and the next action without exposing sensitive data.
    • Structured logs or provider events include safe context such as route/action, operation name, coarse role/tenant category, request/correlation ID where available, provider name, status code, duration, retry count, and sanitized error class/message.
    • Users receive safe fallback states or sanitized errors.
    • Critical failures are surfaced outside local logs through Vercel logs/drains, an existing error provider, alerting, dashboards, or documented manual log queries.
    • Tests prove both the failure behavior and the expected logging/capture call where practical.
  4. Remediate gaps.
    • Prefer existing logger/error-reporting wrappers. If none exist, add a small local wrapper instead of scattering ad hoc console.*.
    • Keep logging close to the boundary that knows the useful context: route/action/job/webhook/provider adapter.
    • Add redaction/normalization before logs leave the process.
    • Preserve stack traces for server-side operators only; never expose internals to users.
    • Add retries, timeouts, dead-letter capture, or alert routing only when the current failure mode needs it.
    • Read references/remediation-patterns.md and references/privacy-redaction.md before editing.
  5. Verify and report.
    • Read references/verification-checklist.md.
    • Run focused tests for changed failure paths before the full local/container gate.
    • Report current instrumentation found, surfaces covered/not covered, privacy risks, alerting/monitoring evidence, commands run, coverage status, residual gaps, and any provider access limits.

Output Expectations

For audits, lead with findings ordered by severity and include evidence paths. For remediation, completion reports must include changed logging surfaces, tests added, focused test results, full local/container gate status, $security-threat-model status when push-readiness is in scope, gitleaks status, dependency audit status, and any remaining production-only validation gaps.

References

  • references/coverage-matrix.md: failure-surface checklist.
  • references/privacy-redaction.md: safe and unsafe log payload rules.
  • references/remediation-patterns.md: Vercel/Next.js-first and provider-neutral implementation patterns.
  • references/verification-checklist.md: proof requirements.

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.