src/main/resources/targets/claude/skills/core/ops/x-troubleshoot-operations/SKILL.md
Diagnoses errors, stacktraces, build failures, and unexpected behavior. Systematic approach: reproduce, locate, understand, fix, verify. Use whenever something fails: compilation errors, test failures, runtime exceptions, coverage gaps, or performance issues.
npx skillsauth add edercnj/claude-environment x-troubleshoot-operationsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Provides a systematic approach to diagnose and fix issues in {{PROJECT_NAME}}. Covers compilation errors, test failures, build failures, runtime exceptions, and domain-specific bugs.
/x-troubleshoot-operations — diagnose issues using the full debug workflow/x-troubleshoot-operations "NullPointerException in PaymentService" — diagnose a specific error/x-troubleshoot-operations testMethodName — diagnose a specific test failure1. REPRODUCE -> Get the exact error (stacktrace, build log, test output)
2. LOCATE -> Find where the error originates
3. UNDERSTAND -> Why is it failing? Expected vs actual behavior?
4. FIX -> Write a test that reproduces the bug, then fix the code
5. VERIFY -> Run the full test suite to ensure no regressions
Always follow this order. Never skip step 4's "write a test first" — the bug-reproducing test prevents regressions.
Get the exact error output. Run the relevant command and capture the full stacktrace, build log, or test output.
{{COMPILE_COMMAND}}
Find where the error originates using the error patterns below.
The error patterns below are {{LANGUAGE}}-specific. Adapt to the actual compiler/interpreter messages for the project:
| Error Category | Likely Cause | Fix | |----------------|--------------|-----| | Missing symbol/type | Missing import, typo in class name | Check package structure, verify imports | | Type mismatch | Wrong type in assignment/return | Check type inference, explicit cast if needed | | Sealed type error | Missing permits/implementations | Add implementing class to sealed hierarchy | | Missing package/module | Wrong package or missing dependency | Verify directory matches package, check deps | | Interface mismatch | Signature mismatch with interface | Compare method signature with interface def |
{{TEST_COMMAND}}
| Failure Type | Diagnosis | Fix | |--------------|-----------|-----| | Assertion error (expected X got Y) | Logic bug in production code | Compare expected vs actual, trace the logic | | NullPointerException in test | Missing setup | Initialize all objects test needs | | Test passes alone, fails in suite | Shared mutable state | Ensure fresh objects per test | | Timeout in test | Async issue or infinite loop | Check for blocking calls, add timeouts |
{{BUILD_COMMAND}}
| Error | Cause | Fix | |-------|-------|-----| | Coverage threshold failure | Coverage below threshold | Write more tests, check coverage report | | Dependency resolution failure | Missing or conflicting dep | Check build file, resolve conflicts | | Out of memory | Memory issue in test/build | Increase memory limits, check for leaks |
The error patterns below are {{LANGUAGE}}-specific. Adapt to the actual runtime error messages for the project:
| Error Category | Likely Cause | Fix | |----------------|--------------|-----| | Missing class/module at runtime | Missing dependency at runtime | Check classpath/module path, add dependency | | Method/function not found | Version mismatch | Align dependency versions | | Connection refused | Service not running | Start required services, check ports | | Circuit breaker open | Downstream service failure | Check downstream health, wait for recovery |
| Symptom | Likely Cause | Fix | |---------|--------------|-----| | Slow response | N+1 queries, missing indexes | Add indexes, optimize queries | | Memory growing | Object leak, missing cleanup | Profile memory, fix resource management | | Thread starvation | Blocking on event loop | Use async patterns, offload to workers |
Analyze why the error occurs. Compare expected vs actual behavior. Trace the data flow from input to the failure point.
For every bug found:
// This test was added for bug #NNN
// Previously [describe the bug]
Run the full test suite. Confirm zero regressions. Check coverage thresholds.
When something fails, check in this order:
When troubleshooting within the feature lifecycle, classify errors for x-lib-verify-group:
| Classification | When | Action | |----------------|------|--------| | TASK_ERROR | Error in current group's code | Retry same tier | | MISSING_DEPENDENCY | Missing type from previous group | Halt, flag regression | | BUILD_ERROR | Missing external dependency | Halt, fix build file | | UNKNOWN | Unrecognized error pattern | Escalate tier |
| Scenario | Action | |----------|--------| | Stacktrace not available | Request the user to provide the full error output | | Error in third-party library | Verify dependency versions, check for known issues upstream | | Non-reproducible failure | Investigate shared mutable state, race conditions, or environment differences | | Fix introduces new failures | Revert the fix, re-analyze root cause with broader context |
| Skill | Relationship | Context | |-------|-------------|---------| | x-lib-verify-group | Referenced by | Invokes troubleshoot when compilation fails during group verification | | x-implement-story | Referenced by | Used during Phase 4 (fixes) for diagnosing test and build failures | | x-execute-tests | Complements | Troubleshoot diagnoses failures that x-execute-tests reports |
development
Documentation freshness gate: validates 6 dimensions (readme, api, adr, etc.) per PR.
testing
Conditional dep-policy gate: CVEs, licenses, versions, freshness; SARIF + report.
documentation
Incrementally updates the service or system architecture document; never regenerative.
development
Scans code and git history for leaked credentials, API keys, and tokens; SARIF output.