Code Dedup
SkillDev toolsSearches for duplicate code, duplicate tests, and dead code, then safely merges or removes them. Use when the user says "deduplicate", "find duplicates", "remove dead code", "DRY up", or "code dedup". Requires test coverage — refuses to touch untested code.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Code Dedup skill
What this skill tells your AI
The instructions your AI receives, as published by melbournedeveloper/dart_node in .claude/skills/code-dedup/SKILL.md and read by ahel’s review.
Carefully search for duplicate code, duplicate tests, and dead code across the repo. Merge duplicates and delete dead code — but only when test coverage proves the change is safe.
Prerequisites — hard gate
Before touching ANY code, verify these conditions. If any fail, stop and report why.
- Run
make test— all tests must pass. If tests fail, stop. make testalready enforces the coverage threshold fromcoverage-thresholds.json. If it failed on coverage, stop.- This is a Dart repo with static typing via
austerity— proceed.
Steps
Step 1 — Inventory test coverage
- Run
make testand note coverage per package from the output - Only packages WITH coverage are candidates for dedup
Step 2 — Scan for dead code
- Look for unused exports, functions, classes, variables across all packages
- Use
dart analyzeoutput for unused element warnings - Grep the entire codebase for references before marking as dead
- List all dead code found. Do NOT delete yet.
Step 3 — Scan for duplicate code
- Look for functions with identical or near-identical logic across packages
- Check across package boundaries
- List all duplicates found. Do NOT merge yet.
Step 4 — Scan for duplicate tests
- Look for tests that verify the same behavior
- Look for test helpers duplicated across test files
- List all duplicate tests found. Do NOT delete yet.
Step 5 — Apply changes (one at a time)
For each change: change -> test -> verify coverage -> continue or revert.
- After each change: run
./tools/test.sh - If tests fail or coverage drops: revert immediately
Step 6 — Final verification
- Run
make test— all tests must still pass - Run
make lintandmake fmt CHECK=1— code must be clean - Report: what was removed, what was merged, final coverage vs baseline
Rules
- No test coverage = do not touch.
- Coverage must not drop.
- One change at a time.
- When in doubt, leave it. False dedup is worse than duplication.
- Three similar lines is fine. Only dedup substantial (>10 lines) or 3+ copies.
Signals
- GitHub stars
- 113
- Forks
- 2
- Last commit
- Jul 2026
Advanced
- Catalog kind
- skill
- Gateway key
code-dedup- Source
- github.com/melbournedeveloper/dart_node