with one click
dedupe-scan
Find and report duplicated code patterns. Read-only - does not fix.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Find and report duplicated code patterns. Read-only - does not fix.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Audit a project against a canon's rules and checklist. Read-only — produces prioritized report without fixing. Works with any canon (nextjs, sql, typescript, etc.).
Lens home base - status, help, and setup
Plan and build a new feature with quality gates.
Simple changes done right. Make the change, clean up after yourself, report what happened.
Review against canons + quality gate, fix findings, verify. Claude-native — no external models.
Plan and improve existing code with quality gates.
| name | dedupe-scan |
| description | Find and report duplicated code patterns. Read-only - does not fix. |
Read-only scan for duplicated code patterns. Reports findings without making changes.
No arguments? Describe this skill and stop. Do not execute.
In addition to duplicates, flag these signs of AI-generated code:
| Antipattern | How to Detect |
|---|---|
| Over-abstraction | Factory/Builder/Wrapper classes used only once |
| Defensive paranoia | Null checks on values that can never be null |
| Speculative features | Config options with only one value ever used |
| Wrapper classes | Classes that just delegate to another class |
| Enterprise patterns | AbstractFactory, *Builder, *Manager in simple code |
Report these in a separate "AI Antipatterns Detected" section.
Search for these function/pattern names appearing in multiple files:
PATTERN SEARCH
──────────────────────────────────────────────────────────────
Directory operations function copy.*Directory
function.*Recursive
Hashing function hash
createHash
Git operations execSync.*git
getGitCommit
getGitRemote
File operations fs.readFileSync (repeated)
fs.writeFileSync (repeated)
fs.existsSync (repeated patterns)
Validation function validate
function is[A-Z].*\(
Path resolution path.join.*\.claude
homedir()
Error handling try.*catch (identical blocks)
Run these searches in parallel:
# Function definitions appearing in multiple files
grep -r "function copy" --include="*.ts" | grep -v test | grep -v node_modules
# Hash functions
grep -r "function hash" --include="*.ts" | grep -v test | grep -v node_modules
# Git exec calls
grep -r "execSync.*git" --include="*.ts" | grep -v test | grep -v node_modules
# Repeated utility patterns
grep -r "createHash" --include="*.ts" | grep -v test | grep -v node_modules
A pattern is TRUE DUPLICATION if:
A pattern is FALSE POSITIVE if:
## Deduplication Report: [path]
DUPLICATIONS_FOUND: N
### 1. [Pattern Name]
FILES:
- [file1:line] - [brief description]
- [file2:line] - [brief description]
RECOMMENDATION: [Extract to utils/X.ts | Keep separate because Y]
### 2. [Pattern Name]
...
FALSE_POSITIVES_SKIPPED: N
- [pattern]: [reason kept separate]
CONSOLIDATION_PRIORITY:
1. [highest impact pattern]
2. [next pattern]
3. ...
DEDUPLICATION_COMPLETE
## Deduplication Report: src/
DUPLICATIONS_FOUND: 3
### 1. copyDirectoryRecursive
FILES:
- src/canon/helpers.ts:114 - sync recursive copy
- src/workflow/index.ts:223 - sync recursive copy
- src/profiles/apply.ts:94 - async recursive copy
RECOMMENDATION: Extract to utils/fs.ts with sync and async variants
### 2. hashDirectory
FILES:
- src/canon/hash.ts:21 - hashSkillDirectory
- src/workflow/index.ts:191 - hashDirectory
RECOMMENDATION: Keep separate - different algorithms for different manifest formats
FALSE_POSITIVES_SKIPPED: 1
- validateProfile: Different validation logic per module
CONSOLIDATION_PRIORITY:
1. copyDirectoryRecursive (3 files, identical logic)
2. git operations (2 files, execSync vs file read)
DEDUPLICATION_COMPLETE
Report findings only. Use /deduplication to consolidate duplicates.
| Skill | Finds | Fixes |
|---|---|---|
/dedupe-scan | ✓ | ✗ (read-only) |
/deduplication | ✓ | ✓ (consolidates) |