agentleFS
christyjacob4christyjacob4/claude-tricks/skills/debug/SKILL.md

debug

Skill2 starsChanged 9 months agoMITView on GitHub

Debug and fix failing tests or errors

144 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-ollama-tool, add-slack and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    add-ollama-tool

    Add Ollama MCP server so the container agent can call local models and optionally manage the Ollama model library.

    Also in 6 projects that use this

  • MicrosoftSkill

    add-slack

    Add Slack channel integration via Chat SDK.

    Also in 6 projects that use this

  • sskarzSkill

    add-telegram-swarm

    Add Agent Swarm (Teams) support to Telegram. Each subagent gets its own bot identity in the group. Requires Telegram channel to be set up first (use /add-telegram). Triggers on "agent swarm", "agent teams telegram", "telegram swarm", "bot pool".

    Also in 5 projects that use this

  • +9 more from microsoft

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. 0 are common, 21 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 127 edited versions we read keep these.

  • 21

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If runtime error, get the full stack trace and identify the failing component.

    line 37
  2. Distinctive:

    Read and understand the failing test file completely.

    line 71
  3. Distinctive:

    Read the production code that the test exercises.

    line 79
  4. Distinctive:

    Read related files: interfaces, shared utilities, configuration, DI modules, database schemas, or mocks that the code under test depends on.

    line 87
  5. Distinctive:

    Use elite-fullstack-architect to implement the fix:

    line 102
  6. Distinctive:

    Do not change unrelated code

    line 106
  7. Distinctive:

    After implementing the fix, launch two parallel agents to verify simultaneously.

    line 110
  8. Distinctive:

    Wait for both agents to complete: If either agent reports a failure, return to Phase 2 with the new information and repeat.

    line 128
  9. Distinctive:

    If the review finds issues, fix them before proceeding.

    line 142
  10. Distinctive:

    Run the entire test suite and build to catch any regressions anywhere in the codebase.

    line 151
  11. Distinctive:

    Wait for both agents to complete: If the full suite has failures, fix every one of them (there are no "pre-existing" failures).

    line 153
  12. Distinctive:

    If the bug was not caught by existing tests:

    line 157
  13. Distinctive:

    Add a test for this specific case

    line 158
  14. Distinctive:

    Add tests for related edge cases

    line 159
  15. Distinctive:

    Ensure this bug cannot recur

    line 160
  16. Distinctive:

    Run the new tests to confirm they pass:

    line 162
  17. Distinctive:

    Check test setup and mocks

    line 191
  18. Distinctive:

    Verify DI is configured correctly

    line 192
  19. Distinctive:

    Check database state for integration tests

    line 193
  20. Distinctive:

    Look for race conditions

    line 197
  21. Distinctive:

    Verify test uses proper async testing utilities

    line 198

“Common” is measured: kept by at least 6 in 10 of the 127 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Debug and Fix

Systematically debug and fix failing tests, build errors, or runtime issues using aggressive parallelization at every phase.

DO NOT STOP UNTIL THE ISSUE IS FIXED AND TESTS PASS.

Arguments

  • $ARGUMENTS - Test name, error message, or description of the issue

Phase 1: Reproduce and Gather Context

Launch three parallel agents simultaneously to maximize information gathering speed.

Agent 1 - Reproduce the failure:

If test failure:

# Run specific test
./gradlew test --tests "*$ARGUMENTS*" --info

# Or run all tests to find failures
./gradlew test

If build error:

./gradlew build --stacktrace

If runtime error, get the full stack trace and identify the failing component.

Capture all error details: full error message, stack trace, test name and class, file and line number, input that caused the failure.

Agent 2 - Check recent changes:

git diff HEAD~5 --name-only
git diff HEAD~5 -- <relevant paths>

Identify what files changed recently that could be related to the failure. Summarize which changes are most likely to have introduced the bug.

Agent 3 - Check git history:

git log --oneline -15
git log --oneline -5 -- <files related to $ARGUMENTS>

Determine if this is a regression by finding when the relevant code last changed and who changed it.

Wait for all three agents to complete. Synthesize their findings to determine:

  • Is this a single test failure or multiple?
  • Is it flaky (intermittent)?
  • Is it a regression (worked before)?
  • What is the scope of the problem?

Phase 2: Root Cause Analysis

Using the error details from Phase 1, launch three parallel agents to analyze all relevant code simultaneously.

Agent 1 - Analyze the failing test (use Explore or read directly):

Read and understand the failing test file completely. Document:

  • What the test expects
  • What setup and mocks it uses
  • What assertions are failing and why
  • Whether the test itself is correct or buggy

Agent 2 - Analyze the code under test (use Explore or read directly):

Read the production code that the test exercises. Document:

  • The relevant function or method signatures
  • The control flow path that leads to the failure
  • Any recent changes to this code (cross-reference with Phase 1 Agent 2 results)
  • Potential bugs: null references, wrong logic, missing error handling, race conditions

Agent 3 - Analyze related dependencies (use Explore or read directly):

Read related files: interfaces, shared utilities, configuration, DI modules, database schemas, or mocks that the code under test depends on. Document:

  • Whether any dependencies changed recently
  • Whether mocks match current interfaces
  • Whether configuration or DI wiring is correct
  • Whether database state assumptions still hold

Wait for all three agents to complete. Synthesize their findings into a root cause hypothesis:

  • What is wrong
  • Why it causes this specific error
  • What the minimal fix should be

Phase 3: Fix and Verify

3.1 Implement Fix

Use elite-fullstack-architect to implement the fix:

  • Fix the root cause, not symptoms
  • Make the minimal targeted change
  • Preserve existing behavior for passing cases
  • Do not change unrelated code

3.2 Parallel Verification

After implementing the fix, launch two parallel agents to verify simultaneously.

Agent 1 - Run the specific failing test:

./gradlew test --tests "*FailingTestName*" --info

Confirm the original failure is resolved. If it still fails, report the new error details.

Agent 2 - Run related tests:

./gradlew test --tests "*RelatedModule*"

Confirm no closely related tests have broken as a side effect of the fix.

Wait for both agents to complete. If either agent reports a failure, return to Phase 2 with the new information and repeat. Do not proceed until both pass.

Phase 4: Full Validation

Launch two parallel agents for final validation.

Agent 1 - Code review (use code-griller):

Review the fix for:

  • Correctness: is this the right fix for the root cause?
  • Edge cases: does it handle all boundary conditions?
  • Side effects: could it cause other issues?
  • Quality: does it follow project conventions and naming standards?

If the review finds issues, fix them before proceeding.

Agent 2 - Full test suite:

./gradlew test
./gradlew build

Run the entire test suite and build to catch any regressions anywhere in the codebase.

Wait for both agents to complete. If the full suite has failures, fix every one of them (there are no "pre-existing" failures). If the code review raised issues, address them and re-run verification.

4.1 Add Test Coverage

If the bug was not caught by existing tests:

  • Add a test for this specific case
  • Add tests for related edge cases
  • Ensure this bug cannot recur

Run the new tests to confirm they pass:

./gradlew test --tests "*NewTestName*"

4.2 Commit Fix

git add -A
git commit -m "$(cat <<'EOF'
(fix): [description of what was fixed]

Root cause: [brief explanation]
EOF
)"

Debug Techniques

For Test Failures

# Run with debug output
./gradlew test --tests "*TestName*" --info

# Run single test class
./gradlew :module:test --tests "com.example.TestClass"

For Null Pointer / Missing Data

  • Check test setup and mocks
  • Verify DI is configured correctly
  • Check database state for integration tests

For Async / Timing Issues

  • Check coroutine scopes
  • Look for race conditions
  • Verify test uses proper async testing utilities

For Flaky Tests

# Run multiple times
for i in {1..10}; do ./gradlew test --tests "*FlakyTest*" || break; done

Test Failure Policy

IMPORTANT: There is no such thing as a "pre-existing" test failure. If any test fails, whether it appears related to your changes or not, you must fix it. The task always completes with completely passing tests.

Completion Criteria

  • Root cause identified
  • Fix implemented
  • Original failing test passes
  • ALL tests pass (no exceptions for "pre-existing" failures)
  • No regressions introduced
  • Fix reviewed via code-griller
  • Committed with clear message

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.