ts2moonbit-migration
Installation
SKILL.md
TypeScript → MoonBit Migration
Port a TypeScript module, library, npm package, or Node service to MoonBit, compile it back to JavaScript with moon build, and ship it so existing JS/TS consumers cannot tell the implementation changed. The compiled .js + generated .d.ts must satisfy the same API contract the TypeScript version exposed.
This skill is the playbook that composes three lower-level skills — it does not duplicate them:
moonbit-js-binding— the mechanics ofextern "js", opaque types, Promise bridging,moon.pkgexports. Load it when you write FFI by hand.translate-programming-language— the general parity methodology (oracles, fixtures, shadow testing, cutover). Load it for the verification discipline.moonbit-practice— MoonBit syntax, tests,mooncommands.
What this skill adds on top of those: the mizchi toolkit map, a TypeScript-specific type-classification pass, and the "preserve the JS API contract" build/publish loop that lets you swap the implementation without touching downstream code.
When To Use
Use this skill when all of these hold:
- The source is TypeScript (a library, npm package, Node CLI/server, or Worker).
- The output must remain consumable as JavaScript — same module shape, same exported signatures, ideally the same
.d.tsand the same test suite. - You will build with the MoonBit
jsbackend (moon build), not WASM-for-the-browser-only.