AgentSkillsCN

error-tracking

设置带有可操作上下文的错误跟踪。适用于配置错误捕获或错误边界时使用。

SKILL.md
--- frontmatter
name: error-tracking
description: Set up error tracking with actionable context. Use when configuring error capture or error boundaries.
triggers:
  - "error tracking"
  - "capture errors"
  - "error boundaries"
priority: 1

Error Tracking

Capture errors with the context needed to debug them.

Core Principle

An error without context is useless. Every error should include:

ContextWhyExample
routeWhere it happened"/checkout"
job_nameWhat user was doing"checkout"
job_stepWhere in the flow"payment"
user_segmentWho's affected"premium"
app_versionRelease correlation"1.2.3"

Error Types to Capture

TypeCapture Method
Unhandled exceptionswindow.onerror, SDK auto-capture
Promise rejectionswindow.onunhandledrejection
Component errorsError boundaries
Async/await errorstry/catch with context
API errorsFetch/axios interceptors

What NOT to Include

Don'tWhy
PasswordsSecurity
Email/phonePII
Full request bodiesPII, size limits
Entire app stateUnbounded
Localized messagesBreaks grouping

Implementation

See templates/error-boundary.tsx for React error boundary with telemetry.

Use Read tool to load template when generating implementation.

Anti-Patterns

See references/anti-patterns.md for common error tracking mistakes.

Related

  • skills/source-map-setup - Readable stack traces
  • skills/api-tracing - API error correlation
  • references/frameworks/*.md - Framework-specific error handling