1. Habit
  2. Skills
  3. jscpd skill
kucherenko · 3K installs

jscpd skill
Runs by itself, weekly duplication scan.

Copy-pasted code stops growing.

Install the jscpd skill and make it a habit: follow https://gethabit.dev/skills/kucherenko/jscpd.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

3K installs6K starsMIT licenceSource on GitHub ↗

jscpd

by kucherenko · 3K installs

The skill

The jscpd skill runs the jscpd copy-paste detector across 220+ languages, finds exact, renamed and near-miss clones, and ranks refactoring hotspots with a codebase summary.

Only when you ask.

The habit

Copy-pasted code stops growing.

↻ Runs by itselfweekly duplication scan

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleOne scan per run, at most one extra noisy pass and the top 10 hotspots.

  1. 01

    Read last run

    Open the log to get the last duplication share and hotspot files.

  2. 02

    Exact clone pass

    Run npx jscpd --reporters ai --summary --no-tips with --ignore for node_modules and dist.

  3. 03

    Check threshold

    Run with --threshold so the scan exits with an error when duplication is too high.

  4. 04

    Optional renamed pass

    If exact clones are handled, run one --ignore-identifiers --min-tokens 70 pass and treat hits as leads.

  5. 05

    Rank hotspots

    Pick the large files with a high dup% from the summary as refactoring targets.

  6. 06

    Hand to refactoring

    Pass the top targets to the dry-refactoring skill for a guided cleanup.

  7. 07

    Write the log

    Save the share, clone count, flags used and top files for the next run.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the jscpd skill helps.

Use it when

  • ✓ you suspect copy-pasted code
  • ✓ you want a duplication gate in CI
  • ✓ you need refactoring hotspots

Skip it when

  • – the codebase is tiny
  • – you need a full linter

Questions

jscpd skill, answered.

Should CI fail on renamed or similar clones?

Not until the team has reviewed what those noisy passes report. Gate on exact clones first.

Does the loop fix the clones?

No. It finds and ranks them and hands targets to the dry-refactoring skill.

Which output does the agent read?

The ai reporter, a compact clone list with a duplication share at the end.

How do I install the jscpd skill?

Copy the prompt at the top into your agent. It installs the skill from kucherenko/jscpd and sets up the habit. Or run npx skills add kucherenko/jscpd --skill jscpd.

Is the jscpd skill free?

Yes. It is published under MIT. Habit is free too.

jscpd. Now as a habit.

Install the jscpd skill and make it a habit: follow https://gethabit.dev/skills/kucherenko/jscpd.md

  • Free
  • No account
  • Undo in one line

All kucherenko skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by kucherenko, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.