Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/check-kimi-code-docs-skill.md
Original file line number Diff line number Diff line change
@@ -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`.
1 change: 1 addition & 0 deletions docs/en/reference/slash-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Kimi Code CLI ships with a set of built-in Skills that appear directly as `/<nam
| `/mcp-config` | Configure MCP servers and handle MCP OAuth login. See [MCP](../customization/mcp.md) |
| `/custom-theme [<text>]` | 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) |

Expand Down
1 change: 1 addition & 0 deletions docs/zh/reference/slash-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Kimi Code CLI 随包内置了一组 Skill,直接以 `/<name>` 形式出现在
| `/mcp-config` | 配置 MCP server 并处理 MCP OAuth 登录。详见 [MCP](../customization/mcp.md) |
| `/custom-theme [<text>]` | 创建或编辑自定义 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`(执行重组) |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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.**
Original file line number Diff line number Diff line change
@@ -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',
},
};
44 changes: 44 additions & 0 deletions packages/agent-core/src/skill/builtin/check-kimi-code-docs.md
Original file line number Diff line number Diff line change
@@ -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.**
22 changes: 22 additions & 0 deletions packages/agent-core/src/skill/builtin/check-kimi-code-docs.ts
Original file line number Diff line number Diff line change
@@ -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',
},
};
3 changes: 3 additions & 0 deletions packages/agent-core/src/skill/builtin/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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,
Expand Down
35 changes: 34 additions & 1 deletion packages/agent-core/test/skill/builtin-update-config.test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down Expand Up @@ -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);
});
});
14 changes: 14 additions & 0 deletions packages/kap-server/test/skills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Loading