/code-habits:extend-not-duplicatefrom code-habits
Use when about to write a new script, command, or file that is near-identical to an existing one with small variations — adds a CLI flag, parameter, or config option to the existing script instead of creating a parallel copy.
Ships in code-habits. 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.
If you're about to write a new script that's >80% the same as an existing one with small differences (different env, different mode, different flag combo), extend the existing one with a CLI argument or config option instead of writing a parallel copy.
Two near-identical scripts diverge over time. A bug fix lands in one and not the other. A new feature gets added inconsistently. Reviewers can't tell which is canonical. The duplicated logic compounds with every change.
When you notice you'd be copying an existing script and changing a few values:
--mode prod / --target dev) or env knob to the existing script.If the differences are structural (different control flow, different inputs, different outputs), then a separate script IS appropriate — but check first whether the structural difference can be expressed as a parameter.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
7 skills in this plugin
/comment-non-obvious-stepsUse when writing or editing code that contains repeated-looking calls on different structures, bitmask/bit-fiddling, ordering-sensitive sequences, or multi-step state mutations across data structures — adds a short inline comment per step explaining WHY each step is distinct, so a reader doesn't stop and ask "wait, why are there three of these?". Does not apply to trivial code with self-explanatory identifiers./deliverable-on-diskUse when about to mark a task as complete, done, finished, or shipped — verifies the deliverable actually exists as a file on disk, in a commit, or as a posted artefact. Blocks claiming completion based on chat output alone./ephemeral-state-in-tmpUse when about to write a state, cursor, marker, scratch, or progress file for a cron loop, monitor task, polling job, recurring schedule, or any session-scoped/ephemeral data — directs the file to /tmp/<name>.json instead of ~/.claude/ or other config dirs./evidence-over-speculationUse when about to assert a fact about code behavior, data state, configuration, or system behavior you have not directly verified — requires either reading the source/running the query/checking the log first, or labelling the claim explicitly as a hypothesis. Also covers secondary sources (deepwiki, subagent reports, web search, memory entries): keep the source tag visible and verify cited facts before relaying them as primary-source assertions./one-test-one-thingUse when writing or reviewing a unit/integration test — enforces a clear scenario-shaped name (no `_and_`), Arrange/Act/Assert structure with visible separation, and one logical behaviour per test. A failing test name should describe exactly what regressed without opening the file. Multiple scenarios become multiple tests, not one test with branches or `_and_` in the name./plans-and-investigations-locationUse when about to write an implementation plan, investigation note, design sketch, post-mortem, or any markdown capturing personal process inside a project repo — and especially when about to save under `docs/plans/`, `docs/investigations/`, or `docs/design/`. Routes personal/in-flight work to `.local/<kind>/` (gitignored) and reserves `docs/<kind>/` for shared, team-reviewed artefacts.npx claudepluginhub amitkot/claude-code-tools --plugin code-habits