AgentSkillsCN

Debug Error

建立系统化的调试流程。

SKILL.md
--- frontmatter
name: Debug Error
description: Systematic debugging workflow
trigger: auto

Debug Error Workflow

Step 1: Reproduce

  • Identify exact steps to reproduce
  • Note environment details (OS, runtime version, config)
  • Capture full error output including stack trace

Step 2: Isolate

  • Add logging around suspected area
  • Check recent git changes: git log -5 --oneline
  • Compare with last known working version: git bisect
  • Check environment variables and config

Step 3: Root Cause

  • Trace the call stack from error to origin
  • Check for null/undefined, type mismatches, race conditions
  • Review related dependencies and their versions

Step 4: Fix

  • Make minimal change to fix root cause
  • Avoid band-aid fixes that mask the real issue
  • Add regression test covering the failure case

Step 5: Verify

  • Run full test suite
  • Test edge cases and boundary conditions
  • Confirm the original reproduction steps no longer fail
  • Document fix in commit message with issue reference