check-dry
Skill1 starsChanged 2 months agoMITView on GitHub
Detect DRY violations and recommend refactoring strategies. Args: [branch | <path>]
In this repository17 other files it gives its agents.
- check-testsSkill
- create-commit-messageSkill
- create-unit-testsSkill
- deslop-proseSkill
- deslopSkill
- fanout-reviewSkill
- fix-security-auditSkill
- framework-upgrade-guideSkill
- generate-adrSkill
- learnSkill
- optimizeSkill
- pr-descriptionSkill
- resolve-merge-conflictsSkill
- security-checkSkill
- ship-itSkill
- takeawaysSkill
- update-claude-mdSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
If you pass anything else (a non-existent path, an unrecognized flag), the skill stops and asks for clarification rather than guessing.
- Distinctive: line 64
If scope detection took the fallback (e.g., neither main nor master exists, or the user passed a non-existent path), the audit line must …
- Distinctive: line 76
After review, proceed with guided implementation or your chosen feature development workflow to implement the approved refactoring.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Note: $ARGUMENTS is substituted by Claude commands only. In Copilot,
the user must include their argument inline in the prompt; the skill
body sees the literal text "$ARGUMENTS" unsubstituted. -->Arguments
[branch | <path>]
- Optional. Pass
branchto diff against the resolved base branch; pass a file/directory path to scope; omit to scan the full codebase. - If you pass anything else (a non-existent path, an unrecognized flag), the skill stops and asks for clarification rather than guessing.
- Examples:
/check-dry,/check-dry branch,/check-dry src/services
Copilot CLI note:
$ARGUMENTSdoes not substitute in skills; include the argument inline in your prompt.
Check DRY Violations
Analyze $ARGUMENTS for DRY violations that signal missing abstractions.
Scope
Determine scope from $ARGUMENTS, in this order:
- Literal
branch-> diff between this branch and the base branch. Resolve the base branch as:git symbolic-ref refs/remotes/origin/HEADif it resolves, elsemainif it exists, elsemaster. If neither exists, stop and ask. - An existing file or directory path -> analyze that specific target only.
- Empty -> scan the full codebase under the current working directory (excluding
node_modules,dist,build,.git, and any path in.gitignore). - Anything else (a non-existent path, a flag the skill does not recognize) -> stop and ask the user to clarify rather than guess.
Detection Criteria
Flag duplication only when it meets all of these:
- Code appears 3+ times (two occurrences may be coincidental)
- The duplicated blocks change together: shared intent, not just shared syntax
- A single abstraction (function, component, module) can replace all occurrences without forced generality
Ignore: boilerplate required by the framework, test setup/fixtures, and config files.
Output format
For each finding, report:
- File and line number(s) of every duplicate occurrence
- What is duplicated and why it matters (shared intent vs coincidental similarity)
- Proposed abstraction: name, signature, and placement, with a code example
- Risk: what breaks if refactored incorrectly
Group findings by severity:
- Critical: the duplication crosses module/package boundaries AND the same logic appears in 4+ places OR a divergence has already produced a bug (look for
git log -S <duplicated-snippet>showing two parallel fixes). These usually want a new shared module/package. - Improvement: duplicated within a single module, 3+ occurrences, no divergence yet. Refactor with a local helper.
- Quick win: small repeated patterns (<=5 lines each) that share intent but no behavior risk yet. Cosmetic.
End with a Mentoring section ONLY if at least one finding hits the rule-of-three boundary or shows a premature-abstraction risk. Skip the section entirely if findings are all mechanical duplication; do not pad.
End with an Audit line stating exactly what was scanned and what was returned:
Audit: scope=<branch | path | full>, files scanned=N, findings=M (critical=A, improvement=B, quick-win=C). Excluded: <list>.
If scope detection took the fallback (e.g., neither main nor master exists, or the user passed a non-existent path), the audit line must say so explicitly.
Rules
- DO NOT implement fixes. DO NOT edit any files. Report only.
- Technical facts and data overrule opinions and personal preferences.
- Match the codebase existing module/file naming when proposing a new shared abstraction; do not introduce a new naming convention.
- Focus on the code, not the developer.
- Be concise: the proposed abstraction signature plus a 5 to 10 line code example beats a paragraph of prose.
Next Step
After review, proceed with guided implementation or your chosen feature development workflow to implement the approved refactoring.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

