code-cleanup

Clean up committed code changes by minimizing diffs and running linters.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/zcawood-mie/agentz --skill code-cleanup-zcawood-mie
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-cleanup
Source: https://github.com/zcawood-mie/agentz/tree/main/skills/code-cleanup
Command: npx skills add https://github.com/zcawood-mie/agentz --skill code-cleanup-zcawood-mie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill reduces unnecessary or noisy changes in commits by reviewing only added or changed lines, minimizing diffs, and improving naming, style, and type clarity so pull requests are focused and easy to review.

Core Features & Use Cases

  • Diff Minimization: Detects whitespace-only edits, moved-but-unchanged code, and reorderings and suggests ways to reduce noise in a diff.
  • Pattern & Naming Consistency: Compares new code to existing patterns and recommends structural or naming changes to match the codebase.
  • Linting & Type Hygiene: Runs linters on changed files and prioritizes fixes in modified code; checks for missing types at public boundaries.
  • Interactive, One-at-a-Time Workflow: Presents a single, actionable issue with file/line references, current snippet, and a proposed fix, then waits for user approval.
  • Use Case: Pre-PR polish to shrink diffs and surface only meaningful, reviewable changes.

Quick Start

Review the current branch diff and propose one cleanup at a time, prioritizing diff minimization first.

Frequently Asked Questions about code-cleanup

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

FAQPage Schema
How do I minimize PR diffs before submitting code for review?

To minimize PR diffs, review only added or modified lines in your branch to detect whitespace-only edits, moved-but-unchanged code, and reorderings. This reduces noise so pull requests stay focused and easy to review.

What is diff minimization and when do I need it for code cleanup?

Diff minimization is detecting unnecessary or noisy changes in commits, such as whitespace edits or code reorderings. You need it during pre-PR polish to ensure pull requests contain only meaningful, reviewable changes.

How do I enforce naming and pattern consistency on changed code?

You enforce naming and pattern consistency by comparing new code to existing patterns in the codebase. This recommends structural or naming changes to match the codebase while checking for missing types at public boundaries.

Can I run linters on only the changed files in a branch diff?

Yes, you can run linters on changed files to prioritize fixes in modified code. This targets only added or changed lines during pre-PR polish or commit refinement workflows, keeping unrelated code untouched.

What is the best way to review code cleanup suggestions interactively?

The best way is to present a single, actionable issue at a time with file and line references, current snippet, and a proposed fix. This interactive workflow waits for user approval before moving to the next issue.

Does diff minimization work on committed code changes or uncommitted work?

Diff minimization works on committed code changes in a branch diff. It applies only to added or modified lines during pre-PR polish, diff review, or commit refinement workflows to minimize unnecessary changes.