[DUPLICATEFINDER]
Documentation for the /duplicatefinder tool.
// Scan for duplicate code and generate a report
$ /duplicatefinder
Scans functions, components, and pages for duplicates and produces a human-readable report with suggested actions.
When to use it
- After rapid, exploratory "vibe coding" when duplicates may have crept in
- When taking over an older project and you need a quick map of similar code
Workflow (Safe by default)
- Run
/duplicatefinder
and review the findings - Open both files, compare intent/props/side effects
- Decide to keep, consolidate, or remove
- Add/update tests to preserve behavior
- Refactor/remove in small PRs and re-run the tests
Cautions
- Do not auto-delete based on the report
- Validate every item manually; similarity can be misleading (i18n, SSR/CSR, roles)
See also: [AUTO-REFACTOR REPORT] · [AUTO-REVIEW]