code-clean

Polishes code diffs by removing dead code and duplication while matching local style conventions.

2|2|Updated Dec 23, 2017
One-click install
npx skills add https://github.com/xriu/dotfiles --skill code-clean-xriu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-clean
Source: https://github.com/xriu/dotfiles/tree/main/home/.skills/code-clean
Command: npx skills add https://github.com/xriu/dotfiles --skill code-clean-xriu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Before handing off work in a pull request, diffs often contain leftover debug logging, duplicated logic, and style inconsistencies that slow down review. This Skill performs a focused manual cleanup pass on your own diff so the code is concise, consistent, and ready for handoff. ## Core Features & Use Cases - Diff Polishing: Re-reads your diff to cut dead code, leftover debug logging, and duplication while extending existing helpers instead of parallel-implementing. - Style Matching: Aligns names, imports, file layout, and comment density with neighboring code so changes blend into the codebase. - PR Handoff Preparation: Runs automatically before creating, updating, or automerging a PR, splitting work into topical commits and writing a whole-change PR title and body. - Use Case: After finishing a feature branch, invoke the cleanup pass to strip debug statements, consolidate duplicated logic into an existing helper, and produce a clean PR description before requesting review. ## Quick Start Ask the assistant to clean up the current diff before opening the pull request.

Frequently Asked Questions about code-clean

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up my code before opening a pull request?▼

Re-read your diff and cut dead code, leftover debug logging, and duplication. Extend existing helpers rather than writing parallel implementations, match neighboring style, and split the work into topical commits with a PR title and body describing the change as a whole.

What does a code cleanup pass include before PR handoff?▼

It includes removing dead code and debug output, consolidating duplication into existing helpers, matching local naming and import style, and writing a concise PR description. It explicitly excludes running the test suite, tsc, or lint as the task.

Does code cleanup mean running tests and linters?▼

No. Cleaning means polishing the code itself, not running the test suite, tsc, or lint as the task. A check is run only when genuinely needed to confirm the polish is safe.

When should I run a code cleanup pass?▼

Run it whenever the code gets messy, including mid-work, and automatically before any PR handoff such as creating, updating, automerging, or moving to the next pull request.

What should be avoided during a code cleanup pass?▼

Avoid unrelated refactors, new abstractions with only one caller, and scope creep disguised as cleanup. Keep the pass limited to polishing your own diff.