golem-add-moonbit-package

Adds MoonBit package dependencies to Golem projects via moon.mod.json and moon install.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-add-moonbit-package
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-add-moonbit-package
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/moonbit/golem-add-moonbit-package
Command: npx skills add https://github.com/golemcloud/golem --skill golem-add-moonbit-package

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding third-party libraries to a MoonBit-based Golem project requires correctly editing moon.mod.json, installing packages from mooncakes.io, and wiring imports into moon.pkg.json, and mistakes in any step break the build.

Core Features & Use Cases

  • Dependency Declaration: Guides editing the "deps" section of moon.mod.json with the correct package name and version constraint.
  • Installation Workflow: Ensures moon install runs before golem build so dependencies are resolved.
  • Import Configuration: Shows how to reference installed packages in moon.pkg.json and use them in .mbt source files.
  • Use Case: When building a Golem agent in MoonBit that needs a JSON utility library, follow the steps to add the mooncakes.io package, install it, and import it into your component.

Quick Start

Add the mooncakes.io package example/json-utils version 0.2.0 to my MoonBit Golem project and show me how to import it.

Frequently Asked Questions about golem-add-moonbit-package

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a dependency to a MoonBit project?

Add the package name and version to the "deps" object in moon.mod.json at the project root, then run moon install to download it. After installation, list the package in the "import" section of moon.pkg.json to use it in your .mbt files.

How to use mooncakes.io packages in a Golem MoonBit project?

Find the package on mooncakes.io, add it to moon.mod.json with its published version, run moon install, then import it in moon.pkg.json. Always run moon install before golem build so the dependency is resolved.

Can I use any MoonBit package with Golem WebAssembly components?

No, only packages compatible with the wasm or wasm-gc backend work in Golem projects. Some MoonBit packages target only native or JS backends, so check the package documentation on mooncakes.io before adding it.

Why does golem build fail after adding a MoonBit dependency?

The most common cause is skipping moon install after editing moon.mod.json, so the dependency is never downloaded. Another cause is forgetting to add the package to the "import" list in moon.pkg.json before referencing it in source files.

What version format does moon.mod.json use for dependencies?

Dependencies are specified as string version constraints in the "deps" object, using the exact version published on mooncakes.io, for example "example/json-utils": "0.2.0".