/marekkirejczyk-skills:dont-repeat-yourself [repository | pr <number|url|branch> | path | concept]from marekkirejczyk-skills
Finds duplicated concepts across a repository, PR, directory, or concept scope and consolidates them into one well-tested implementation. Automatically extracts identical copies and surfaces behavioral differences for user decision.
Ships in marekkirejczyk-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Find every concept implemented more than once in a scope and give it one well-tested implementation. Arguments: $ARGUMENTS. If your agent does not fill that in, take them from the user's message.
The scope is what the user names: the repository, a PR or branch, a directory, a file, a module, or a concept ("everything about dates"). With no scope given, use the whole repository.
For a PR, compare its new code against the whole repository:
Run phase 1 from start to finish without asking for approval. Phase 2 is the only time you ask the user anything.
Each concept has one implementation, so a change to it is a change in one place.
You are done when all of these hold:
A cluster is two or more implementations of one concept. Look for the intention, not matching text: three ways of writing "today / yesterday / a minute ago" are one cluster. Inline blocks count as well as named helpers, and so do route types that describe the same contract.
Work mainly within one layer. Across layers, extract only pure functions, placed where the project's dependency rules allow. Other cross-layer duplication is report-only, because the fix is moving a rule, which is a different change.
These hold after every round. A round that breaks one is undone.
Copies are identical only if you have compared every branch and found the same result for each of:
Any difference, however small, means the cluster goes to phase 2.
utils or helpers modules are never the destination.When an extraction creates or extends a module, look through every file that extraction touched. Move local helpers about the module's subject into it, even those with a single caller. A helper bound to its caller's private state stays, and so do helpers on other subjects.
A move is phase 1 work, in its own commit, separate from the extraction. Existing tests move with the helper. Add direct tests for a non-trivial helper that has none.
Present every Ask cluster in one batch, as numbered items, each with:
file:lineRecommend leaving separate when keeping the differences would take more than 2–3 options.
Apply the user's answers in the same session, one commit per cluster, under the same rules and test-first order. A cluster the user does not answer stays as it is.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
code-deduplication, refactoring, dry-principle, code-quality
npx claudepluginhub marekkirejczyk/skills --plugin marekkirejczyk-skills11 skills in this plugin
/baby-sittingBaby-sit the current branch's pull request until it is merged. With nothing or manual it keeps the PR rebased, green and answered, working through the review bot's comments you pick, and leaves the merge to you; with auto it turns on GitHub auto-merge./eval-reportRun a repository's evals and turn the results into one static HTML report for fast review, with pass/fail counts, collapsible files, filters for failed and for new or changed cases, and links to the code. Run it with nothing for the whole repository, with commit or pr to mark what changed, or with only commit|pr to run just what changed./eval-report-install-ciSet up eval-report on GitHub Actions, so every pull request gets an HTML eval report linked at the top of its description and in one comment, built by a script without model tokens. Adds it to the existing eval job, or proposes a lean eval job of its own. Needs the eval-report skill installed next to it./explain-with-slidesBuild a slide deck that walks through a repository, the current one or one at a URL, (architecture and features) or through one pull request (its changes, before/after screenshots, diagrams, key files, diffs, tests and review risks), with screenshots taken from the code actually running. Published as a Claude Slides artifact or as a standalone HTML deck. Use only when the user asks for a repo presentation, onboarding deck or PR walkthrough deck./explain-with-videoMake a narrated explainer video of a repository or a pull request, as an MP4 with captions on a shareable video page. Scenes reveal and highlight item by item while a synthetic voice explains them (macOS say by default; OpenAI or ElevenLabs when configured). Use only when the user asks for a narrated video, screencast or video explainer of a repository, a feature or a pull request./finish-prFinish the current branch's pull request. It reviews the change in sub-agents and fixes what is worth fixing, pushes it with a description, lists its links and the files its code owners must review, then baby-sits it. With nothing or manual it leaves the PR ready for you to merge; with auto it merges once green.Other plugins' skills for the same job