debug
Add traceable debug logs that can be auto-removed with a single command. Use when debugging issues - logs follow a strict format for clean removal.
When & Why to Use This Skill
This Claude skill streamlines the software debugging process by enabling the insertion of traceable, formatted debug logs that can be automatically removed with a single command. It ensures developers can troubleshoot complex logic and state changes efficiently while maintaining a clean, production-ready codebase without manual cleanup.
Use Cases
- Case 1: Rapidly isolating logic errors in complex functions by inserting temporary, tagged logs at critical execution points like entry, exit, and state transitions.
- Case 2: Monitoring real-time variable values and application state during local development in multi-language environments (e.g., JavaScript, Python) using a standardized format.
- Case 3: Maintaining codebase hygiene by using the automated removal script to strip all temporary debug statements instantly before committing code to version control or deploying to production.
| name | debug |
|---|---|
| description | Add traceable debug logs that can be auto-removed with a single command. Use when debugging issues - logs follow a strict format for clean removal. |
Debug Logging
Add debug logs in this exact format so they can be auto-removed:
Format
// [DEBUG:PERFUX] <description>
console.log("[DEBUG:PERFUX]", <values>);
Examples
JavaScript/TypeScript:
// [DEBUG:PERFUX] Check user state
console.log("[DEBUG:PERFUX]", { user, isLoggedIn });
Python:
# [DEBUG:PERFUX] Check user state
print("[DEBUG:PERFUX]", user, is_logged_in)
Process
- Identify the issue area
- Add debug logs at key points (entry, exit, state changes)
- Run the code and analyze output
- Iterate: add more logs if needed
- When done, run the removal script
Removal
Run from project root:
.opencode/skill/debug/scripts/remove-debug-logs.ts
Or with bun:
bun .opencode/skill/debug/scripts/remove-debug-logs.ts
All lines containing [DEBUG:PERFUX] are removed automatically.