Community寫作與編輯github.com

MoonshotAI/gen-docs

在影響產品行為或用戶體驗的實質性程式碼變更後更新 Kimi Code CLI 使用者文件。

gen-docs 是什麼?

此技能用於在程式碼庫發生影響產品行為或用戶體驗的變更時,自動化更新 Kimi Code CLI 的雙語使用者文件。它專注於維持 `docs/en/` 和 `docs/zh/` 目錄下的文件同步,尤其針對非更新日誌頁面進行鏡像同步,而更新日誌則需從英文手動翻譯至中文。技能會根據 Git 歷史、差異和變更集檔案來檢查使用者可見的影響,然後同步英文更新日誌,根據 `docs/AGENTS.md` 中的術語表和風格指南更新相關頁面,最後調用 `translate-docs` 技能來同步雙語內容。此技能支援 Claude Code 等 AI 代理平台,透過嚴格的規則防止常見錯誤,例如在範例中使用真實的內部值或發明新的術語,確保文件準確且維護良好。

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

Installed? Explore more 寫作與編輯 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜歡的 AI 中提問

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

說明文件

生成文件

概述

此儲存庫在 docs/ 目錄下維護雙語使用者文件。docs/en/ 和 docs/zh/ 對於大多數頁面是鏡像對;請在同一變更中同時更新兩者。更新日誌是例外 — 英文是原始來源,中文從英文翻譯而來。

每當程式碼庫發生影響產品行為或用戶體驗的變更時,請使用此技能來更新對應的文件。

若要進行完整的發布前審核(偵測幻覺和涵蓋範圍缺口),請改用 audit-docs 技能。

先決條件

此技能依賴於以下條件。如果其中任何一項缺失,請停止並向使用者報告,然後再繼續:

  • docs/ 目錄,其中包含 docs/zh/、docs/en/ 和 docs/.vitepress/config.ts(VitePress 網站)。
  • docs/AGENTS.md 風格指南 — 定義事實來源規則、術語表、排版和寫作風格。
  • docs/scripts/sync-changelog.mjs — 自動將根目錄 CHANGELOG.md 同步至 docs/en/release-notes/changelog.md。
  • translate-docs 技能位於 .agents/skills/ — 處理雙語同步。

工作流程

  1. 檢查變更

    • git log main..HEAD --oneline — 目前分支上的提交
    • git diff main..HEAD --stat — 檔案層級的範圍
    • ls .changeset/*.md(排除 README.md)— 待處理的 changeset 條目
    • 閱讀 CHANGELOG.md 和任何子套件 packages/*/CHANGELOG.md 以獲取已記錄的條目。
  2. 了解使用者可見的影響

    對於每個變更,必要時請閱讀實際的實作程式碼;請勿僅從提交訊息或 PR 標題推斷行為。跳過:

    • 沒有外部可見行為變更的內部重構
    • 測試、CI、僅類型變更
    • 不改變使用者呼叫 CLI 方式的工具/建置系統變更

    如果在掃描後斷定沒有使用者可見的影響,請說明並停止。

  3. 同步英文更新日誌

    執行:

    node docs/scripts/sync-changelog.mjs
    

    這會將 docs/en/release-notes/changelog.md 從根目錄的 CHANGELOG.md 更新。切勿手動編輯文件更新日誌。

  4. 更新使用者文件

    遵循 docs/AGENTS.md 中的規則,編輯您正在處理的地區設定中的受影響頁面,然後同步鏡像。比對 docs/AGENTS.md 中的術語表和周圍頁面中現有的措辭。

    涵蓋所有相關章節:

    • 指南(入門、使用案例、互動、工作階段、IDE 整合)
    • 自訂(技能、代理、MCP、掛鉤、外掛程式等)
    • 配置(設定檔、環境變數、提供者、資料位置)
    • 參考(CLI 子命令、斜線命令、鍵盤快捷鍵)
    • 發行說明(如果涉及重大變更,則更新 docs/zh/release-notes/breaking-changes.md)
  5. 同步雙語內容

    調用 translate-docs 技能。它將:

    • 在 docs/en/ 和 docs/zh/ 之間同步已更新的非更新日誌頁面
    • 將英文更新日誌翻譯成中文,並置於 docs/zh/release-notes/changelog.md

規則與慣例

  • 地區同步:非更新日誌頁面在 docs/en/ 和 docs/zh/ 之間保持鏡像。更新日誌的流程是英文 → 中文。
  • 術語:嚴格使用 docs/AGENTS.md 中的術語表。不要發明新的翻譯或使用同義詞。
  • 範圍紀律:僅更新受近期變更影響的章節。不要投機取巧地重寫不相關的文件。
  • 公開範例:切勿將真實的內部端點、金鑰名稱、帳戶名稱或服務名稱寫入文件。使用中性佔位符,例如 https://api.example.com/v1、https://registry.example.com/v1/models/api.json、example.test 和 YOUR_API_KEY。
  • 重大變更:如果任何變更是破壞性的,也請更新 docs/en/release-notes/breaking-changes.md(在 ## Unreleased 下),包含 **受影響** + **遷移** 小節,並在 docs/zh/release-notes/breaking-changes.md 中鏡像它。
  • 請勿編輯自動同步的檔案:docs/en/release-notes/changelog.md 由同步腳本重新產生;任何手動編輯都將被覆蓋。

常見錯誤

  • 描述程式碼變更的內容,而不是使用者現在可以(或不能再)做什麼。
  • 每個功能都新增一個新的章節標題,而不是將變更融入現有文字中。
  • 僅更新一個地區設定,而讓其鏡像停滯。
  • 僅編輯鏡像來修復應在您首先變更的地區設定中修正的措辭。
  • 發明偏離 docs/AGENTS.md 術語表的新術語。
  • 在範例中使用真實的內部值,而不是中立的 example 佔位符。

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

相關技能