debug

perfux's avatarfrom perfux

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.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 3, 2026⬇️1downloads

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.
namedebug
descriptionAdd 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

  1. Identify the issue area
  2. Add debug logs at key points (entry, exit, state changes)
  3. Run the code and analyze output
  4. Iterate: add more logs if needed
  5. 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.