Community编程与开发github.com

MoonshotAI/sync-changelog

发布成功后,维护人员需将 apps/kimi-code/CHANGELOG.md 同步到 docs/en/release-notes/changelog.md 和 docs/zh/release-notes/changelog.md,然后在专用分支上发起 PR。

sync-changelog 是什么?

该技能(Skill)专为 MoonshotAI 的 kimi-code 项目设计,用于在版本发布后,将 CLI 包(@moonshot-ai/kimi-code)的变更日志同步到文档站点。它处理英语和中文两种文档,确保用户看到的变更日志准确、清晰。技能核心功能包括:从上游 changesets 生成的 CHANGELOG.md 中提取新版本条目,去除装饰性链接和致谢信息,根据变更类型(功能、优化、修复、重构、其他)分类,并将相似条目合并,以提升可读性。它还支持自动将 descope 条目翻译成中文,并添加 web: 前缀以标记前端改动。该技能适用于 Claude Code、Cursor 等支持 Skills 的 AI Agent 平台,通过明确的步骤和规则引导 AI 完成同步,并确保只在专用分支上操作,避免直接修改主分支。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/MoonshotAI/kimi-code/tree/main/.agents/skills/sync-changelog

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

同步变更日志

概述

kimi-code 使用 changesets 进行版本管理。每个包都有自己的 CHANGELOG.md。面向用户的 CLI 包 @moonshot-ai/kimi-code 的变更日志位于:

apps/kimi-code/CHANGELOG.md

此文件是文档站点变更日志的唯一上游源。内部包的变更日志(例如 packages/*/CHANGELOG.md)不会进入文档站点。

发布流程完成后(发布 PR 合并 → Version Packages 完成 → npm 发布成功),维护人员手动运行此技能,将新的 CLI 变更日志条目复制到文档站点,将英文增量翻译成中文,等待可选的人工审核,然后在专用分支上提交并打开 PR。

何时使用

  • 新版本已发布到 npm。
  • apps/kimi-code/CHANGELOG.md 顶部包含尚未出现在 docs/en/release-notes/changelog.md 中的版本块。
  • gen-docs 流程不会自动执行此操作;维护人员必须在发布后明确执行。

在发布 PR 合并之前不要运行此技能。此时,changesets 尚未将新版本写入 apps/kimi-code/CHANGELOG.md。

源文件与目标文件

文件角色编辑者
apps/kimi-code/CHANGELOG.md唯一上游源,由 changesets 生成切勿手动编辑
docs/en/release-notes/changelog.md英文文档变更日志;文档的事实源此技能
docs/zh/release-notes/changelog.md中文文档变更日志,从英文翻译而来此技能,遵循 translate-docs

核心规则:英文文档变更日志是事实源,中文从英文翻译而来。这与 translate-docs 一致。

前置条件

编辑前,请确认:

  • 已发布的版本存在于 npm 上(npm view @moonshot-ai/kimi-code versions --json)或存在匹配的 GitHub Release 标签。
  • apps/kimi-code/CHANGELOG.md 顶部是该新版本。

如果任何条件不满足,停止并向用户确认。

不要直接在 main 上编辑或提交。所有同步工作都在步骤 1 中创建的专用分支上进行。

工作流程

1. 准备分支

从最新的默认分支开始:

git fetch origin
git checkout main
git pull --ff-only origin main

在创建分支之前,查看版本范围,以便分支名称与正在同步的最新版本匹配:

rg '^## ' apps/kimi-code/CHANGELOG.md | head -5
rg '^## ' docs/en/release-notes/changelog.md | head -5

将分支命名为英文文档页面中尚未包含的最新上游版本:

docs/changelog-sync-<newest-version>

示例:仅同步 0.2.1 → docs/changelog-sync-0.2.1。

git checkout -b docs/changelog-sync-<newest-version>

如果分支已存在于本地或远程,请停止并向用户确认,而不是重复使用它。

2. 找到版本范围

使用步骤 1 中的相同版本列表。确认:

  • 首次同步:将所有上游版本块复制到英文页面中。
  • 增量同步:复制英文页面中已存在的最新版本之上的每个上游版本块。

使用上游顺序:最新版本优先。

3. 剥离装饰并提取条目文本

上游条目如下所示:

- [#317](https://github.com/...) [`2f51db4`](https://github.com/...) Thanks [@user](https://github.com/...)! - Clean up lint warnings ...

Changesets 可能会添加 Thanks ...! 致谢,但每次都必须删除。保留:

  • 版本标题,例如 ## 0.2.0。
  • 每个条目中,删除 PR/哈希装饰和任何 Thanks ...! 致谢后的正文文本。

删除:

  • 上游的 H1 # @moonshot-ai/kimi-code,因为文档页面已有 # Changelog。
  • Changesets 的子标题,例如 ### Patch Changes、### Minor Changes 和 ### Major Changes。
  • PR 链接,例如 [#317](...)。
  • 提交哈希链接,例如 [`2f51db4`](...)。
  • Thanks [@user](...)! 致谢,包括多作者形式 Thanks [@a](...), [@b](...)!。每次都删除整个 Thanks ...! 段,无论该功能是否启用。

剥离后,每个条目为 - <正文文本>。

删除仅与 SDK 相关和提供者内部的细节。此变更日志服务于 @moonshot-ai/kimi-code CLI 和 Web 用户。在条目的正文中,只保留 CLI/Web 用户可以感知的内容,并删除描述内部实现而非用户可见行为的句子。在英文和中文页面上均应用此规则:

  • 删除关于 SDK 如何映射能力、构建模型别名或通过 API(如 getExperimentalFeatures())暴露标志的句子——这些属于 SDK 变更日志,而不是这里。
  • 删除提供者/线格式实现机制(如 XML 标记 <tools_added>、协议字段说明、“线协议未更改”、缓存命中机制),除非它们是用户感知的行为。
  • 保留用户可见的效果以及用户必须遵守的任何约束(例如“问题文本必须唯一”)。

不要更改事实或删除真实的用户可见行为——仅修剪仅限内部的脚手架。对于过长、内部内容繁重的条目,此修剪也适用于英文页面,而不仅限于翻译。

Web UI 前缀:如果条目是 Web UI 更改,则在正文文本前加上 web: ,以便读者知道它影响 Web UI:

- web: <正文文本>

当上游提交触及 apps/kimi-web/ 时,计为 Web UI 更改。使用 git show --name-only <hash> 检查(哈希是上面剥离的提交哈希)。gen-changesets 会为 Web 更改写入此前缀,因此通常已存在于上游中——如果存在则保留,如果 Web 条目缺少则添加。当提交同时触及 Web 和非 Web 代码时,仅当条目描述的用户可见更改位于 Web UI 中时,才使用 web:。在中文页面上也保留 web: 前缀——它是一个范围标记,不翻译。

上游语言规则:gen-changesets 要求变更日志条目为英文。如果上游 CLI 变更日志包含非英文条目,请停止并向用户报告。不要同步文档时静默重写。

公开文本规则:不要将真实的内部端点、密钥名称、账户名称或服务名称复制到文档变更日志中。用中性占位符替换示例,例如 example.com、example.test 或 YOUR_API_KEY,同时保留用户可见的含义。

4. 合并、去重和分类条目

在分类之前,合并相关条目并删除面向用户变更日志中的冗余条目:

  • **合并对同一表面的微调。**将对同一 UI 区域或功能的几个小调整合并为一个简洁的条目,在更高层级上描述。例如,“更改编辑器的默认高度”和“更改编辑器的默认字体”合并为“优化编辑器的默认样式”。使用最具体的共同祖先(编辑器、设置页面、工具卡片等)。根据合并效果对合并的条目进行分类,如果合并的更改仍然是面向 Web 的,则保留 web: 前缀。
  • 当有三个或更多针对同一表面或同类型修复时合并。“Bug Fixes”部分往往会积累许多狭窄的 UI/优化修复,逐一列出时读起来像噪音。当三个或更多修复针对同一区域(例如 TUI 中的多个工具卡片,或 Web 会话/对话表面)或同一类问题(例如流式传输期间的多个“跳跃/闪烁/折叠”修复)时,将它们合并为一个更高级别的条目。示例:
    • “修复 Bash 工具卡片折叠...”、“修复 Edit 工具卡片高度跳跃...”、“修复 Edit 工具卡片在其结果流式传输时闪烁”→“修复多个 TUI 工具卡片在结果流式传输或结束短输出时跳跃、闪烁或高度折叠。”
    • “修复折叠侧边栏未隐藏...”、“停止聊天历史重放其入场动画...”、“修复工具组件在展开/折叠时跳跃对话”→“web: 修复切换会话时的几个布局和显示问题,包括折叠侧边栏未隐藏、聊天历史重放其入场动画以及工具组件跳跃对话。”
    • 如果合并的修复全部面向 Web,则保留 web:。分类为 Bug Fixes。
    • **不要过度合并。**当修复广泛、高价值或真正独特时(例如模型/提供者工具调用错误、会话列表损坏、文件完成间隙),保持独立。合并适用于低读者价值、相似形状的修复,这些修复读起来像一堵相似的要点墙。
  • **删除被 Web 条目覆盖的服务器/API 管道。**如果一个条目添加了 Web UI 功能(例如,已归档会话页面),而另一个条目仅添加了仅为支持该 Web 功能而存在的服务器或 REST/WebSocket 端点,则保留 web: 条目并删除 API 条目。CLI 和 Web 用户感知的是 Web 页面;后端 API 是实现细节,在此变更日志中没有独立的用户价值。仅当 API 条目具有独立的用户价值时才保留它——一个新的公共端点,供 SDK 或服务器消费者直接调用,或者一个可以在 Web 功能之外使用的功能。不确定时,保留两者并让审阅者决定。

文档变更日志使用五种部分类型:

英文部分中文部分含义
### Features### 新功能新的用户可见功能,例如之前不存在的新命令、标志、模式或能力
### Polish### 优化对现有功能的用户可见改进,包括 UX 调整、行为调整和对现有功能的性能改进,这些不是修复或新能力
### Bug Fixes### 修复对损坏行为的修复
### Refactors### 重构内部更改,没有用户可见的行为更改,包括构建、CI、测试、依赖清理和内部重命名
### Other### 其他任何不符合上述类别的内容,例如 CDN/端点交换和文档相关的工件

分类过程:

  1. 首先根据剥离的条目文本进行分类。
  2. 如果不清楚,检查相关的提交或 PR:
    • 使用剥离的提交哈希,执行 git show <hash>。
    • 或使用 PR 编号,执行 gh pr view <NNN>。
  3. 如果仍然不清楚,将其放入 Other。不要猜测或强制将条目放入 Features。

Features 与 Polish:询问该条目是否引入了用户以前无法做到的事情。如果是(新命令、标志、模式、查看器或能力),使用 Features。如果它只改进了现有表面(已存在的 UI 面板、现有提示、现有工具卡片、现有有效负载管道),使用 Polish。像 Add 这样的动词并不自动意味着 Features——对现有 UI 的小视觉添加仍然是 polish。

默认行为更改:更改现有功能的默认值(例如默认启用某个功能)通常是 Polish,因为该能力已经存在。仅当新默认值实质性地改变了大多数用户的即开即用体验,并且是他们以前无法获得的方式时,才使用 Features。当真正不清楚时,标记它并与审阅者确认,而不是猜测。

关键字提示:

  • Features:Add ... command/flag/option/mode/viewer、Introduce、Support、Allow、Enable、Implement、New ... command/flag/option
  • Bug Fixes:Fix、Resolve、Correct、Address、Prevent ... from、Stop ... from、... no longer ...
  • Polish:Polish、Optimize、Improve、Enhance、Speed up、Reduce、Cap、Shorten、Wrap、Clarify、Tweak、Adjust、Offload、Show ... in existing surface,对现有功能的性能/UX 调整
  • Refactors:Refactor、Rename、Clean up、Simplify、Remove unused、Migrate to、Unify、Restructure、Internal、依赖版本提升、纯 CI/构建/测试更改
  • Other:文档工件、CDN/端点切换、真正不适合任何其他部分的内容

在每个版本内,部分顺序为:

Features → Polish → Bug Fixes → Refactors → Other

省略空部分。在每个部分内,按读者价值排序,而不是上游顺序:

  1. 将最有价值、最明显和更大的更改放在第一位。
  2. 更倾向于广泛的用户可见功能、工作流程变更修复、高频错误和大型跨领域改进,而不是小的优化、狭窄的边缘情况和内部清理。
  3. 在 Polish 中,将直接用户可见的 UX 或性能改进(用户可以看见或感觉到的东西)放在协议或内部行为调整(使模型或管道行为更可靠但对用户不可见的东西)之前。
  4. 如果条目具有相似价值,保留上游顺序。

不要仅仅为了让条目看起来更重要而重新措辞或夸大;只重新排序现有条目。

5. 编写英文页面

永远不要更改英文页面标题:

# Changelog

This page documents the changes in each Kimi Code CLI release.

在标题段落之后、上一最新版本之前插入新的版本块。

每个版本标题必须携带其发布日期(括号中):

## <version> (YYYY-MM-DD)

从版本的已发布 GitHub Release 标签中获取日期,而不是从您运行同步时获取:

git log -1 --format=%cs "@moonshot-ai/kimi-code@<version>"

在英文页面上使用半角括号形式 (YYYY-MM-DD)。切勿发明或猜测日期;如果缺少标签,请停止并向用户确认。

示例:

## 0.2.0 (2026-05-26)

### Bug Fixes

- Fix the TUI not restoring the current todo list after resuming a session.

### Refactors

- Clean up lint warnings across the CLI, SDK examples, and bundled runtime code without changing product behavior.
- Update the native release workflow to use current GitHub artifact actions.

Individual skills in this repo

This repo contains 13 individual skills — each has its own dedicated page.

MoonshotAI/agent-core-dev

Use when developing in packages/agent-core-v2 (the DI × Scope agent engine) — adding or modifying a domain Service, choosing a LifecycleScope, wiring DI dependencies, splitting a domain across scopes, owning or migrating a config section, gating behavior behind an experimental flag, raising coded errors, working on the permission system, writing DI/Scope tests, porting business logic from agent-core (v1) to v2, triaging a main-branch commit against v2, or exposing a v2 domain over server-v2 while keeping the /api/v1 wire contract compatible with released clients. Self-contained guide organized by development stage (orient → design → implement → test → verify) plus align workflows for v1→v2 migration, main-branch commit triage, and server-v2 wire exposure; each file carries the rules, examples, and red lines for its step.

MoonshotAI/agent-core-review

Use ONLY for code review and test write/review guidance in `packages/agent-core-v2` (the DI × Scope agent engine). Does NOT apply to the legacy `packages/agent-core` or to any other package — for those, do not load this skill. Groups the review and testing lenses used for agent-core-v2 — `slop` (single-level-of-abstraction / layered error-handling review, invoked only on explicit request) and `test` (contract-driven per-test rules for both authoring and reviewing tests). Apply the sub-skill that matches the task; do not apply `slop` unprompted.

MoonshotAI/consolidate

Apply an approved sub-skill grouping by moving user-specified skills into a parent bundle, with timestamped backups of every modified directory.

MoonshotAI/gen-changesets

Use when generating changesets in the kimi-code repository, including package bump selection, internal package and CLI bundle handling, bump levels, major confirmation, and English changelog wording.

MoonshotAI/gen-docs

Update Kimi Code CLI user documentation after meaningful code changes that affect product behavior or user experience.

MoonshotAI/kimi-datasource

Universal data-source assistant. Use this skill when the user wants external structured data such as stocks, financial reports, technical indicators, A-share/HK/US markets, global macroeconomics, Chinese enterprise registry information, arXiv papers, Google Scholar results, or Chinese laws/regulations and judicial cases. This plugin exposes tools via MCP server `plugin-kimi-datasource_data`; call them in the flow `mcp__plugin-kimi-datasource_data__get_data_source_desc` → `mcp__plugin-kimi-datasource_data__call_data_source_tool`.

MoonshotAI/pre-changelog

Use before merging a kimi-code release PR to preview the user-facing CLI changelog in Chinese. Reads the changelog that changesets pre-generated in the release PR, then reuses sync-changelog's strip / classify / translate logic to render a Chinese preview. Writes no files.

MoonshotAI/review

Analyze the available skill set and recommend candidate groups that could be consolidated into sub-skill bundles. Read-only — proposes a plan, does not move files.

MoonshotAI/slop

Invoke only when the user explicitly asks to review code through the "single level of abstraction / layered error handling" lens — a function does only its own layer's business logic while errors are handled above or below. The agent reports detections, raw-count measurements, and move directions. Apply only when the user explicitly requests this lens.

MoonshotAI/sub-skill

Discover and reorganize the skill inventory into hierarchical sub-skill bundles. Use when the user asks to review, group, or consolidate skills into a parent bundle.

MoonshotAI/test

Use when writing or reviewing tests, or when asked how to write a good single test. Encodes the per-test rules behind the "test the contract / responsibility, not the implementation" principle — name and structure one behavior per `it`, drive through the public surface, stub only true external boundaries, control time and config via documented knobs, and keep tests clear, isolated, and refactor-resilient. The same rules drive both authoring (write mode) and auditing existing tests (review mode).

MoonshotAI/translate-docs

Translate and sync bilingual user documentation between docs/zh/ and docs/en/ following the source-of-truth rules in docs/AGENTS.md.

MoonshotAI/write-tui

Use when writing or modifying the kimi-code terminal UI in apps/kimi-code/src/tui — components, dialogs/selectors, slash commands, themes, streaming render, or the KimiTUI controllers. Covers the architecture, where new features go, test placement, the theme system mechanics, and the dialog interaction/visual spec (DESIGN.md).

相关技能