agentsclimarketplace

Moonbit

Skill morning-start/agent-skills/lang/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

Install
npx -y skills add morning-start/agent-skills --skill moonbit

Assembled 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/ or references/ 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 intentGo toUse when
Create a new projectskills/1-create-project/SKILL.mdNew app, library, CLI, or template selection
Write or refactor codeskills/2-write-code/SKILL.mdFunctions, traits, generics, match, visibility, mutation
Debug errorsskills/3-debug-errors/SKILL.mdParse errors, type errors, compiler diagnostics, bad migrations
Write testsskills/4-write-tests/SKILL.mdTest layout, assertions, test helpers, coverage
Optimize performanceskills/5-optimize/SKILL.mdRuntime speed, binary size, backend choice, benchmarking
Publish a libraryskills/6-publish-lib/SKILL.mdmooncakes release, package prep, validation, versioning
Integrate FFIskills/7-ffi-integration/SKILL.mdC/JS interop, extern bindings, wrapper design
Make architecture decisionsskills/8-architecture-decisions/SKILL.mdAPI shape, module boundaries, design tradeoffs

Reference Map

FileBest use
references/syntax.mdQuick syntax lookup
references/type-system.mdTypes, options, results, refs, and data modeling
references/generics-traits-methods.mdGenerics, traits, methods, and implementation patterns
references/pattern-matching.mdMatch expressions and advanced branching
references/error-codes.mdCompiler errors and fix strategies
references/project-layout.mdModule and package layout
references/app-templates.mdProject templates and scaffolding patterns
references/library-design.mdPublic API and library design
references/multi-backend.mdWasm, JS, and native backend strategy
references/real-world-examples.mdCase studies from real projects
references/pitfalls.mdCommon mistakes and how to avoid them
references/async.mdExperimental async support
references/verification.mdExperimental verification material
references/decision-matrices.mdTradeoff tables for choosing an approach
references/architecture.mdHow this skill is organized

Execution Checklist

Use this checklist before handing work back:

  1. Run moon check.
  2. Run moon test.
  3. Run moon fmt.
  4. Build the target the user cares about.
  5. 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 with references/error-codes.md if 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

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.