moonbitlang/skills

moonbit-spec-test-development

Create formal spec-driven MoonBit APIs and test suites.

First seen May 21, 2026

Installation

$ npx skills add moonbitlang/skills --skill moonbit-spec-test-development

Summary

  • Create formal spec-driven MoonBit APIs and test suites.
  • Use when asked to set up a spec.mbt, spec-driven tests, or a formal contract-first workflow (e.g., "set up a formal spec & test suite for Yaml in MoonBit"), including moon.mod.json/moon.pkg.json scaffolding and guidance to implement in separate files.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from moonbitlang/skills.

npx skills add moonbitlang/skills

Browse all from moonbitlang/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 31
Default branch master
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,903 B
  • docs SUMMARY.md 344 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 184 installs

SKILL.md

MoonBit Spec & Test Development

Overview

Define a formal API contract in <pkg>_spec.mbt, write type-checked tests against it, and scaffold a minimal MoonBit module so moon check passes before implementation work begins.

Workflow

Confirm API surface (if needed)

  • Infer the package name from context; only ask if ambiguous.
  • Confirm the API surface: core types, entry points, error types, and any versioning needs.

Scaffold the module using moon new (preferred for new projects)

  • If you didn't use moon new, fall back to the moon.mod.json and moon.pkg.json templates.

Write the formal spec (<pkg>_spec.mbt)

  • Use #declaration_only for all types/functions that will be implemented later.
  • Functions with #declaration_only must still have a body: { ... }.
  • Keep the spec as the contract: treat it as read-only after creation; implementation goes in new files under the same package.
  • Use pub(all) for types you need to construct in tests; keep pub for opaque types.

Write spec-driven tests

  • Create <pkg>easytest.mbt, <pkg>midtest.mbt, and <pkg>difficulttest.mbt (or similar) in the same package.
  • Prefer black-box tests using public APIs; use @json.inspect(...) for complex values.
  • Try to make the tests rich enough to validate the spec surface.

Validate

  • Run moon check to confirm the spec + tests type-check.
  • Run moon test only after some implementations exist

Templates

  • See references/templates.md for scaffolding and file templates.