agentsclimarketplace

Debugging

Skill Elmmly/genie-team/skills/debugging

Structured root cause investigation for any reported bug, regression, or failed fix. Use when a user reports a bug or runtime misbehavior, when a test fails that you expected to pass, when a previous fix attempt didn't work ('the fix didn't work'), or when an error occurs during implementation. Reproduce first; find the root cause before patching.From its SKILL.md

Install
npx -y skills add Elmmly/genie-team --skill debugging

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.8 KB, as published. Nobody here has run it

Systematic Debugging

When a bug is reported, a regression appears, a test fails unexpectedly, or a fix attempt doesn't work, follow this protocol. Do NOT improvise. Do NOT try random changes.

This applies to user-reported runtime bugs exactly as it does to test failures during implementation — for a runtime bug, "the failing test" in Phase 1 means reproducing the reported behavior and stating the reproduction.

Attempt Counter

Track your fix attempts. Each time you modify code to fix the issue, increment the counter.

  • Attempt 1-3: Follow the 4-phase protocol below
  • Attempt 3+ (ESCALATION): STOP. See Escalation Protocol.

Phase 1: Reproduce and Read

  1. Run the failing test in isolation. Capture the EXACT error message.
  2. Read the error message completely — every line, every stack frame.
  3. Identify: What was expected? What actually happened? Where did execution diverge?
  4. Do NOT attempt a fix yet.

Output: A 1-2 sentence root cause hypothesis based on reading the error.

Phase 2: Pattern Analysis

  1. Compare working code vs broken code. What changed?
    • git diff to see recent changes
    • Compare with a similar test that passes
  2. Look for the SIMPLEST explanation first:
    • Typo? Wrong variable name?
    • Missing import? Wrong path?
    • Stale state? Missing setup?
  3. Check if the error matches a known pattern:
    • "Cannot find module" — import path or missing dependency
    • "undefined is not a function" — wrong method name or missing mock
    • "expected X received Y" — logic error or wrong test data

Output: Refined hypothesis with specific location (file:line).

Phase 3: Hypothesis Testing

  1. Form ONE hypothesis about the root cause
  2. Make ONE change to test that hypothesis
  3. Run the test
  4. If it passes: Go to Phase 4
  5. If it fails: Return to Phase 1 with the NEW error message (Increment attempt counter)

Rules:

  • ONE change at a time. Never change multiple things.
  • If the hypothesis was wrong, REVERT the change before trying the next one.
  • Each failed hypothesis is data — write down what you learned.

Phase 4: Implement the Fix

Once root cause is confirmed:

  1. REVERT the hypothesis test change (if it was a hack)
  2. Write a failing test that captures the root cause (TDD RED phase)
  3. Implement the proper fix (TDD GREEN phase)
  4. Verify all tests pass (including the original failing test)

This phase hands off to the tdd-discipline skill.

Escalation Protocol

TRIGGERED AT: 3 failed fix attempts.

STOP. Do not attempt another fix. Instead:

  1. Re-read the ORIGINAL error message (not the latest one — you may have drifted)
  2. Question your assumptions:
    • "Am I looking at the right file?"
    • "Am I understanding the error correctly?"
    • "Is my mental model of how this code works actually correct?"
    • "Could the problem be in test setup rather than implementation?"
    • "Could this be an environmental issue (dependency version, config)?"
  3. Read the code path from entry point to failure — don't skim, READ
  4. If still stuck: Ask for help (interactive) or document the block and stop (headless)

In headless mode: After escalation, set execution report status to blocked with a clear description of what was tried and what failed.

RED FLAGS — Stop Immediately

Anti-PatternSignalResponse
Shotgun debuggingYou're changing multiple things at onceSTOP. Revert all. Pick ONE hypothesis.
Symptom fixingYour fix suppresses the error without understanding why it occursSTOP. Return to Phase 1. Find root cause.
"It works now"Tests pass but you can't explain why your change fixed itSTOP. Revert and reproduce. Understand the mechanism.
Escalating complexityEach fix attempt is more complex than the lastSTOP. Trigger escalation — your mental model is wrong.
Test modificationYou're tempted to change the test to match your codeSTOP. The test defines expected behavior. Fix implementation.

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.