Moonbit
Use when the user asks about MoonBit project setup, writing or refactoring code, debugging compiler errors, tests, publishing, optimization, FFI, or architecture decisions. Keywords: MoonBit, .mbt, .pkg, moon new, moon build, moon test, moon check.From its SKILL.md
npx -y skills add morning-start/agent-skills --skill moonbitAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.9 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
MoonBit Action Handbook
This is the fast entry point for MoonBit work.
Use this file for common tasks, then jump to
skills/orreferences/only when the task needs more depth.
Start Here
Use these commands to validate the local toolchain and start a project:
moon --version
moon new my-app
moon check
moon test
moon build
moon fmt
If the user asked for a specific target, verify the target in the relevant sub-skill before choosing build flags.
Minimal Code Shapes
Function
fn greet(name: String) -> String {
"Hello, \{name}!"
}
Main
fn main {
println(greet("MoonBit"))
}
Struct and enum
struct Point {
x: Int
y: Int
}
enum Color {
Red
Green
Blue
}
Trait and impl
pub(open) trait Show {
fn to_string(self) -> String
}
impl Show for Point with to_string(self) -> String {
"Point(\{self.x}, \{self.y})"
}
Error handling
suberror NotFound
fn lookup(id: Int) -> String raise NotFound {
if id <= 0 {
raise NotFound
}
"ok"
}
Task Router
| User intent | Go to | Use when |
|---|---|---|
| Create a new project | skills/1-create-project/SKILL.md | New app, library, CLI, or template selection |
| Write or refactor code | skills/2-write-code/SKILL.md | Functions, traits, generics, match, visibility, mutation |
| Debug errors | skills/3-debug-errors/SKILL.md | Parse errors, type errors, compiler diagnostics, bad migrations |
| Write tests | skills/4-write-tests/SKILL.md | Test layout, assertions, test helpers, coverage |
| Optimize performance | skills/5-optimize/SKILL.md | Runtime speed, binary size, backend choice, benchmarking |
| Publish a library | skills/6-publish-lib/SKILL.md | mooncakes release, package prep, validation, versioning |
| Integrate FFI | skills/7-ffi-integration/SKILL.md | C/JS interop, extern bindings, wrapper design |
| Make architecture decisions | skills/8-architecture-decisions/SKILL.md | API shape, module boundaries, design tradeoffs |
Reference Map
| File | Best use |
|---|---|
references/syntax.md | Quick syntax lookup |
references/type-system.md | Types, options, results, refs, and data modeling |
references/generics-traits-methods.md | Generics, traits, methods, and implementation patterns |
references/pattern-matching.md | Match expressions and advanced branching |
references/error-codes.md | Compiler errors and fix strategies |
references/project-layout.md | Module and package layout |
references/app-templates.md | Project templates and scaffolding patterns |
references/library-design.md | Public API and library design |
references/multi-backend.md | Wasm, JS, and native backend strategy |
references/real-world-examples.md | Case studies from real projects |
references/pitfalls.md | Common mistakes and how to avoid them |
references/async.md | Experimental async support |
references/verification.md | Experimental verification material |
references/decision-matrices.md | Tradeoff tables for choosing an approach |
references/architecture.md | How this skill is organized |
Execution Checklist
Use this checklist before handing work back:
- Run
moon check. - Run
moon test. - Run
moon fmt. - Build the target the user cares about.
- If the task touches public API, verify the route to
skills/8-architecture-decisions/.
Guidance
- Prefer the sub-skill when the task is focused and specific.
- Prefer
references/when you need deeper detail or a second example. - Avoid hard-coded claims about exact MoonBit syntax or release dates unless they are verified against the installed toolchain.
- Keep examples minimal in this file; put specialized patterns in the child skills and references.
Notes
- This skill is a router and handbook, not a full tutorial.
- If a user reports a compiler error, route to
skills/3-debug-errors/first and then confirm withreferences/error-codes.mdif needed. - If a user asks for performance advice, route to
skills/5-optimize/and measure before changing code. - If a user asks for a new project, route to
skills/1-create-project/and choose the template before writing code.
What ships with it: 16 files
467.9 KB alongside SKILL.md
references/
- app-templates.md140.0 KB
- architecture.md3.9 KB
- async.md8.7 KB
- decision-matrices.md8.4 KB
- error-codes.md14.4 KB
- generics-traits-methods.md61.6 KB
- library-design.md75.1 KB
- multi-backend.md31.6 KB
- pattern-matching.md15.9 KB
- pitfalls.md13.8 KB
- project-layout.md23.6 KB
- real-world-examples.md34.7 KB
- syntax.md12.5 KB
- type-system.md10.2 KB
- verification.md11.5 KB
- INDEX.md2.1 KB
Gives 0 of the 12 instructions most test skills give in ~1.1k tokens
Counted across 964 of the 1,571 authors here whose files we hold, read 2026-08-07
- Close the browser when donein 55 of 964, across 12 files
- Wait for network idle statein 51 of 964, across 6 files
- Launch Chromium in headless modein 49 of 964, across 6 files
- Use descriptive selectors for elementsin 49 of 964, across 6 files
- Run provided scripts with help flag firstin 49 of 964, across 6 files
- Add appropriate explicit waitsin 48 of 964, across 5 files
- Use bundled scripts as black boxesin 46 of 964, across 3 files
- Do not read script source codein 46 of 964, across 3 files
- Use sync playwright for scriptsin 46 of 964, across 3 files
- Inspect dom before executing actionsin 46 of 964, across 3 files
- Run the full test suitein 37 of 964
- Write the failing test firstin 29 of 964, across 23 files
Said here and by no other author read
- Run moon check
- Run moon fmt
- Verify the target before choosing build flags
- Build the target the user cares about
- Route compiler errors to the debug sub-skill
- Route performance advice to the optimize sub-skill
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.