code-migration
하는 일
앱이나 라이브러리를 다른 언어로 옮기는 방법을 제시하며, 각 함수를 옮길 때마다 확인합니다. Java 앱을 Kotlin으로 옮기는 것처럼 소프트웨어를 다시 작성하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓팀이 한 프로그래밍 언어의 라이브러리를 다른 언어로 옮기려 할 때.
- ✓개발자가 이미 옮긴 함수와 남은 함수를 확인해야 할 때.
- ✓팀이 같은 앱의 두 버전이 동작에서 여전히 일치하는지 확인하려 할 때.
스킬 링크
https://github.com/kucherenko/jscpd/blob/master/skills/code-migration/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 Python 라이브러리를 함수 하나씩 TypeScript로 옮겨 주세요. 남은 작업도 정리해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 비교 도구로 원본 함수와 대응하는 함수를 짝짓습니다. AI에게 먼저 테스트를 옮기고, 그다음 그 테스트가 확인하는 코드를 옮기라고 안내하며, 그 결과로 진행 상황을 추적합니다.
기술 내용 (원본 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
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
codebase-refactoring
6.5k에이전트가 중복 코드를 고치고, 쓰이지 않는 코드를 제거하며, 가장 복잡한 파일을 단순하게 만들어 프로젝트 상태를 개선하도록 돕습니다. 이 순서대로 진행합니다.
compare-codebases
6.5k에이전트가 두 코드 폴더를 언어와 상관없이 함수 단위로 비교해, 서로 일치하는 함수와 빠진 함수를 찾도록 돕습니다.
dry-refactoring
6.5k에이전트가 프로젝트에서 복사해 붙여 넣은 코드를 찾아, 가장 많이 반복된 블록부터 공용 함수로 합치도록 돕습니다.
jscpd
6.5k에이전트가 완전 복사, 이름만 바뀐 복사, 비슷한 복사 형태로 된 중복 코드를 찾고 그 비율을 측정하도록 돕습니다.