/ceh-coding-conduct:shrink-diff [base-branch]from ceh-coding-conduct
Load this skill when a feature branch works and its diff against main should shrink before review: duplication it added, single-caller wrappers, code it made dead. Trigger on "shrink the diff", "consolidate the branch". Not for whole-codebase cleanup (use refactor-repo).
Ships in ceh-coding-conduct. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
write-less-code fires at write time, inside one session. Code accreted across sessions and
commits escapes it: session three writes a helper session one already had, a later commit leaves
a wrapper with one caller, an early abstraction outlives its need. This skill applies the same
standard retroactively — one pass over the finished diff, before it goes to review.
Claude Code's built-in /simplify already reviews changed code for reuse and simplification. This
skill adds what it does not carry: the write-less-code ladder as the yardstick, the whole branch
against its base as the scope, and behavior preservation as the gate on every edit.
The seed set is everything the branch changed relative to the base branch (the argument, default
main):
git diff --stat <base>...HEAD # size baseline (three dots: merge-base, not the base tip)
git diff --name-only <base>...HEAD # seed files
Read anything; edit outside the seed only with cause. The three causes:
Flag every out-of-seed edit in the summary with its cause. Anything beyond these three causes is
general cleanup — out of scope here; suggest refactor-repo instead.
Walk each piece of code in scope down the write-less-code ladder, in hindsight:
For each seed symbol, in order of payoff:
Rank candidates by payoff (lines removed, readability gained) over risk; apply top-down. A
candidate whose own diff would blow past reviewability (the size limits in
ceh-git-workflow:pull-request) gets flagged, not applied.
A refactor changes shape, never behavior:
ceh-testing:verify-behavior-preserved (characterization tests, golden files, differential run)
and commit those pins on their own before touching the code. A green existing suite is the weaker
check: it only proves what it already covered.refactor: type, separate from any other change.End with the before/after git diff --stat <base>...HEAD totals, the candidates applied, the
candidates flagged but not applied (with why), and every out-of-seed edit with its cause.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/agent-coding-contractCore behavioral contract for coding sessions./find-root-causeLoad this skill when something is broken and no command has yet shown why, before any fix: reproduce it, kill hypotheses with evidence, name the cause. Trigger on "debug this", "find and fix these bugs", "why is this failing", an unexplained stack trace, or a second fix that did not hold./refactor-repoAudit a whole codebase or one module for accumulated complexity and shrink it: a read-only inventory, a ranked proposal, then, only after approval, refactor/ branches under a behavior-preservation gate. Not for one branch's diff (use shrink-diff)./write-less-codeThe write-less-code minimalism standard: the full ladder and what never to simplify away.npx claudepluginhub cheneeheng/ceh-claude-code-library --plugin ceh-coding-conduct