The MoonBit Refactoring skill automates the transition from prototype MoonBit code to production-grade, idiomatic patterns. It focuses on minimizing public API surfaces, converting free functions into discoverable methods, and leveraging MoonBit's powerful pattern matching and view types (like ArrayView) to eliminate unnecessary allocations. Whether you are splitting large packages, adding Dafny-style loop invariants for formal verification, or improving test coverage, this skill provides a structured workflow to ensure architectural integrity and performance without breaking existing contracts.