Skip to content
Skills Library
Programming · Building & coding

diff-cleanup

/diff-cleanup

Cleans a git diff: strips unneeded code, leaves the remainder maintainable and readable, then runs the project's tests, lint, and format suite. Use when the user asks to clean up a diff, strip leftover scaffolding from a change, or make a change review-ready.

Repository
agent-kit ↗
Licence
MIT
Last repository change
11.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Cleans a git diff: strips unneeded code, leaves the remainder maintainable and readable, then runs the project's tests, lint, and format suite. Use when the user asks to clean up a diff, strip leftover scaffolding from a change, or make a change review-ready.

Original author description

Cleans a git diff: strips unneeded code, leaves the remainder maintainable and readable, then runs the project's tests, lint, and format suite. Use when the user asks to clean up a diff, strip leftover scaffolding from a change, or make a change review-ready.

How it works

  1. 1. Pin the diff
  2. 2. Find every unneeded site
  3. 3. Clean the remainder
  4. 4. Run the suite
  5. 5. Report
Original SKILL.md headings · 78 lines, 518 words
SKILL.md preview
---
name: diff-cleanup
description: >-
  Cleans a git diff: strips unneeded code, leaves the remainder maintainable
  and readable, then runs the project's tests, lint, and format suite. Use
  when the user asks to clean up a diff, strip leftover scaffolding from a
  change, or make a change review-ready.
---

# Diff Cleanup

Read the change, strip everything that does not earn its keep, leave the **remainder** maintainable and readable, then run the **suite** until it is green. Stop after the report; leave committing to the user.

## 1. Pin the diff

Resolve the range:

- User named a fixed point → `git diff <fixed-point>...HEAD`, plus any working-tree changes
- Working tree is dirty → the working tree against `HEAD`, including untracked files
- Working tree is clean → `git diff <main>...HEAD` (resolve `main` / `master` / the tracked upstream from git)

State the range. Gather the file list and the full diff. Work in source humans maintain; skip lockfiles, generated output, and vendor trees.

Completion: the range is stated, and the file list plus full diff are in context.

## 2. Find every unneeded site

Walk every hunk and every newly added file. Read enough surrounding code to tell leftover from load-bearing.

A line is **unneeded** when deleting it would not change the behavior the change exists to deliver:

- Dead code, unused imports, unused exports, unused parameters
- Debug leftovers (`console.log`, `debugger`, stray prints)
- Commented-out code
- Scaffold from the implementation (WIP notes, finished TODOs, always-true flags, `REFACTOR:` scope markers from refactor-scope)
- Speculative generality: abstractions, params, or hooks the change does not use
- Duplicate logic that can collapse into one place
- Comments that restate the next line

Apply the **deletion test** to new wrappers and helpers: if deleting them only moves the same lines to the caller, they are unneeded. Scope is the change.

Completion: every unneeded site in the diff is listed, or you have confirmed there are none.

## 3. Clean the remainder

Edit only files in the change. Cut every listed site. When a test only asserted unneeded behavior, remove that test with the code.

What remains should be something a teammate can maintain:

- Names reveal what the thing does or holds
- Control flow is straight: early returns, one job per function
- The surrounding file's style is the style
- A new type or helper exists only when it hides real complexity

Preserve public behavior. If a cut would change what callers observe, keep the code.

Completion: every listed site is gone, and the remainder reads as intentional.

## 4. Run the suite

Discover the project's **suite** from the environment: task-runner scripts, Makefile, `justfile`, CI config. Use those commands.

Run, in order: format, lint, tests. A single `check` / `ci` / `verify` script counts as the whole suite when it covers those. Skip any piece the project does not define, and say so.

On failure caused by this cleanup: fix and re-run. On a pre-existing failure outside the change: note it and stop.

Completion: every defined piece of the suite is green, or every remaining failure is pre-existing and named.

## 5. Report

```
## Cleanup

Range: <the pinned range>

Removed:
- <file>: <what and why>

Rewrote:
- <file>: <what made it more readable>

Suite: format ✓  lint ✓  tests ✓
```

Omit empty sections. If nothing was unneeded, say so and still report the suite.
Files in this package (2)
  • SKILL.md 3 KB
  • agents/openai.yaml 1 KB

Versions

The database has no other skills named diff-cleanup.

Database snapshot: 13.11.2026 · package version 821aed4b0a58 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100world-class-engineering
    Use when designing, building, reviewing, or upgrading production software that must be secure, performant, maintainable, scalable, and user-centred, and when verifying a change before claiming done or opening a PR via the six-phase build, types, lint, tests, security, and…
  • 95oil-diff
    将 Git 改动、提交范围或工作区修改生成直观易读的可视化 HTML 改动汇报页(含业务模块速览、前后对比图示、具体例子、单行改动文件树与右侧原文对照抽屉)。用户要求解释一轮代码或文档改了什么、把 git diff 做成汇报页或可视化演示页、向老板或团队展示仓库改动时使用。不用于执行代码修改、Git 提交、常规 Code Review 缺陷审计或制作通用幻灯片。
  • 90ship-check
    Pre-commit checklist that runs tests and lint, reviews the diff, and catches secrets and leftover debug logs before you commit or push. Use when the user says ship it, ready to commit, pre-commit check, before I push, is this safe to commit, or review my changes.
  • 90ship
    Pre-flight check before opening a PR: runs the project's typecheck, lint and tests, reviews the diff for bugs with the code-reviewer agent, then drafts the PR description. Use when the user says they're ready to ship, open a PR, or wrap up a change.
  • 100quality-check
    Use when the user finishes a code change and wants format / lint / type-check / tests run together, or asks "is this clean?" / "any issues?". On-demand replacement for prior chained quality gates.
  • 100deslop
    Use when the user says deslop, debloat, tidy, simplify, clean a diff, cleanup codebase, or deslop branch diff, or remove dead code or config. Not for remote, credential, publish, deploy, or irreversible changes.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.