MoonBit single-file checks for .mbt.md
Use this skill to validate a standalone .mbt.md file with MoonBit’s single-file mode.
What single-file mode means
Single-file mode is the moon check/moon test path that runs directly on a single .mbt.md file outside a MoonBit project.
- •It applies only when the file is not inside a project.
- •A project is present if a
moon.mod.jsonexists above the file or amoon.pkg.jsonexists next to it. - •Execution (
moon run) is not supported for.mbt.mdsingle-file mode.
Quick workflow
- •Confirm the file is truly standalone:
- •No
moon.mod.jsonin parent directories. - •No
moon.pkg.jsonin the same directory as the.mbt.md.
- •No
- •Run
moon check <file>.mbt.md. - •Run
moon test <file>.mbt.md.
Non-standalone files
If the file sits inside a MoonBit project (a moon.mod.json above it and moon.pkg.json next to it), single-file mode does not apply.
- •Do not use this skill’s commands in that case.
- •Ask whether to run project-level
moon check/moon testinstead or relocate the file.
Notes and conventions
- •Single-file mode is for
.mbt.mdonly; do not use it for.mbtsources here. - •Execution (
moon run) is not supported for.mbt.mdsingle-file mode. - •If warnings are expected in examples, prefer
#warnings("-<warning_id>")scoped to the snippet.