Community写作与编辑github.com

MoonshotAI/gen-docs

在影响产品行为或用户体验的代码变更后,更新 Kimi Code CLI 用户文档。

gen-docs 是什么?

该技能(MoonshotAI/gen-docs)专为 Kimi Code CLI 的文档维护设计,确保用户文档与产品行为变更保持同步。它适用于任何影响产品行为或用户体验的代码变更,能够自动或半自动地更新中文和英文双语文档。该技能支持 VitePress 构建的文档站点,并依赖于 `docs/AGENTS.md` 风格指南和 `translate-docs` 技能来实现双语同步。其工作流程包括检查代码变更、评估用户影响、同步英文变更日志、更新用户文档(如指南、自定义、配置、参考和发布说明),最后调用 `translate-docs` 技能同步双语内容。该技能严格遵循术语表,禁止手动编辑自动同步的文件,并避免常见错误,例如仅更新单一语言版本或使用真实内部值作为示例。

兼容平台~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
    

    这会从根目录的 CHANGELOG.md 更新 docs/en/release-notes/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 下添加 **Affected** 和 **Migration** 小节),并在 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).

相关技能