moonbit-agent-guide
БесплатноБез исполняемых скриптовНе проверенGuide for writing, refactoring, and testing MoonBit projects. Use when working in MoonBit modules or packages, organizing MoonBit files, using moon tooling…
Об этом скилле
MoonBit Project Layouts
MoonBit use the .mbt extension and interface files .mbti. At
the top-level of a MoonBit project there is a moon.mod.json file specifying
the metadata of the project. The project may contain multiple packages, each
with its own moon.pkg.json file.
Example layout
my_module
├── moon.mod.json # Module metadata, source field(optional) specifies the source directory of the module
├── moon.pkg.json # Package metadata (each directory is a package like Golang)
├── README.mbt.md # Markdown with tested code blocks (`test "..." { ... }`)
├── README.md -> README.mbt.md
├── cmd # Command line directory
│ └── main
│ ├── main.mbt
│ └── moon.pkg.json # executable package with {"is_main": true}
├── liba/ # Library packages
│ └── moon.pkg.json # Referenced by other packages as `@username/my_module/liba`
│ └── libb/ # Library packages
│ └── moon.pkg.json # Referenced by other packages as `@username/my_module/liba/libb`
├── user_pkg.mbt # Root packages, referenced by other packages as `@username/my_module`
├── user_pkg_wbtest.mbt # White-box tests (only needed for testing internal private members, similar to Golang's package mypackage)
└── user_pkg_test.mbt # Black-box tests
└── ... # More package files, symbols visible to current package (like Golang)
Module:
moon.mod.jsonfile in the project directory. A MoonBit module is like a Go module,it is a collection of packages in subdirectories, usually corresponding to a repository or project. Module boundaries matter for dependency management and import paths.Package: a
moon.pkg.jsonfile per directory. All subcommands ofmoonwill still be executed in the directory of the module (wheremoon.mod.jsonis located), not the current package. A MoonBit package is the actual compilation unit (like a Go package). All source files in the same package are concatenated into one unit. Thepackagename in the source defines the package, not the file name. Imports refer to module + package paths, NEVER to file names.Files: A
.mbtfile is just a chunk of source inside a package. File names do NOT create modules or namespaces. You may freely split/merge/move declarations between files in the same package. Any declaration in a package can reference any other declaration in that package, regardless of file.
Coding/layout rules you MUST follow:
Prefer many small, cohesive files over one large file.
- Group related types and functions into focused files (e.g. http_client.mbt, router.mbt).
- If a file is getting large or unfocused, create a new file and move related declarations into it.
You MAY freely move declarations between files inside the same package.
- Each block is separated by
///|, moving a function/struct/trait between files does not change semantics, as long as its name and pub-ness stay the same, the order of each block is irrelevant too. - It is safe to refactor by splitting or merging files inside a package.
- Each block is separated by
File names are purely organizational.
- Do NOT assume file names define modules, and do NOT use file names in type paths.
- Choose file names to describe a feature or responsibility, not to mirror type names rigidly.
When adding new code:
- Prefer adding it to an existing file that matches the feature.
- If no good file exists, create a new file under the same package with a descriptive name.
- Avoid creating giant “misc” or “util” files.
Tests:
- Place tests in dedicated test files (e.g. *_test.mbt) within the appropriate package.
For a package, besides
*_test.mbtfiles,*.mbt.mdare also blackbox test files, the code blockmbt checkare treated as test cases, they serve both purposes: documentation and tests.
You may haveREADME.mbt.mdfiles withmbt checkcode examples, you can also symlinkREADME.mbt.mdtoREADME.mdto make it integrate better with GitHub. - It is fine—and encouraged—to have multiple small test files.
- Place tests in dedicated test files (e.g. *_test.mbt) within the appropriate package.
For a package, besides
Interface files(
pkg.generated.mbti)pkg.generated.mbtiis compiler-generated summaries of each package's public API surface. They provide a formal, concise overview of all exported types, functions, and traits without implementation details. They are generated usingmoon info, useful for code review, when you have a commit that does not change public APIs,pkg.generated.mbtifiles will remain unchanged, so it is recommended to putpkg.generated.mbtiin version control when you are done.You can also use
moon doc @moonbitlang/core/strconvto explore the public API of a package interactively andmoon ide peek-def 'Array::join'to read the definition.
Common Pitfalls to Avoid
- Don't use uppercase for variables/functions - compilation error
Установить moonbit-agent-guide в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл moonbit-agent-guide?
Guide for writing, refactoring, and testing MoonBit projects. Use when working in MoonBit modules or packages, organizing MoonBit files, using moon tooling (build/check/test/doc/ide), or following MoonBit-specific layout, documentation, and testing conventions.
Как установить скилл moonbit-agent-guide?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл moonbit-agent-guide запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic