본문으로 건너뛰기
cccskills
무료GitHub에 공개

interactive-debugging

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(6)

  • SKILL.md5.6 KB
  • agents/openai.yaml309 B
  • assets/debug.png9.8 KB
  • README.md256 B
  • scripts/debug_server.js1.2 KB
  • scripts/debug_server.py1.7 KB

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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

agent-log

무료

Use this skill to maintain an agent log in .agents/log, a decision journal shared by the developer and agents. Trigger when the user explicitly asks to use agent-log or record/update an agent log entry; when planning, implementing, or finalizing a significant feature in a repo with an existing .agents/log; or before non-trivial changes or questions in areas covered by existing entries. Never initialize .agents/log unless the user explicitly asks for an agent log.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

denysdovhan/agents182026년 7월 29일 업데이트

commit

무료

Use this skill when an agent needs to prepare a focused commit, follow repository commit-message conventions, write a clear commit message, and create the git commit cleanly.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

denysdovhan/agents182026년 7월 29일 업데이트

Use when creating, reviewing, debugging, or maintaining Home Assistant custom Lovelace cards or card editors, including custom elements, Web Components, hass data, setConfig, getCardSize/getGridOptions, getConfigElement/getConfigForm, window.customCards, resource registration, HACS card packages, entity display, service calls, translations, or frontend build validation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

denysdovhan/agents182026년 7월 29일 업데이트

Use this skill when creating, scaffolding, reviewing, or maintaining Python Home Assistant custom integrations, including work on custom_components, manifests, config flows, options flows, config entries, platforms/entities, DataUpdateCoordinator, integration automation triggers, diagnostics, repairs, discovery/networking, authentication, HACS-ready repositories, or Home Assistant integration quality scale compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

denysdovhan/agents182026년 7월 29일 업데이트

denysdovhan의 스킬 모두 보기

이 스킬의 문제 신고