File contents 发布 MoonBit 库
触发条件
用户准备将 MoonBit 库发布到 mooncakes 时激活。
发布前 Checklist
API 质量
配置完整性
测试覆盖
版本号
执行步骤
Step 1: API 审查
运行 moon info 检查公开接口:
moon info
git diff -- "*.mbti" # 检查 API 变更
对照 references/library-design.md Parts 1-5 检查 API 设计质量。
Step 2: 构建 Release
moon build --release
# 或指定后端
moon build --target wasm-gc --release
moon build --target js --release
Step 3: 本地验证
# 创建临时测试项目验证安装
moon new test-consumer
# 在 test-consumer 中 import 你的库
# 确认可以正常使用
Step 4: 发布
moon publish # 发布到 mooncakes
# 或手动上传
Step 5: 发布后
更新 CHANGELOG.md
打 git tag: git tag -a vx.y.z
更新 README 版本 badge
库设计核心原则速查
最小 API : 只暴露必要的东西
正确可见性 : pub(只读) > pub(all)(完全公开)
Trait 密封 : 默认 pub trait,需要外部实现才用 pub(open)trait
语义化版本 : 不 breaking change 不升 major
文档完备 : 公开 API 必须有注释
详细知识
🔗 references/library-design.md — 完整库设计指南(Parts 1-11)
🔗 references/real-world-examples.md — 成功发布的库案例
🔗 references/app-templates.md — 库项目模板
1 --- 2 name: 6-publish-lib 3 description: 发布 MoonBit 库 4 --- 5 6 # 发布 MoonBit 库 7 8 ## 触发条件 9 用户准备**将 MoonBit 库发布到 mooncakes** 时激活。 10 11 ## 发布前 Checklist 12 13 ### API 质量 14 - [ ] 公开 API 最小化原则(只暴露必要的) 15 - [ ] 命名遵循规范(snake_case 函数 / CamelCase 类型) 16 - [ ] 所有公开类型有文档注释 17 - [ ] 无 pub(all) 滥用(只在确实需要外部构造时使用) 18 - [ ] Trait 设计合理(pub(open)trait 用于需要外部实现的接口) 19 20 ### 配置完整性 21 - [ ] `moon.mod.json` name/version/readme/license 正确 22 - [ ] `moon.pkg` export/import 配置正确 23 - [ ] 支持 target 兼容性声明(如需) 24 - [ ] README.md 包含安装和使用示例 25 26 ### 测试覆盖 27 - [ ] 所有公开函数有测试 28 - [ ] 测试通过 (`moon test`) 29 - [ ] 无编译警告 30 31 ### 版本号 32 - [ ] 遵循语义化版本 (semver) 33 - [ ] breaking change → major 34 - [ ] 新功能 → minor 35 - [ ] bug fix → patch 36 37 ## 执行步骤 38 39 ### Step 1: API 审查 40 运行 `moon info` 检查公开接口: 41 ```bash 42 moon info 43 git diff -- "*.mbti" # 检查 API 变更 44 ``` 45 对照 `references/library-design.md` Parts 1-5 检查 API 设计质量。 46 47 ### Step 2: 构建 Release 48 ```bash 49 moon build --release 50 # 或指定后端 51 moon build --target wasm-gc --release 52 moon build --target js --release 53 ``` 54 55 ### Step 3: 本地验证 56 ```bash 57 # 创建临时测试项目验证安装 58 moon new test-consumer 59 # 在 test-consumer 中 import 你的库 60 # 确认可以正常使用 61 ``` 62 63 ### Step 4: 发布 64 ```bash 65 moon publish # 发布到 mooncakes 66 # 或手动上传 67 ``` 68 69 ### Step 5: 发布后 70 - 更新 CHANGELOG.md 71 - 打 git tag: `git tag -a vx.y.z` 72 - 更新 README 版本 badge 73 74 ## 库设计核心原则速查 75 1. **最小 API**: 只暴露必要的东西 76 2. **正确可见性**: pub(只读) > pub(all)(完全公开) 77 3. **Trait 密封**: 默认 pub trait,需要外部实现才用 pub(open)trait 78 4. **语义化版本**: 不 breaking change 不升 major 79 5. **文档完备**: 公开 API 必须有注释 80 81 ## 详细知识 82 🔗 `references/library-design.md` — 完整库设计指南(Parts 1-11) 83 🔗 `references/real-world-examples.md` — 成功发布的库案例 84 🔗 `references/app-templates.md` — 库项目模板
morning-start/agent-skills/tree/main/lang/moonbit/skills/6-publish-lib commit 8bf7c15b0c
Frequently asked questions How do I install the 6 Publish Lib skill? Run npx skillmds@latest add morning-start/6-publish-lib in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the 6 Publish Lib skill do? 发布 MoonBit 库 It is listed under Coding & Dev Tools on SkillMD.
Is 6 Publish Lib safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with 6 Publish Lib? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is 6 Publish Lib free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published 6 Publish Lib? morning-start (@morning-start) published this skill. Their other Agent Skills are listed on their SkillMD profile.