Debugging

From akillness/jeo-skills · View interactive version

Debugging is an AI agent skill from the GitHub repository akillness/jeo-skills. Run a reproduce → isolate → verify debugging workflow for concrete bugs, regressions, flaky failures, and environment-specific behavior. Use when the user already has a failing command, test, request, UI flow, or narrowed symptom and needs root-cause diagnosis or fix verification rather than raw log

How to use this skill

Skill file

Debugging

Use this skill when the job is to turn a concrete failure into a bounded diagnosis loop.

The center of the skill is small and repeatable:

  1. define the failing behavior in testable terms,
  2. build or confirm the cheapest reliable reproducer,
  3. isolate the narrowest failing boundary,
  4. run one discriminating check per hypothesis,
  5. verify the fix under the same conditions.

Read references/handoff-boundaries.md before taking work that may belong to log-analysis, testing-strategies, code-review, or performance-optimization.

Read references/debug-loop.md for the full experiment-loop scaffolding.

Read references/mode-selection-and-fast-checks.md when the case is clearly a regression, flake, env/config mismatch, or artifact-led investigation.

When to use this skill

When not to use this skill

Instructions

Step 1: Freeze the failure definition

Write the failure in a form that can be retested.

Capture:

Minimum shape:

Expected: ...
Actual: ...
Trigger: ...
Environment: ...
Confidence: high | medium | low

If the report is still just "something failed" with giant logs and no narrowed symptom, route to log-analysis first.

Step 2: Choose the right first evidence source

Pick the cheapest path that can falsify or confirm your next hypothesis.

Use this routing shortcut:

Step 3: Build the smallest reliable reproducer

Prefer the cheapest reproduction that still fails.

Common shapes:

Useful tactics:

Step 4: Isolate the boundary before proposing fixes

Narrow the problem first.

Isolation angles:

  1. boundary — UI vs API vs DB vs worker vs config vs dependency vs asset/runtime
  2. input — one payload, record, seed, scene, or fixture
  3. history — what changed between good and bad
  4. environment — local vs CI vs staging vs production
  5. timing — ordering, retries, caching, clocks, async waits, shared state

High-value questions:

Step 5: Run one discriminating check per hypothesis

Do not patch five things at once.

For each hypothesis:

Good first checks:

Step 6: Use the right mode packet

Once the case type is clear, follow the matching packet in references/mode-selection-and-fast-checks.md:

Step 7: Fix the cause, then prove it

A good debugging result shows that the cause was addressed, not just the symptom muted.

Verification checklist:

Step 8: Escalate honestly when evidence is still weak

If reproduction or isolation still fails:

  1. say confidence is low,
  2. ask for the smallest missing artifact only,
  3. avoid pretending the root cause is known,
  4. prefer one more discriminating check over speculative patching.

Output format

Always return a concise debugging brief or debugging plan.

# Debugging Brief

## Failure definition
- Expected: ...
- Actual: ...
- Reproducer: ...
- Confidence: high | medium | low

## Isolation result
- Narrowed boundary: ...
- Recent change / env difference / artifact clue: ...

## Hypotheses and checks
1. Hypothesis: ...
   - Check: ...
   - Result: ...

## Likely root cause
- 1-3 sentences grounded in evidence

## Fix direction
1. ...
2. ...

## Verification
- Reproducer rerun: ...
- Regression guard: ...

## Handoff
- Stay in `debugging` | route to `diagnosing-bugs` (hard/flaky bug needing a HITL feedback loop) | route to `log-analysis` | route to `testing-strategies` | route to `code-review` | route to `performance-optimization`

Examples

Example 1: Regression after a refactor

Input

Saving a profile without uploading a new avatar now clears the existing avatar. It worked before the refactor.

Output sketch

Example 2: Flaky CI failure

Input

This checkout test passes locally but fails in CI about one in eight runs.

Output sketch

Example 3: Prod-only behavior with artifact clue

Input

The job only fails in staging. I have the first failing request payload and the config diff.

Output sketch

Example 4: Symptom-only log dump

Input

Here are 500 lines of retries and stack traces. Can you debug this?

Output sketch

Best practices

  1. Reproduce before patching — unproven fixes are guesses.
  2. Use the cheapest evidence source first — direct repro, repeated run, env diff, or artifact clue.
  3. Keep mode selection explicit — regression, flake, env/config, artifact-led, and runtime cases need different first checks.
  4. Separate symptom triage from diagnosis — logs help you start, not finish.
  5. Change one thing at a time — debugging is an experiment loop.
  6. End with verification — every result should say how the cause was confirmed.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.