code-migration
Что он делает
Навык даёт метод переноса приложения или библиотеки на другой язык с проверкой каждой функции по ходу. Он нужен разработчикам, которые переписывают ПО, например Java-приложение на Kotlin.
Когда использовать
- ✓Когда команда хочет перенести библиотеку с одного языка программирования на другой.
- ✓Когда разработчику нужно увидеть, какие функции уже перенесены и какие остались.
- ✓Когда команда хочет проверить, что две версии одного приложения по-прежнему совпадают в поведении.
Ссылка на скилл
https://github.com/kucherenko/jscpd/blob/master/skills/code-migration/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Помогите перенести эту библиотеку на Python в TypeScript по одной функции за раз и отслеживайте, что осталось.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Навык использует инструмент сравнения, чтобы сопоставить каждую исходную функцию с её аналогом. ИИ переносит сначала тесты, затем проверяемый ими код, а результаты используются для отслеживания прогресса.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
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-download
jscpd 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 counterpar
Частые вопросы
Как отслеживается прогресс?
С помощью отчёта сравнения, который показывает, какие функции имеют пару в другой кодовой базе, а какие нет.
Зачем писать тесты первыми?
Каждая функция переносится вместе с тестами, которые доказывают её работу, поэтому новую версию можно проверять по мере роста.
Можно ли сравнить два приложения, которые оба продолжают использоваться?
Да. Тот же отчёт может показать, насколько близко совпадают две работающие реализации.
Подробности
Оригинальное описание автора
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.
repo: kucherenko/jscpd
Популярность
- Звёзды на GitHub
- 6.5k
- Место в рейтинге
- #14187
- Лицензия
- MIT
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
codebase-refactoring
6.5kПомогает агенту улучшить состояние кодовой базы: устранить дублирование кода, удалить мёртвый код и упростить самые сложные файлы, именно в этом порядке.
compare-codebases
6.5kПомогает агенту сравнивать две папки с кодом функция за функцией, даже на разных языках, чтобы видеть, какие функции совпадают, а каких не хватает.
dry-refactoring
6.5kПомогает агенту убрать из проекта скопированный код, объединяя повторяющиеся блоки в общие функции, начиная с самых больших повторов.
jscpd
6.5kПомогает агенту находить в проекте скопированный код в точной, переименованной или почти одинаковой форме и измерять, какая доля кода дублирована.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.