From c9fba27a2cf382f06ed47936e3cefd6b47295cbf Mon Sep 17 00:00:00 2001 From: liruifengv Date: Wed, 15 Jul 2026 11:28:46 +0800 Subject: [PATCH 1/4] feat(agent-core): add check-kimi-code-docs builtin skill --- .../src/skill/builtin/check-kimi-code-docs.md | 44 +++++++++++++++++++ .../src/skill/builtin/check-kimi-code-docs.ts | 22 ++++++++++ .../agent-core/src/skill/builtin/index.ts | 3 ++ .../test/skill/builtin-update-config.test.ts | 35 ++++++++++++++- 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 packages/agent-core/src/skill/builtin/check-kimi-code-docs.md create mode 100644 packages/agent-core/src/skill/builtin/check-kimi-code-docs.ts diff --git a/packages/agent-core/src/skill/builtin/check-kimi-code-docs.md b/packages/agent-core/src/skill/builtin/check-kimi-code-docs.md new file mode 100644 index 0000000000..f64d179fe9 --- /dev/null +++ b/packages/agent-core/src/skill/builtin/check-kimi-code-docs.md @@ -0,0 +1,44 @@ +--- +name: check-kimi-code-docs +description: Answer questions about the Kimi Code product using the official documentation — CLI usage, configuration, slash commands, features, membership and quota, API onboarding, third-party tool setup, and error codes. Use when the user asks how Kimi Code works, how to set something up, or what a Kimi Code error message means. +--- + +# Check Kimi Code docs (check-kimi-code-docs) + +Answer Kimi Code **product** questions from the official documentation site, not from memory. This skill covers product usage ("how do I configure a provider", "what does this error mean", "how does membership quota work"); it is not for developing the Kimi Code repository itself. + +## The single source of truth + +Official documentation (English): + +``` +https://www.kimi.com/code/docs/en/ +``` + +Fetch pages with **FetchURL** before answering. All page links below are relative to this base. + +## Which page to read for which question + +| Question topic | Page (relative to the base URL) | +| --- | --- | +| What Kimi Code is; Base URL / API Key; standard vs high-speed model; platform comparison | `./` (home overview) | +| Membership plans, quota and rate limits, fuel packs | `kimi-code/membership.html` | +| Install / login / usage FAQ | `kimi-code/faq.html` | +| Error codes and their meaning (e.g. 401 for high-speed model access) | `kimi-code/error-reference.html` | +| Product news and recent changes | `kimi-code/whats-new.html` | +| Community guidelines; contact and feedback | `kimi-code/community-guidelines.html`, `kimi-code/contact-and-feedback.html` | +| `config.toml` fields, providers/models, environment variables, data locations, config overrides | `kimi-code-cli/configuration/` — `config-files.html`, `providers.html`, `env-vars.html`, `data-locations.html`, `overrides.html` | +| Skills, MCP, hooks, plugins, themes, agents/sub-agents, Kimi Datasource | `kimi-code-cli/customization/` — `skills.html`, `mcp.html`, `hooks.html`, `plugins.html`, `themes.html`, `agents.html`; Kimi Datasource lives at `plugins.html#kimi-datasource` | +| Getting started, sessions and context, goals, interaction and input, IDEs, migration, use cases | `kimi-code-cli/guides/` — `getting-started.html`, `sessions.html`, `goals.html`, `interaction.html`, `ides.html`, `migration.html`, `use-cases.html` | +| Slash commands, keyboard shortcuts, builtin tools, `kimi` command flags, ACP | `kimi-code-cli/reference/` — `slash-commands.html`, `keyboard.html`, `tools.html`, `kimi-command.html`, `kimi-acp.html` | +| CLI changelog | `kimi-code-cli/release-notes/changelog.html` | +| Using Kimi Code in Claude Code and other third-party agents | `third-party-tools/other-coding-agents.html` | + +If no row fits the question, fetch the docs home page and follow its navigation links. + +## How to answer + +1. Pick the page from the table above. +2. **FetchURL the page before answering** — answer strictly from the fetched content, never from memory. +3. Cite the page link(s) you used at the end of the answer. +4. If the fetch fails or the docs do not cover the question, say so plainly: answer from what you already know, attach the docs entry link (`https://www.kimi.com/code/docs/en/`), and mark which parts you could not verify. **Never invent config keys, command names, model IDs, or product behaviors.** diff --git a/packages/agent-core/src/skill/builtin/check-kimi-code-docs.ts b/packages/agent-core/src/skill/builtin/check-kimi-code-docs.ts new file mode 100644 index 0000000000..f99275c710 --- /dev/null +++ b/packages/agent-core/src/skill/builtin/check-kimi-code-docs.ts @@ -0,0 +1,22 @@ +import { parseSkillText } from '../parser'; +import type { SkillDefinition } from '../types'; +import CHECK_KIMI_CODE_DOCS_BODY from './check-kimi-code-docs.md?raw'; + +const PSEUDO_PATH = 'builtin://check-kimi-code-docs'; + +const parsed = parseSkillText({ + skillMdPath: '/builtin/skills/check-kimi-code-docs.md', + skillDirName: 'check-kimi-code-docs', + source: 'builtin', + text: CHECK_KIMI_CODE_DOCS_BODY, +}); + +export const CHECK_KIMI_CODE_DOCS_SKILL: SkillDefinition = { + ...parsed, + path: PSEUDO_PATH, + dir: PSEUDO_PATH, + metadata: { + ...parsed.metadata, + type: parsed.metadata.type ?? 'inline', + }, +}; diff --git a/packages/agent-core/src/skill/builtin/index.ts b/packages/agent-core/src/skill/builtin/index.ts index a5150815e7..ff13ae84a8 100644 --- a/packages/agent-core/src/skill/builtin/index.ts +++ b/packages/agent-core/src/skill/builtin/index.ts @@ -1,4 +1,5 @@ import type { SessionSkillRegistry } from '../registry'; +import { CHECK_KIMI_CODE_DOCS_SKILL } from './check-kimi-code-docs'; import { CUSTOM_THEME_SKILL } from './custom-theme'; import { IMPORT_FROM_CC_CODEX_SKILL } from './import-from-cc-codex'; import { MCP_CONFIG_SKILL } from './mcp-config'; @@ -16,12 +17,14 @@ export function registerBuiltinSkills(registry: SessionSkillRegistry): void { registry.registerBuiltinSkill(UPDATE_CONFIG_SKILL); registry.registerBuiltinSkill(CUSTOM_THEME_SKILL); registry.registerBuiltinSkill(WRITE_GOAL_SKILL); + registry.registerBuiltinSkill(CHECK_KIMI_CODE_DOCS_SKILL); registry.registerBuiltinSkill(SUB_SKILL_PARENT); registry.registerBuiltinSkill(SUB_SKILL_REVIEW); registry.registerBuiltinSkill(SUB_SKILL_CONSOLIDATE); } export { + CHECK_KIMI_CODE_DOCS_SKILL, CUSTOM_THEME_SKILL, IMPORT_FROM_CC_CODEX_SKILL, MCP_CONFIG_SKILL, diff --git a/packages/agent-core/test/skill/builtin-update-config.test.ts b/packages/agent-core/test/skill/builtin-update-config.test.ts index 2b81983130..3231da6b64 100644 --- a/packages/agent-core/test/skill/builtin-update-config.test.ts +++ b/packages/agent-core/test/skill/builtin-update-config.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import { SessionSkillRegistry, UPDATE_CONFIG_SKILL, registerBuiltinSkills } from '../../src/skill'; +import { CHECK_KIMI_CODE_DOCS_SKILL, SessionSkillRegistry, UPDATE_CONFIG_SKILL, registerBuiltinSkills } from '../../src/skill'; describe('builtin skill: update-config', () => { it('has the expected identity and inline metadata', () => { @@ -32,3 +32,36 @@ describe('builtin skill: update-config', () => { ).toBe(true); }); }); + +describe('builtin skill: check-kimi-code-docs', () => { + it('has the expected identity and inline metadata', () => { + expect(CHECK_KIMI_CODE_DOCS_SKILL.name).toBe('check-kimi-code-docs'); + expect(CHECK_KIMI_CODE_DOCS_SKILL.source).toBe('builtin'); + expect(CHECK_KIMI_CODE_DOCS_SKILL.description.length).toBeGreaterThan(0); + expect(CHECK_KIMI_CODE_DOCS_SKILL.metadata.type).toBe('inline'); + }); + + it('is model-invocable (does not disable model invocation)', () => { + expect(CHECK_KIMI_CODE_DOCS_SKILL.metadata.disableModelInvocation).not.toBe(true); + }); + + it('pins the official docs site and the module routing list', () => { + const content = CHECK_KIMI_CODE_DOCS_SKILL.content; + expect(content).toContain('https://www.kimi.com/code/docs/en/'); + expect(content).toContain('kimi-code-cli/configuration/'); + expect(content).toContain('kimi-code-cli/customization/'); + expect(content).toContain('kimi-code/membership.html'); + expect(content).toContain('kimi-code/error-reference.html'); + expect(content).toContain('FetchURL'); + }); + + it('registers through registerBuiltinSkills and shows up as model-invocable', () => { + const registry = new SessionSkillRegistry(); + registerBuiltinSkills(registry); + + expect(registry.getSkill('check-kimi-code-docs')).toBeDefined(); + expect( + registry.listInvocableSkills().some((skill) => skill.name === 'check-kimi-code-docs'), + ).toBe(true); + }); +}); From 1368679fa95ee1ce9e0dac227e30782fd097d3b3 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Wed, 15 Jul 2026 11:28:48 +0800 Subject: [PATCH 2/4] feat(agent-core-v2): add check-kimi-code-docs builtin skill --- .../src/app/skillCatalog/builtin/builtin.ts | 3 ++ .../builtin/check-kimi-code-docs.md | 44 +++++++++++++++++++ .../builtin/check-kimi-code-docs.ts | 26 +++++++++++ packages/kap-server/test/skills.test.ts | 14 ++++++ 4 files changed, 87 insertions(+) create mode 100644 packages/agent-core-v2/src/app/skillCatalog/builtin/check-kimi-code-docs.md create mode 100644 packages/agent-core-v2/src/app/skillCatalog/builtin/check-kimi-code-docs.ts diff --git a/packages/agent-core-v2/src/app/skillCatalog/builtin/builtin.ts b/packages/agent-core-v2/src/app/skillCatalog/builtin/builtin.ts index 8f5ff6d244..6a1febdb25 100644 --- a/packages/agent-core-v2/src/app/skillCatalog/builtin/builtin.ts +++ b/packages/agent-core-v2/src/app/skillCatalog/builtin/builtin.ts @@ -9,6 +9,7 @@ import type { InMemorySkillCatalog } from '#/app/skillCatalog/registry'; import type { SkillDefinition } from '#/app/skillCatalog/types'; +import { CHECK_KIMI_CODE_DOCS_SKILL } from './check-kimi-code-docs'; import { CUSTOM_THEME_SKILL } from './custom-theme'; import { IMPORT_FROM_CC_CODEX_SKILL } from './import-from-cc-codex'; import { MCP_CONFIG_SKILL } from './mcp-config'; @@ -26,6 +27,7 @@ export const BUILTIN_SKILLS: readonly SkillDefinition[] = [ UPDATE_CONFIG_SKILL, CUSTOM_THEME_SKILL, WRITE_GOAL_SKILL, + CHECK_KIMI_CODE_DOCS_SKILL, SUB_SKILL_PARENT, SUB_SKILL_REVIEW, SUB_SKILL_CONSOLIDATE, @@ -38,6 +40,7 @@ export function registerBuiltinSkills(registry: InMemorySkillCatalog): void { } export { + CHECK_KIMI_CODE_DOCS_SKILL, CUSTOM_THEME_SKILL, IMPORT_FROM_CC_CODEX_SKILL, MCP_CONFIG_SKILL, diff --git a/packages/agent-core-v2/src/app/skillCatalog/builtin/check-kimi-code-docs.md b/packages/agent-core-v2/src/app/skillCatalog/builtin/check-kimi-code-docs.md new file mode 100644 index 0000000000..f64d179fe9 --- /dev/null +++ b/packages/agent-core-v2/src/app/skillCatalog/builtin/check-kimi-code-docs.md @@ -0,0 +1,44 @@ +--- +name: check-kimi-code-docs +description: Answer questions about the Kimi Code product using the official documentation — CLI usage, configuration, slash commands, features, membership and quota, API onboarding, third-party tool setup, and error codes. Use when the user asks how Kimi Code works, how to set something up, or what a Kimi Code error message means. +--- + +# Check Kimi Code docs (check-kimi-code-docs) + +Answer Kimi Code **product** questions from the official documentation site, not from memory. This skill covers product usage ("how do I configure a provider", "what does this error mean", "how does membership quota work"); it is not for developing the Kimi Code repository itself. + +## The single source of truth + +Official documentation (English): + +``` +https://www.kimi.com/code/docs/en/ +``` + +Fetch pages with **FetchURL** before answering. All page links below are relative to this base. + +## Which page to read for which question + +| Question topic | Page (relative to the base URL) | +| --- | --- | +| What Kimi Code is; Base URL / API Key; standard vs high-speed model; platform comparison | `./` (home overview) | +| Membership plans, quota and rate limits, fuel packs | `kimi-code/membership.html` | +| Install / login / usage FAQ | `kimi-code/faq.html` | +| Error codes and their meaning (e.g. 401 for high-speed model access) | `kimi-code/error-reference.html` | +| Product news and recent changes | `kimi-code/whats-new.html` | +| Community guidelines; contact and feedback | `kimi-code/community-guidelines.html`, `kimi-code/contact-and-feedback.html` | +| `config.toml` fields, providers/models, environment variables, data locations, config overrides | `kimi-code-cli/configuration/` — `config-files.html`, `providers.html`, `env-vars.html`, `data-locations.html`, `overrides.html` | +| Skills, MCP, hooks, plugins, themes, agents/sub-agents, Kimi Datasource | `kimi-code-cli/customization/` — `skills.html`, `mcp.html`, `hooks.html`, `plugins.html`, `themes.html`, `agents.html`; Kimi Datasource lives at `plugins.html#kimi-datasource` | +| Getting started, sessions and context, goals, interaction and input, IDEs, migration, use cases | `kimi-code-cli/guides/` — `getting-started.html`, `sessions.html`, `goals.html`, `interaction.html`, `ides.html`, `migration.html`, `use-cases.html` | +| Slash commands, keyboard shortcuts, builtin tools, `kimi` command flags, ACP | `kimi-code-cli/reference/` — `slash-commands.html`, `keyboard.html`, `tools.html`, `kimi-command.html`, `kimi-acp.html` | +| CLI changelog | `kimi-code-cli/release-notes/changelog.html` | +| Using Kimi Code in Claude Code and other third-party agents | `third-party-tools/other-coding-agents.html` | + +If no row fits the question, fetch the docs home page and follow its navigation links. + +## How to answer + +1. Pick the page from the table above. +2. **FetchURL the page before answering** — answer strictly from the fetched content, never from memory. +3. Cite the page link(s) you used at the end of the answer. +4. If the fetch fails or the docs do not cover the question, say so plainly: answer from what you already know, attach the docs entry link (`https://www.kimi.com/code/docs/en/`), and mark which parts you could not verify. **Never invent config keys, command names, model IDs, or product behaviors.** diff --git a/packages/agent-core-v2/src/app/skillCatalog/builtin/check-kimi-code-docs.ts b/packages/agent-core-v2/src/app/skillCatalog/builtin/check-kimi-code-docs.ts new file mode 100644 index 0000000000..01aaa94823 --- /dev/null +++ b/packages/agent-core-v2/src/app/skillCatalog/builtin/check-kimi-code-docs.ts @@ -0,0 +1,26 @@ +/** + * `skillCatalog` domain (L3) — builtin `check-kimi-code-docs` skill definition. + */ + +import type { SkillDefinition } from '#/app/skillCatalog/types'; +import { parseSkillText } from '#/app/skillCatalog/parser'; +import CHECK_KIMI_CODE_DOCS_BODY from './check-kimi-code-docs.md?raw'; + +const PSEUDO_PATH = 'builtin://check-kimi-code-docs'; + +const parsed = parseSkillText({ + skillMdPath: '/builtin/skills/check-kimi-code-docs.md', + skillDirName: 'check-kimi-code-docs', + source: 'builtin', + text: CHECK_KIMI_CODE_DOCS_BODY, +}); + +export const CHECK_KIMI_CODE_DOCS_SKILL: SkillDefinition = { + ...parsed, + path: PSEUDO_PATH, + dir: PSEUDO_PATH, + metadata: { + ...parsed.metadata, + type: parsed.metadata.type ?? 'inline', + }, +}; diff --git a/packages/kap-server/test/skills.test.ts b/packages/kap-server/test/skills.test.ts index 146ec8ec01..0ace87c21b 100644 --- a/packages/kap-server/test/skills.test.ts +++ b/packages/kap-server/test/skills.test.ts @@ -185,6 +185,20 @@ describe('server-v2 /api/v1 skills', () => { expect(updateConfig).not.toHaveProperty('is_sub_skill'); expect(updateConfig).not.toHaveProperty('isSubSkill'); }); + + it('lists the check-kimi-code-docs builtin skill', async () => { + const id = await createSession(); + const { body } = await getJson<{ skills: SkillWire[] }>( + `/api/v1/sessions/${id}/skills`, + ); + expect(body.code).toBe(0); + const skills = listSkillsResponseSchema.parse(body.data).skills; + + const docsSkill = skills.find((s) => s.name === 'check-kimi-code-docs'); + expect(docsSkill).toBeDefined(); + expect(docsSkill).toMatchObject({ source: 'builtin' }); + expect(docsSkill?.description.length).toBeGreaterThan(0); + }); }); describe('POST /api/v1/sessions/{sid}/skills/{name}:activate', () => { From ae63483f0fff2628d5d82c0f64a106fd651e4d6b Mon Sep 17 00:00:00 2001 From: liruifengv Date: Wed, 15 Jul 2026 11:28:51 +0800 Subject: [PATCH 3/4] docs: list check-kimi-code-docs in builtin skill commands --- docs/en/reference/slash-commands.md | 1 + docs/zh/reference/slash-commands.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/en/reference/slash-commands.md b/docs/en/reference/slash-commands.md index f74812c0e0..a84271a146 100644 --- a/docs/en/reference/slash-commands.md +++ b/docs/en/reference/slash-commands.md @@ -122,6 +122,7 @@ Kimi Code CLI ships with a set of built-in Skills that appear directly as `/]` | Create or edit a custom TUI color theme. See [Themes](../customization/themes.md) | | `/update-config` | Inspect or edit `config.toml` (model, provider, permission, hooks) and `tui.toml` (theme, editor, notifications, auto-update) | +| `/check-kimi-code-docs` | Answer Kimi Code product questions (CLI usage, configuration, membership, error codes) against the official docs | | `/import-from-cc-codex` | Import Claude Code and Codex instructions, skills, and MCP settings into Kimi Code | | `/sub-skill` | Discover and reorganize the local skill inventory into hierarchical sub-skill bundles. Includes `/sub-skill.review` (read-only proposal) and `/sub-skill.consolidate` (apply the reorganization) | diff --git a/docs/zh/reference/slash-commands.md b/docs/zh/reference/slash-commands.md index 2180108350..7692e06c9a 100644 --- a/docs/zh/reference/slash-commands.md +++ b/docs/zh/reference/slash-commands.md @@ -120,6 +120,7 @@ Kimi Code CLI 随包内置了一组 Skill,直接以 `/` 形式出现在 | `/mcp-config` | 配置 MCP server 并处理 MCP OAuth 登录。详见 [MCP](../customization/mcp.md) | | `/custom-theme []` | 创建或编辑自定义 TUI 配色主题。详见 [主题](../customization/themes.md) | | `/update-config` | 查看或编辑 `config.toml`(模型、供应商、权限、hooks)和 `tui.toml`(主题、编辑器、通知、自动更新) | +| `/check-kimi-code-docs` | 依据官方文档回答 Kimi Code 产品问题(CLI 用法、配置、会员、错误码) | | `/import-from-cc-codex` | 从 Claude Code 和 Codex 导入 instructions、skills 和 MCP 设置 | | `/sub-skill` | 发现并将本地 skill 库存重组为分层子 skill 包。包含 `/sub-skill.review`(只读提案)和 `/sub-skill.consolidate`(执行重组) | From 04d1f939b8c5617af7afe9133d3ad16863a8ec94 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Wed, 15 Jul 2026 11:28:51 +0800 Subject: [PATCH 4/4] chore: add changeset for check-kimi-code-docs skill --- .changeset/check-kimi-code-docs-skill.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/check-kimi-code-docs-skill.md diff --git a/.changeset/check-kimi-code-docs-skill.md b/.changeset/check-kimi-code-docs-skill.md new file mode 100644 index 0000000000..e1df2de824 --- /dev/null +++ b/.changeset/check-kimi-code-docs-skill.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": minor +--- + +Add a builtin `check-kimi-code-docs` skill that answers Kimi Code product questions (CLI usage, configuration, membership, error codes) against the official documentation with source links. It triggers automatically on product questions, or run `/check-kimi-code-docs`.