# Minimal Diff

> Produces the smallest correct diff. Use when implementing features, fixing bugs, or refactoring. No drive-by edits, no scope creep, no reformatting unrelated code.

- Skill: `aresiddharthareddy/minimal-diff` (Agent Skill)
- Install (CLI): `npx skillmds@latest add aresiddharthareddy/minimal-diff`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aresiddharthareddy/minimal-diff/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: aresiddharthareddy (https://skillmd.com/u/aresiddharthareddy)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/aresiddharthareddy/minimal-diff

---


# Minimal Diff

## Rule

Change **only** what the task requires. A reviewer should see one clear intent.

## Scope checklist

Before editing, write (internally):

```
Goal:
Files allowed:
Files forbidden (unless user asked):
```

Default **forbidden**: unrelated files, style-only churn, renaming sprees, "while I'm here" cleanups.

## Editing tactics

1. **Locate** the single function/component/module that owns the behavior.
2. **Patch** that unit — not its entire directory.
3. **Import** instead of duplicating.
4. **Delete** dead code only if you introduced a replacement in the same change.

## Diff size targets

| Task type | Target |
|-----------|--------|
| Bug fix | 1–3 files, often &lt;20 lines |
| Small feature | Extend existing module before new file |
| New file | Justify why no existing file fits |

## Forbidden without explicit user request

- Reformatting untouched lines
- Renaming unrelated symbols
- Adding tests for unrelated code
- New config/env/docs files
- Dependency upgrades
- "Improvements" outside the ask

## Refactor requests

When user says "refactor":

1. Confirm **behavior unchanged**.
2. Refactor **one** cohesive unit per step.
3. Do not mix refactor + feature in one diff.

## Verify

- `git diff` shows only task-related hunks
- No new abstractions unless they **remove** more lines than they add

