Agent skill

Debug

by sd0xdev in sd0xdev/sd0x-harness

Interactive debugging workflow with hypothesis-driven probe loop.

MITAuto-check: notesDevelopment

Install Debug

skills CLI
$ npx skills add sd0xdev/sd0x-harness --skill debug -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sd0xdev/sd0x-harness debug --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sd0xdev/sd0x-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/debug .claude/skills/debug && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
debug
GitHub stars
192
Token cost
~2k tokens
SKILL.md length
599 words
Files
4 (incl. references)
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Interactive debugging workflow with hypothesis-driven probe loop.

  • Works in 6 steps: Intake + Reproduce → Classify → Probe Loop → …
  • Silent failures
  • SKILL.md covers Trigger, When NOT to Use, Prohibited Actions and Workflow, plus 14 more sections
  • Calls git and curl

What it does

Debug is an agent skill from sd0xdev/sd0x-harness. Interactive debugging workflow with hypothesis-driven probe loop. Use when: unknown bugs, script errors, silent failures, troubleshooting. Not for: known bugs (use bug-fix), GitHub issue analysis (use issue-analyze), code understanding (use code-explore). Output: debug report with probe journal + root cause + fix.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/failure-taxonomy.md`, `references/probe-protocol.md` and `references/report-template.md`).

It sits in Development, covering Debugging and Root cause analysis. It works with GitHub. The repository describes itself as: The harness layer for Claude Code — a reference implementation of harness engineering with hook-enforced dual review, state-machine gates that survive context compaction, and… The licence is MIT.

When your agent uses it

  • Silent failures
  • Troubleshooting

Example prompts

  • “/debug”

Requirements

  • Pre-approved tools (allowed-tools): Read, Grep, Glob, Edit, Write, Bash, Skill, AskUserQuestion

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Intake + Reproduce
  2. Classify
  3. Probe Loop
  4. Root Cause Confirmation
  5. Fix + Verify
  6. Debug Report

What it can do on your machine

Read from SKILL.md and the folder at commit a4d4bc1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep
    • Glob
    • Edit
    • Write
    • Bash
    • Skill
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Debug loads about 2k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 80 tokens; SKILL.md has 599 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Grep, Glob, Edit, Write, Bash, Skill, AskUserQuestion

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from sd0xdev/sd0x-harness at commit a4d4bc1, republished under its MIT licence (© sd0xdev). 599 words, ~1,979 tokens.

Download SKILL.mdSave it as .claude/skills/debug/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
debug
description
Interactive debugging workflow with hypothesis-driven probe loop. Use when: unknown bugs, script errors, silent failures, troubleshooting. Not for: known bugs (use bug-fix), GitHub issue analysis (use issue-analyze), code understanding (use code-explore). Output: debug report with probe journal + root cause + fix.
allowed-tools
Read, Grep, Glob, Edit, Write, Bash, Skill, AskUserQuestion

Debug Skill

Trigger

  • Keywords: debug, 除錯, troubleshoot, diagnose, 查問題, 找 bug, 為什麼不動, 為什麼不 work, something wrong, not working

When NOT to Use

ScenarioAlternative
GitHub Issue / PR thread 分析/issue-analyze
已知根因、直接修復/bug-fix
理解程式碼如何運作/code-explore
需要雙視角確認邏輯/code-investigate
部署後唯讀功能驗證/feature-verify

Prohibited Actions

❌ git add | git commit | git push — per @rules/git-workflow.md

This skill debugs and may fix code but does not commit. /precommit is a quality gate only. To commit, offer the menu per rules/git-workflow.md § Proactive Offer — a commit option on any real branch, a push option only where review-state.js offer allows one — and invoke /smart-commit --execute on selection; never print the command for the user to copy.

Workflow

Phase 0    Phase 1     Phase 2          Phase 3           Phase 4        Phase 5
Intake  →  Classify →  Probe Loop   →   Root Cause    →   Fix +       →  Report
+ Repro    (Taxonomy)  (max 6)          Confirmation      Verify
  │          │           │                 │                │              │
  ▼          ▼           ▼                 ▼                ▼              ▼
Execute    refs/       Bash            /seek-verdict    Edit+test     --export
reproduce  failure-    /codex-         /code-investigate /bug-fix      (optional)
           taxonomy    brainstorm      (optional)

Phase 0: Intake + Reproduce

StepActionOutput
0a解析問題描述(症狀、範圍、環境)結構化問題描述
0b嘗試重現(執行命令/腳本)預期 vs 實際結果
0c重現成功?Yes → Phase 1 / No → ⚠️ Need Human

Repro Contract: 根因聲稱必須基於可重現的觀察,不可基於靜態推測。

Phase 1: Classify

根據觀察到的失敗模式,使用 Failure Taxonomy 分類並選擇 first-probe 策略。

See references/failure-taxonomy.md for:

  • 6 problem types + detection signals + first-probe commands
  • Classification decision tree
  • Escalation paths

Phase 2: Probe Loop

假設驅動的互動式探測迴圈。See references/probe-protocol.md for full rules.

每個 probe 是一個假設測試:

1. 定義假設 H
2. 設計探測命令 C
3. 預測「若 H 成立 → 期望 O」
4. 執行 C → 觀察實際結果
5. 更新假設集合
6. 選下一個最具鑑別力的探測
Termination
ConditionAction
根因已定位 + ≥1 執行結果佐證Stop → Phase 3
≥2 競爭假設無法區分Brainstorm → /codex-brainstorm 對抗辯論
連續 2 輪無新資訊Escalate → ⚠️ Need Human
Max rounds (6) reachedEscalate → ⚠️ Need Human
/codex-brainstorm Integration

When ≥2 equally credible hypotheses exist:

  1. Pause probe loop
  2. Invoke /codex-brainstorm via Skill tool — topic = hypothesis comparison
  3. Use Nash equilibrium result as new primary hypothesis
  4. Resume probe loop to verify

Phase 3: Root Cause Confirmation

StepActionRequired
3a總結根因(What + Why + Impact + Evidence)✅
3b/seek-verdict --intent confirm — Codex 獨立驗證✅ Mandatory
3c/code-investigate 雙視角深入驗證Optional
3d/git-investigate 追蹤引入點(若 regression)Conditional
/seek-verdict Integration (Step 3b — Mandatory)

Invoke /seek-verdict --intent confirm for independent root cause verification.

Anti-anchoring contract (per @skills/seek-verdict/SKILL.md):

  • Fresh thread: a new § Start dispatch, never a § Resume onto an existing thread
  • No Claude conclusions: prompt must not contain Claude's probe findings or root cause judgment
  • Finding packet only: provide symptoms, files, observed behavior — let Codex judge independently

Result routing:

ResultAction
ACTIONABLE (confirm)→ Phase 4
NON_ACTIONABLE (high confidence)Re-enter Phase 2 or ⚠️ Need Human
UNCERTAIN→ Phase 4 (conservative), note low confidence
Show full SKILL.md (266 more words)Show less

Phase 4: Fix + Verify

ConditionPath
Simple fix (≤3 lines)Edit + regression test + verify
Complex fix (multi-file)Delegate to /bug-fix
Architecture-level change⛔ Need Human — report root cause + recommendation

All fix paths require regression test per @rules/testing.md evidence model. Bug type → test level mapping per @skills/bug-fix/SKILL.md.

Simple fix path:

  1. Edit fix
  2. Write regression test
  3. Re-execute Phase 0 repro command (verify fix)
  4. If code file changed → enter review loop (auto-loop)

Phase 5: Debug Report

Output format: see references/report-template.md.

Default: conversation-only output. With --export [path], write to file (with redaction per Probe Safety Rules).

Probe Safety Rules

RuleDescription
Read-first default預設探測為唯讀:cat, curl -s, grep, ls, git log
Write-probe gate可能修改狀態的探測標記 [WRITE_PROBE],非 sandbox 環境需用戶確認
Timeout每個探測命令 timeout ≤ 30 秒
Output budget單次探測輸出 ≤ 500 行(超出 truncate)
Redaction禁止記錄 API keys, tokens, passwords(per @rules/security.md),以 [REDACTED] 取代
Deny list禁止:rm, drop, delete, truncate, 任何 destructive 操作

Config

KeyDefaultDescription
debug.max_probe_rounds6Maximum probe loop iterations

Review Loop

MUST re-review after fix until PASS (per @rules/auto-loop.md)

Fix → Review → Issues found → Fix again → ... → ✅ Pass → Next step

Doc Sync

Doc Sync is governed by @rules/auto-loop.md (behavior-layer rule). After precommit pass, triggers conditionally when changes map to docs/features/.

Output

markdown
## Debug Report: <title>
- **Type**: <classification>
- **Root Cause**: <what + why>
- **Fix**: <change description>
- **Verdict**: <seek-verdict result>
- **Probe Rounds**: <N>

Verification

  • Phase 0 reproduced the issue
  • Problem classified using failure taxonomy
  • Probe journal recorded for each round
  • /seek-verdict --intent confirm executed (Phase 3)
  • Root cause has ≥1 execution evidence
  • Regression test written (if fix applied)
  • Review loop completed (if code changed)
  • No git add/commit/push executed

References

FilePurposeWhen to Read
references/failure-taxonomy.mdProblem classification + first-probe routingPhase 1
references/probe-protocol.mdProbe Loop rules + termination criteriaPhase 2
references/report-template.mdDebug Report template + export formatPhase 5

Examples

Script Bug
Input: /debug bash scripts/deploy.sh 回傳 exit code 1
Phase 0: 執行 bash scripts/deploy.sh → 確認失敗
Phase 1: Script Bug
Phase 2: R1: bash -x trace → 發現 line 42 curl 失敗
         R2: 直接 curl endpoint → 404
         R3: 檢查 URL → 路徑缺少 /api prefix → Stop
Phase 3: /seek-verdict confirm → ACTIONABLE
Phase 4: Edit line 42 + regression test
Phase 5: Debug Report
API Error
Input: /debug API 回傳空陣列但資料庫有資料
Phase 0: curl API endpoint → 確認回傳 []
Phase 1: Silent Failure(表面正常但結果錯誤)
Phase 2: R1: 檢查 query filter → 發現 status 欄位名稱不符
         R2: 直接 DB query → 有資料 → Stop
Phase 3: /seek-verdict confirm → ACTIONABLE
Phase 4: 修正 field name + unit test
Phase 5: Debug Report
Silent Failure
Input: /debug ks-status.sh 回傳 ready:false 但 deployment 已就緒
Phase 0: 執行 bash ks-status.sh → ready:false, 缺少 replicas 欄位
Phase 1: Silent Failure(404 被 fallback 吞掉)
Phase 2: R1: 直接 curl API → invalid JSON → R2: 原始回應 → 404
         R3: 改用 apps/v1 路徑 → 200 + 完整資料 → Stop
Phase 3: /seek-verdict confirm → ACTIONABLE
Phase 4: api/v1 → apps/v1(1 word fix)+ test
Phase 5: Debug Report

© sd0xdev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/debug of sd0xdev/sd0x-harness.

  • SKILL.md
  • references/failure-taxonomy.md
  • references/probe-protocol.md
  • references/report-template.md

Open the folder on GitHubat commit a4d4bc1

Compare with similar skills

Debug next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Debug compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Debug this skillsd0xdev/sd0x-harness192—~2kAutomated safety check: NotesMIT
OpenROAD Bug FixerThe-OpenROAD-Project/OpenROAD3.2k—~784Automated safety check: PassBSD-3-Clause
Octocode Code Researchbgauryy/octocode949—~1.5kAutomated safety check: PassMIT
Triagebot Action Bug Triagewithastro/astro63k—~639Automated safety check: PassCustom licence
Issue TracerZaxbyHub/opencode-swarm490—~4.4kAutomated safety check: PassMIT
iOS FixMacMagazine/app-iOS171—~957Automated safety check: PassNone

Similar skills

  • OpenROAD Bug Fixer

    The-OpenROAD-Project/OpenROAD

    Fixes an OpenROAD bug from a GitHub issue or error code: finds the root cause, implements the fix, adds a regression test and prepares a signed-off commit.

    3.2k GitHub stars~784 tokensUpdated today
    DevelopmentAuto-check passed
  • Octocode Code Research

    bgauryy/octocode

    Researches code with evidence: traces callers, imports and cross-repo links, diagnoses failures and reports findings with exact file and line references and a confidence label.

    949 GitHub stars~1.5k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Official

    Takes a bug report for the triagebot-action GitHub Action through reproduction, root-cause diagnosis, an intended-behavior check and a fix attempt.

    63k GitHub stars~639 tokensUpdated today
    DevelopmentAuto-check passed
  • Issue Tracer

    ZaxbyHub/opencode-swarm

    Drives a bug report from validation and root-cause tracing through a critic-reviewed plan, an approved minimal fix and a PR-ready closure, never merging without recorded human approval.

    490 GitHub stars~4.4k tokensUpdated today
    DevelopmentAuto-check passed
  • iOS Fix

    MacMagazine/app-iOS

    Bug-fix and refactoring workflow for MacMagazine — root cause analysis, pattern-matching fix, regression verification.

    171 GitHub stars~957 tokensUpdated today
    DevelopmentAuto-check passed
  • LazyCodex Bug Reporter

    code-yeongyu/oh-my-openagent

    Investigates a LazyCodex or Codex CLI defect, decides which GitHub repository owns it, and drafts an evidence-backed issue or pull request with repro steps.

    70k GitHub stars~3k tokensUpdated today
    DevelopmentAuto-check passed

More from sd0xdev/sd0x-harness

All 89 skills in this repo
  • Adr

    sd0xdev/sd0x-harness

    Write an Architecture Decision Record (ADR) for a feature — Context / Decision / Status / Consequences / Alternatives, filed as docs/features/<feature/adr-<NNN-<title.md with a 3-digit zero-padded…

    192 GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Load PR Review

    sd0xdev/sd0x-harness

    Load GitHub PR review comments into AI session — analyze, triage, plan.

    192 GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Next Step

    sd0xdev/sd0x-harness

    Change-aware next step advisor. An agent skill from sd0xdev/sd0x-harness.

    192 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Obsidian CLI

    sd0xdev/sd0x-harness

    Obsidian vault integration via official CLI. An agent skill from sd0xdev/sd0x-harness.

    192 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Orchestrate

    sd0xdev/sd0x-harness

    Agent-driven workflow orchestration (v1 report-only). An agent skill from sd0xdev/sd0x-harness.

    192 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • PR Comment

    sd0xdev/sd0x-harness

    Post friendly review comments to a GitHub PR — prepare locally, preview, then submit as atomic review.

    192 GitHub stars~1.5k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Debug

What does Debug do?

Interactive debugging workflow with hypothesis-driven probe loop. Debug is an agent skill from sd0xdev/sd0x-harness. Interactive debugging workflow with hypothesis-driven probe loop.

When should I use Debug?

Debug fits situations like: silent failures; troubleshooting.

How do I install Debug in Claude Code?

Run `npx skills add sd0xdev/sd0x-harness --skill debug -a claude-code`. Or copy the skill folder (skills/debug in sd0xdev/sd0x-harness) into .claude/skills/debug in your project. Claude Code loads it when a task matches its description.

How do I install Debug in Codex?

Run `npx skills add sd0xdev/sd0x-harness --skill debug -a codex`. Or copy the skill folder (skills/debug in sd0xdev/sd0x-harness) into .agents/skills/debug in your project. Codex loads it when a task matches its description.

Can I use Debug in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sd0xdev/sd0x-harness --skill debug -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/debug, .gemini/skills/debug, .github/skills/debug and .opencode/skills/debug in your project.

What does Debug need to run?

Going by SKILL.md and its folder, Debug needs the command-line tools its instructions call (git and curl). Its frontmatter pre-approves these tools: Read, Grep, Glob, Edit, Write, Bash, Skill, AskUserQuestion.

Does Debug access the network?

SKILL.md contains no URLs. Its commands use git and curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Debug safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Debug use?

Debug is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Debug use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.

What are the alternatives to Debug?

Skills that share tags, products or a category with Debug: OpenROAD Bug Fixer (The-OpenROAD-Project/OpenROAD, 3.2k stars), Octocode Code Research (bgauryy/octocode, 949 stars), Triagebot Action Bug Triage (withastro/astro, 63k stars) and Issue Tracer (ZaxbyHub/opencode-swarm, 490 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Debug?

sd0xdev (a GitHub user) maintains it in sd0xdev/sd0x-harness, which has 192 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 8, 2026.

Source: sd0xdev/sd0x-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.