Agent skill
Debug
Systematically diagnose and fix errors, test failures, and unexpected behavior.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/debug-carrot-foundation-methodology-rules
SKILL.md
1. Capture Evidence
Gather all relevant information before making changes:
- The exact command that failed
- The full error message and stack trace
- Which package or Nx target is affected
- What changed recently (
git diff,git log --oneline -5)
2. Isolate the Failure
Determine the error category:
- TypeScript error: Run
pnpm nx ts <project>to reproduce - Lint error: Run
pnpm nx lint <project>to reproduce - Test failure: Run
pnpm nx test <project>to reproduce, then narrow to a single test file withpnpm nx test <project> -- --testPathPattern=<file> - Build error: Run
pnpm nx build <project>to reproduce - Runtime error: Check Lambda handler wiring and environment variables
Narrow down to the smallest reproducible scope: a single nx run <project>:<target> command or a single test file.
3. Fix the Root Cause
- Fix the root cause, not just the symptom
- Preserve all existing changes that are unrelated to the bug
- Prefer using existing shared helpers over creating new utilities
- Check if the same issue exists in similar files or patterns
4. Re-verify
Run all quality checks to confirm the fix and ensure no regressions:
pnpm lint:affected
pnpm ts:affected
pnpm test:affected
All three must pass before the fix is considered complete.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?