dry

Installation
SKILL.md

DRY — Don't Repeat Yourself

What it detects

Two functions can look different in naming and literal values yet share identical structure. This skill finds those structural duplicates by normalising each function's AST — replacing variable names with :symbol, literals with :literal, and preserving only the skeleton (control flow, collection shapes, call patterns). It then compares every pair of functions via Jaccard similarity over their fingerprint sets.

A score of 1.0 means two functions are structurally identical despite different names and values. The default threshold of 0.82 catches candidates close enough to warrant review.

Supported languages: Python, JavaScript, TypeScript (including JSX/TSX).

Workflow

Phase 1 — Scan

  • Detect project language(s) from file extensions
  • Run python3 scripts/dry_check.py <src> -f json --base-dir <project_root>
  • Parse JSON output; sort by worst similarity score

Phase 2 — Review

Related skills

More from mohganji/skills

Installs
3
Repository
mohganji/skills
GitHub Stars
4
First Seen
5 days ago