code-migration
Skill6.3k starsChanged 3 months agoMITView on GitHub
Move code from one implementation to another function by function, tests first and code second, and check two implementations of one app for parity, with jscpd --compare as the progress measure and a coverage map binding each function to its tests. Use when porting a library or app to another language or framework (Java to Kotlin, JavaScript to Rust, a Python library to TypeScript, an iOS app to Android), when asked what is left to port, or when comparing the Android and iOS versions of an app.
3 other projects use a version of this.
Trending
More talk lately.about the whole repository
Most recently taken up by
- anthropics/code-migration-kit-with-claude-codetheir own version, first seen Jul 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen May 8, 2026
- konveyor-ecosystem/playpen-pf-mig-skillstheir own version, first seen Apr 15, 2026
Who's talking about kucherenko/jscpd
- A Hacker News story“Jscpd Public Copy/paste detector for programming source code”Hacker News · Jun 29, 2025 · 5 points
- sivagao/blog“2016/03/31 针针见血:怎么消除JavaScript中的代码坏味道”GitHub · Mar 31, 2016 · 5 reactions
- @marmelab.bsky.social“Just came across jscpd: A Copy/paste detector for programming source code. It lets you see if your code can …”Bluesky · Mar 7, 2025 · 4 likes
- A Hacker News story“Show HN: Jscpd start support type2/type3 clones”Hacker News · Sep 11, 2026 · 2 points
- AFI-Protocol/afi-config“chore(deps-dev)(deps-dev): bump jscpd from 4.2.5 to 5.0.12”GitHub · Jul 20, 2026 · 2 reactions
The biggest 5 of 49 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 49
Talked about on GitHub, Hacker News and Bluesky (49 times).
On GitHub · 44
- Mar 31, 20162016/03/31 针针见血:怎么消除JavaScript中的代码坏味道 — sivagao/blog5 reactions · 9 comments
- Jul 20, 2026chore(deps-dev)(deps-dev): bump jscpd from 4.2.5 to 5.0.12 — AFI-Protocol/afi-config2 reactions · 3 comments
- Jun 8, 2026Bump jscpd from 4.2.4 to 5.0.4 — hbmartin/raffy-research2 reactions · 3 comments
- May 31, 2026Bump jscpd from 4.0.9 to 4.2.4 — hbmartin/react-mentions-ts2 reactions · 3 comments
- Aug 8, 2026chore(deps): bump the dev-minor-patch group across 1 directory with 13 updates — juliopolycarpo/mangostudio1 reaction · 7 comments
39 more on GitHub
- Jul 20, 2026build(deps): bump the routine-minor-patch group with 20 updates — zaks-io/splitch1 reaction · 3 comments
- Jul 20, 2026build(deps-dev): bump the dev-dependencies group across 1 directory with 15 updates — zaks-io/splitch1 reaction · 2 comments
- Jul 20, 2026build(deps-dev): bump the dev-dependencies group with 14 updates — zaks-io/splitch1 reaction · 5 comments
- Jul 13, 2026build(deps-dev): bump the dev-dependencies group with 12 updates — zaks-io/splitch1 reaction · 2 comments
- Jul 13, 2026build(deps): Bump jscpd from 4.2.4 to 5.0.12 — zaks-io/insecur1 reaction · 1 comment
- Jul 6, 2026build(deps-dev): bump the dev-dependencies group with 8 updates — zaks-io/splitch1 reaction · 5 comments
- Jun 30, 2026chore(deps): bump jscpd from 4.2.4 to 5.0.11 — zaks-io/insecur1 reaction · 1 comment
- Jun 18, 2026README benchmarks may be outdated after jscpd Rust rewrite — fallow-rs/fallowsays it tested it1 reaction · 5 comments
- Apr 14, 2026chore(deps): bump the npm-deps group across 1 directory with 14 updates — dctmfoo/openai-agents1 reaction · 1 comment
- Jan 24, 2023New linters/formatters — db-ux-design-system/core-web1 reaction · 3 comments
- Oct 5, 2026chore(deps): bump jscpd from 5.0.14 to 5.4.0 — actions-marketplace-validations/Raed2180416_holt0 reactions
- Oct 5, 2026build(deps-dev): bump jscpd from 5.3.1 to 5.4.0 — aurelienbobenrieth/harness0 reactions
- Oct 5, 2026chore(deps): bump jscpd from 5.0.14 to 5.3.3 in /benchmarks — CircuitBoardGames/Fallow-Forgejosays it tested it0 reactions
- Oct 5, 2026chore(deps-dev): bump jscpd from 4.2.5 to 5.4.0 — Axl47/Theoria-Codex0 reactions
- Oct 5, 2026ci(deps): bump kucherenko/jscpd from 5.3.2 to 5.4.0 in the github-actions group — xsyetopz/easel.js0 reactions · 1 comment
- Oct 4, 2026chore(deps-dev): bump jscpd from 4.3.0 to 5.4.0 — GabrielV-Engineer/AILIENANT0 reactions
- Oct 3, 2026chore(deps-dev): bump jscpd from 5.2.1 to 5.4.0 — ZinTrust/zintrust0 reactions · 1 comment
- Oct 3, 2026Bump jscpd from 5.0.12 to 5.1.2 — xiejianjun000/eco-agent0 reactions · 1 comment
- Oct 3, 2026build(deps-dev): bump jscpd from 5.0.12 to 5.1.2 — murilloleonel939-art/deepseek0 reactions · 1 comment
- Oct 1, 2026build(deps-dev): bump the npm-dependencies group with 2 updates — chapmandu/rust-in-peace0 reactions
- Oct 1, 2026chore(deps): bump jscpd from 5.0.16 to 5.3.2 in /benchmarks — actions-marketplace-validations/fallow-rs_fallowsays it tested it0 reactions
- Oct 1, 2026build(deps): bump jscpd from 4.3.0 to 5.3.2 — astubbs/duplicate-code-cross-check0 reactions · 1 comment
- Oct 1, 2026Bump jscpd from 5.0.16 to 5.3.2 — vinceyvincey/agent-readiness0 reactions
- Sep 30, 2026chore(deps): bump jscpd from 5.0.12 to 5.3.2 — fderuiter/equipose-randomization0 reactions · 1 comment
- Sep 29, 2026chore(deps): bump jscpd from 5.0.14 to 5.3.2 — Raed2180416/holt0 reactions
- Sep 29, 2026chore(deps-dev): bump jscpd from 5.0.16 to 5.3.2 — xplorer1/starter-test0 reactions
- Sep 28, 2026Bump jscpd from 3.4.2 to 5.3.2 in /dependencies — asia215/super-linter0 reactions
- Sep 28, 2026chore(deps): bump jscpd from 5.0.14 to 5.3.2 — Dorsey-Creative/secrets-sync-cli0 reactions
- Sep 26, 2026chore(deps-dev): bump jscpd from 5.2.0 to 5.3.0 — mnahkies/shoe-string-server0 reactions
- Sep 23, 2026chore(deps-dev): bump jscpd from 4.3.0 to 5.3.2 — Glock-Boonyarith/school-check0 reactions · 1 comment
- Sep 23, 2026build(deps-dev): bump jscpd from 5.0.15 to 5.3.1 — authenticmemory/gami-cli-verifier0 reactions
- Sep 21, 2026Bump jscpd from 3.3.26 to 5.2.1 in /dependencies — SM-125F/super-linter0 reactions
- Sep 15, 2026build(deps-dev): bump jscpd from 5.0.12 to 5.0.15 — Suife-yuanxing/deepseek-harness-personal0 reactions · 1 comment
- Sep 14, 2026build(deps-dev): bump jscpd from 5.0.12 to 5.0.15 — AStarqx/DeepSeek-Harness-Desktop0 reactions · 1 comment
- Sep 12, 2026chore(deps-dev): bump jscpd from 5.0.14 to 5.2.0 — ninasokolov8/browser-coder0 reactions
- Sep 11, 2026build(deps): Bump jscpd from 5.0.14 to 5.1.2 — codacy/codacy-duplication-jscpd0 reactions · 1 comment
- Sep 10, 2026Bump jscpd from 4.3.0 to 5.1.2 — VISVANTHA/Digital-Sippoy-new0 reactions
- Sep 7, 2026Bump jscpd from 3.5.3 to 5.1.2 in /dependencies — NocturnalGlory/super-linter0 reactions
- Aug 14, 2026jscpdで重複コードを防ぐ仕組みを作る — taka1156/webspaces0 reactions
On Hacker News · 4
- Jun 29, 2025Jscpd Public Copy/paste detector for programming source code5 points
- Sep 11, 2026Show HN: Jscpd start support type2/type3 clones2 points
- Oct 22, 2025jscpd: Copy/paste detector for programming source code2 points
- Jan 30, 2024Copy/paste detector for programming source code, supports 150 formats1 point
On Bluesky · 1
- Mar 7, 2025Just came across jscpd: A Copy/paste detector for programming source code. It lets you see if your code can be “simplified” in certain… — @marmelab.bsky.social4 likes and reposts
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- anthropics/code-migration-kit-with-claude-code★ 736same name
- ishandutta2007/Awesome-Claude-Skills★ 15same name
- konveyor-ecosystem/playpen-pf-mig-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- codebase-refactoringSkill
- compare-codebasesSkill
- dry-refactoringSkill
- jscpdSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 9 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
Check both paths for such folders.
- Very specific: line 52
If the target is not in a git repository, tell the user that jscpd reads the .gitignore only after git init.
- Distinctive: line 63
Run the console report for yourself and for the user.
- Distinctive: line 126
Use the map for three things:
- Distinctive: line 139
Run the target's tests. The ported tests that pass already cover what the target has.
- Very specific: line 145
Run the JSON report and take the source's unmatched list from its code section.
- Distinctive: line 150
Run the target's coverage for those tests and check that they run the new function.
- Distinctive: line 156
When the source keeps changing during the port, a function that was paired can come back as unmatched after a rewrite, and new source …
- Very specific: line 160
When both implementations live on, as the iOS and the Android app do, npx jscpd --compare ios/ android/ shows parity.
- Distinctive: line 195
Keep the two paths, their order, the options and the model the same from run to run, or the numbers stop being comparable.
- Very specific: line 196
Keep vendored dependencies, installed packages and build output out of both paths: through a .gitignore in a git repository, which you …
- Distinctive: line 198
Treat the report as a map of what to read and what is left.
- Very specific: line 199
Never game the percentage: no stubs, no renames made only for jscpd, no deleting source functions to shrink the denominator without the …
- Distinctive: line 200
When the report and your reading of the code disagree, trust the code and tell the user which pair looked wrong.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
code-migration
jscpd --compare SOURCE TARGET pairs every function of one folder with the function of the other folder that does the same job, in any pair of languages, and lists the functions that have no counterpart. This skill uses it to measure a port: what is ported, what is left, and whether the port you just wrote was recognized.
A port runs in two phases: the tests first, then the code they check. A coverage report of the source's tests tells which tests exercise which function, so each function is ported together with the tests that prove it works. See Plan: tests first, then code.
Two words are used throughout:
- source: the implementation you port from, such as the iOS app, the Python library, or the JavaScript package;
- target: the implementation you port to, such as the Android app, the Rust crate, or the TypeScript rewrite.
Neither has to be old or new. The source may stay in production and keep changing, and the target may already hold features the source lacks. For two implementations that both live on (ios/ and android/), the same report shows parity; see Parity.
jscpd finds functions in JavaScript, TypeScript, JSX, TSX, Vue, Svelte, Astro, Python, Rust, Go, Java, Kotlin, C#, C, C++, PHP, Ruby, Scala and Swift. The compare-codebases skill explains how the comparison pairs functions and how to check its result; the jscpd skill covers the rest of the tool.
Setup
--compare pairs functions with a code embedding model that runs inside jscpd. Download it once (548 MB, CodeRankEmbed). Ask the user before you start the download:
npx jscpd --semantic-downloadjscpd caches the vectors, so a repeat run embeds only the functions whose code changed and takes seconds.
Pick the two paths and keep them fixed for the whole port: the source first, the target second. Two paths are required, and they must not overlap (app/ and app/android/ is refused). The target may be empty at the start.
One run measures both phases: the report has a Code block and a Tests block (a code and a tests section in JSON), and a test pairs only with a test. jscpd tells a test by the conventions of its language: test files such as *_test.go, test_*.py, *.test.ts or *Test.java, folders such as tests/, __tests__/ or src/test/, Rust tests in #[cfg(test)] modules, and JavaScript test cases such as it('rounds cents', () => …). Phase 1 reads the Tests block, phase 2 the Code block.
Keep vendored and generated code out
--compare counts and embeds every function in both paths. Vendored dependencies (vendor/ from cargo vendor or go mod vendor, third_party/), installed packages (node_modules/, .venv/), build output (target/, build/, dist/) and generated code are not part of the port, yet a vendored crate tree alone holds thousands of functions. With them in a path, the first run embeds all of them and takes tens of minutes instead of seconds, and the percentages describe the dependencies instead of the port.
jscpd skips what .gitignore excludes, but only inside a git repository. Before the first run:
- Check both paths for such folders. A target you create for the port gets them as soon as you build it or vendor its dependencies, so check again after the first build.
Suggest a
.gitignoreto the user that lists the folders the target's language and tools produce, plus the report folder. For a Rust addon built with napi-rs:/target/ /vendor/ node_modules/ *.node .jscpd-compare/If the target is not in a git repository, tell the user that jscpd reads the
.gitignoreonly aftergit init.Until the
.gitignoreworks, pass the same folders with--ignore, and keep the globs the same for every run:npx jscpd --compare node-lib/ rust-lib/ --ignore "**/vendor/**,**/target/**,**/node_modules/**"
The totals line shows when something slipped through. Suspect vendored or generated code in a path when the target has far more functions than the source, or when a run embeds hundreds of functions after a small change.
Measure
Run the console report for yourself and for the user. Here a Python billing library is being ported to TypeScript:
npx jscpd --compare billing-py/ billing-ts/ 71% 5 of 7 functions in billing-py/ have a counterpart in billing-ts/
80% 4 of 5 functions in billing-ts/ have a counterpart in billing-py/
billing-py/
file paired similarity counterpart
billing.py 4 / 5 0.89 billing.ts
shipping.py 1 / 2 0.91 shipping.ts
billing-ts/
file paired similarity counterpart
billing.ts 3 / 4 0.89 billing.py
shipping.ts 1 / 1 0.91 shipping.py
Paired under other names (1):
billing-py/ billing-ts/ similarity
billing.py:28 tax_for_region billing.ts:27 salesTax 0.87 high
Only in billing-py/ (2):
billing.py (1)
46 due_date 6 lines
shipping.py (1)
18 estimate_delivery_days 8 lines
Only in billing-ts/ (1):
billing.ts (1)
39 toCurrency 8 lines- The first line is the port's progress: the share of the source's functions that have a counterpart in the target. "Only in" the source is the work left.
- The second line and "Only in" the target describe the target's own code: helpers the port needed, features the source never had, or a port jscpd did not recognize (see Misses).
- Each file row gives its paired functions, the mean similarity of their pairs (with the number of
lowpairs, if any), and the counterpart file: the file on the other side that holds most of its counterparts. Use the counterpart to decide where a missing function goes. - "Paired under other names" lists the pairs whose names differ even once case and underscores are ignored: renamed ports, constructors, platform names. Each has its similarity and level (see Reading pairs). These are ported already, even though a search by name would not find them.
- With an empty target the report is one line of totals plus
billing-ts/ has no functions yet.
For work you plan and track, read the JSON report instead of the console:
npx jscpd --compare billing-py/ billing-ts/ -r json -o .jscpd-compare --silentjscpd measures tests and code apart and pairs a test only with a test, so .jscpd-compare/jscpd-compare.json has a code and a tests section of the same shape. Each section has sides[0] (the source) and sides[1] (the target), each with path, functions, matched, percentage, files (file, functions, matched, counterpart, similarity, lowPairs) unmatched (file, name, start, end) and readyToPort (the unmatched functions whose callees all have a counterpart, with their number of callers, most called first), and pairs, each with a (source), b (target), similarity, level (high, medium, low), renamed (the names differ) and matchedBy (code or name). Paths are relative to each side's folder. Add .jscpd-compare/ to .gitignore or write the report outside the repository.
-r console-full also prints every pair with its similarity, -r markdown writes jscpd-compare.md, a table you can paste into a PR description or a tracking issue, and -r html writes jscpd-compare.html, a migration map the user can open to see the two dependency graphs side by side, or the same pairs as a table.
Plan: tests first, then code
Port the tests before the code. Ported tests define, before any target code exists, what it means for each function to be ported: when the function lands, its tests pass or show what still differs. A port written before its tests can only be checked against your reading of the source.
Bind tests to functions with coverage
A test's name does not say which functions it runs: a test of checkout also runs apply_discount and tax_for_region. Coverage does. Before porting anything, build a map from each source function to the tests that exercise it.
- Get a coverage report of the source's tests that says which test ran which lines: recorded per test, or per test file when the project's tooling has no per-test mode.
- Take the source's functions and their lines from the
codesection of the JSON report. Every counted function is either in the source'sunmatchedlist or theaside of a pair, each withfile,name,startandend. Functions under--min-tokensor--min-linesare not listed there; take those from the coverage report's own function list, which most formats have. - A test covers a function when it runs a line from the function's
startto itsend. Write the map both ways, function to tests and test to functions, to a file next to the report (for example.jscpd-compare/test-map.json), and rebuild it when the source's tests change.
Use the map for three things:
- which tests to port with a function, and which functions a ported test needs before it can pass;
- the source functions no test covers. Before porting such a function, write a test for it on the source side that records what it does today (a characterization test), and port that test with the others. A port with no test has nothing to check it;
- the order of work: tests that need few functions come first, since they turn green soonest.
Coverage says which code a test runs, not what it checks. A function that a test only passes through on the way to another is weakly bound to that test; prefer the tests whose names or assertions are about the function.
Phase 1: port the tests
- Take the source's unmatched tests from the
testssection of the JSON report. A JavaScript or TypeScript test case written as a callback,it('rounds cents', () => …), goes by its title, so it pairs withtest_rounds_centsin pytest orrounds_centsin Rust like any named test. - Port the tests file by file, into the target's test layout, against the API the target will have. Keep inputs and expected values exactly as they are. Where the target must behave differently (a platform limit, a language's number types), write the difference into the test with a comment and tell the user.
- A ported test calls functions that do not exist yet, so it fails. In a compiled language it stops the whole test build. Keep such tests out of the build until their functions land, for example a module declaration left commented out, a cfg feature or an excluded source set, and turn them on one by one in phase 2. Do not write empty functions to make the tests compile: a stub under a source name can pair by name and count as ported.
- Run the target's tests. The ported tests that pass already cover what the target has; the failing or disabled ones, read against the test map, are the work list for phase 2.
Phase 2: port the code
Port the code one function at a time, with its tests already in place.
- Run the JSON report and take the source's
unmatchedlist from itscodesection. - Order the work. Start with functions whose tests are ported, and port a function after the functions it calls, since a caller ported before its helpers has nothing to call. The source's
readyToPortlist is that order's front: the functions whose callees all have a counterpart already, most called first. Take the next one from there, and rerun the report after each batch, since every port can make its callers ready. Within that order, finish one file before starting the next, so each target file fills up in one go. - Before writing a port, make sure the target does not have it already. Pairs with
renamed: trueare ported functions under other names; they are not inunmatched, but check them when the user asks where a function went. Then search the target for an equivalent that jscpd missed: in the counterpart file fromfiles, under other names (constructors, merged functions, a platform or library call that replaces the helper). If one exists, do not port the function again. Note the equivalent and move on. - Write the port in the counterpart file, or in the file the target's layout puts it in. Keep the name recognizable in the target language's convention (
encodeBinarybecomesencode_binaryin Rust or Python), because jscpd pairs short functions by name. Follow the style of pairs that are already done in the same file.console-fulllists them. - Turn on the function's ported tests, as the test map lists them, and run them. When they fail, fix the port, not the test, unless the user agrees that the target should behave differently. A pair in the report says the two functions look alike; the tests say whether they behave alike.
- Run the target's coverage for those tests and check that they run the new function. A ported test that never reaches it is bound to something else on the target (a helper, a mock, an old path), and it proves nothing about the port.
- Run the comparison again with the same paths and options. Check that the function has left
unmatched, that its pair joins the right function in the target, and its level. Ahighpair is done. Alowpair to your port usually means the port differs a lot from the source in structure; read both and make sure the behavior matches. A pair to a different function means the port is not recognized, or it resembles the wrong thing; read both before going on. - Report progress to the user with both measures, as the reports print them: tests ported and passing, and functions ported (
functions 73% → 76%, 3 ported: …; tests 41 of 44 ported, 38 passing), with the functions you decided not to port and why.
Repeat until the source's unmatched list holds only functions you decided not to port. Typical reasons: dead code (check with npx jscpd --dead-code on the source where it supports the language), code the target platform or its libraries provide (a JSON parser, a retry helper), platform glue with no equivalent on the target (an iOS delegate callback, an Android notification channel), and features the user decided not to carry over. List these in a notes file or the PR, one line each, so the remaining percentage is explained.
When the source keeps changing during the port, a function that was paired can come back as unmatched after a rewrite, and new source functions join the list. Rerun the report before each batch of work instead of reusing an old list.
Parity between two implementations
When both implementations live on, as the iOS and the Android app do, npx jscpd --compare ios/ android/ shows parity. Read both "Only in" lists:
- a function on one side only is either platform code (Android notification channels, iOS delegate callbacks) or a feature the other side lacks. Report each missing feature to the user before implementing it;
- to add a missing feature, treat the side that has it as the source for that feature: bind its tests with coverage, port the tests, then the code, as in Plan: tests first, then code.
jscpd pairs functions within modules that already match. A module is the folder right under the deepest folder each side's files share, so keep the two trees parallel (ios/<plugin> and android/<plugin>) for the best pairing.
Reading pairs
levelrates the similarity on the scale of the model in use, so it means the same with every model.high(0.7125 and up with the default CodeRankEmbed, across languages) is almost always the same function.mediumis usually the same function, restructured.lowneeds reading both functions, since related code pairs there too (a function counting UTF-8 bytes paired with one converting a string to them). On the Tauri plugins, everylowpair joined two differently named functions, and one of them joined two different plugins.matchedBy: codemeans the two functions are each other's closest match and the similarity stands out.matchedBy: namemeans the names match once case and underscores are ignored, and the code is similar enough. It catches short ports. Read these pairs, because a same-named function can do something else.- The similarity does not see small differences in behavior. Two versions that drifted apart still pair. Only tests and reading the code catch drift.
Misses
jscpd compares functions only: types, constants, enums with data, SQL and UI markup (storyboards, Android layouts) are not in the report, so port and check them yourself. Known gaps in pairing:
- constructors across languages (a Java constructor and Rust's
new, Kotlin'sconstructor, Swift'sinit) pair only when their code is similar enough; - a short function renamed in the port (
add_historyfor_finder_penalty_add_history); - one function split into several, or several merged into one: the report may pair only the closest part and list the rest as unmatched;
- anonymous functions (callbacks, closures) take no part at all, except JavaScript and TypeScript test cases such as
it('rounds cents', () => …), which go by their titles.
A function listed only in the target that you know is a port of a source function is one of these. Do not rename working code only to raise the number, and never add stubs or empty functions with source names: jscpd may pair a stub by name, and the progress would then report work that was not done.
Options
--min-tokens(30 with--compare) and--min-lines(5) decide which functions count toward the totals. Smaller functions still pair as partners. Raise them to focus on substantial functions, and keep them fixed across runs so percentages compare.--ignoreleaves files out, such as vendored dependencies, build output, generated code or fixtures (see Keep vendored and generated code out);--patternnarrows the comparison to some files, such as the tests of one module. Keep the globs fixed across runs.--formatnarrows the walk to some languages, for example when the source mixes the code being ported with build scripts.--semantic-modeland--semantic-urlpick another embedding model or an OpenAI-compatible API (npx jscpd --semantic-modelslists the models with calibrated thresholds). Keep the model fixed across runs, because each model scores on its own scale.- The exit code is 0 whatever the progress, so the command does not fail a build on its own.
Rules
- Keep the two paths, their order, the options and the model the same from run to run, or the numbers stop being comparable.
- Keep vendored dependencies, installed packages and build output out of both paths: through a
.gitignorein a git repository, which you suggest to the user, or with--ignore. - Port the tests before the code, and a function only together with the tests the coverage map binds to it.
- Treat the report as a map of what to read and what is left. It does not prove the port is correct; tests do.
- Never game the percentage: no stubs, no renames made only for jscpd, no deleting source functions to shrink the denominator without the user's decision.
- When the report and your reading of the code disagree, trust the code and tell the user which pair looked wrong.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

