agentleFS
liza-masliza-mas/liza/skills/debugging/SKILL.md

debugging

Skill409 starsChanged 34 days agoApache-2.0View on GitHub

Debugging Protocol

We split this skill into the rules it gives an agent

25 rules. 0 are common, 24 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 98 edited versions we read keep these.

  • 24

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If not sufficient, there are two different paths to pursue: Fast Path and Normal Path.

    line 8
  2. Distinctive:

    If any of these is the cause → fix directly, no protocol needed.

    line 21
  3. Distinctive:

    Constraint: No refactor, no cleanup, no opportunistic improvements.

    line 35
  4. Distinctive:

    Escalation: If fix fails on first attempt → undo the fix, then escalate to normal path.

    line 47
  5. Distinctive:

    If new information contradicts the initial hypothesis → abandon Fast Path immediately.

    line 48
  6. Distinctive:

    Before qualification, ground the report:

    line 54
  7. Distinctive:

    If critical context is missing, ask before proceeding.

    line 61
  8. Very specific:

    When debugging detected, ask: "Debugging in [collaboration mode] because [reason].

    line 65
  9. Distinctive:

    If sporadic: narrow conditions or instrument.

    line 82
  10. Distinctive:

    Document both positive (triggers) and negative (doesn't trigger) cases

    line 87
  11. Distinctive:

    Temporal Bug Patterns: If timing-related, identify the category:

    line 89
  12. Distinctive:

    Add timestamps/sequence IDs to logs

    line 96
  13. Distinctive:

    Check replica lag / propagation status

    line 99
  14. Distinctive:

    Before narrowing, establish a reference point:

    line 119
  15. Distinctive:

    If no analogue exists, note explicitly — you're debugging novel code without a known-good reference.

    line 125
  16. Distinctive:

    Observability check: Before narrowing, ensure you can observe the relevant state transitions.

    line 133
  17. Distinctive:

    Exit condition: If narrowing reveals expected behavior → False Positive path: document why, assess doc/UX need, close as "Not a Bug"

    line 144
  18. Distinctive:

    Analysis Summary: Before Root Cause Identification, summarize the narrowing chain.

    line 146
  19. Distinctive:

    Before proposing fix: what evidence would prove this root cause wrong?

    line 152
  20. Distinctive:

    If bug traced to external dependency: present options (workaround / upstream report / version change) before proceeding.

    line 168
  21. Distinctive:

    If manual repro only: write failing test now

    line 170
  22. Distinctive:

    Verify test fails for the right reason

    line 171
  23. Distinctive:

    Run related tests for regressions

    line 173
  24. Distinctive:

    Search codebase for similar patterns

    line 174
  25. Distinctive:

    If explanation doesn't hold → Low confidence regardless of test results.

    line 177

“Common” is measured: kept by at least 6 in 10 of the 98 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

Debugging optimizes for certainty, not speed. Speed is a byproduct of certainty. Debugging always starts by ruling out trivial causes. If not sufficient, there are two different paths to pursue: Fast Path and Normal Path.

Quick Wins (30 seconds max)

First check the no brainers:

  • Typo / wrong variable name
  • Missing import / uninstalled dependency
  • Stale cache / needs rebuild
  • Wrong branch / uncommitted changes
  • Environment variable missing / misconfigured
  • Runtime / compiler version mismatch
  • Unexpected input shape / encoding / locale

If any of these is the cause → fix directly, no protocol needed.

Fast Path Debugging

Note: Regular tasks have their own FAST PATH (Rule 4).

Eligible when ALL true:

  • Bug conditions are obvious and need no report intake.
  • Stacktrace/error points directly to fault location (no inference needed)
  • Single hypothesis survives first inspection (no competing explanations)
  • Fix is self-evident from the bug (seeing the problem IS seeing the solution)
  • Localized (single file, single function)
  • Deterministic (not flaky)

Constraint: No refactor, no cleanup, no opportunistic improvements. Fix the bug and stop.

Format:

Mode: Debug (Fast)
Bug: [one-line: location + cause]
Fix: [one-line change]
Verify: [test/command] → [expected outcome]
Proceed (P)?

The above verification should be successful for the bug to be considered fixed.

Escalation: If fix fails on first attempt → undo the fix, then escalate to normal path. No second tries in fast mode. If new information contradicts the initial hypothesis → abandon Fast Path immediately. Don't bend the hypothesis to fit.

Normal Path Debugging

Bug Report Intake

Before qualification, ground the report:

  • Where? (local / CI / staging / prod)
  • What branch/version?
  • Since when? (always / recent / after X)
  • Who's affected? (just me / others / unknown)
  • What was already tried?

If critical context is missing, ask before proceeding.

Mode Selection

When debugging detected, ask: "Debugging in [collaboration mode] because [reason]. Override?"

Defaults: Syntax/type → Autonomous. Logic → User Duck. Architectural → Pairing.

Escalation: 2 failed Autonomous → User Duck. 3 stalled iterations → Stop & Document (see Structured Failure Report).

Bug Qualification

Convergence Goal: A reproducible trigger + a traced failure path. Iterate until both are stable.

Failure Path: Trace trigger → state → symptom with concrete identifiers (values, line numbers, states).

  • Distinguish: Observed (logs/debugger) vs Inferred (code reading)
  • Multiple errors: identify primary vs cascade
  • Calibration: ❌ "The validation fails" ✓ "score=None at line 47 → ValueError; set by parse_input(line 32) receiving empty string"

Reproducibility: Capture in failing test (ideal — this becomes the regression test) or documented manual steps (acceptable). Reduce to minimal case before analysis — fewer lines reveal more. If sporadic: narrow conditions or instrument. Do not propose fixes for untriggerable bugs.

Counterfactual Check: What similar inputs/states do NOT trigger the bug?

  • Identify the boundary: "fails with empty string but not whitespace" reveals more than "fails with empty string"
  • Vary one dimension at a time to isolate the trigger
  • Document both positive (triggers) and negative (doesn't trigger) cases

Temporal Bug Patterns: If timing-related, identify the category:

  • Race condition: multiple actors, shared state, non-deterministic outcome
  • Async ordering: operations complete in unexpected sequence
  • Cache staleness: read returns outdated value
  • Eventual consistency: state not yet propagated

Instrumentation for temporal bugs:

  • Add timestamps/sequence IDs to logs
  • Inject artificial delays to widen race windows
  • Force cache misses to isolate caching effects
  • Check replica lag / propagation status

These bugs may resist minimal reproduction — document the timing conditions even if not fully deterministic.

Qualification Summary:

Bug Profile: [regression|novel] [deterministic|flaky] [reproducible|sporadic] [tested|untested]
  Optional: [technical|logical] [observable|opaque] [localized|distributed] [stateless|stateful]
If regression: consider git bisect (known-good SHA, fast test command; moves HEAD — approval required).
Signal: [symptom] vs [expected] — Observability: [stacktrace|logs|metrics|user report|silent]
Impact: [data loss | security exposure | user-visible | silent corruption | degraded performance | cosmetic]
Reproduction: [steps] — Feedback loop: [fast <10s | slow | manual]
Failure Path: [traced path, observed vs inferred]
Missing Evidence: [none | logs: ... | access: ... | repro: ... | spec: ... | metrics: ... | permissions: ...]
User context needed? [N / Y: specific question]
Proceed to analysis? (Y/N)

Pattern Analysis

Before narrowing, establish a reference point:

  1. Find working analogues in the codebase (similar functionality that works)
  2. Study relevant portions — focus on the code path that differs from your bug
  3. Catalog distinctions between working and broken versions
  4. Note dependencies and environmental differences

If no analogue exists, note explicitly — you're debugging novel code without a known-good reference.

Skip this phase when: the bug is in isolated logic with no comparable pattern, or the failure path already points to a clear contract violation.

Analysis (Divide and Conquer)

Debugging is a narrowing search, not guess-and-check.

Observability check: Before narrowing, ensure you can observe the relevant state transitions. If not, add instrumentation (logging, tracing, metrics) before forming hypotheses. Debugging blind wastes cycles.

Loop until atomic:

  1. State the problem space — check for biases:
    • Anchoring: Am I overweighting my first hypothesis?
    • Stacktrace trust: This shows where it failed, not necessarily where the bug is
    • "It worked before": Maybe the bug was always there, just not triggered
    • Correlation ≠ cause: Are these events actually related, or just coincident?
  2. List 2-3 hypotheses if possible. Pick one with rationale, favoring bisection over single-point tests
  3. Implement verification (typically a test) — ask: "What evidence would falsify this hypothesis fastest?" Add instrumentation if needed to observe the outcome.
  4. Narrow to surviving subspace. If ambiguous, try different bisection point.
    • Exit condition: If narrowing reveals expected behavior → False Positive path: document why, assess doc/UX need, close as "Not a Bug"

Analysis Summary: Before Root Cause Identification, summarize the narrowing chain.

Root Cause Gate

Where → Why: Pull the string until you reach an actionable flaw — something that should have been different and can be corrected.

Before proposing fix: what evidence would prove this root cause wrong?

Root Cause Gate:
Category: [wrong assumption | missing guard | violated contract | design gap | external dependency | timing/race | data corruption | observability gap | other: ...]
Root Cause: [one-line actionable flaw]
Chain: [root cause] → [symptoms] → [impacts]
Falsifiable by: [evidence that would prove this wrong]
Confidence: [high: would bet on it | medium: best hypothesis | low: educated guess]
Proceed to Resolution (P)?

Resolution

  1. Verify: Re-run repro to confirm bug still exists
  2. Fix: Minimum scope, root cause not symptom. Compact Approval request.
    • If bug traced to external dependency: present options (workaround / upstream report / version change) before proceeding.
  3. Protect: Repro test → regression suite (TDD workflow):
  • If manual repro only: write failing test now
  • Verify test fails for the right reason
  • Implement fix → verify test passes
  • Run related tests for regressions
  • Search codebase for similar patterns
  • Post-fix validation: check adjacent code paths, inverse conditions, and previously working edge cases
  1. Confidence Gate: Explain why this fix (not something else) addresses the root cause stated in the Gate.
  • If explanation doesn't hold → Low confidence regardless of test results.
  • High → proceed to close
  • Medium → require additional validation (extended soak, peer review, or monitoring period)
  • Low → do not close; document as "mitigated, not resolved", record in TECH_DEBT.md, schedule follow-up
  1. Close: Summary with lessons learned

Post-Resolution Reflection:

  • Why did this bug escape earlier detection? (missing test, untested edge case, insufficient logging, unclear contract)
  • What signal could have caught it sooner? (test, assertion, metric, log pattern)
  • Is this a one-off or a pattern worth addressing systemically?

Stop-on-Repeat: Same fix twice → explain why it will work this time.

Struggle Report (3 stalled attempts):

Attempted: [approach] — failed because [reason]
Dead Ends: [do not revisit]
Evidence Gathered: [what we now know that we didn't before]
Remaining Hypotheses: [untested]
Blockers: [what prevents progress]
Next Steps: [escalation or alternative]

Download now (ZIP)

  • Other versions109 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 109

    1. tursodatabase/turso★ 25ksame name
    2. JetBrains/intellij-community★ 21ksame name
    3. DetachHead/rebased★ 6ksame name
    4. mrgoonie/claudekit-skills★ 2.2ksame name
    5. JetBrains/MPS★ 1.7ksame name
    6. glommer/pgmicro★ 1.2ksame name
    7. karrioapi/karrio★ 799same name
    8. rapidaai/voice-ai★ 746same name
    9. i-am-manware/Manware-s-AI-Learning-Toolkit★ 717same name
    10. vchelaru/Gum★ 634same name

    99 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use Problem-Solving Techniques, media-processing 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.
    • truongtv22Skill

      Problem-Solving Techniques

      Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.

      Also in 4 projects that use this

    • mrgoonieSkill

      media-processing

      Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.

      Also in 6 projects that use this

    • JetBrainsSkill

      ssr

      Guide for using Structural Search and Replace in IntelliJ. Use when creating or modifying SSR inspections or search patterns.

      Also in 3 projects that use this

    • mrgoonieSkill

      web-frameworks

      Build modern full-stack web applications with Next.js (App Router, Server Components, RSC, PPR, SSR, SSG, ISR), Turborepo (monorepo management, task pipelines, remote caching, parallel execution), and RemixIcon (3100+ SVG icons in outlined/filled styles). Use when creating React applications, implementing server-side rendering, setting up monorepos with multiple packages, optimizing build performance and caching strategies, adding icon libraries, managing shared dependencies, or working with TypeScript full-stack projects.

      Also in 6 projects that use this

    • DevNewbie1826Skill

      programming

      MUST USE for work on Python, Rust, TypeScript, or Go source files and project manifests. Triggers: write or edit code; new project; Go HTTP service (gin lane); Bubble Tea TUI; CJK IME; Connect-Go RPC; sqlc or pgx; branded IDs; exhaustive matching; unsafe Rust; Miri; oversized file; refactoring; logging, log levels, structured logging, or observability; arena, allocator, bumpalo, const fn, const generics, compile-time programming, zero-allocation APIs, bitfields, repr, scope guards, errdefer-style cleanup, Zig-like patterns, zero-copy parsing, packed data, or FFI; Rust public API design or macros.

      Also in 3 projects that use this

    • +7 more from mrgoonie
  • In this repository29 other files it gives its agents.

Does it work?

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

Reviews can't be read right now.

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.