Debugging Discipline

SkillDev tools

Concrete debugging playbook for the AIDE stack, reproduce minimally, instrument at the boundary, diff pass-vs-fail, one hypothesis at a time. Includes this repo's verified traps (workdir-less commands, chained destructive calls, stale refs, silent EADDRINUSE, LSP null shapes, TDZ ordering, dynamic DOM ids). Use whenever anything misbehaves.

Use Debugging Discipline in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Debugging Discipline and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the Debugging Discipline skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Debugging DisciplineStart free

What this skill tells your AI

The instructions your AI receives, as published by anonymousnomad/covert-coder in skills/packs/aide-debugging-discipline/SKILL.md and read by Ahel’s review.

The Loop

  1. REPRODUCE minimally
  2. INSTRUMENT at the boundary (log exact bytes, not summaries)
  3. DIFF pass vs fail — one variable at a time
  4. FIX root cause
  5. REGRESSION-TEST the trap
  6. ENCODE the lesson here

Verified Traps

TrapSymptomLaw
Workdir-less commandsCannot find module E:\app.jsALWAYS set workdir on repo-relative commands
Chained kill+relaunchStack dies mid-sequence, stale logs lieONE destructive action per call; verify zero between steps
Detached stdio ignoreChild produces no output; crashes invisibleUse pipe for stderr during debugging; switch to ignore only after stable
Stale origin/main ref"Everything up-to-date" while remote is behindgit ls-remote is truth
.git/index.lock after abortCommit fails "index.lock exists"Remove stale lock after verifying no git proc running
Silent EADDRINUSENew server dies, old zombie answers with old codetaskkill ALL, verify zero, THEN relaunch
LSP null vs errorresult:null = valid empty; error object = bugTreat differently
Strict zod rejects legacy keysBAD_REQUEST unrecognized_keysContract-first: client sends exact contract keys
Dynamic DOM ids break static auditsui-audit fails on createElement idsDeclare ids in HTML; JS updates existing nodes only
TDZ orderingReferenceError when const used before top-level declaration executesShared state declarations must precede init calls in app.js
Log metadata ignored3 failed fix attempts blaming config filesREAD THE TOOL'S OWN DEBUG LOG FIRST — npm's log said verbose cwd E:\ before any file blame was warranted; verify process cwd before rewriting files
Undeclared shared varFeature silently dead (beforeunload handler threw ReferenceError on every fire)Enable lint gates — eslint catches 49-reference undeclared vars in seconds; static analysis IS feature work
Scope-trapped helperClick handler at module scope calls fn declared inside another functionDeclarations used by top-level wiring must live at module scope
Fixed ports in testsTest suite exits 1 only when production stack runs (bind EADDRINUSE)Tests bind port 0 / probe freePort(); NEVER hardcode production ports (4173/4777-4779)
Twice-fail lawSame step failed twice in one session = guessing patternSTOP at second failure. Research the mechanism, encode in aide-route-slice-sop or matching skill, THEN retry. Attempt #3 from memory is forbidden
Facade route-map cacheNew route family 404s via :4777, works via :4778Facade loads map at startup — restart facade after editing facade-route-map.json
Contracts regen orderCI arch gate fails openapi-drift on a commit whose routes "worked locally"npm run contracts is LITERALLY the last edit before committing route/contract changes
Gate chains with ';'Commit pushed despite failing tscVerification chains use && ONLY — failure must halt the chain

Server Won't Start — Systematic Checklist

Run these IN ORDER. Stop at the first one that reveals the problem.

1. node --check <entry-file>          → syntax OK?
2. node <entry-file>                  → run foreground, capture stderr
3. Check port availability            → netstat -ano | findstr :PORT
4. Check for zombie processes         → tasklist | findstr node
5. Check disk space                   → free RAM + disk
6. Check env vars                     → are required vars set?
7. Run with NODE_DEBUG=*              → verbose internal logging
8. strace-equivalent                  → Process Monitor on Windows

Integration

Feeds continuous-improvement-sop · verification-complete · process-hygiene-sop.

Signals

GitHub stars
43
Forks
14
Last commit
Oct 2026
Advanced
Item type
skill
Key
aide-debugging-discipline
Source
github.com/anonymousnomad/covert-coder