usb-target-debug skill + target-debugger agentStatus: agreed but NOT started. Design discussion happened 2026-07-13 in session c31a4617-43b1-491d-9865-3e35f393996b (post-merge of the agents/workflows harness, PR #3762 / ac595bc5c). This document is the implementation brief for a fresh session.
Agreed sequencing: skill first → dogfood on 1-2 real HIL failures → then the agent as its own small PR. Do not build both at once — the agent charter's hard parts are exactly what dogfooding the skill answers.
When HIL fails today, what failed is covered (hil-validate workflow, hil-operator agent) but the deep why loop — instrument the target, capture on both sides, correlate — has no skill and no agent. Every hard case so far (musb babble, rusb2 FRDY wedge, ch32v307 Heisenbug) fell back to interactive main-session work.
Why no existing agent can do it:
hil_test.py → recover. It never edits source, so it cannot inject instrumentation.usbmon, usb-debug); the device-side half exists only as CLAUDE.md recipes plus session memory.The skill completes the debugging trio:
| Skill | Answers | Status |
|---|---|---|
usbmon | what the host actually exchanged (URBs) | on master |
usb-debug | why the host acted (dmesg / dynamic debug) | ships in PR #3758 (untracked copy in tree) |
usb-target-debug | what the device did | this hand-off |
usb-target-debug skill (do this first)Create .claude/skills/usb-target-debug/SKILL.md. Match the style of .claude/skills/usbmon/SKILL.md and usb-debug/SKILL.md: frontmatter name + description where the description states concretely when to reach for it (HIL test fails and host-side capture can't explain it; device silently NAKs, wedges, or misbehaves; need TU_LOG/device-state evidence from real hardware).
Playbook to codify — all techniques already proven on this rig:
LOG=2 (add LOGGER=rtt for RTT); UART capture from the board's debug serial; RTT via JLinkGDBServer -RTTTelnetPort 19021 + JLinkRTTClient (non-interactive: timeout 20s JLinkRTTClient > rtt.log). Note which log level perturbs timing (see warning #6).usb-recover/SKILL.md).python3 test/hil/board_lock.py hold <board> --reason "target debug: <bug>" … work … release <board>. Never stop the actions-runner. Board → probe mapping via test/hil/tinyusb.json; JLINK_DEVICE/OPENOCD_OPTION via hw/bsp/*/boards/*/board.cmake or board.mk.Where to ship: its own small PR (usb-recover/usb-debug already belong to PR #3758 — don‘t grow that one), or fold into #3758 if it is still open and being rebased anyway. User’s call at the time.
target-debugger agent (later, after dogfooding)Create .claude/agents/target-debugger.md as its own PR once the skill has been through at least one real debug session.
Agreed charter outline:
model: opus; omit tools: (= all tools — it must edit source AND drive hardware). Note the registry supports no effort field — the agreed opus/xhigh tier is requested per agent() call by whichever workflow or session spawns it.usb-target-debug, usbmon, usb-debug, usb-recover, hil SKILL.md files before acting.Questions dogfooding must answer before the charter is written (do NOT guess these now — that was the whole reason for skill-first):
.claude/skills/usbmon/SKILL.md, usb-debug/SKILL.md, usb-recover/SKILL.md (the latter two are #3758's copies, present untracked)..claude/agents/hil-operator.md (lock discipline, skills-as-source-of-truth), port-dev.md (source-edit + verify charter).docs/superpowers/specs/2026-07-09-claude-agents-workflows-design.md (convention: spec evolves in-repo; plans like this file are per-effort records)..claude/agents/*.md at session start — a new agent file is only visible to sessions launched after it exists.