pre-commit-reviewer
Clean up debug logging and dead code before commit. Use when preparing changes for commit.
от nimbalyst★ 29 звёзд на GitHub
Установить pre-commit-reviewer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Prepare for Commit
Review the current git diff and comment out logging statements that are inappropriate for production:
Logging to Comment Out
- Console.log statements - Most console.log calls should be commented out (use proper logging service instead)
- Verbose debug logging - Excessive debug statements that clutter production logs
- Temporary debugging code - Any logging added just for debugging a specific issue
- Performance logging - Detailed performance measurements unless critical for monitoring
Logging to Keep
- Error logging - Keep
log.error(),console.error(), and error reporting - Warning logging - Keep
log.warn()and important warnings - Critical info logging - Keep
log.info()for significant application events - Analytics events - Keep
analyticsService.sendEvent()calls - Startup/shutdown logs - Keep important lifecycle logging
Instructions
- Run
git diffto see staged and unstaged changes - Look for inappropriate logging statements in the diff
- Comment out (don't delete) inappropriate logs with explanation:
// Debug logging - uncomment if needed
// console.log('some debug info:', data);
- Preserve proper logging that uses the logging service (
log.info,log.warn,log.error) - Check for leftover TODOs - Look for TODO comments that were added during development that should be resolved before commit
- Check for dead code - Look for commented-out code blocks, unused variables, or unreachable code that was added
- Show me what you found and what you're commenting out before making changes
- Ask for confirmation before proceeding
- After changes are approved, run
git addfor only the files that were reviewed/modified
Code Quality Checks
TODOs to Flag
// TODO:comments added in the diff that indicate incomplete work// FIXME:comments that should be addressed before commit// HACK:or// TEMP:markers
Dead Code to Flag
- Commented-out code blocks (not logging comments, but actual dead code)
- Unused imports added in the diff
- Variables declared but never used
- Unreachable code after return statements
Plan Status Check
If a plan document (in plans/ or nimbalyst-local/plans/) is being committed, quickly check its frontmatter:
- If
statusis notcompletedorprogressis less than 100, mention this to the user - This is just a note, not a blocker - they may be intentionally committing a partial plan
Important Rules
- Never delete logs - comment them out so they can be restored later
- Don't touch logging in test files
- Don't touch logging that's already commented out
- Focus only on files in the current git diff
- For TODOs/dead code: flag them for review rather than automatically removing
After reviewing, ask me if I want to proceed with the changes.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pre-commit-reviewer?
Clean up debug logging and dead code before commit. Use when preparing changes for commit.
Как установить скилл pre-commit-reviewer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pre-commit-reviewer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…