/moonbit-skills:moonbit-orientationfrom moonbit-skills
Provides up-to-date MoonBit language guidance: compiler diagnostics, package/toolchain setup, FFI, test patterns, and API discovery via moon ide. Activates on .mbt files, moon.mod/moon.pkg manifests, or moon commands.
Ships in moonbit-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Validated 2026-10-28 against moon 0.1.20261023 / moonc v0.10.17+d971670cd by live toolchain probes. Key refreshed facts: manifests are now
moon.mod/moon.pkg(legacy.jsonforms are hard-rejected — "is no longer supported. Runmoon fmtto migrate"),llvmbuilds fail on stable with "toolchain is incomplete: missingprelude.mi", and diagnostics explain via bothmoon check --explainand themoon explain --diagnosticcommand.
Use this skill to solve MoonBit developer questions by identifying the missing context first. This is an orientation skill, not a bundled copy of all MoonBit documentation.
If the user asks for exact standard-library APIs, package APIs, or recently
changed behavior, verify with moon ide doc, official API docs, package docs,
or local project files instead of guessing.
Some MoonBit facts move faster than model memory: new syntax, experimental features, package availability, package APIs, dependency versions, target support, and command flags. For these, do not turn memory into a final answer.
Use this pattern:
moon commands,
official docs, mooncakes package docs, or the registry.This is not a rule to verify every stable fact. It is a rule to admit when MoonBit ecosystem or feature knowledge may be stale, then check the latest source before making exact claims.
Keep freshness checks bounded. For package or API discovery, use one local toolchain query and, if needed, one registry or public-docs lookup. If those do not confirm the exact fact, stop and answer "not confirmed from the checked sources" with the next verification command. Do not run many near-duplicate web searches just to prove absence.
Keep discovery narrow. Once a source-of-truth command or document answers the user's requested level of detail, stop searching unless the user asked for examples, signatures, alternatives, or validation by execution. Do not spend extra context proving nearby facts that are not needed for the answer.
When recommending external material, provide a concrete URL from
references/source-map.md. Do not assume the user has this repository checked
out.
moon ide doc in the
user's project. It reflects the installed toolchain and dependencies better
than memory or stale docs.moon add <candidate> in a disposable or
user project before naming a dependency as available.llvm is nightly-only. Stable backend guidance should use wasm, wasm-gc,
js, or native; --target all excludes llvm. Verified on the stable
toolchain (0.1.20261023): moon build --target llvm fails with
"toolchain is incomplete: missing prelude.mi for target llvm" — the llvm
core ships with the nightly channel.moon.mod and moon.pkg beat generic advice for package
names, imports, targets, and dependencies. Legacy moon.mod.json/moon.pkg.json
are no longer accepted by current toolchains (verified 0.1.20261023: hard error
"... is no longer supported. Run moon fmt to migrate") — treat that error as a
migration gate, not an environment fault.E#### diagnostics, use moon check --explain (renders explanations inline),
the dedicated moon explain --diagnostic <code|mnemonic> command (verified
0.1.20261023), or the exact online error page pattern before inventing a cause.Treat MoonBit facts as three tiers:
llvm being nightly-only.moon ide, local
files, generated interfaces, official docs, or mooncakes.Never present unverified guesses as facts. If an exact fact is not verified,
say what must be checked and provide the command or URL. Prefer "I can answer
the capability, but the exact API needs moon ide doc '*json*'" over a
plausible module or function name.
If a verification command fails, returns no result, or was only checked outside
the user's project, do not cite it as if it proved the exact API. Say what the
failure means and give the next source, for example package installation,
moon tree, mooncakes package docs, or a local dependency file.
If you did verify an exact fact, say so compactly: "Verified with
moon ide doc '@json'" or "Source: ". Do not omit the verification source
after naming exact imports, functions, or error meanings.
Do not cite this skill's own reference files as the final verification source for users. The final answer should cite an external URL, a local project file, or a command result. The skill is guidance for the agent, not user-facing evidence.
This rule still applies when a reference file contained the answer. Use the reference file to route the work, then cite the public URL, command, or local project file named by that reference.
Avoid "likely" guesses for exact API behavior. For unknown calls such as
Json.parse or result.unwrap(), say "verify whether this returns typed errors
or a result-like value" instead of guessing which one it uses.
references/question-routing.md
and references/source-map.md.references/answer-shapes.md first. Load
references/capabilities-faq.md only when the quick shape does not cover the
concept or the user asks for a broader comparison. If exact APIs are involved,
use references/lookup-recipes.md.references/mental-models.md.references/idioms.md.moon output, package errors, backend errors, or
diagnostics with an E#### code: read references/diagnostics-playbook.md
and the relevant recipe in references/lookup-recipes.md.references/toolchain-map.md.references/source-map.md.For tasks that span multiple areas, read the most specific reference first, then one secondary reference if needed.
Before answering, decide whether the unknown is most likely:
State uncertainty briefly when it matters, but do not stop at uncertainty if a
recipe can resolve it. For concrete code work, prefer a narrow validation
command such as moon check, moon test, or moon build with the relevant
--target.
moonbit-docs repository itself;
use the repo maintainer skill for docs, translation, Sphinx, or example
maintenance workflows.agents/openai.yaml (opens in a new tab)references/answer-shapes.md (opens in a new tab)references/capabilities-faq.md (opens in a new tab)references/diagnostics-playbook.md (opens in a new tab)references/idioms.md (opens in a new tab)references/lookup-recipes.md (opens in a new tab)references/mental-models.md (opens in a new tab)references/question-routing.md (opens in a new tab)references/source-map.md (opens in a new tab)references/toolchain-map.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
moonbit, compiler-diagnostics, package-management, toolchain, ffi
npx claudepluginhub moonbitlang/skills --plugin moonbit-skills9 skills in this plugin
/make-moonbit-c-bindingsGuides agents through complete, maintainable MoonBit bindings for C/C++ libraries, from upstream source survey through vendoring, safe API design, documentation tests, and ASan validation. Use when creating or hardening MoonBit native FFI bindings, wrapping C APIs, vendoring C sources into native-stub, or turning a C library into a MoonBit package./moonbit-agent-guideGuide for writing, refactoring, and testing MoonBit projects, including exclusive use of `.mbtx` for agent-authored automation. Use when working in MoonBit modules or packages, organizing MoonBit files, using moon tooling (build/check/run/test/doc/ide etc.), or following MoonBit-specific layout, scripting, documentation, and testing conventions./moonbit-c-bindingGuide for writing MoonBit bindings to C libraries using native FFI. Use when adding extern "c" declarations, writing C stubs with moonbit.h, configuring native-stub and link.native in moon.pkg, choosing/moonbit-extract-spec-testExtract formal spec and comprehensive test suites from existing MoonBit implementations. Use when asked to "extract spec from implementation", "generate tests from code", or "create spec-driven tests for existing package". Analyzes existing code to produce spec.mbt with `declare` keyword stubs and organized test files (valid/invalid)./moonbit-proofUse when writing or refactoring proof-carrying code in MoonBit, especially for Why3-backed specifications, abstraction functions, representation invariants, proof assertions, recursive verified data structures, or reducing trusted proof bridges./moonbit-refactoringRefactor MoonBit code to be idiomatic: shrink public APIs, convert functions to methods, use pattern matching with views, add loop invariants, and ensure test coverage without regressions. Use when updating MoonBit packages or refactoring MoonBit APIs, modules, or tests.Other plugins' skills for the same job