Communityコーディング&開発github.com

MoonshotAI/gen-changesets

kimi-code リポジトリで changesets を生成する際に使用します。パッケージのバンプ選択、内部パッケージと CLI バンドルの処理、バンプレベル、メジャー確認、英語のチェンジログの文言作成を含みます。

gen-changesets とは?

このスキルは、MoonshotAI の kimi-code リポジトリにおいて、changesets を用いたバージョン管理とチェンジログ生成を自動化・支援するためのものです。公開パッケージ `@moonshot-ai/kimi-code` と、それにバンドルされる内部パッケージ(`@moonshot-ai/kimi-code-sdk`, `agent-core` など)の変更を適切に処理します。スキルの核心は、内部パッケージの変更が CLI のバンドルに影響を与えるかどうかを判断し、changesets が自動的にバンプを伝播しないケースでも正しく `@moonshot-ai/kimi-code` を frontmatter にリストすることです。また、`major` バンプの適用はユーザー確認を必須とし、英語のチェンジログエントリには簡潔さと具体的な表現を求め、ユーザー向け新機能には短い使用ヒントを付加します。`@moonshot-ai/kimi-web` や `@moonshot-ai/pi-tui` といった特殊なパッケージの扱いについても明確なルールを提供しており、複雑なモノレポ構成におけるチェンジログ管理の一貫性と正確性を実現します。

対応~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に質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Changesets の生成

kimi-code は changesets を使用してバージョンとチェンジログを管理します。現在ユーザー向けに公開されているパッケージは次のとおりです:

  • @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 は特別な内部パッケージです。これは決して公開されないプライベートフォーク(private: true)ですが、changesets を通じて独自のチェンジログを保持します。これは基本ルール 4 の例外であり、以下の専用セクションを参照してください。

基本ルール

  1. 最初に実際の変更を確認する。 git status / git diff --name-only を使用して、どのパッケージが実際に変更されたかを特定します。
  2. changesets でリリース可能なパッケージをリストする。 変更されたパッケージが .changeset/config.json で無視されている場合、その無視されたパッケージを無視されていないパッケージと同じ frontmatter に配置しないでください。changesets は無視/非無視の混合 frontmatter を拒否します。
  3. 無視された内部変更を、影響を受けるリリースパッケージにマッピングする。 無視された内部パッケージが CLI の出力や動作を変更する場合、@moonshot-ai/kimi-code をリストし、チェンジログのテキストで実際のユーザーが見える変更またはリリース成果物の変更を説明します。
  4. CLI バンドルに取り込まれる内部パッケージのソース変更は、手動で CLI をリストする必要がある。 @moonshot-ai/kimi-code は @moonshot-ai/* のソースをインラインバンドルしますが、これらの内部パッケージは CLI から見ると devDependencies であるため、changesets は自動的にバンプを伝播しません。変更が CLI の出力に影響する場合は、@moonshot-ai/kimi-code をリストします。
    • Web アプリ(@moonshot-ai/kimi-web)の変更は常に CLI バンドルに取り込まれる。 @moonshot-ai/kimi-web は changesets によって無視され(.changeset/config.json 参照)、1 つの changeset の frontmatter で @moonshot-ai/kimi-code と混在させることはできません。Web の変更をチェンジログのテキストで説明しますが、@moonshot-ai/kimi-code をリストして、CLI リリースがバンドルされた dist-web 出力を保持するようにします。
  5. ドキュメントのみの変更やテストのみの変更は、通常 changeset を必要としない。 README、内部ドキュメント、およびパッケージ出力に影響を与えない test/ の変更は、CLI のバンプをトリガーしません。
  6. @moonshot-ai/vis / vis-server / vis-web は changesets によって無視されており、処理するべきではありません。@moonshot-ai/kimi-inspect(決して出荷されないプライベート dev アプリ)も同様に無視され、changeset の frontmatter に決して現れてはなりません。

ワークフロー

  1. 変更されたパッケージをリストし、各パッケージが .changeset/config.json によって無視されているかどうかを確認します。
  2. 各パッケージのバンプレベルを選択します。
  3. 無視された内部パッケージの変更が CLI バンドルに取り込まれる場合、無視されたパッケージを同じ changeset に混在させる代わりに、frontmatter に @moonshot-ai/kimi-code を配置します。
  4. .changeset/ の下に短いケバブケースのファイルを作成します。
  5. 無関係な変更は別々の changeset に分割し、1 つの論理的な変更を 1 つのファイルに保持します。

フォーマット:

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

<英語のチェンジログエントリ>

バンプレベル

レベル使用するタイミング
patchバグ修正; ビルド/パッケージ修正; 動作を変更しない内部リファクタリング; 文言の微調整; 小規模な依存関係のアップグレード; ユーザーへの影響が限定的な既存機能の小規模な改善(例:新しいキーボードショートカット、フラグのエイリアス、マイナーな UX 調整)
minor実質的な新しいユーザー向け機能。例:新しいスラッシュコマンド、新しいビルトインツール、新しいモード
major破壊的変更:互換性のない設定変更、コマンド/引数の名前変更や削除、動作セマンティクスの変更など

patch と minor の間で迷った場合:変更が既存の機能を改善し、ユーザーへの影響が小さい場合は、技術的に「新しい」変更であっても patch を選択してください。minor は、ユーザーが以前はできなかったことを可能にする実質的な新しい機能のために予約します。

メジャールール

自分で major を書いてはいけません。

変更がメジャーに該当すると思われる場合、まず停止し、理由を説明し、ユーザーに確認を求めてください。ユーザーが明示的に同意した後にのみ major を書いてください。ユーザーが返信しない、あいまいに返信する、または同意しない場合は、minor にフォールバックします。minor も不明な場合は、patch にフォールバックします。

文言ルール

  • チェンジログエントリは 英語で書かれていなければなりません。
  • エントリ全体を簡潔に保つ。 何が行われたかを述べる短い 1 文を目指し、多くても短い 1 文と 1 行の使用ヒントに留めてください。段落を書いたり、技術的な詳細を積み重ねたり、すべてのサブ変更を列挙したりしないでください。
  • 新しいユーザー向け機能の場合、簡単な使用ヒントを追加 して、ユーザーがどのように試すかを知らせます。短い 1 行(コマンド名、サブコマンド、フラグ、または「使用方法」の 1 行)に抑えてください。デザインの根拠を説明したり、エッジケースを列挙したりしないでください。バグ修正、内部変更、リファクタリングの場合はヒントを省略します。
    • スラッシュコマンド: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 番号、コミットハッシュを記載しないでください。
  • 実際の内部エンドポイント、キー名、アカウント名、サービス名を含めないでください。例が必要な場合は、example.com、example.test、YOUR_API_KEY などの中立なプレースホルダーを使用します。
  • refactor、optimize、improve などのあいまいな言葉は避けてください。実際の変更を説明するか、より具体的な文言を使用します。

変更について確信が持てない場合

diff が明確に示す内容から changeset を生成します。変更の一部が不明確で、ユーザーに対して何を行うかを自信を持って説明できない場合、推測したり、あいまいな言葉でエントリを埋めたりしないでください。

  1. 明確な部分については changeset を完了します。
  2. 次に、ユーザーに一度だけ短いリストで質問します。理解できない特定の変更に名前を付け、リポジトリを調査して(関連するソース、テスト、呼び出し箇所を読んで)より正確に説明してもよいか尋ねます。
  3. ユーザーが同意した場合にのみ、さらにコードを読んでください。ユーザーが拒否した場合、または返信しない場合は、すでに持っている簡潔な文言を保持し、詳細を invent しないでください。

一般的な例

内部パッケージが 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 リリース成果物にバンドルされるため、出荷される Web の変更は代わりに @moonshot-ai/kimi-code をリストし、テキストで実際の Web 向けの変更を説明する必要があります。

  • チェンジログエントリのテキストの先頭に web: を付けます(例:web: Fix the chat not scrolling to the bottom after sending a message.)。これにより、同期されたドキュメントのチェンジログが Web UI のエントリをマークできるようになります。変更が Web プロジェクト(@moonshot-ai/kimi-web)に対するものである場合は常にこれを適用します。
  • PR が、その機能を支えるためだけに存在するサーバー API 変更を伴う Web UI 機能を出荷する場合、Web ユーザーが得るものを説明する単一の web: エントリを優先します。サーバー API に独立したユーザー価値がある場合(SDK やサーバーコンシューマーが直接呼び出す公開エンドポイント)を除き、別のサーバー API の changeset を追加しないでください。ドキュメントのチェンジログ同期もこのパターンを重複排除しますが、ここで捕捉することで重複した changeset を避けられます。
  • すべてのマイクロ調整を列挙しないでください。Web ユーザーが得るものを捉えた 1 文に留めます。

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 にそれ自体で独立したユーザー価値がある場合(例:SDK コンシューマーが直接呼び出す公開エンドポイント)にのみ、2 つの changeset に分割します。その場合、上記の web エントリに加えて、Add a public REST API to list archived sessions for SDK consumers. などの別のエントリを追加します。

@moonshot-ai/pi-tui の変更

@moonshot-ai/pi-tui は packages/pi-tui にあるベンダーフォークです。private: true であり、決して公開されませんが、changesets によって無視されては いません。changesets はこれをバージョニングし、packages/pi-tui/CHANGELOG.md を書き込んで、フォークが独自の履歴を保持できるようにします。これは他の内部パッケージと同様に CLI にバンドルされるため、基本ルール 4 の例外です。pi-tui のみに影響する変更に対して @moonshot-ai/kimi-code をリストしては いけません。

  • pi-tui のみに影響する変更(ビルド、パッケージ、strick-mode クリーンアップ、レンダラー修正):@moonshot-ai/pi-tui のみをリストします。CLI の changeset は不要です。
  • 同じ変更が CLI でもユーザーに見える場合(例:CLI ユーザーが見ることができる端末レンダリング修正)、pi-tui の changeset に加えて、@moonshot-ai/kimi-code を CLI に焦点を当てた文言でリストした 別の changeset を追加します。両方のパッケージを 1 つの frontmatter に混在させないでください。2 つのチェンジログは異なる文言を必要とします。

pi-tui のみの変更:

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

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

pi-tui の変更であり、CLI でも見える場合(2 つの別々の 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 がリストされている。
  • チェンジログエントリが中国語である。
  • 文言が diff が実際に行ったこと以上を主張している。
  • CLI の文言に内部パッケージ名、クラス名、PR 番号が含まれている。
  • エントリに、中立的なプレースホルダーの代わりに実際の内部識別子が含まれている。
  • @moonshot-ai/pi-tui のみに触れる変更が、@moonshot-ai/pi-tui の代わりに @moonshot-ai/kimi-code をリストしている、または両方のパッケージを 1 つの frontmatter に混在させている。
  • Web アプリの変更エントリに web: プレフィックスが欠落している。
  • web: の changeset が既に説明している Web 機能を支えるためだけにサーバー/API の changeset が存在する(API に独立したユーザー価値がない限り、代わりに 1 つの 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).

関連スキル