From arthur0824hao-skills
Coder-only debugging lifecycle for AI agents. Open isolated debug sessions, record hypothesis steps, capture tool friction, and close with a structured lesson written to memory.
npx claudepluginhub arthur0824hao/skills --plugin document-skillsThis skill uses the workspace's default tool permissions.
This skill is coder-only. The public contract is a lifecycle:
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
This skill is coder-only. The public contract is a lifecycle:
start opens a debug session with its own scratch dir and time budgetstep records hypothesis progression, evidence, and optional tool frictionclose writes a structured lesson with root-cause and verification fields back into memoryReviewer surfaces should consume the resulting lesson or friction artifacts, not run sk debug directly.
The preferred public entrypoint is the unified CLI:
python3 ../skill-system-cli/scripts/sk.py debug start --title "FD entry path bug" --symptom "entry.json env paths failed from arbitrary cwd"
python3 ../skill-system-cli/scripts/sk.py debug step --debug-id dbg_123 --hypothesis "paths are cwd-relative" --action "inspect entry rewrite"
python3 ../skill-system-cli/scripts/sk.py debug close --debug-id dbg_123 --root-cause-file path/to/file.py --root-cause-line 42 --hypothesis-chain "..." --counter-evidence "..." --fix "..." --verification "..."
Direct debug_tool.py invocation remains the underlying runtime surface.
python3 scripts/debug_tool.py start --title "FD entry path bug" --symptom "entry.json relative path fails in runtime"
python3 scripts/debug_tool.py step --debug-id dbg_123 --hypothesis "entry path resolved relative to cwd" --action "inspect loader path join" --evidence "loader joins cwd + entry.json"
python3 scripts/debug_tool.py close \
--debug-id dbg_123 \
--root-cause-file skills/skill-system-memory/scripts/mem.py \
--root-cause-line 2162 \
--hypothesis-chain "cwd-relative path hypothesis -> reproduction -> fix confirmed" \
--counter-evidence "absolute paths worked, proving parser was fine" \
--fix "normalize to artifact-relative path resolution" \
--verification "reproduced bug, applied fix, reran loader successfully"
.tkt/debug/<debug_id>.yaml.sisyphus/tmp/debug/<debug_id>/step/close must warn when elapsed time exceeds budgetclose is fail-closed if required lesson fields are missingEvery successful close must capture:
root_cause.fileroot_cause.linehypothesis_chaincounter_evidencefixverificationstart / step / closeThis lifecycle was exercised against the real FD entry.json relative-path bug in:
/share/nas165/arthur0824hao/Work/Study/GNN/FraudDetect/Experiment/scripts/regenerate_fd_absolute_entries.py:54The resulting close lesson recorded:
and wrote a debug-lesson memory row after the close path was corrected to respect procedural-memory importance rules.
{
"schema_version": "2.0",
"id": "skill-system-debug",
"version": "0.2.0",
"capabilities": ["debug-start", "debug-step", "debug-close"],
"effects": ["fs.read", "fs.write", "proc.exec", "db.write"],
"operations": {
"start": {
"description": "Open a coder-only debug session with isolated scratch state and budget tracking.",
"input": {
"title": { "type": "string", "required": true },
"symptom": { "type": "string", "required": true },
"workdir": { "type": "string", "required": false },
"time_budget_minutes": { "type": "integer", "required": false }
},
"output": {
"description": "Debug session metadata",
"fields": { "debug_id": "string", "state_path": "string", "scratch_dir": "string", "time_budget_minutes": "integer" }
},
"entrypoints": {
"unix": ["python3", "scripts/debug_tool.py", "start", "--title", "{title}", "--symptom", "{symptom}"],
"windows": ["python", "scripts/debug_tool.py", "start", "--title", "{title}", "--symptom", "{symptom}"]
}
},
"step": {
"description": "Record one debug step with hypothesis, evidence, and optional tool friction.",
"input": {
"debug_id": { "type": "string", "required": true },
"hypothesis": { "type": "string", "required": true },
"action": { "type": "string", "required": true },
"evidence": { "type": "string", "required": false },
"counter_evidence": { "type": "string", "required": false },
"tool_unfriendly": { "type": "boolean", "required": false },
"friction_note": { "type": "string", "required": false }
},
"output": {
"description": "Step progression result",
"fields": { "debug_id": "string", "step_index": "integer", "budget_warning": "boolean", "friction_logged": "boolean" }
},
"entrypoints": {
"unix": ["python3", "scripts/debug_tool.py", "step", "--debug-id", "{debug_id}", "--hypothesis", "{hypothesis}", "--action", "{action}"],
"windows": ["python", "scripts/debug_tool.py", "step", "--debug-id", "{debug_id}", "--hypothesis", "{hypothesis}", "--action", "{action}"]
}
},
"close": {
"description": "Close a debug session and write a structured lesson into memory.",
"input": {
"debug_id": { "type": "string", "required": true },
"root_cause_file": { "type": "string", "required": true },
"root_cause_line": { "type": "integer", "required": true },
"hypothesis_chain": { "type": "string", "required": true },
"counter_evidence": { "type": "string", "required": true },
"fix": { "type": "string", "required": true },
"verification": { "type": "string", "required": true }
},
"output": {
"description": "Debug closure result",
"fields": { "debug_id": "string", "closed": "boolean", "lesson_path": "string", "memory_write_status": "string", "friction_count": "integer" }
},
"entrypoints": {
"unix": ["python3", "scripts/debug_tool.py", "close", "--debug-id", "{debug_id}", "--root-cause-file", "{root_cause_file}", "--root-cause-line", "{root_cause_line}", "--hypothesis-chain", "{hypothesis_chain}", "--counter-evidence", "{counter_evidence}", "--fix", "{fix}", "--verification", "{verification}"],
"windows": ["python", "scripts/debug_tool.py", "close", "--debug-id", "{debug_id}", "--root-cause-file", "{root_cause_file}", "--root-cause-line", "{root_cause_line}", "--hypothesis-chain", "{hypothesis_chain}", "--counter-evidence", "{counter_evidence}", "--fix", "{fix}", "--verification", "{verification}"]
}
}
},
"stdout_contract": {
"last_line_json": true
}
}