← ClaudeAtlas

debug-loglisted

Add debug logging to trace code execution. Use when debugging, tracing control flow, or investigating unexpected behavior. Any language (JS/TS, Python, Go).
nielsmadan/skills · ★ 0 · Code & Development · score 75
Install: claude install-skill nielsmadan/skills
<!-- Generated from https://github.com/nielsmadan/agentic-coding — edits here are overwritten. --> # Debug Log Add targeted debug logging to trace execution flow and variable state. ## Usage ``` /debug-log authentication flow /debug-log # Uses last topic from conversation /debug-log the checkout process ``` ## Debugging Discipline **One-Variable Rule:** - Make ONE change at a time - Test after EACH individual change - If a change doesn't help, REVERT it before trying the next - Never stack untested changes **Circuit Breaker:** If 3 sequential attempts fail to isolate the issue, STOP. Document findings and escalate to `hard-fix` for parallel investigation. ## Gotchas - Log statements inside ternaries or short-circuit expressions change control flow — the return value becomes the log output, not the original expression. - String interpolation can trigger side effects (e.g., calling a getter that consumes an iterator or increments a counter). Log arguments must be pure reads. ## Workflow 1. **Identify target** - Use provided topic or infer from recent conversation 2. **Find relevant code** - Locate functions, handlers, and key decision points 3. **Add logs at strategic points:** - Function entry/exit - Before/after async operations - Inside conditionals and loops - Variable assignments that matter 4. **Use descriptive prefixes** - Make logs easy to trace ## Log Format by Language **JavaScript/TypeScript:** ```js console.log('[DEBUG]