Agent SkillsMoonshotAI/kimi-code › sync-changelog

sync-changelog

GitHub

在发布成功后,将CLI包的CHANGELOG同步至中英文文档站点,翻译增量内容并在专用分支提交PR。

.agents/skills/sync-changelog/SKILL.md MoonshotAI/kimi-code

Trigger Scenarios

npm发布成功且Release PR已合并 需要更新docs站点的中英文changelog

Install

npx skills add MoonshotAI/kimi-code --skill sync-changelog -g -y
More Options

Non-standard path

npx skills add https://github.com/MoonshotAI/kimi-code/tree/main/.agents/skills/sync-changelog -g -y

Use without installing

npx skills use MoonshotAI/kimi-code@sync-changelog

指定 Agent (Claude Code)

npx skills add MoonshotAI/kimi-code --skill sync-changelog -a claude-code -g -y

安装 repo 全部 skill

npx skills add MoonshotAI/kimi-code --all -g -y

预览 repo 内 skill

npx skills add MoonshotAI/kimi-code --list

SKILL.md

Frontmatter
{
    "name": "sync-changelog",
    "description": "Use after a release succeeds, when maintainers need to sync apps\/kimi-code\/CHANGELOG.md into docs\/en\/release-notes\/changelog.md and docs\/zh\/release-notes\/changelog.md, then open a PR on a dedicated branch."
}

Sync Changelog

Overview

kimi-code uses changesets for versioning. Each package gets its own CHANGELOG.md. The user-facing CLI package, @moonshot-ai/kimi-code, writes its changelog here:

apps/kimi-code/CHANGELOG.md

This file is the only upstream source for the documentation-site changelog. Internal package changelogs such as packages/*/CHANGELOG.md do not go into the documentation site.

After the release flow finishes (Release PR merged → Version Packages completed → npm publish succeeded), maintainers manually run this skill to copy the new CLI changelog entries into the docs site, translate the English increment into Chinese, wait for an optional human review, then commit on a dedicated branch and open a PR.

When To Use

  • A new version has been published to npm.
  • The top of apps/kimi-code/CHANGELOG.md contains version blocks that are not yet in docs/en/release-notes/changelog.md.
  • The gen-docs flow does not run this automatically; maintainers must explicitly do it after release.

Do not run this before the Release PR is merged. At that point, changesets has not yet written the new version into apps/kimi-code/CHANGELOG.md.

Source And Targets

File Role Edited by
apps/kimi-code/CHANGELOG.md Only upstream source, generated by changesets Never edit manually
docs/en/release-notes/changelog.md English docs changelog; source of truth for docs This skill
docs/zh/release-notes/changelog.md Chinese docs changelog, translated from English This skill, following translate-docs

Core rule: the English docs changelog is the source of truth, and Chinese is translated from English. This matches translate-docs.

Preconditions

Before editing, confirm:

  • The released version exists on npm (npm view @moonshot-ai/kimi-code versions --json) or has a matching GitHub Release tag.
  • The top of apps/kimi-code/CHANGELOG.md is that new version.

If any condition is not true, stop and confirm with the user.

Do not edit or commit directly on main. All sync work happens on a dedicated branch created in step 1.

Workflow

1. Prepare Branch

Start from an up-to-date default branch:

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

Before creating the branch, peek at the version range so the branch name matches the newest version being synced:

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

Name the branch after the newest upstream version that is not yet in the English docs page:

docs/changelog-sync-<newest-version>

Example: syncing 0.2.1 only → docs/changelog-sync-0.2.1.

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

If the branch already exists locally or on the remote, stop and confirm with the user instead of reusing it.

2. Find The Version Range

Use the same version lists from step 1. Confirm:

  • First sync: copy all upstream version blocks into the English page.
  • Incremental sync: copy every upstream version block above the latest version already present in the English page.

Use upstream order: newest version first.

3. Strip Decorations And Extract Entry Text

Upstream entries look like this:

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

Keep:

  • Version headings such as ## 0.2.0.
  • Only the body text of each entry, after the PR/hash decoration.

Remove:

  • The upstream H1 # @moonshot-ai/kimi-code because the docs page already has # Changelog.
  • Changesets subheadings such as ### Patch Changes, ### Minor Changes, and ### Major Changes.
  • PR links such as [#317](...).
  • Commit hash links such as [`2f51db4`](...).

After stripping, each entry should be only:

- <body text>

Web UI prefix: if the entry is a web UI change, prefix the body text with web: so readers can tell it affects the web UI:

- web: <body text>

An entry counts as a web UI change when its upstream commit touches apps/kimi-web/. Check with git show --name-only <hash> (the commit hash is the one stripped above). gen-changesets writes this prefix for web changes, so it is usually already present in upstream — preserve it when it is there, and add it when a web entry lacks it. When a commit touches both web and non-web code, use web: only if the user-facing change described by the entry is in the web UI. Keep the web: prefix on the Chinese page too — it is a scope marker, not translated text.

Upstream language rule: gen-changesets requires changelog entries to be English. If the upstream CLI changelog contains a non-English entry, stop and report it to the user. Do not silently rewrite it while syncing docs.

Public-text rule: do not copy real internal endpoints, key names, account names, or service names into docs changelogs. Replace examples with neutral placeholders such as example.com, example.test, or YOUR_API_KEY while preserving the user-visible meaning.

4. Classify Entries

The docs changelog uses five section types:

English section Chinese section Meaning
### Features ### 新功能 New user-facing functionality, such as a new command, flag, mode, or capability that did not exist before
### Bug Fixes ### 修复 Fixes for behavior that was broken
### Polish ### 优化 User-visible improvements to existing functionality, including UX adjustments, behavior tweaks, and performance improvements that are not fixes or new capabilities
### Refactors ### 重构 Internal changes with no user-visible behavior change, including build, CI, tests, dependency cleanup, and internal renames
### Other ### 其他 Anything that does not fit above, such as CDN/endpoint swaps and docs-related artifacts

Classification process:

  1. Classify from the stripped entry text first.
  2. If unclear, inspect the related commit or PR:
    • Use the stripped commit hash with git show <hash>.
    • Or use the PR number with gh pr view <NNN>.
  3. If it is still unclear, put it in Other. Do not guess or force entries into Features.

Features vs. Polish: ask whether the entry introduces something the user could not do before. If yes (new command, flag, mode, viewer, or capability), use Features. If it only improves an existing surface (a UI panel that already existed, an existing prompt, an existing tool card, an existing payload pipeline), use Polish. Verbs like Add do not automatically mean Features — a small visual addition to an existing UI is still polish.

Keyword hints:

  • 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, performance and UX adjustments to existing features
  • Refactors: Refactor, Rename, Clean up, Simplify, Remove unused, Migrate to, Unify, Restructure, Internal, dependency bumps, pure CI/build/test changes
  • Other: docs artifacts, CDN/endpoint switches, anything that genuinely fits no other section

Within each version, section order is:

Features → Bug Fixes → Polish → Refactors → Other

Omit empty sections. Within each section, order entries by reader value, not upstream order:

  1. Put the most valuable, obvious, and larger changes first.
  2. Prefer broad user-visible features, workflow-changing fixes, high-frequency bugs, and large cross-cutting improvements over small polish, narrow edge cases, and internal cleanup.
  3. If entries have similar value, preserve upstream order.

Do not reword or exaggerate entries just to make them look more important; only reorder existing entries.

5. Write The English Page

Never change the English page header:

# Changelog

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

Insert new version blocks immediately after the header paragraph and before the previous latest version.

Every version heading must carry its release date in parentheses:

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

Take the date from the version's published GitHub Release tag, not from when you run the sync:

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

Use the half-width parenthesis form (YYYY-MM-DD) on the English page. Never invent or guess a date; if the tag is missing, stop and confirm with the user.

Example:

## 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.

6. Translate The Increment Into Chinese

After updating the English page, translate only the newly added English content into docs/zh/release-notes/changelog.md.

Follow translate-docs, direction en → zh. Changelog direction is English-to-Chinese even though many other docs flows use Chinese-to-English.

Chinese page requirements:

  • Header:

    # 变更记录
    
    本页记录 Kimi Code CLI 每个版本的变更内容。
    
  • Preserve version headings including the release date, but use full-width parentheses on the Chinese page, such as ## 0.2.0(2026-05-26). The date must match the English page; only the parenthesis style differs (half-width () in English, full-width () in Chinese).

  • Translate section headings exactly:

    • ### Features### 新功能
    • ### Bug Fixes### 修复
    • ### Polish### 优化
    • ### Refactors### 重构
    • ### Other### 其他
  • The Chinese page must mirror the English page 1:1 for versions, sections, section order, entry order, and entry counts.

  • Keep the classification and entry order from the English page. Do not reclassify or reorder while translating.

  • Translate only entry body text. Do not add entries that are not present in English.

  • Follow docs/AGENTS.md for Chinese typography: full-width punctuation, spaces between Chinese and English, and the glossary.

Chinese wording style

Structural fidelity does not mean literal translation. The Chinese entries should read like a concise, idiomatic Chinese changelog. Keep the same facts as the English entry, but rephrase for natural Chinese prose.

Guidelines:

  • One entry, one sentence. Avoid chaining multiple effects with commas or semicolons. If the English entry is long, split it into shorter sentences or keep only the most important effect.
  • Prefer common changelog verbs: 新增、支持、修复、优化、改进、调整.
  • Avoid indirect "through... make..." structures. Do not write "通过 X,使 Y"; prefer direct cause-effect or just state the result.
    • Bad: 通过缓存已渲染消息行,使终端在长篇对话中保持响应。
    • Better: 缓存已渲染消息行,提升长对话下终端的响应速度。
  • Be specific, not vague. Prefer concrete actions over abstract quality words.
    • Bad: 加固默认系统提示词和内置工具描述。
    • Better: 优化默认系统提示词与内置工具描述,避免 Agent 阻塞后台任务。
  • Name concrete files or config keys when it helps clarity.
    • Bad: 插件现在可以在其清单中声明 hooks。
    • Better: 插件现支持在 kimi.plugin.json 中声明生命周期 hooks。
  • Include required argument placeholders in CLI options.
    • Bad: --allowed-host
    • Better: --allowed-host <host>
  • Keep usage hints to one short clause.
    • Bad: 传入 --allowed-host 以允许额外的 host。例如 ... (多句展开)
    • Better: 例如 kimi web --allowed-host example.com。
  • Do not translate technical identifiers: keep command names, flag names, file names, env vars, config keys, and the web: scope prefix as-is.

Example — translating a feature entry:

English source:

- Add a --allowed-host flag to kimi web that lets extra Host header values pass the DNS-rebinding check, and include allow guidance in the 403 error message. Pass --allowed-host <host> to allow an extra host.

Before (literal, wordy):

- 为 `kimi web` 新增 `--allowed-host` 标志,允许额外的 Host 请求头值通过 DNS 重绑定检查,并在 403 错误消息中包含允许指引。传入 `--allowed-host <host>` 以允许额外的 host。例如 `kimi web --allowed-host example.com`。

After (concise, idiomatic):

- `kimi web` 新增 `--allowed-host <host>` 选项,可将指定 Host 加入 DNS 重绑定白名单;403 错误会提示如何通过 `--allowed-host` 或 `KIMI_CODE_ALLOWED_HOSTS` 放行,例如 `kimi web --allowed-host example.com`。

7. Verify

Review:

git diff docs/en/release-notes/changelog.md docs/zh/release-notes/changelog.md

Check:

  • Versions and version counts match between English and Chinese.
  • Every version heading carries its release date from the published tag, with half-width parentheses in English and full-width in Chinese.
  • Each version has the same section set and order on both pages.
  • Each section has the same number of entries on both pages.
  • Within each section, the most valuable, obvious, and larger entries appear before smaller or narrower entries.
  • PR links and commit hashes were stripped.
  • Real internal identifiers were replaced with neutral placeholders.
  • There are no empty sections.
  • Markdown indentation and blank lines are intact.

Then run the docs build:

pnpm --filter docs run build

8. Human Review Checkpoint

After verification passes, before committing, ask the user whether they want to review the sync result. Use AskQuestion with options such as:

  • Review first — show the diff and wait for the user to finish checking.
  • Skip review, commit and open PR — proceed directly to steps 9 and 10.

If the user chooses review:

  1. Show the uncommitted diff:

    git diff docs/en/release-notes/changelog.md docs/zh/release-notes/changelog.md
    
  2. Summarize synced versions, section counts, and anything that needed manual classification.

  3. Tell the user to reply when they are done reviewing, or to ask for edits.

  4. Do not commit, push, or open a PR until the user explicitly says review is complete, or asks to proceed.

If the user requests edits during review, make the changes, re-run verification from step 7, and return to this checkpoint.

9. Commit

Only run this step when the user skipped review or confirmed review is complete.

Stage only the changelog docs files:

git add docs/en/release-notes/changelog.md docs/zh/release-notes/changelog.md

Use a neutral docs-sync commit message:

docs(changelog): sync <version range> from apps/kimi-code/CHANGELOG.md

Do not create a changeset for changelog docs sync. Docs sync does not enter the bundle.

10. Push And Open PR

Run immediately after step 9.

Push the branch:

git push -u origin HEAD

Create the PR with gh pr create. Title follows Conventional Commits:

docs(changelog): sync <version range> from apps/kimi-code/CHANGELOG.md

Fill in .github/pull_request_template.md. For changelog sync PRs:

  • Related Issue: write N/A — post-release docs maintenance (no issue required).
  • Problem: the docs-site changelog is behind the published CLI release(s).
  • What changed: list synced version(s), note English source + Chinese translation, and mention verification (pnpm --filter docs run build).
  • Checklist: check CONTRIBUTING; explain no issue, no tests, no changeset, and that gen-docs is not needed because this is the dedicated changelog sync flow.

Example body:

## Related Issue

N/A — post-release docs maintenance

## Problem

The docs-site changelog has not yet been synced for `<version range>` after the npm release.

## What changed

- Synced `<version range>` from `apps/kimi-code/CHANGELOG.md` into `docs/en/release-notes/changelog.md`
- Translated the new English increment into `docs/zh/release-notes/changelog.md`
- Verified with `pnpm --filter docs run build`

## Checklist

- [x] I have read the CONTRIBUTING document.
- [x] I have linked a related issue, or explained the problem above.
- [ ] I have added tests that prove my feature works. (N/A — docs-only sync)
- [x] Ran `gen-changesets` skill, or this PR needs no changeset. (No changeset — docs sync is out of bundle)
- [x] Ran `gen-docs` skill, or this PR needs no doc update. (This PR is the dedicated changelog sync)

Return the PR URL to the user when done.

Rules

  • The English docs changelog is the source of truth.
  • Never edit upstream apps/kimi-code/CHANGELOG.md.
  • Do not backfill unreleased .changeset/*.md drafts into the docs site.
  • Prefix web UI entries with web: (when the upstream commit touches apps/kimi-web/), and keep the prefix on both the English and Chinese pages.
  • If upstream wording is wrong, leave upstream alone and fix it in a future changeset.
  • Always sync on a docs/changelog-sync-* branch and open a PR; never push changelog docs sync directly to main.
  • Wait for the human review checkpoint before committing, pushing, or opening a PR.

Common Mistakes

Mistake Fix
Adding entries directly to the English docs page without reading upstream Use apps/kimi-code/CHANGELOG.md as the source
Copying PR links or commit hashes into docs Strip them; keep only body text
Rewording upstream English entries Upstream is frozen; copy the body text unless the user explicitly asks otherwise
Leaving English text untranslated in the Chinese page The Chinese page must be fully Chinese except preserved technical terms
Editing upstream changelog text Do not edit upstream
Losing two-space indentation in multi-line list items Restore indentation so Markdown lists stay valid
Copying ### Patch Changes into docs Remove changesets headings and classify under Features / Bug Fixes / Polish / Refactors / Other
Guessing unclear entries as Features Inspect commit/PR; if still unclear, use Other
Treating any Add ... line as Features If the entry only adds a small element to an existing UI/surface, use Polish
Filing UX or performance tweaks under Other Use Polish for user-visible improvements to existing functionality
Preserving upstream order when a small entry hides a larger change Reorder within the section so the highest-value, most obvious items appear first
Reclassifying entries while translating Chinese classification must mirror English
Leaving empty sections Delete sections with no entries
Putting everything under Other for convenience Classify what can be classified first
Translating tool names, command names, or config keys Keep them as written
Creating a changeset for docs sync Do not create one
Committing or pushing directly on main Create docs/changelog-sync-<version>, commit there, then open a PR
Committing or opening a PR before the user skips review or confirms review is done Wait at the human review checkpoint
Using curly quotes or half-width Chinese punctuation Follow docs/AGENTS.md
Omitting the release date from a version heading, or guessing it Add (YYYY-MM-DD) (full-width () in Chinese) taken from the published tag
Forgetting or translating the web: prefix on web UI entries Prefix web UI entries (commit touches apps/kimi-web/) with web: on both pages; keep the prefix as-is when translating

Stop Signals

  • The top version in apps/kimi-code/CHANGELOG.md is not published on npm or GitHub Releases.
  • You are about to edit apps/kimi-code/CHANGELOG.md.
  • You are about to add docs sync to a changeset.
  • English and Chinese versions, entry counts, or section sets do not match.
  • A section is empty.
  • A Chinese term is uncertain and docs/AGENTS.md does not answer it.
  • A docs/changelog-sync-* branch already exists for the same version and you cannot confirm whether it is stale.
  • The user asked to review but has not yet confirmed review is complete.

Version History

  • 4963c90 Current 2026-07-06 00:01

Same Skill Collection

.agents/skills/gen-changesets/SKILL.md
.agents/skills/gen-docs/SKILL.md
.agents/skills/pre-changelog/SKILL.md
.agents/skills/translate-docs/SKILL.md
.agents/skills/write-tui/SKILL.md
plugins/official/kimi-datasource/SKILL.md

Metadata

Files
0
Version
4963c90
Hash
c24f762e
Indexed
2026-07-06 00:01

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 23:17
浙ICP备14020137号-1 $Carte des visiteurs$