Agent skill
debug-whatifwedigdeeper-claude-template
Investigate and fix a bug systematically
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/testing/debug-whatifwedigdeeper-claude-template
SKILL.md
Debug: $ARGUMENTS
Systematically investigate and fix the reported bug.
Process
1. Reproduce the Issue
- Understand the expected vs actual behavior
- Identify steps to reproduce
- Run the app or tests to confirm the bug exists
2. Gather Information
# Check recent changes
git log --oneline -10
# Check for related errors
npm run build 2>&1
npm test 2>&1 | head -50
3. Locate the Problem
Search strategies:
- Grep for error messages or related keywords
- Trace the code path from UI to data
- Check recent git changes to affected files
Narrow down:
- Which file(s) are involved?
- Which function(s)?
- Which line(s)?
4. Understand Root Cause
Read the code and understand:
- What is the code supposed to do?
- What is it actually doing?
- Why is there a difference?
Common causes:
- Off-by-one errors
- Null/undefined not handled
- Async timing issues
- State not updated correctly
- Wrong variable referenced
5. Develop Fix
- Fix the root cause, not just symptoms
- Consider edge cases
- Keep the fix minimal and focused
6. Add Regression Test
Create a test that:
- Would have caught this bug
- Verifies the fix works
- Prevents future regression
test('should handle [specific case that was broken]', () => {
// Test the exact scenario that was failing
});
7. Validate
npm run build
npm run lint
npm test
8. Document
Summarize:
- What was the bug
- Root cause
- How it was fixed
- Test added
Debugging Tools
Console debugging:
console.log('variable:', variable);
console.trace('call stack');
React DevTools: Check component state and props
Network tab: Check API requests/responses
Node debugging:
node --inspect script.js
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?