agentleFS
denysdovhandenysdovhan/agents/skills/interactive-debugging/SKILL.md

interactive-debugging

Skill21 starsChanged 10 days agoMITView on GitHub

Use this skill when debugging runtime behavior requires live data from the running app, temporary instrumentation, or hypothesis verification through logs. Trigger for async timeouts, stale or incorrect state updates, race conditions, event ordering bugs, intermittent failures, browser/client behavior that static inspection cannot explain, or any issue where the agent should create a local debug HTTP server, insert temporary probes, ask the user to reproduce, inspect .debug/debug.log, then remove all debug instrumentation and assets.

  • Sends data out

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. denysdovhan/skills★ 21100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    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.

  • In this repository4 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. About 0 are common, 13 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to run a debug loop: hypothesize, instrument, reproduce, inspect runtime logs, fix, verify, and clean up.

    line 8
  2. Distinctive:

    Read the relevant code before changing anything.

    line 22
  3. Distinctive:

    Do not jump to a fix before collecting data unless the cause is already proven.

    line 24
  4. Very specific:

    Create .debug/ in the project under debug.

    line 28
  5. Distinctive:

    Keep the server thin: no schemas, dashboards, persistence, extra routes, or broad utilities.

    line 31
  6. Distinctive:

    Run it from the project root:

    line 35
  7. Very specific:

    Use another port only if 3333 is occupied.

    line 43
  8. Very specific:

    Verify it with curl http://localhost:3333/health.

    line 44
  9. Distinctive:

    Add the fewest probes needed to test the hypotheses.

    line 49
  10. Distinctive:

    Use the target language's matching comments:

    line 105
  11. Distinctive:

    Do not log secrets, tokens, cookies, credentials, full environment dumps, or private user data.

    line 116
  12. Distinctive:

    Stop and wait while they reproduce unless you can run the reproduction yourself.

    line 122
  13. Very specific:

    If it is large, use tail, wc -l, or targeted rg before reading the whole file.

    line 127
  14. Distinctive:

    If the logs are inconclusive, add a smaller second round of probes and repeat reproduction.

    line 129
  15. Distinctive:

    Keep instrumentation until the fix is verified.

    line 134
  16. Very specific:

    Remove every #region DEBUG / #endregion DEBUG block and its contents.

    line 139
  17. Distinctive:

    Stop the debug server.

    line 140
  18. Very specific:

    Delete .debug/debug_server.* and .debug/debug.log.

    line 141
  19. Very specific:

    Verify cleanup with rg '#region DEBUG|#endregion DEBUG|localhost:3333/debug|debug_server|\\.debug/debug.log', replacing 3333 with the port …

    line 142
  20. Distinctive:

    Run the relevant test or reproduction check after cleanup.

    line 143

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Interactive Debugging

Use this skill to run a debug loop: hypothesize, instrument, reproduce, inspect runtime logs, fix, verify, and clean up.

Required Paths

  • Debug server: .debug/debug_server.*
  • Debug log: .debug/debug.log
  • Default endpoint: http://localhost:3333/debug

The bundled servers in this skill's scripts/ directory (next to this SKILL.md, not in the project being debugged) are intentionally thin. They accept POST /debug, append the raw request body to .debug/debug.log with a timestamp, and return ok.

Steps

Step 1: Understand the Bug

  • Read the relevant code before changing anything.
  • State 1-3 concrete hypotheses that runtime data can prove or disprove.
  • Do not jump to a fix before collecting data unless the cause is already proven.

Step 2: Create the Debug Server

  • Create .debug/ in the project under debug.
  • Copy the matching bundled server from this skill's scripts/ directory to .debug/debug_server.js or .debug/debug_server.py in the project.
  • For another language, create the smallest equivalent server at .debug/debug_server.<ext>.
  • Keep the server thin: no schemas, dashboards, persistence, extra routes, or broad utilities.

Step 3: Start the Debug Server

Run it from the project root:

node .debug/debug_server.js 3333
python3 .debug/debug_server.py 3333
  • The server is a long-running foreground process; start it in the background (or another terminal) so it does not block your shell.
  • Use another port only if 3333 is occupied.
  • Verify it with curl http://localhost:3333/health.
  • Clear .debug/debug.log before reproduction if it already exists.

Step 4: Instrument the Code

  • Add the fewest probes needed to test the hypotheses.
  • Wrap every probe or probe block in matching debug region markers:
// #region DEBUG
fetch("http://localhost:3333/debug", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    event: "function-entry",
    traceId,
    value,
  }),
}).catch(() => {});
// #endregion DEBUG

Dependency-free examples for other languages:

# #region DEBUG
import json
import urllib.request

try:
    urllib.request.urlopen(
        urllib.request.Request(
            "http://localhost:3333/debug",
            data=json.dumps({"event": "function-entry", "value": value}).encode(),
            headers={"Content-Type": "application/json"},
            method="POST",
        ),
        timeout=0.2,
    ).close()
except Exception:
    pass
# #endregion DEBUG
# #region DEBUG
require "json"
require "net/http"
require "uri"

begin
  Net::HTTP.post(
    URI("http://localhost:3333/debug"),
    { event: "function-entry", value: value }.to_json,
    "Content-Type" => "application/json",
  )
rescue StandardError
end
# #endregion DEBUG
  • Use the target language's matching comments:
    • JavaScript, TypeScript, Java, C#, Go, Rust, C, C++: // #region DEBUG and // #endregion DEBUG
    • Python, Ruby, Shell, YAML: # #region DEBUG and # #endregion DEBUG
    • HTML, Vue, Svelte: <!-- #region DEBUG --> and <!-- #endregion DEBUG -->
    • Lua: -- #region DEBUG and -- #endregion DEBUG

Step 5: Choose Useful Probe Data

  • Include event names such as process-order:entry, state-before-set, or branch-empty-result.
  • Include IDs needed to correlate flow, such as traceId, request ID, entity ID, or attempt number.
  • Include compact values that distinguish hypotheses.
  • Do not log secrets, tokens, cookies, credentials, full environment dumps, or private user data.
  • Redact or summarize large objects.

Step 6: Ask for Reproduction

  • Tell the user exactly what is ready and ask them to reproduce the issue.
  • Stop and wait while they reproduce unless you can run the reproduction yourself.

Step 7: Read the Logs

  • Inspect .debug/debug.log.
  • If it is large, use tail, wc -l, or targeted rg before reading the whole file.
  • Compare the observed events, ordering, and values to the hypotheses.
  • If the logs are inconclusive, add a smaller second round of probes and repeat reproduction.

Step 8: Fix and Verify

  • Make the smallest fix explained by the logs.
  • Keep instrumentation until the fix is verified.
  • Clear .debug/debug.log, ask the user to verify again when manual reproduction is required, then inspect the new log if needed.

Step 9: Clean Up

  • Remove every #region DEBUG / #endregion DEBUG block and its contents.
  • Stop the debug server.
  • Delete .debug/debug_server.* and .debug/debug.log; delete .debug/ if empty.
  • Verify cleanup with rg '#region DEBUG|#endregion DEBUG|localhost:3333/debug|debug_server|\\.debug/debug.log', replacing 3333 with the port actually used.
  • Run the relevant test or reproduction check after cleanup.

Log Reading Checklist

  • Missing events show code paths that did not run.
  • Event ordering shows async races and stale updates.
  • Value changes across awaited work show mutation timing.
  • Duplicate events show retries, repeated subscriptions, or double handlers.
  • Error payloads near a missing event often explain swallowed failures.

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.