SuperAPI AI Directory

moonbit-skills

Coding & development

View repository

Updated 10-15 17:44

About this skill

MoonBit Skills v7.0 🚀

Overview

MoonBit Skills v7.0 is aLibrary Design Best Practices Extension, building on the v6.0 application templates, adding software library design skills:

v7.0 Core Improvements

Dimension v6.0 (Previous) v7.0 (Current) Improvement
Number of Skills 14 15 ⬆️ +1 (library-design)
Library Design Capability ❌ None ✅ Complete Guide Brand New Capability
Coverage Scenarios Language Learning + Engineering Practice + Application Creation Language Learning + Engineering Practice + Application Creation + Library Design Capability Leap

Major Changes

🆕 New Software Library Design Best Practices Skill:

  • moonbit-library-design - API design principles, Trait/generic engineering, naming conventions, Builder pattern, reliability/flexibility/future-oriented design, documentation standards, release process, anti-pattern avoidance guide

📚 Retain v6.0 application templates (7 templates):

  • moonbit-app-templates - CLI tools, algorithm libraries, computation libraries, TUI/GUI/Web application templates

📚 Retain v5.0 deep integration with official documentation (13 URLs):

  • fundamentals.html → moonbit-functional (Part 1: Core Syntax Basics)
  • methods.html → moonbit-functional (Part 4-6: Methods/Overloading/Objects)
  • derive.html → moonbit-functional (Part 7: Deriving Macro System)
  • tests.html → moonbit-devtools (Part 1: Testing System)
  • benchmarks.html → moonbit-devtools (Part 2: Benchmarking)
  • docs.html → moonbit-devtools (Part 3: Documentation Comments)
  • attributes.html → moonbit-devtools (Part 4: Attribute System)

✨ Retain v5.0 advanced experimental skills:

  • moonbit-async - Asynchronous programming and structured concurrency
  • moonbit-verification - Formal verification

Three-Layer Skill Architecture (v5.0)

flowchart TB
    ROOT["🌙 MoonBit Skills v7.0<br/>官方文档深度整合版 + 库设计最佳实践"] --> L1["📘 Layer 1<br/>学习路径层"]
    ROOT --> L2["🔧 Layer 2<br/>工程实践层"]
    ROOT --> L3["🎯 Layer 3<br/>专业领域层"]

    subgraph L1 ["📘 Foundation Path (4 skills)"]
        direction LR
        F1[quickstart<br/>快速入门]
        F2[data-types<br/>数据类型系统]
        F3[pattern-match<br/>模式匹配]
        F4[functional<br/>函数式编程 ⭐<br/>1344行 v5.0整合]
    end

    subgraph L2 ["🔧 Engineering Practice (4 skills)"]
        direction LR
        E1[project-layout<br/>项目布局]
        E2[workflow<br/>标准工作流]
        E3[error-handling<br/>错误处理]
        E4[devtools<br/>开发工具 ⭐<br/>823行 v5.0整合]
    end

    subgraph L3 ["🎯 Domain Expertise (7 skills)"]
        direction LR
        D1[multi-backend<br/>多后端开发]
        D2[ffi<br/>C FFI 绑定]
        D3[refactoring<br/>重构指南]
        D4[async ⚡<br/>异步编程]
        D5[verification 🔬<br/>形式化验证]
        D6[app-templates 🆕<br/>CLI/算法库/GUI/TUI/Web]
        D7[library-design 🆕<br/>API设计/Trait/泛型/Builder]
    end

    style ROOT fill:#f3e5f5,stroke:#9c27b0,color:#4a148c,stroke-width:3px
    style L1 fill:#e8f5e9,stroke:#4caf50,color:#1b5e20
    style L2 fill:#e3f2fd,stroke:#2196f3,color:#0d47a1
    style L3 fill:#fff3e0,stroke:#ff9800,color:#e65100

Layer 1: 📘 Learning Path Layer (Foundation Path)

Target Users: Beginners, systematic learners

When to Use: Learning MoonBit language basics, understanding core concepts

Skill Core Content Estimated Time Complexity Source
moonbit-quickstart Environment setup, Hello World, core syntax basics 1h 🟢 Beginner 🆕 Merged
moonbit-data-types Arrays, tuples, structs, enums, Map, Option, Result 1h 🟡 Intermediate Renamed
moonbit-pattern-match match expressions, destructuring, guard conditions, exhaustiveness checking 45min 🟡 Intermediate Retained
moonbit-functional Advanced functions, higher-order functions, closures,Generics/Trait/Method library-level practices (v6.0 enhanced) 1.5h 🟡 Intermediate 🆕 v6.0 Enhanced

Recommended Learning Path

Week 1: quickstart → data-types
Week 2: pattern-match → functional

Total Learning Time: ~4 hours (33% reduction from 6 hours in v3.0)


Layer 2: 🔧 Engineering Practice Layer (Engineering Practice)

Target Users: Practitioners, daily developers

When to Use: Actual project development, following best practices

Skill Core Content Trigger Scenarios Source
moonbit-project-layout Project Structure, Module vs Package, Coding Standards Creating a New Project Retained
moonbit-workflow Bug Fix / Refactor / Feature Standard Workflow Daily Development Tasks Retained
moonbit-error-handling Option/Result/raise/try/catch/Error Polymorphism Error Handling Retained
moonbit-devtools CLI Toolchain, Package Management, Testing and Debugging, IDE Integration Development Tool Usage 🆕 Merged

🆕 Core Highlight: Integrated Development Tools

The devtools skill integrates content that was previously scattered across 3 skills:

Original Skill Content Now
toolchain-skill moon CLI commands, build configuration ✅ devtools Part 1
packages-skill mooncakes, dependency management ✅ devtools Part 2
testing-skill Unit testing, expect test, debugging ✅ devtools Part 3

Advantages: One-stop solution for all development tool needs, avoiding cross-skill searching.


Layer 3: 🎯 Domain Expertise Layer (Domain Expertise)

Target Users: Senior developers, platform-specific experts

When to Use: Development for specific backends or advanced scenarios

Skill Target Platform/Scenario Core Content Complexity Source
moonbit-multi-backend Multi-backend Comparison and Selection wasm/js/native compilation, optimization, interoperability 🟠 Advanced Retained
moonbit-ffi C FFI Bindings Type mapping, ownership system, External Object 🔴 Expert Retained
moonbit-refactoring Code Refactoring API minimization, pattern matching idioms, functional style 🟡 Intermediate Retained
moonbit-async ⚡ Asynchronous Programming (Experimental) async functions, TaskGroup, cancellation mechanism, async IO 🔴 Expert Retained
moonbit-verification 🔬 Formal Verification (Experimental) Contract specifications, loop invariants, SMT solvers, model-based verification 🔴🔴 Expert Retained
moonbit-app-templates 🆕 Application Templates (New in v6.0) CLI tools, algorithm libraries, computation libraries, TUI/GUI/Web application creation 🟡 Intermediate 🆕 v6.0
moonbit-library-design 🆕 Software Library Design Best Practices API design principles, Trait/generics engineering, naming conventions, Builder pattern, reliability design, release process 🟡 Intermediate 🆕 v7.0

🆕 New in v6.0: Application Template Skill Description

moonbit-app-templates (Application Templates) 🆕

Based on the latest MoonBit v0.9 syntax and third-party library ecosystem, covering 7 application templates:

  • ✅ CLI Tool Template: Command-line argument parsing, subcommand routing, configuration management
  • ✅ Algorithm Library Template: Sorting algorithms (quicksort/mergesort), data structures (linked list/tree/graph)
  • ✅ Computation Library Template: Math utilities, vector/matrix operations, statistical functions
  • ✅ TUI Application Template: LunarTUI terminal interface framework integration
  • ✅ GUI Application Template: moonbit-webview desktop application framework integration
  • ✅ Qt GUI Template: moonbit-qt-gui Qt widget library integration
  • ✅ Web application template: JavaScript backend + FFI interop

Use cases: Quickly create various MoonBit applications

Third-party dependencies:

  • FrozenLemonTee/LunarTUI - TUI framework
  • WilliamZ1008/qtgui - Qt GUI library
  • justjavac/moonbit-webview - WebView GUI

v5.0 Advanced Experimental Skills Description (retained)

moonbit-async (asynchronous programming) ⚡

From the official async-experimental documentation, covering:

  • ✅ async Function definition and calling conventions
  • ✅ Structured concurrency:@async.with_task_group
  • ✅ TaskGroup and background tasks (spawn_bg)
  • ✅ Cancellation mechanism: automatic propagation, timeout pattern, retry pattern
  • ✅ Asynchronous IO: HTTP client, file operations, network IO
  • ✅ Limited support for the JavaScript backend

Use cases: High-concurrency servers, IO-intensive applications, systems requiring timeout/retry

⚠️ Experimental warning: The API may change; the Native backend has the best support

moonbit-verification (formal verification) 🔬

From the official verification documentation, covering:

  • ✅ Environment setup: Why3 + SMT solvers (Z3/CVC5/Alt-Ergo)
  • ✅ Code structure: program side (.mbt) vs logic side (.mbtp)
  • ✅ Function contracts: preconditions (proof_require) / postconditions (proof_ensure)
  • ✅ Loop invariants:proof_invariant / proof_yield / proof_reasoning
  • ✅ Advanced features:#proof_pure / #proof_axiomatized / model-based verification
  • ✅ Run verification:moon prove command

Use cases: Proof of correctness for critical algorithms, verification of data structure invariants, safety-critical systems

⚠️ Experimental warning: The surface syntax and prover integration are still evolving rapidly


Quick start

Get started in 5 minutes

# 1. 安装 MoonBit
curl -fsSL https://www.moonbitlang.com/install.sh | bash

# 2. 创建项目
moon new hello-moonbit && cd hello-moonbit

# 3. 运行程序
moon run cmd/main

# 4. 构建到不同后端
moon build --target wasm     # WebAssembly
moon build --target js       # JavaScript
moon build --target native   # 原生代码

Which skill should I start with?

flowchart TD
    Start{"我是..."} --> Q1{新手?}

    Q1 -->|是的| Path1["📖 Layer 1: 学习路径"]
    Q1 -->|有经验| Q2{需要做什么?}

    Q2 -->|写新代码| Path2["🔧 workflow → project-layout"]
    Q2 -->|修Bug| Path3["🔧 workflow (Bug Fix) → devtools"]
    Q2 -->|重构| Path4["🎯 refactoring → devtools"]
    Q2 -->|处理错误| Path5["🔧 error-handling"]
    Q2 -->|选后端| Path6["🎯 multi-backend"]

    Path1 --> L1[quickstart → data-types]
    Path2 --> L2[project-layout → devtools]
    Path3 --> L3[workflow → devtools → error-handling]
    Path4 --> L4[refactoring → devtools]
    Path5 --> L5[error-handling (4大场景)]
    Path6 --> L6[multi-backend (wasm/js/native)]

    style Start fill:#f3e5f5,stroke:#9c27b0,color:#4a148c
    style Path1 fill:#e8f5e9,stroke:#4caf50,color:#1b5e20
    style Path2 fill:#e3f2fd,stroke:#2196f3,color:#0d47a1
    style Path3 fill:#e3f2fd,stroke:#2196f3,color:#0d47a1
    style Path4 fill:#fff3e0,stroke:#ff9800,color:#e65100
    style Path5 fill:#ffcdd2,stroke:#d32f2f,color:#b71c1c
    style Path6 fill:#fce4ec,stroke:#e91e63,color:#880e4f

Directory structure

moonbit-skills/ (v6.0.0)
│
├── SKILL.md                              # 母技能入口 (本文件)
├── INDEX.md                              # 技能索引
│
├── skills/                               # Layer 1: 技能容器(符合三层架构)
│   │
│   ├── layer1-foundation-path/           # Layer 2: 学习路径层协调器
│   │   ├── moonbit-quickstart/SKILL.md
│   │   ├── moonbit-data-types/SKILL.md
│   │   ├── moonbit-pattern-match/SKILL.md
│   │   └── moonbit-functional/SKILL.md    # ⭐ v5.0: 1344行深度整合
│   │
│   ├── layer2-engineering-practice/      # Layer 2: 工程实践层协调器
│   │   ├── moonbit-project-layout/SKILL.md
│   │   ├── moonbit-workflow/SKILL.md
│   │   ├── moonbit-error-handling/SKILL.md
│   │   └── moonbit-devtools/SKILL.md     # ⭐ v5.0: 823行完整版
│   │
│   └── layer3-domain-expertise/          # Layer 2: 专业领域层协调器
│       ├── moonbit-multi-backend/SKILL.md
│       ├── moonbit-ffi/SKILL.md
│       ├── moonbit-refactoring/SKILL.md
│       ├── moonbit-async/SKILL.md        # v5.0: 异步编程(实验性)
│       ├── moonbit-verification/SKILL.md # v5.0: 形式化验证(实验性)
│       └── moonbit-app-templates/SKILL.md # 🆕 v6.0: 应用程序模板
│
└── references/                           # 不计入层级深度
    ├── architecture.md
    ├── error-codes.md
    └── decision-matrices.md

Total: 14 sub-skills + 3 reference documents | Architecture: Three layers (L0→L1→L2) | Compliant with the skill-factory specification ✅

v6.0 new statistics:

  • Number of new skills:+1 (app-templates)
  • Number of application templates:7 types (CLI/algorithm library/computation library/TUI/GUI/Qt/Web)

Version history

v7.0.0 - 📖 Best practices for software library design (2026-05-16)

Major changes:

🆕 New software library design skill

  • 🆕 moonbit-library-design - The 5 commandments of API design, naming conventions, trait design principles, generics practices, Builder pattern, reliability/flexibility/future-oriented design, documentation conventions, release process, anti-pattern avoidance guide

📊 Quantitative results

  • Number of skills: 14 → 15(+1 library design skill)
  • Coverage capability: from "can write code" → "can write good libraries"

📚 Reference sources: Rust API Guidelines, yourbasic.org API design principles, Microsoft REST API best practices

v6.0.0 - 🆕 Application template expansion (2026-05-16)

Major changes:

🆕 New application template skill

  • 🆕 moonbit-app-templates - 7 application templates (CLI/algorithm library/computation library/TUI/GUI/Qt/Web)
  • Integrate the latest MoonBit v0.9 syntax features (Debug trait, regex match, reverse pipe, etc.)
  • Integrate third-party library ecosystem: LunarTUI, moonbit-qt-gui, moonbit-webview

📊 Quantitative results

  • Number of skills: 13 → 14(+1 application template skill)
  • Application scenario coverage: from language learning → complete application creation capability
  • Third-party library integration:3(TUI/GUI/WebView)

v5.0.0 - 📚 In-depth integration of official documentation (2026-05-08)

Major changes:

📚 In-depth integration of 13 official documentation URLs

  • fundamentals.html → moonbit-functional Part 1 (core syntax basics)
  • methods.html → moonbit-functional Part 4-6 (methods/overloading/objects)
  • derive.html → moonbit-functional Part 7 (deriving macro system)
  • tests.html → moonbit-devtools Part 1 (testing system)
  • benchmarks.html → moonbit-devtools Part 2 (benchmarking)
  • docs.html → moonbit-devtools Part 3 (documentation comments)
  • attributes.html → moonbit-devtools Part 4 (attribute system)

✨ Created 2 advanced experimental skills

  • 🆕 moonbit-async - Asynchronous programming and structured concurrency (from async-experimental.html)
  • 🆕 moonbit-verification - Formal verification (from verification.html)

📊 Quantitative results

  • Number of skills: 11 → 13(+2 advanced skills)
  • functional skill: 627 lines → 1344 lines(+114%)
  • devtools skill: 4-line placeholder → 823-line full version
  • Total new content:~2200+ lines
  • Official documentation coverage:9/13 documents fully integrated

v4.1.0 - 🏗️ Three-layer architecture compliance (2026-05-08)

Major changes:

🆕 Added skills/ container directory

  • Complies with the skill-factory three-layer architecture iron rule (L0→L1→L2)
  • Hierarchy depth: 3 layers (root → category → skill)
  • Semantic grouping: layer1/2/3-{category}

🔄 Path migration

  • All 11 sub-skills migrated from the root directory to the skills/ directory
  • Organized by three-layer architecture: foundation-path / engineering-practice / domain-expertise
  • Updated all internal links and references

📊 Architecture compliance

  • ✅ Hierarchy depth ≤ 3 layers
  • ✅ skills/ container directory exists
  • ✅ Clear semantic grouping
  • ✅ Complies with skill-factory specifications

v4.0.0 - 🚀 Architecture streamlining and optimization (2026-05-08)

Major changes:

🗑️ Removed redundancy (-5 skills)

  • Removed moonbit-tutorial(75% overlap with core)
  • Removed moonbit-core(basic parts already covered)
  • Removed moonbit-functions(35% overlap with core)
  • Removed moonbit-generics(should belong to functional programming)
  • Removed moonbit-data-structures(renamed)

🔄 Consolidation and optimization (6→4 skills)

  • Created moonbit-quickstart = tutorial + core basics
  • Created moonbit-functional = functions + generics
  • Created moonbit-devtools = toolchain + packages + testing
  • Created moonbit-multi-backend = wasm + js + native

✨ Added skills (+2 advanced skills)

  • New moonbit-ffi - C FFI Bindings (Expert level)
  • New moonbit-refactoring - Refactoring Guide (Intermediate level)

📊 Quantified Results

  • Number of skills: 16 → 11(31% reduction)
  • Content overlap: 4 instances → 0 instances
  • Documentation consistency: ❌ → ✅
  • Maintenance cost: reduced by ~40%

v3.0.0 - 🚀 Architecture Refactoring (2026-05-08)

🏗️ New Three-Layer Architecture

  • 📖 Layer 1: Learning Path Layer (6 skills)
  • 🔧 Layer 2: Engineering Practice Layer (6 skills) - New! Drawing on official workflows
  • 🎯 Layer 3: Professional Domain Layer (5 skills)

🆕 New Skills (5)

  • moonbit-quickstart, moonbit-data-types, moonbit-project-layout
  • moonbit-workflow, moonbit-ffi, moonbit-refactoring

v2.0.0 - Error Handling Refactoring (2026-05-08)

  • ✨ moonbit-error-handling-skill v2.0: Reorganized into 4 major scenarios by purpose
  • 🆕 references/error-codes.md: Compiler error code index

v1.2.0 ~ v1.0.0

  • Initial version, 13 sub-skills

Comparison with Official Skill Package

Dimension Official moonbit-agent-guide Our moonbit-skills v4.0
Positioning AI Agent-assisted coding Human learning + AI assistance + practical guidance
Organization Task-oriented ✅ Task-oriented + learning path
Number of skills 6 main skills ✅ 11 sub-skills (more granular but no redundancy)
Workflow support ✅ Complete ✅ Aligned with official + enhanced
Language teaching ❌ Assumes prior knowledge ✅ Systematic (our advantage)
FFI support ✅ Yes ✅ New complete FFI skill
Refactoring guidance ✅ Yes ✅ New refactoring guide
Multi-backend comparison ⚠️ Limited ✅ Detailed comparison and selection

Differentiated Advantages:

  • ✅ Zero content overlap(key optimization in v4.0)
  • ✅ Complete FFI and refactoring support(new)
  • ✅ Systematic learning path(retained advantage)
  • ✅ Rich visual diagrams(retained advantage)

FAQ

Q: What is the difference between v4.0 and v3.0?

A: v4.0 is astreamlining optimization, mainly addressing the content overlap issue in v3.0. The number of skills was reduced from 16 to 11, but the coverage was not narrowed (instead, FFI and refactoring were added); redundancy was simply eliminated.

Q: I am learning a skill in v3.0. What should I do?

A: All core content from v3.0 has been integrated into the new skills in v4.0:

  • Original tutorial/core → quickstart
  • Original functions/generics → functional
  • Original toolchain/packages/testing → devtools
  • Original wasm/js/native → multi-backend

Q: Why was data-structures removed?

A: It was not actually deleted, but ratherrenamedto data-types, a more accurate name (it includes not only data structures, but also the type system).

Q: How difficult are the ffi and refactoring skills?

A:

  • ffi is at the 🔴 Expert level, requiring a foundation in C and experience in systems programming
  • refactoring is at the 🟡 Intermediate level, suitable for developers with some experience

Q: How can I contribute a new skill?

A: Refer to the production process of skill-factory, follow the three-layer architecture iron rules, and ensure there is no content overlap with existing skills.


Acknowledgments and References

Official Resources

Design Inspiration

This v4.0 streamlined and in-depth version deeply integrates the following sources:

  • ✅ skill-factory v3.1 's four-dimensional classification and three-layer architecture iron rules
  • ✅ Official moonbit-agent-guide 's workflow-driven philosophy
  • ✅ In-depth analysis Content overlap among the 16 skills in v3.0
  • 💪 Zero-tolerance determination against redundant content

Last updated: 2026-05-16 | Version: v7.0.0 | Number of skills: 15 (+1 new) | Architecture: Three-Layer Compliant (skill-factory) | Official documentation integration: 13 URLs | Application templates: 7 types | Library design: Complete guide