moonbit-code-transform

Parse MoonBit source code into an AST and generate transformed code.

5|1|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/golemcloud/moonbit-sdk --skill moonbit-code-transform
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moonbit-code-transform
Source: https://github.com/golemcloud/moonbit-sdk/tree/main/.agents/skills/moonbit-code-transform
Command: npx skills add https://github.com/golemcloud/moonbit-sdk --skill moonbit-code-transform

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides the tools and guidance to programmatically parse, analyze, and generate MoonBit source code, enabling the creation of sophisticated code transformation tools.

Core Features & Use Cases

  • AST Parsing: Convert MoonBit source code into an Abstract Syntax Tree (AST) for analysis.
  • AST Construction: Programmatically build new AST nodes to represent generated code.
  • Code Generation: Format and emit modified or entirely new MoonBit source code from AST.
  • Use Case: Automatically refactor large codebases by applying consistent changes, generate boilerplate code based on specific patterns, or create custom linters and code formatters.

Quick Start

Use the moonbit-code-transform skill to parse the provided MoonBit source code into an Abstract Syntax Tree.

Frequently Asked Questions about moonbit-code-transform

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I parse and transform MoonBit source code programmatically?

To parse and transform MoonBit source code, use dedicated parser and formatter libraries to convert source text into an Abstract Syntax Tree (AST), manipulate the nodes, and emit the modified code back as formatted source.

What is AST manipulation used for in MoonBit development?

AST manipulation in MoonBit is used for source-to-source code transformations, enabling automated codebase refactoring, boilerplate code generation, and the creation of custom linters and code analysis tools.

How do I generate MoonBit boilerplate code from an AST?

To generate MoonBit boilerplate code from an AST, programmatically construct new AST nodes representing the desired patterns and pass them through a formatter library to emit valid MoonBit source code.

Do I need to understand MoonBit syntax tree structure to build a custom code formatter?

Yes, building a custom code formatter requires a solid understanding of MoonBit's syntax tree structure and AST manipulation to correctly parse, analyze, and format the source code.

Can I automatically refactor large MoonBit codebases using AST manipulation?

Yes, you can automatically refactor large MoonBit codebases by parsing the source code into an AST, applying consistent programmatic changes to the syntax tree, and generating the updated source files.

What are the limitations of using AST manipulation for MoonBit code generation?

The primary limitation of AST manipulation for MoonBit code generation is the prerequisite knowledge required; developers must deeply understand MoonBit's syntax tree structure to correctly construct and transform AST nodes without generating invalid code.