agentleFS
viknesh20-20viknesh20-20/claude-code-tool-kit/.claude/skills/error-monitor/SKILL.md

error-monitor

Skill7 starsChanged 7 months agoMITView on GitHub

Sets up error monitoring and tracking for the project. Detects the framework and generates integration code for Sentry, Bugsnag, or custom error tracking with proper error boundaries and middleware.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    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:

    NEVER hardcode DSN/API keys — use environment variables

    line 74
  2. Distinctive:

    Always scrub sensitive data before sending to error tracker

    line 75
  3. Distinctive:

    Don't track expected errors (404 for invalid URLs, validation errors)

    line 78

≈ “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

Error Monitoring Setup

Detect Framework

!ls package.json requirements.txt go.mod Cargo.toml *.csproj 2>/dev/null !cat package.json 2>/dev/null | grep -E "react|next|express|fastify|koa|nest|vue|angular|svelte" | head -5 !cat requirements.txt pyproject.toml 2>/dev/null | grep -iE "django|flask|fastapi|starlette" 2>/dev/null | head -5

Existing Error Tracking

!grep -r "sentry\|bugsnag\|rollbar\|airbrake\|errortracking\|newrelic" --include="*.json" --include="*.ts" --include="*.js" --include="*.py" -l 2>/dev/null | head -5


Setup Process

Step 1: Choose Provider

Based on the project stack:

  • Sentry: Best overall, supports all major languages
  • Bugsnag: Good for mobile and frontend
  • Custom: For projects that can't use third-party services

Step 2: Framework-Specific Integration

React/Next.js:

  • Error Boundary component wrapping the app
  • Sentry.init() in entry point
  • Source map upload in build step
  • Client-side error capturing

Express/Fastify/Koa:

  • Error handling middleware (must be last middleware)
  • Request context enrichment (user, request ID)
  • Unhandled rejection handler

FastAPI/Django/Flask:

  • Middleware for request error capture
  • Custom exception handlers
  • Background task error tracking

Go:

  • Panic recovery middleware
  • Error wrapping with context
  • Goroutine error capture

Step 3: Configuration

Generate configuration file with:

  • DSN/API key reference (from environment variable, never hardcoded)
  • Environment detection (development, staging, production)
  • Release version tracking
  • Sample rate configuration
  • Sensitive data scrubbing rules (strip passwords, tokens, PII)

Step 4: Custom Error Classes

Generate project-specific error types:

  • AppError base class with code, message, context
  • ValidationError for input validation failures
  • NotFoundError for missing resources
  • AuthError for authentication/authorization failures
  • ExternalServiceError for third-party failures

Step 5: Alert Configuration

Recommend alert rules:

  • Critical: Unhandled exceptions, auth failures, data corruption
  • Warning: High error rate, slow responses, degraded service
  • Info: New error types, deployment markers

Rules

  • NEVER hardcode DSN/API keys — use environment variables
  • Always scrub sensitive data before sending to error tracker
  • Include contextual data (user ID, request ID, action) with every error
  • Set up source maps for frontend (minified code is useless in stack traces)
  • Don't track expected errors (404 for invalid URLs, validation errors)

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.