deduplicate
Skill1 starsChanged 3 months agoMITView on GitHub
Deduplicates code by finding one single source of truth and sharing it across call sites. Works on a named target or the full first-party codebase. Collapses duplicated logic, types, schemas, constants, UI, and tests that represent the same knowledge—without inventing false abstractions. Use when the user says "deduplicate", "dedupe", "DRY this up", "remove duplication", "single source of truth", "extract shared", or asks to consolidate repeated code into one place.
In this repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agents-mdSkill
- base-uiSkill
- better-authSkill
- brainstormSkill
- bullmqSkill
- bunSkill
- clickhouseSkill
- clone-to-tempSkill
- compound-uiSkill
- copywritingSkill
- create-durable-planSkill
- d3Skill
- date-fnsSkill
- decimal-jsSkill
- design-engineerSkill
- designSkill
- drizzle-ormSkill
- effectSkill
- elysia-architectureSkill
- elysiaSkill
- evlogSkill
- feedsmithSkill
- grokSkill
- handoffSkill
- heyapiSkill
- impitSkill
- intlayerSkill
- jsdocSkill
- kafkaSkill
- kill-legacySkill
- legend-stateSkill
- loopSkill
- mantine-hooksSkill
- mobbinSkill
- motionSkill
- oxfmtSkill
- oxlintSkill
- permixSkill
- plain-languageSkill
- playwrightSkill
- react-boundariesSkill
- react-emailSkill
- reactSkill
- reorganizeSkill
- researchSkill
- schema-dtsSkill
- sentrySkill
- seoSkill
- setup-competitors-mdSkill
- setup-copywriting-mdSkill
- setup-icp-mdSkill
- setup-project-mdSkill
- simplify-layoutSkill
- storybookSkill
- subagentsSkill
- tailwindSkill
- tailwind-variantsSkill
- takumiSkill
- tanstack-chartsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 14 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
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 8
Single goal: remove duplicated knowledge by placing one canonical implementation and having every consumer use it.
- Distinctive: line 10
Do not broaden into general cleanup, renaming, layout rewrites, or smell hunting.
- Distinctive: line 16
Prefer a little intentional duplication over a wrong abstraction.
- Distinctive: line 18
Keep edits reviewable: one duplication cluster (or tightly related cluster) per pass when the scope is large.
- Distinctive: line 23
Targeted: only the named file, directory, module, feature, or duplication cluster.
- Distinctive: line 24
Full codebase: search first-party code for duplication hotspots.
- Distinctive: line 26
If the boundary is ambiguous and would change what gets edited, ask one focused scope question.
- Distinctive: line 37
Test setup that encodes the same domain fixture
- Distinctive: line 52
Prefer one clear export over a grab-bag file.
- Distinctive: line 60
Delete the now-dead copies.
- Distinctive: line 61
Update tests: assert through the shared source.
- Distinctive: line 62
Do not leave “thin wrappers” that only re-export without adding meaning—unless a public boundary requires a stable facade.
- Distinctive: line 66
Run the narrowest existing format / lint / typecheck / tests for touched surfaces.
- Distinctive: line 68
If checks cannot run, say what was skipped and why.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Deduplicate
Single goal: remove duplicated knowledge by placing one canonical implementation and having every consumer use it.
Do not broaden into general cleanup, renaming, layout rewrites, or smell hunting. If something is not duplication (or forced by a correct dedupe), leave it alone.
Core Rules
- Preserve behavior, public APIs, and data formats unless the user authorizes a change.
- Deduplicate knowledge that will drift, not coincidental structural similarity.
- Prefer a little intentional duplication over a wrong abstraction. Extract only when the copies share one stable concept, name, and change reason.
- Reuse an existing home for the concept when one exists. Do not invent a competing
utils/helpers/shareddump. - Keep edits reviewable: one duplication cluster (or tightly related cluster) per pass when the scope is large.
- Preserve unrelated user changes.
Establish Scope
- Targeted: only the named file, directory, module, feature, or duplication cluster. Follow references outside the target for understanding; change them only when required to wire the shared source.
- Full codebase: search first-party code for duplication hotspots. Exclude generated files, vendored code, build output, caches, lockfiles, snapshots, and migrations unless they are the stated problem.
If the boundary is ambiguous and would change what gets edited, ask one focused scope question. Otherwise state the inferred boundary and proceed.
Workflow
1. Map candidates
Search for repeated:
- Logic / algorithms / validation / mapping
- Types, interfaces, schemas, constants, enums, config
- UI fragments that express the same product concept
- Test setup that encodes the same domain fixture
Record each cluster with: locations, what knowledge is duplicated, confidence, and proposed canonical home.
Skip clusters that are only similar shape with different meaning, or that will diverge for good reasons. Details: when-not-to.md.
2. Choose the single source of truth
For each accepted cluster, pick one home using ssot-placement.md.
Decision order:
- Does an existing module already own this concept? Prefer it.
- Else, place it at the narrowest owner that all consumers share (feature → package → workspace package).
- Name it for the concept, not for “shared helper.”
- Prefer one clear export over a grab-bag file.
State the chosen path and why before (or as you) extract.
3. Extract and rewire
- Move or create the canonical implementation in the chosen home.
- Replace every duplicate with an import / composition of that source.
- Delete the now-dead copies.
- Update tests: assert through the shared source; keep only consumer-specific coverage local.
- Do not leave “thin wrappers” that only re-export without adding meaning—unless a public boundary requires a stable facade.
4. Verify
Run the narrowest existing format / lint / typecheck / tests for touched surfaces. Expand only when the shared module sits on a cross-cutting boundary.
If checks cannot run, say what was skipped and why.
Completion Report
Keep it short:
- Scope inspected
- Clusters deduplicated: concept → canonical path → former locations
- Clusters left alone (with reason: intentional divergence, false similarity, out of scope, low confidence)
- Verification run and results
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.

