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 of extern "js", opaque types, Promise bridging, moon.pkg exports. 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, moon commands.

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.ts and the same test suite.
  • You will build with the MoonBit js backend (moon build), not WASM-for-the-browser-only.
Installs
26
Repository
mizchi/skills
GitHub Stars
325
First Seen
Jul 9, 2026
ts2moonbit-migration — mizchi/skills