debug

perfux 的头像作者 perfux

添加可追踪的调试日志,可使用单个命令自动删除。在调试问题时使用,日志遵循严格的格式以便干净地删除。

📖 中文导读:添加可追踪的调试日志,可使用单个命令自动删除。在调试问题时使用,日志遵循严格的格式以便干净地删除。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

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

  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.