code-migration
यह क्या करती है
यह किसी ऐप या लाइब्रेरी को दूसरी भाषा में ले जाने का तरीका देती है, और हर फ़ंक्शन को आगे बढ़ते समय जाँचती है। यह उन डेवलपर्स के लिए है जो सॉफ़्टवेयर फिर से लिख रहे हैं, जैसे Java ऐप को Kotlin में ले जाना।
कब इस्तेमाल करें
- ✓जब टीम किसी लाइब्रेरी को एक प्रोग्रामिंग भाषा से दूसरी में ले जाना चाहे।
- ✓जब डेवलपर को देखना हो कि कौन से फ़ंक्शन ले जाए जा चुके हैं और कौन से बचे हैं।
- ✓जब टीम जाँचना चाहे कि एक ही ऐप के दो वर्शन व्यवहार में अब भी मेल खाते हैं।
Skill का लिंक
https://github.com/kucherenko/jscpd/blob/master/skills/code-migration/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस Python लाइब्रेरी को एक-एक फ़ंक्शन करके TypeScript में ले जाने में मदद कीजिए, और बाकी बचे कामों का हिसाब रखिए।”
हर हफ़्ते 5 नई skills, 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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
codebase-refactoring
6.5kआपके एजेंट को किसी कोडबेस की सेहत सुधारने में मदद करती है: दोहराया कोड ठीक करके, बेकार कोड हटाकर और सबसे जटिल फ़ाइलों को सरल बनाकर, इसी क्रम में।
compare-codebases
6.5kआपके एजेंट को दो कोड फ़ोल्डरों की तुलना फ़ंक्शन-दर-फ़ंक्शन करने में मदद करती है, भाषाएँ अलग होने पर भी, यह देखने के लिए कि कौन से फ़ंक्शन मेल खाते हैं और कौन से गायब हैं।
dry-refactoring
6.5kआपके एजेंट को प्रोजेक्ट से कॉपी-पेस्ट किया हुआ कोड हटाने में मदद करती है, दोहराए गए ब्लॉक को साझा फ़ंक्शन में मिलाकर, सबसे बड़े दोहराव से शुरू करते हुए।
jscpd
6.5kआपके एजेंट को प्रोजेक्ट में सटीक, नाम बदले हुए या लगभग-नकल वाले कॉपी-पेस्ट कोड खोजने में मदद करती है, और यह मापने में कि कितना कोड दोहराया गया है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।