dry
Skill4 starsChanged 4 months agoMITView on GitHub
Don't Repeat Yourself — Rule of Three, when duplication is fine, extracting the right abstraction.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- owenlamont/skillstheir own version, first seen Oct 20, 2026
- syntropic137/software-leverage-pointstheir own version, first seen Oct 14, 2026
- MohGanji/skillstheir own version, first seen Jul 10, 2026
- syntropic137/harness-app-templatetheir own version, first seen May 30, 2026
- JordanCoin/codingskillstheir own version, first seen Feb 28, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- JordanCoin/codingskills★ 10same name
- MohGanji/skills★ 5same name
- owenlamont/skills★ 1same name
- syntropic137/harness-app-template★ 0same name
- syntropic137/software-leverage-points★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adrSkill
- auditSkill
- autoloopSkill
- browserSkill
- bugfixSkill
- changelogSkill
- clean-codeSkill
- creating-workflowsSkill
- deep-researchSkill
- doc-genSkill
- dont-reinventSkill
- executingSkill
- featureSkill
- gcliSkill
- harness-auditSkill
- healthSkill
- mega-prSkill
- onboardSkill
- pr-readySkill
- refactorSkill
- researchSkill
- scrapeSkill
- scratchpadSkill
- screenshotSkill
- self-auditSkill
- self-improveSkill
- self-lintSkill
- self-migrateSkill
- self-perfSkill
- self-testSkill
- setup-rulesSkill
- stuckSkill
- test-genSkill
- tri-debugSkill
- tri-dispatchSkill
- tri-reviewSkill
- tri-securitySkill
- yagniSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 7 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
7
Distinctive
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 10
Don't abstract on the first duplication.
- Distinctive: line 20
Not all duplication is bad.
- Distinctive: line 22
The duplicated code serves different concerns: Test setup that looks similar to production code isn't "duplication" — they change for …
- Distinctive: line 23
The cost of coupling exceeds the cost of duplication: If extracting a shared function means two unrelated modules now depend on each other, …
- Distinctive: line 30
When you do extract, get the abstraction right:
- Distinctive: line 34
Don't over-parameterize: If the shared function needs 8 config options to handle all cases, the cases are probably too different to share.
- Distinctive: line 35
Keep it simple: If the abstraction is harder to understand than the duplication, the duplication was better.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DRY (Don't Repeat Yourself)
The Rule of Three
Don't abstract on the first duplication. Wait for three instances.
- First time — Just write it.
- Second time — Notice the duplication, wince, keep going.
- Third time — Now extract. You have enough examples to see the real pattern.
Premature abstraction is worse than duplication. Wrong abstractions are expensive to undo.
When Duplication Is Fine
Not all duplication is bad. Duplication is acceptable when:
- The duplicated code serves different concerns. Test setup that looks similar to production code isn't "duplication" — they change for different reasons.
- The cost of coupling exceeds the cost of duplication. If extracting a shared function means two unrelated modules now depend on each other, keep them separate.
- The "duplication" is coincidental. Two things look the same today but will evolve independently. Forcing them to share code creates a false coupling.
The test: if one copy changes, must the other change too? If yes, extract. If maybe not, leave it.
Extracting the Right Abstraction
When you do extract, get the abstraction right:
- Name it for what it does, not where it came from.
formatCurrencynotextractedFromOrderPage. - Parameterize the differences. The parts that vary between call sites become parameters.
- Don't over-parameterize. If the shared function needs 8 config options to handle all cases, the cases are probably too different to share.
- Keep it simple. If the abstraction is harder to understand than the duplication, the duplication was better.
The Real DRY Principle
DRY is about knowledge, not code. The principle says every piece of knowledge should have a single authoritative source. Two functions with identical code but representing different business rules are not a DRY violation.
"Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." — Andy Hunt & Dave Thomas
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.

