Community程式設計與開發github.com

MoonshotAI/gen-changesets

用於在 kimi-code 儲存庫中產生 changeset,包括選擇套件 bump 等級、處理內部套件與 CLI 綑綁、主要版本確認以及英文 changelog 撰寫規則。

gen-changesets 是什麼?

此技能專門為 kimi-code 專案管理版本與 changelog 而設計。它能自動化產生 changeset 檔案,涵蓋 bump 等級選擇、內部套件與 CLI 綑綁處理、主要版本確認、以及英文 changelog 撰寫。使用者必須先檢查實際變更的套件,判斷哪些套件會被 changeset 忽略(例如 @moonshot-ai/kimi-web),並將內部的 CLI 綑綁變更對應到 @moonshot-ai/kimi-code。技能支援 patch、minor、major 三種 bump 等級,且對於 major 有嚴格規範——必須先獲得使用者明確同意。此技能僅適用於 kimi-code 儲存庫,並能處理相依性(如 @moonshot-ai/pi-tui)與 web 應用變更等特殊情況。

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

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

產生 Changesets

kimi-code 使用 changesets 來管理版本與 changelog。目前對外的發佈套件為:

  • @moonshot-ai/kimi-code:CLI

所有其他 @moonshot-ai/* 套件均視為內部套件,包含 @moonshot-ai/kimi-code-sdk、agent-core、kosong、kaos、kimi-code-oauth、kimi-telemetry 以及 migration-legacy。

@moonshot-ai/pi-tui 是一個特殊的內部套件:它是私人 fork(private: true),永遠不會發佈,但會透過 changesets 維護自己的 changelog,是核心規則 4 的例外情況——請參閱下方專章。

核心規則

  1. 先檢查實際變更。 使用 git status / git diff --name-only 來識別實際被更動的套件。
  2. 列出可透過 changesets 發佈的套件。 如果某個被更動的套件在 .changeset/config.json 中被忽略,請不要將該忽略套件與非忽略套件一起放在 frontmatter 中;changesets 拒絕混合被忽略與未被忽略的 frontmatter。
  3. 將被忽略的內部變更對應到受影響的已發佈套件。 如果被忽略的內部套件變更影響了 CLI 輸出或行為,請列出 @moonshot-ai/kimi-code,並在 changelog 文字中描述實際對使用者可見或對發佈 artifact 的變更。
  4. 進入 CLI 綑綁的內部套件原始碼變更必須手動列出 CLI。 @moonshot-ai/kimi-code 內聯綑綁了 @moonshot-ai/* 的原始碼,但這些內部套件從 CLI 的角度來看是 devDependencies,因此 changesets 不會自動傳播 bump。如果變更影響了 CLI 輸出,請列出 @moonshot-ai/kimi-code。
    • Web 應用程式 (@moonshot-ai/kimi-web) 的變更一定會進入 CLI 綑綁。 @moonshot-ai/kimi-web 會被 changesets 忽略(請參閱 .changeset/config.json),且不能與 @moonshot-ai/kimi-code 混合在一個 changeset frontmatter 中。請在 changelog 文字中描述 web 變更,但列出 @moonshot-ai/kimi-code,以便 CLI 發佈時攜帶綑綁的 dist-web 輸出。
  5. 僅限文件與測試的變更通常不需要 changeset。 README、內部文件以及不進入套件輸出的 test/ 變更不會觸發 CLI bump。
  6. @moonshot-ai/vis / vis-server / vis-web 會被 changesets 忽略,不應處理。@moonshot-ai/kimi-inspect(一個從不發佈的私人開發應用程式)同樣被忽略,且絕對不能出現在 changeset frontmatter 中。

工作流程

  1. 列出被變更的套件,並檢查每個套件是否被 .changeset/config.json 忽略。
  2. 為每個套件選擇 bump 等級。
  3. 如果被忽略的內部套件變更進入 CLI 綑綁,請在 frontmatter 中放置 @moonshot-ai/kimi-code,而非將被忽略套件混入相同 changeset。
  4. 在 .changeset/ 下建立一個簡短的 kebab-case 檔案。
  5. 將不相關的變更拆分為獨立的 changeset;每個檔案只保留一個邏輯變更。

格式:

---
"<package A>": patch
"<package B>": minor
---

<英文 changelog 條目>

Bump 等級

等級使用時機
patch錯誤修正;建構/套件修正;不改變行為的內部重構;用詞調整;小型依賴升級;對現有功能的小幅改進且對使用者影響有限(例如新的鍵盤快捷鍵、標誌別名、微小的 UX 調整)
minor重要的新使用者面向功能,例如新的斜線命令、新的內建工具或新模式
major破壞性變更:不相容的設定變更、重新命名或移除的命令/參數、行為語意變更等

若在 patch 與 minor 之間猶豫:如果變更改進了現有功能且對使用者的影響很小,即使變更技術上算是「新的」,也請選擇 patch。將 minor 保留給引入使用者從前無法做到的重要新能力。

主要版本規則

請勿自行撰寫 major。

若你認為某項變更屬於 major,請先暫停,說明原因,並詢問使用者確認。僅在使用者明確同意後才能撰寫 major。如果使用者未回覆、回覆含糊不清或不同意,則改為 minor;若 minor 也不明確,則改為 patch。

用詞規則

  • Changelog 條目必須使用英文撰寫。
  • 保持條目精簡。 目標是一個簡短的句子說明做了什麼;最多一個短句加上一行的使用提示。請勿寫成段落、不要堆砌技術細節,也不要列舉每個子變更。
  • 針對新的使用者面向功能,附加簡短的使用提示,讓使用者知道如何試用。保持在一行內——命令名稱、子命令、標誌或一行的「如何使用」。請勿解釋設計原理或列出邊界案例。錯誤修正、內部變更與重構則略過提示。
    • 斜線命令:Add the /foo slash command to list active sessions. Run /foo to see them.
    • CLI 子命令:Add the kimi web subcommand to open the web UI. Run kimi web to launch it.
    • 標誌:Add a --bar flag to skip confirmation prompts. Pass --bar to skip.
    • 過長:Add the /foo command to list active sessions. It accepts an optional --all flag to include background sessions, supports filtering by name with /foo <name>, and writes the result to the transcript...
  • 使用者面向的 CLI 用詞僅在 CLI 使用者能感知到變更時使用。
  • 不影響 CLI 使用者的內部變更仍可與 CLI 共享一個 changeset,但用詞必須誠實描述實際變更,且不得將其描述為使用者面向的功能。
  • 請勿提及檔案名稱、類別名稱、函式名稱、PR 編號或 commit hash。
  • 請勿包含真實的內部端點、金鑰名稱、帳戶名稱或服務名稱。如需範例,請使用中性預留位置,例如 example.com、example.test 或 YOUR_API_KEY。
  • 避免使用模糊詞語,如 refactor、optimize 與 improve。請描述實際變更,或使用更具體的用詞。

當你對某項變更不確定時

根據 diff 明確顯示的內容來產生 changeset。如果部分變更不明確,且你無法自信地描述它對使用者的影響,請勿猜測或用模糊用詞填充條目。

  1. 針對明確的部分完成 changeset。
  2. 然後向使用者提問一次,以簡短列表形式:指出你不理解的具體變更,並詢問是否可以深入儲存庫(閱讀相關原始碼、測試或呼叫位置)以更準確地描述。
  3. 僅在使用者同意後才能讀取更多程式碼。如果使用者拒絕或未回覆,保持你已有的簡潔用詞,不要編造細節。

常見範例

內部套件修正了一個對 CLI 使用者可見的錯誤:

---
"@moonshot-ai/kimi-code": patch
---

Fix occasional loss of tool call results in long conversations.

新的使用者面向斜線命令(注意簡短的使用提示):

---
"@moonshot-ai/kimi-code": minor
---

Add the /foo slash command to list active sessions. Run /foo to see them.

新的 CLI 子命令:

---
"@moonshot-ai/kimi-code": minor
---

Add the kimi web subcommand to open the web UI. Run kimi web to launch it.

現有命令的新標誌:

---
"@moonshot-ai/kimi-code": patch
---

Add a --bar flag to skip confirmation prompts. Pass --bar to skip.

內部套件有僅限內部的變更,但進入了 CLI 綑綁:

---
"@moonshot-ai/kimi-code": patch
---

Unify tool execution metadata handling.

僅 SDK 原始碼變更,且 CLI 未使用:

---
"@moonshot-ai/kimi-code-sdk": patch
---

Clarify session status typing for internal SDK callers.

Web 應用程式變更

@moonshot-ai/kimi-web 會被 changesets 忽略,且絕對不能出現在 changeset frontmatter 中。由於 web 應用程式被綑綁進 CLI 發佈 artifact,任何需要發佈的 web 變更都必須改為列出 @moonshot-ai/kimi-code,並在文字中描述實際對 web 的變更。

  • 在 changelog 條目文字前加上 web: 前綴(例如 web: Fix the chat not scrolling to the bottom after sending a message.),以便同步的文件 changelog 能標記 web UI 條目。每當變更涉及 web 專案(@moonshot-ai/kimi-web)時皆應套用此規則。
  • 如果一個 PR 發佈了由伺服器 API 變更支援的 web UI 功能,且該 API 僅為支援該功能而存在,則優先使用單一 web: 條目描述 web 使用者獲得的功能。除非 API 本身具有獨立的價值(SDK 或伺服器消費者直接呼叫的公開端點),否則不要額外新增伺服器 API 的 changeset。文件 changelog 同步也會對這種模式進行去重,但在這裡捕捉可以避免重複的 changeset。
  • 請勿列舉每個微調,保持一個描述 web 使用者獲得內容的句子。

僅限 web 的修正:

---
"@moonshot-ai/kimi-code": patch
---

web: Fix the chat not scrolling to the bottom after sending a message.

同一 PR 中的 web UI 加上支援的伺服器 API(優先使用單一 web: 條目;API 只是管線):

---
"@moonshot-ai/kimi-code": minor
---

web: Add the server-hosted web UI, including chat layout and session list behaviors.

僅在 API 本身具有獨立價值時才拆分為兩個 changeset(例如 SDK 使用者直接呼叫的公開端點)。在這種情況下,除了上方 web 條目之外,再加上一個獨立的條目,例如 Add a public REST API to list archived sessions for SDK consumers.

@moonshot-ai/pi-tui 變更

@moonshot-ai/pi-tui 是一個位於 packages/pi-tui 的供應商 fork。它是 private: true,永遠不會發佈,但不會被 changesets 忽略:changesets 會對其進行版本管理並寫入 packages/pi-tui/CHANGELOG.md,以便 fork 維護自己的歷史記錄。由於它像其他內部套件一樣被綑綁進 CLI,因此是核心規則 4 的例外情況——對於僅影響 pi-tui 的變更,請勿列出 @moonshot-ai/kimi-code。

  • 僅影響 pi-tui 的變更(建構、套件、嚴格模式清理、渲染器修正):僅列出 @moonshot-ai/pi-tui。無需 CLI changeset。
  • 如果同一變更對 CLI 使用者也可見(例如 CLI 使用者能看到的終端機渲染修正),則在 pi-tui changeset 之外,另外新增一個列出 @moonshot-ai/kimi-code 且使用 CLI 聚焦用詞的 changeset。請勿將兩個套件混合在一個 frontmatter 中——兩個 changelog 需要不同的用詞。

僅限 pi-tui 的變更:

---
"@moonshot-ai/pi-tui": patch
---

Export the package manifest so the bundled binary can locate its native assets.

同時也在 CLI 中可見的 pi-tui 變更(兩個獨立的 changeset):

---
"@moonshot-ai/pi-tui": patch
---

Clamp the differential render to the visible viewport so scrolling up during streaming no longer jumps to the top.
---
"@moonshot-ai/kimi-code": patch
---

Fix the transcript jumping to the top when scrolling up through history during streaming output.

紅旗警示

  • 你即將在未詢問使用者的情況下撰寫 major。
  • 新的使用者面向功能條目沒有使用提示,或提示過長且解釋了設計原理。
  • 你對不理解的變更猜測用詞,而非詢問使用者是否可以深入儲存庫。
  • 內部套件原始碼進入 CLI 綑綁,但缺少 @moonshot-ai/kimi-code。
  • changeset frontmatter 混合了被忽略的內部套件與未忽略的套件。
  • packages/node-sdk 未被變更,但為了「內部套件同步」而列出了 @moonshot-ai/kimi-code-sdk。
  • Changelog 條目使用中文。
  • 用詞誇大了 diff 實際上所做的內容。
  • CLI 用詞提及內部套件名稱、類別名稱或 PR 編號。
  • 條目包含真實的內部識別碼,而非中性預留位置。
  • 僅影響 @moonshot-ai/pi-tui 的變更列出了 @moonshot-ai/kimi-code 而非 @moonshot-ai/pi-tui,或將兩個套件混合在一個 frontmatter 中。
  • Web 應用程式變更條目缺少 web: 前綴。
  • 伺服器/API changeset 僅用於支援已由 web: changeset 描述的 web 功能(除非 API 具有獨立價值,否則請使用一個 web: 條目)。

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-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/sync-changelog

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.

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

相關技能