# Review Duplicates

> Duplicate code detection using similarity-rs. Identifies refactoring candidates based on semantic similarity.

- Skill: `nwiizo/review-duplicates-2` (Agent Skill)
- Install (CLI): `npx skillmds@latest add nwiizo/review-duplicates-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/nwiizo/review-duplicates-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: nwiizo (https://skillmd.com/u/nwiizo)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/nwiizo/review-duplicates-2

---


Detect duplicate code in the ccswarm codebase using similarity-rs.

```bash
similarity-rs crates/ --threshold 0.80
```

For Rust code, also consult `cargo coupling` so duplicate cleanup is prioritized
by architectural impact, not only by textual similarity.

```bash
cargo coupling . --summary --exclude-tests
cargo coupling . --hotspots=12 --exclude-tests
```

If a duplicate cluster is located in a coupling hotspot, high-risk boundary, or
cycle-related module, raise its refactoring priority accordingly.

Classify results by priority:

| Priority | Condition | Action |
|----------|-----------|--------|
| High | 95%+ similarity, 10+ lines | Extract to common function |
| Medium | 90-95% similarity, 5+ lines | Consider trait or macro |
| Low | 85-90% similarity | Evaluate structural similarity |
| Skip | Test code, config structs | Allow intentional duplication |

Output a JSON report with `high_priority`, `medium_priority`, `low_priority`, and `ignored` sections.

