Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

moonbit-docsMoonbit 文档

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

346

周安装

14

GitHub Stars

公开资料未说明

下载量

109
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:moonbit-docs(Moonbit 文档)
来源仓库:https://github.com/totto2727-dotfiles/agents
仓库路径:skills/moonbit-docs
安装命令:
npx skills add https://github.com/totto2727-dotfiles/agents --skill moonbit-docs
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/totto2727-dotfiles/agents --skill moonbit-docs

简介

用于辅助文档、README 和 Markdown 内容的整理与改写。

  • 适合提炼结构、补齐章节、统一术语或检查链接有效性。
  • 使用时需保留项目已有事实,避免虚构未确认的信息。
  • 涉及对外文案时应控制语气,防止过度营销或夸大能力。
  • 建议配合本地预览验证渲染效果和格式一致性。moonbit-docs 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Related Skills

  • moonbit-bestpractice — MoonBit coding standards and best practices. Use when writing, reviewing, or refactoring MoonBit code.

Introduction

A MoonBit program consists of top-level definitions including:

  • type definitions
  • function definitions
  • constant definitions and variable bindings
  • init functions, main function and/or test blocks.

Expressions and Statements

MoonBit distinguishes between statements and expressions. In a function body, only the last clause should be an expression, which serves as a return value. For example:

fn foo() -> Int {
  let x = 1
  x + 1
}

fn bar() -> Int {
  let x = 1
  //! x + 1
  x + 2
}

Expressions include:

  • Value literals (e.g. Boolean values, numbers, characters, strings, arrays, tuples, structs)
  • Arithmetical, logical, or comparison operations
  • Accesses to array elements (e.g. a[0]), struct fields (e.g r.x), tuple components (e.g. t.0), etc.
  • Variables and (capitalized) enum constructors
  • Anonymous local function definitions
  • match, if, loop expressions, etc.

Statements include:

  • Named local function definitions
  • Local variable bindings
  • Assignments
  • return statements
  • Any expression whose return type is Unit, (e.g. ignore)

A code block can contain multiple statements and one expression, and the value of the expression is the value of the code block.

Variable Binding

A variable can be declared as mutable or immutable using let mut or let, respectively. A mutable variable can be reassigned to a new value, while an immutable one cannot.

A constant can only be declared at top level and cannot be changed.

let zero = 0

const ZERO = 0

fn main {
  //! const ZERO = 0
  let mut i = 10
  i = 20
  println(i + zero + ZERO)
}

NOTE

A top level variable binding

  • requires explicit type annotation (unless defined using literals such as string, byte or numbers)
  • can't be mutable (use Ref instead)

Naming conventions

Variables, functions should start with lowercase letters a-z and can contain letters, numbers, underscore, and other non-ascii unicode chars. It is recommended to name them with snake_case.

Constants, types should start with uppercase letters A-Z and can contain letters, numbers, underscore, and other non-ascii unicode chars. It is recommended to name them with PascalCase or SCREAMING_SNAKE_CASE.

Keywords

The following are the keywords and should not be used:

[
  "as",
  "else",
  "extern",
  "fn",
  "fnalias",
  "if",
  "let",
  "const",
  "match",
  "using",
  "mut",
  "type",
  "typealias",
  "struct",
  "enum",
  "trait",
  "traitalias",
  "derive",
  "while",
  "break",
  "continue",
  "import",
  "return",
  "throw",
  "raise",
  "try",
  "catch",
  "pub",
  "priv",
  "readonly",
  "true",
  "false",
  "_",
  "test",
  "loop",
  "for",
  "in",
  "impl",
  "with",
  "guard",
  "async",
  "is",
  "suberror",
  "and",
  "letrec",
  "enumview",
  "noraise",
  "defer"
]

Reserved Keywords

The following are the reserved keywords. Using them would introduce a warning. They might be turned into keywords in the future.

[
  "module",
  "move",
  "ref",
  "static",
  "super",
  "unsafe",
  "use",
  "where",
  "await",
  "dyn",
  "abstract",
  "do",
  "final",
  "macro",
  "override",
  "typeof",
  "virtual",
  "yield",
  "local",
  "method",
  "alias",
  "assert",
  "package",
  "recur",
  "using",
  "enumview",
  "isnot",
  "define",
  "downcast",
  "inherit",
  "member",
  "namespace",
  "static",
  "upcast",
  "use",
  "void",
  "lazy",
  "include",
  "mixin",
  "protected",
  "sealed",
  "constructor",
  "atomic",
  "volatile",
  "anyframe",
  "anytype",
  "asm",
  "await",
  "comptime",
  "errdefer",
  "export",
  "opaque",
  "orelse",
  "resume",
  "threadlocal",
  "unreachable",
  "dynclass",
  "dynobj",
  "dynrec",
  "var",
  "finally",
  "noasync"
]

Program entrance

init and main

There is a specialized function called init function. The init function is special:

  1. It has no parameter list nor return type.
  2. There can be multiple init functions in the same package.
  3. An init function can't be explicitly called or referred to by other functions. Instead, all init functions will be implicitly called when initializing a package. Therefore, init functions should only consist of statements.
fn init {
  let x = 1
  println(x)
}

There is another specialized function called main function. The main function is the main entrance of the program, and it will be executed after the initialization stage.

Same as the init function, it has no parameter list nor return type.

fn main {
  let x = 2
  println(x)
}

The previous two code snippets will print the following at runtime:

1
2

Only packages that are main packages can define such main function. Check out build system tutorial for detail.

{
  "is-main": true
}

test

There's also a top-level structure called test block. A test block defines inline tests, such as:

test "test_name" {
  assert_eq(1 + 1, 2)
  assert_eq(2 + 2, 4)
  inspect([1, 2, 3], content="[1, 2, 3]")
}

The following contents will use test block and main function to demonstrate the execution result, and we assume that all the test blocks pass unless stated otherwise.

Related Documentation

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.91%
按下载量换算37

Claude

32.09%
按下载量换算35

Cursor

20.24%
按下载量换算22

Gemini CLI

9.12%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills