Debug

/hub:debug dispatches hub:debugger with the systematic-debugging skill. You describe the symptom; it finds the root cause and proposes a fix.

When to use it

  • A bug, crash, intermittent failure, or weird behaviour you can reproduce or describe clearly.
  • You've tried the obvious and it didn't work.
  • You want the why, not just a patch.

When NOT to use it

  • You want to build a feature. Use plan.
  • The bug is just “this line is wrong.” Fix it directly — don't spend tokens on trivial.

Invocation

/hub:debug GET /days-until/2026-05-15 returns 1 day short

Example session

The off-by-one date bug
user
/hub:debug GET /days-until/2026-05-15 returns 1 day short
gate
MEDIUM · hub:debugger · systematic-debugging + testing-patterns · ~22k · [y/n/tweak]
user
y
hub:debugger

Reproduce: curl confirms it — response says {"days": 85}, actual calendar distance is 86.

Isolate: the math is Math.floor((target - now) / 86_400_000). With any target-time earlier in the day than now, you lose a day to the floor.

Root cause: not timezone — floating-point division + floor on a sub-day remainder. Affects ~50% of requests.

Fix: compare calendar days in UTC:

const toUtcDay = (d: Date) => Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate());
const days = Math.round((toUtcDay(target) - toUtcDay(now)) / 86_400_000);

Diff applied. Added contract test covering this case. Passing.

Pro tips

  • Give a repro in the prompt. A concrete request/response pair saves the agent an entire isolate step.
  • Always ask for a regression test. Debug that doesn't leave a test behind is a bug waiting to come back.
  • Chain with test: /hub:debug <symptom>/hub:test → done. Don't skip the second step.

Next steps