Install
$ agentstack add skill-hyfdev-moonbit-agent-skills-moonbit-language ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
MoonBit language
Verification contract
Everything in this skill was verified by compiling and running real code against moonc v0.10.4+2cc641edf (MoonBit release 0.10.4, build 2026-07-15) on Linux x86_64, targets wasm-gc, wasm, js, native, on 2026-07-18. MoonBit is pre-1.0 and changes fast; there is no language version separate from the compiler — language behavior is keyed to the moonc version.
Before relying on this skill, run moon version --all. If the local moonc differs from the pin above:
- Treat every claim here as a hypothesis, not a fact.
- For any load-bearing construct, run a minimal experiment first: put the snippet in a scratch file and run
moon check /tmp/probe.mbtor atest { }block viamoon test /tmp/probe.mbt.md(both work standalone, no project needed) — or pipe it throughnode scripts/verify_snippet.ts, which does exactly that. - Check the release notes at https://www.moonbitlang.com/updates/ for changes between 0.10.4 and the local version.
- Say explicitly in your answer which version you verified against and where versions differed.
Non-negotiable working rules
- The compiler is the oracle. Never assert that MoonBit syntax exists, or that code is correct, from memory alone — MoonBit changed too fast for pretraining to be trusted. If you cannot run
moon check, say so and mark the answer unverified. - Write current syntax, not remembered syntax. The highest-risk drift areas, all verified 2026-07-18: entry point is
fn main { }(no parens);fn init { }(bareinit { }is gone); type parameters are prefix (fn[T] id, notfn id[T]); trait/impl bodies never useimpl Type { }blocks; error handling issuberror+-> T raise E+try/catch/noraise(the!Error,f!(),try?forms are deprecated);loopis deprecated;derive(Show)for debugging is deprecated in favor ofDebug. - Distinguish status. Label knowledge as: verified (ran here), documented (official docs, not run), proposal (moonbit-evolution — NEVER present as shipped; that repo's own status fields lag), or unknown. The docs themselves lag in places (e.g. trait pages still show pre-0.10.0 fn-less signatures).
- Cross-language habits are the main failure mode. When input code looks like Rust, TypeScript, or Go, check references/cross-language-and-stale-syntax.md before "fixing" it into another language's idiom. Watch the silent traps:
"${x}"is literal text (interpolation is\{x}),deferis block-scoped, and unnecessarylet mutis a hard error.
- If the toolchain contradicts this skill, complete the reporting protocol before the final response rather than merely mentioning the mismatch. Reproduce it with a fresh minimal snippet, prepare a privacy-scrubbed public issue draft, show the user its exact title and body, and provide the issue-template link. Stop there: never submit the issue or invoke GitHub from this skill workflow, even if the user gave blanket or draft-specific permission. A later request for the host agent to send it is a separate outbound action governed by that client's own approval controls. Never edit the installed skill copy or write the draft into the user's repository. Exact protocol: references/reporting-errors.md
Reference routing
Load only what the task needs:
- Program structure, functions, methods, lambdas, pipelines, cascades → references/declarations-and-functions.mbt.md
- Structs, enums, newtypes, aliases, derives → references/types-structs-enums.mbt.md
- match, patterns (array/string/map/range),
is,guard→ references/pattern-matching.mbt.md - Traits, generics, impls, operators, trait objects → references/traits-and-generics.mbt.md
- pub / pub(all) / pub(open) / priv, cross-package access → references/visibility.mbt.md
- Error types, raise, try/catch, Option/Result → references/errors-and-error-handling.mbt.md
- Numbers, strings, bytes, arrays, maps, views → references/data-types.mbt.md
- Loops, iteration, closures, guard flow, Iter → references/control-flow-and-iteration.mbt.md
- test blocks, inspect snapshots, doc tests, .mbt.md → references/tests-and-checked-docs.mbt.md
- async semantics, extern FFI declarations → references/async-and-ffi.md
- Attributes (#cfg, #deprecated, #alias, ...) → references/attributes.mbt.md
- Rust/TS/Go habits and stale MoonBit forms → references/cross-language-and-stale-syntax.md
Files ending in .mbt.md are executable documentation: every mbt check block in them is compiled and run by this repository's CI against the pinned toolchain, so their examples are guaranteed-current at the pin. Blocks marked mbt nocheck show rejected or deprecated forms.
- Toolchain contradicts this skill → report upstream (with consent): references/reporting-errors.md
Boundary
This skill owns language semantics (what code means, which programs compile). It does not cover moon commands, moon.mod/moon.pkg configuration, dependency management, targets, linking, or publishing — that is the moonbit-toolchain skill. For a task that spans both (new package with code, FFI plus build wiring, fixing a repo where both code and config are broken), load both skills. Using moon check/moon test to verify language claims as described above does not require the toolchain skill.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: hyfdev
- Source: hyfdev/moonbit-agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.