跳到正文
FunCoding

octocode-debugging

Load this skill first when a program crashes, hangs, leaks, runs slowly or returns a wrong or flaky result. Inspect runtime state, profile costs and replay the fix.

Star
971
许可证
MIT
最近提交
2026年12月1日

skills/octocode-debugging/SKILL.md

在 GitHub 上查看

Octocode Debugging

Inspect surviving evidence before restarting a live process. For wrong results, find the first divergent state. For performance, identify what the measurement counts. CPU samples show running code, wall time includes waits, and allocation churn differs from retention. If the program works but the assistant keeps choosing the same tool, octocode-agentic inspects the decision loop.

Procedure

  1. Inspect the traceback, dump, log or saved profile. If it settles the question, answer from that evidence.
  2. Observe the stop or measurement that separates rival causes. A conditional breakpoint isolates an invocation; a data watchpoint finds the writer. Verify a live target's identity and the impact of pausing it; ask before pausing, attaching to or signaling a process the request did not identify (a named service counts once you find and verify its PID). Resume or detach anything you stopped. Revise the probe when it leaves the cause unresolved. For performance and memory, follow the profiling loop.
  3. Fix the first divergence when requested. Add a test that fails before the fix and passes after (check the pre-fix state in a separate worktree or checkout at the base revision, or with the file from the base commit; never revert, stash or check out in a shared tree, and an index that tooling stages on its own is not a baseline), and search for the same pattern elsewhere. Replay the failure and nearby cases with the same input, environment and measurement; compare before and after on equivalent windows.
  4. Clean up: stop the processes you started, remove temporary breakpoints, debugger; statements, logs and unsupported experimental edits, and keep the evidence the answer cites.

Before a capture, check installed tools and their --help for supported events and permissions; do not install profilers or change host permissions implicitly. Preserve the raw recording and its diagnostics.

Optional references

In reference commands, $skill is this skill's absolute folder, $out an existing capture directory, $pid a verified target and $seconds the observation window (an experiment parameter, not an application timeout).

What you’re investigatingWhere to look
A wrong value, exception, hang or crashDebugger techniques, dumps, replay · Experiments, reproductions, bisecting
A flaky or load-only failureList every wall-clock bound (timeouts, deadlines, sleeps), shared or global state and first-run or I/O cost (cold caches, process start, disk) on the failing path; then replay N times under induced load (parallel copies, CPU or I/O stress) and count failures, before and after the fix. Experiments
CPU, I/O, waits or latencyProfiling loop, comparable runs (compare-runs.mjs compares builds), reading a measurement, platform, JVM and .NET captures or trace a full-stack request
Growing memory or host loadAllocation versus retention or the process using the machine (host-usage.mjs), then one process
Browser frames or GPU stallsBrowser and GPU timelines
Native, Rust or Go targetNative debugger and crashes or hangs, Rust profiler, memory and async tracing, or Go tools; native-capture.sh samples a verified PID
Node or Python targetNode debugger (node-break.mjs), DevTools attach, profiler (profile-top.mjs) or allocation and metrics timeline; Python debugger, profiler or async and allocation growth.
A long log, test run or CI outputSave it under the workspace; search known markers with localSearch, and use clasify for a typed question exact search cannot narrow.
The code behind a frame, log line or symbollocalSearch for the text, localFetch at the line, lspSearch callers or references for who reaches it.
Sharing a findingOutput options · HTML renderer

Done when the evidence answers the question or names a concrete blocker; a requested fix also needs a replay check. Tie the diagnosis to observed state or cost, and report uncertainty and unrun checks.

相似的 Skill

rea-analysis-optimization

MOmorluto/rea485k近 7 天新增 7,690 个 star

codebase-design

MAmattpocock/skills336k近 7 天新增 4,217 个 star

精选

diagnosing-bugs

诊断困难 bug 和性能回归,用测试或脚本构建反馈循环定位问题。

MAmattpocock/skills336k近 7 天新增 4,217 个 star

setup-ts-deep-modules

MAmattpocock/skills336k近 7 天新增 4,217 个 star

code-review

MAmattpocock/skills336k近 7 天新增 4,217 个 star

implement

MAmattpocock/skills336k近 7 天新增 4,217 个 star