with one click
debug
Systematic debugging workflow: reproduce, isolate, fix, and verify.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Systematic debugging workflow: reproduce, isolate, fix, and verify.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Write a structured handoff at session end. Preserves context so the next agent can resume without human briefing. Invoke before ending any feature session longer than 30 minutes.
Multi-perspective code review against project standards with P1/P2/P3 severity classification. Works in Claude Code (Agent + optional GitHub MCP) and Cursor (Task subagents + gh/git). Use when the user invokes /review, asks for a PR or diff review, or wants a standards-aligned review with severity tags.
Multi-perspective code review (P1/P2/P3) for Cursor: inline checklists plus three parallel Task subagents (perf-auditor, security-reviewer, simplicity-reviewer with combined data-integrity prompt). Use when the user invokes /review, asks for a PR review, or wants repo-standard findings with severity.
Create well-formatted git commits following conventional commit standards.
Red→green→refactor discipline for new behavior — forces a failing test before implementation and a passing test before any claim of done.
Create or manage a git worktree for isolated parallel development — lets multiple agents work in the repo simultaneously without branch collisions.
| name | debug |
| description | Systematic debugging workflow: reproduce, isolate, fix, and verify. |
Systematic debugging workflow: reproduce, isolate, fix, and verify.
/debug <issue> [--logs <path>] [--trace]
issue: Description of the bug, error message, or issue number--logs <path>: Path to relevant log files--trace: Enable verbose tracing during investigationWhen this skill is invoked:
Autonomy:
Thoroughness:
Methodology:
Gather information:
Read relevant code in parallel:
Check logs if available:
# Recent logs
tail -100 {log_path}
# Search for errors
grep -i "error\|exception\|fail" {log_path}
Create minimal reproduction:
Write a failing test:
# Create test that captures the bug
{test_command} tests/unit/test_bug_reproduction.py -v
Verify test fails for the right reason
Form hypotheses (list 3-5 likely causes):
Test each hypothesis:
Binary search if issue location unclear:
Check common causes:
Implement minimal fix:
Verify fix:
# Run the failing test
{test_command} tests/unit/test_bug_reproduction.py -v
# Run related tests
{test_command} tests/unit/test_{module}.py -v
# Run full test suite
{test_command} tests/ -v
Add regression test if not already covered
Update issue/ticket with:
Create commit with clear message:
fix(scope): description of what was fixed
Root cause: [explanation]
Solution: [what was changed]
Closes #issue_number
If this fix took more than 15 minutes to diagnose, or the root cause was non-obvious, run /compound to capture the solution. This prevents future re-discovery of the same problem and builds the project's knowledge base in docs/solutions/.
/compound (if non-trivial fix)Null Reference:
# Symptom: "Cannot read property X of undefined"
# Check: Is the object initialized? Is it returned from async?
Race Condition:
# Symptom: Intermittent failures, works sometimes
# Check: Async operations, shared state, missing awaits
Type Error:
# Symptom: "Expected X but got Y"
# Check: API response shape, serialization, type coercion
Configuration:
# Symptom: Works locally, fails in CI/prod
# Check: Environment variables, file paths, permissions
$ /debug "TypeError: Cannot read property 'id' of undefined in UserService"
====== Phase 1: Understand ======
Error: TypeError: Cannot read property 'id' of undefined
Location: src/services/user.py:45
Stack trace points to: getUserById() method
Reading relevant files...
- src/services/user.py
- src/api/users.py
- tests/unit/test_user.py
====== Phase 2: Reproduce ======
Reproduction steps:
1. Call GET /api/users/999 (non-existent ID)
2. Service returns undefined instead of null
3. Caller tries to access .id property
Writing failing test...
Created: tests/unit/test_user_not_found.py
Test result: FAILED (as expected)
====== Phase 3: Isolate ======
Hypotheses:
1. getUserById returns undefined for missing users
2. Database query doesn't handle empty results
3. Null check missing in API layer
Testing hypothesis 1...
Confirmed: getUserById returns undefined, not null
Root cause: Missing null check after database query
====== Phase 4: Fix ======
Fix: Add explicit null return when user not found
src/services/user.py:45
- return result
+ return result if result else None
Running tests...
- test_user_not_found: PASSED
- test_user_service: PASSED (15/15)
- Full suite: PASSED (142/142)
====== Phase 5: Document ======
Root cause: Database query returned undefined for missing records,
but callers expected null. This caused a TypeError when accessing
properties on the undefined value.
Fix: Added explicit null return with proper type hints.
Ready to commit:
fix(user): handle missing user in getUserById
Closes #789