Rust Code Similarity

SkillDev tools

Detect semantic code similarities using similarity-rs. Creates refactoring plans for duplicate code.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Rust Code Similarity skill

What this skill tells your AI

The instructions your AI receives, as published by nwiizo/cargo-coupling in .claude/skills/similarity/SKILL.md and read by ahel’s review.

Scan the requested scope (default ./src) with similarity-rs. Start with one scan and inspect the reported code; thresholds rank candidates, not required actions:

rtk proxy similarity-rs ./src --threshold 0.85 --skip-test

Honor requested options. Use --print for source detail or --experimental-types when comparing types is relevant. Consult similarity-rs --help for other options; do not run several threshold sweeps without an unresolved question.

Check callers, semantics, and intentional differences. Recommend shared code only when responsibilities align and the abstraction reduces maintenance cost. A high similarity percentage alone does not justify generics, traits, or extraction.

When assessing a structural change, use cargo-coupling on the relevant scope to check its effect on boundaries. Launch visualization only when requested or needed to answer the task. Report locations, the shared responsibility (if any), and the recommendation, including cases where duplication should remain. Implement fixes when requested and verify the changed behavior and coupling.

Signals

GitHub stars
97
Forks
2
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
similarity
Source
github.com/nwiizo/cargo-coupling