Skip to content

feat: add Kimi Code CLI support#1792

Open
lasting-yang wants to merge 2 commits intobmad-code-org:mainfrom
lasting-yang:main
Open

feat: add Kimi Code CLI support#1792
lasting-yang wants to merge 2 commits intobmad-code-org:mainfrom
lasting-yang:main

Conversation

@lasting-yang
Copy link

add Kimi Code CLI support

@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

📝 Walkthrough

Walkthrough

Adds Kimi Code CLI support by introducing a KimiCliSetup class that orchestrates end-to-end artifact export and skill generation, including artifact collection, frontmatter-to-skill transformation, directory management, and custom agent launcher creation. Registers the new platform in the IDE installer infrastructure.

Changes

Cohort / File(s) Summary
Kimi CLI Setup Implementation
tools/cli/installers/lib/ide/kimi-cli.js
New KimiCliSetup class (extends BaseIdeSetup) providing complete setup flow: collects Claude-style artifacts via specialized generators, converts to Kimi Skill format with YAML frontmatter transformation, writes skills under .kimi/skills directory, clears old BMAD artifacts, manages platform-native line endings, and creates custom agent launcher as Skill.md file.
IDE Infrastructure Registration
tools/cli/installers/lib/ide/manager.js, tools/cli/installers/lib/ide/platform-codes.yaml
Extends IdeManager to load kimi-cli.js installer module; adds kimi-cli platform entry (code: kimi-cli, category: cli, non-preferred) to platform registry for Moonshot AI's Kimi Code CLI.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • Issue #1630: These changes implement the Kimi Code CLI integration referenced in the issue, establishing the end-to-end artifact export and skill generation workflow.

Possibly related PRs

  • PR #1729: Implements parallel CLI installer pattern with identical artifact-to-skill-directory conversion, frontmatter transformation, and custom agent launcher creation functionality.
  • PR #1701: Follows the same architectural approach of adding a custom IDE installer class extending BaseIdeSetup and updating IdeManager infrastructure to register the new installer.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add Kimi Code CLI support' directly and clearly describes the main change: introducing support for Kimi Code CLI across multiple files.
Description check ✅ Passed The description 'add Kimi Code CLI support' is related to the changeset and matches the PR title, though it is minimal in detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (7)
tools/cli/installers/lib/ide/kimi-cli.js (6)

326-331: cleanup doesn't pass options to clearOldBmadSkills.

If called with options.silent = true, this won't propagate to clearOldBmadSkills, causing unexpected log output during cleanup.

♻️ Proposed fix
-  async cleanup(projectDir = null) {
+  async cleanup(projectDir = null, options = {}) {
     if (projectDir) {
       const destDir = this.getKimiSkillsDir(projectDir);
-      await this.clearOldBmadSkills(destDir);
+      await this.clearOldBmadSkills(destDir, options);
     }
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` around lines 326 - 331, The cleanup
method currently ignores caller options so flags like options.silent aren't
propagated; update cleanup to accept an options parameter (e.g.,
cleanup(projectDir = null, options = {})) and forward that options object when
calling clearOldBmadSkills (call this.clearOldBmadSkills(destDir, options));
ensure the default options object is used when none provided so existing callers
remain compatible.

211-211: Inline require inside loop is inefficient.

require('node:os') is called inside the loop on every artifact iteration. Hoist this import to the module level.

♻️ Proposed fix

At the top of the file (around line 1):

 const path = require('node:path');
+const os = require('node:os');
 const fs = require('fs-extra');

Then in writeSkillArtifacts:

-      const os = require('node:os');
       const platformContent = skillContent.replaceAll('\n', os.EOL);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` at line 211, The require('node:os')
call is being executed inside the artifact loop in writeSkillArtifacts which is
inefficient; hoist this import to the module scope by adding a single const os =
require('node:os') at the top of the file and remove the inline require from
inside writeSkillArtifacts so all uses in that function reference the
module-scoped os variable.

364-364: Same inline require('node:os') issue.

This duplicates the pattern flagged earlier. With the module-level import, this line can also be simplified.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` at line 364, Inline require of
'node:os' creates a duplicate pattern—remove the inline const os =
require('node:os'); and rely on the module-level import already present; replace
usages of the local 'os' if any were shadowing the top-level import so all code
references use the single module-level symbol (os) and no additional require
calls remain in kimi-cli.js.

307-307: Unused projectDir parameter.

The projectDir parameter is declared but never used in the function body. Either remove it or use it to construct the instructions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` at line 307, The
getProjectSpecificInstructions function declares a projectDir parameter that is
never used; fix this by either removing projectDir from the signature and all
call sites (update callers of getProjectSpecificInstructions to stop passing
projectDir) or use projectDir inside getProjectSpecificInstructions to build
project-scoped paths/instructions (e.g., incorporate projectDir into the
returned instruction strings) and update any tests/callers expecting the
previous behavior; locate the function by name getProjectSpecificInstructions in
kimi-cli.js and apply one consistent approach across the module.

232-232: Redundant \r handling in regex after normalization.

Line 229 normalizes all line endings to \n, making the \r?\n patterns in line 232's regex unnecessary. Consider simplifying.

♻️ Proposed simplification
-    const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
+    const fmMatch = content.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` at line 232, The regex for
frontmatter parsing uses optional CRs (/\r?\n/) even though earlier code
normalizes line endings to '\n'; update the match call that assigns fmMatch
(content.match(...)) to remove the redundant '\r?' sequences so it only matches
'\n' (e.g., replace '\r?\n' with '\n' in the pattern) ensuring the pattern still
captures frontmatter and body correctly while relying on the prior normalization
of content.

107-109: Silent error swallowing may hide legitimate issues.

Catching and ignoring all errors from readdir could mask permission issues or filesystem problems. Consider logging at debug level if a debug mode is available.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` around lines 107 - 109, The catch
block that swallows errors coming from the prior fs.readdir call should capture
the error object (e.g., catch (err)) and log it at debug/verbose level instead
of ignoring it; update the anonymous catch in kimi-cli.js that follows readdir
to call the existing debug/logger (or console.debug) with a short message and
the error so permission/FS issues are visible while still not failing the CLI.
tools/cli/installers/lib/ide/manager.js (1)

11-11: Stale comment - mentions 4 files but now there are 5.

The comment references "codex.js, github-copilot.js, kilo.js, rovodev.js" but kimi-cli.js is now also a custom installer file.

📝 Proposed fix
- * 1. Custom installer files (codex.js, github-copilot.js, kilo.js, rovodev.js) - for platforms with unique installation logic
+ * 1. Custom installer files (codex.js, github-copilot.js, kilo.js, rovodev.js, kimi-cli.js) - for platforms with unique installation logic
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/manager.js` at line 11, The header comment in
manager.js enumerates custom installer files but is stale—update the comment
that lists "codex.js, github-copilot.js, kilo.js, rovodev.js" to include the new
custom installer (kimi-cli.js) or rewrite it generically; locate the comment
near the top of tools/cli/installers/lib/ide/manager.js (the block that
describes "Custom installer files") and add "kimi-cli.js" to the list or change
the phrasing to "e.g. codex.js, github-copilot.js, kilo.js, rovodev.js,
kimi-cli.js" / "custom installer files (e.g. ...)" accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/cli/installers/lib/ide/kimi-cli.js`:
- Around line 17-19: The constructor in the class (constructor calling
super('kimi-cli', 'Kimi Code CLI', true)) sets the preferred flag to true but
platform-codes.yaml lists preferred: false; pick the source of truth and make
them consistent—either change the third argument in the constructor to false or
update platform-codes.yaml to true. Locate the constructor in kimi-cli.js (the
super call) and the preferred entry for "kimi-cli" in platform-codes.yaml and
make both values identical; ensure any related docs/tests that assert preferred
for "kimi-cli" are updated accordingly.
- Line 43: Change tasks to be loaded as global artifacts by removing the
selectedModules filter when calling getTasksFromBmad; replace the call
getTasksFromBmad(bmadDir, options.selectedModules || []) with a call that only
passes bmadDir (and update getTasksFromBmad signature if it currently expects
the second argument). Ensure only agents remain filtered by
options.selectedModules (e.g., in getAgentsFromBmad or wherever agents are
loaded), so workflows/tasks are always installed regardless of selectedModules.
- Around line 27-28: The setup method lacks validation of the bmadDir parameter,
causing downstream artifact collectors to receive null/undefined; inside the
async setup(projectDir, bmadDir, options = {}) function add a validation step
(similar to getKimiSkillsDir's projectDir checks) that ensures bmadDir is a
non-empty string (or resolves a sensible default) and throws or logs a clear
error if invalid; reference the setup function and any artifact collector calls
that consume bmadDir so the check runs before those calls.
- Line 137: The tasks returned by getTasksFromBmad are global and must not be
filtered by selectedModules (same bug as in setup()); update the call and
surrounding logic so tasks remain unfiltered — e.g., call
getTasksFromBmad(bmadDir) or adjust getTasksFromBmad to accept a flag to skip
module filtering, and remove any post-call filtering of the tasks array based on
selectedModules; ensure functions/variables referenced are getTasksFromBmad,
tasks, and selectedModules so the change targets the correct spot.
- Line 355: The string that emits the embedded SKILL.md reference uses the
`@${agentPath}` syntax which must be changed to a relative path form; update the
template that builds the line (`1. LOAD the FULL agent file from
@${agentPath}\n`) to remove the `@` so it emits `1. LOAD the FULL agent file
from ${agentPath}\n` (i.e., use the existing agentPath variable and output a
relative path rather than `@path`) so SKILL.md uses the Kimi CLI relative-path
convention.

---

Nitpick comments:
In `@tools/cli/installers/lib/ide/kimi-cli.js`:
- Around line 326-331: The cleanup method currently ignores caller options so
flags like options.silent aren't propagated; update cleanup to accept an options
parameter (e.g., cleanup(projectDir = null, options = {})) and forward that
options object when calling clearOldBmadSkills (call
this.clearOldBmadSkills(destDir, options)); ensure the default options object is
used when none provided so existing callers remain compatible.
- Line 211: The require('node:os') call is being executed inside the artifact
loop in writeSkillArtifacts which is inefficient; hoist this import to the
module scope by adding a single const os = require('node:os') at the top of the
file and remove the inline require from inside writeSkillArtifacts so all uses
in that function reference the module-scoped os variable.
- Line 364: Inline require of 'node:os' creates a duplicate pattern—remove the
inline const os = require('node:os'); and rely on the module-level import
already present; replace usages of the local 'os' if any were shadowing the
top-level import so all code references use the single module-level symbol (os)
and no additional require calls remain in kimi-cli.js.
- Line 307: The getProjectSpecificInstructions function declares a projectDir
parameter that is never used; fix this by either removing projectDir from the
signature and all call sites (update callers of getProjectSpecificInstructions
to stop passing projectDir) or use projectDir inside
getProjectSpecificInstructions to build project-scoped paths/instructions (e.g.,
incorporate projectDir into the returned instruction strings) and update any
tests/callers expecting the previous behavior; locate the function by name
getProjectSpecificInstructions in kimi-cli.js and apply one consistent approach
across the module.
- Line 232: The regex for frontmatter parsing uses optional CRs (/\r?\n/) even
though earlier code normalizes line endings to '\n'; update the match call that
assigns fmMatch (content.match(...)) to remove the redundant '\r?' sequences so
it only matches '\n' (e.g., replace '\r?\n' with '\n' in the pattern) ensuring
the pattern still captures frontmatter and body correctly while relying on the
prior normalization of content.
- Around line 107-109: The catch block that swallows errors coming from the
prior fs.readdir call should capture the error object (e.g., catch (err)) and
log it at debug/verbose level instead of ignoring it; update the anonymous catch
in kimi-cli.js that follows readdir to call the existing debug/logger (or
console.debug) with a short message and the error so permission/FS issues are
visible while still not failing the CLI.

In `@tools/cli/installers/lib/ide/manager.js`:
- Line 11: The header comment in manager.js enumerates custom installer files
but is stale—update the comment that lists "codex.js, github-copilot.js,
kilo.js, rovodev.js" to include the new custom installer (kimi-cli.js) or
rewrite it generically; locate the comment near the top of
tools/cli/installers/lib/ide/manager.js (the block that describes "Custom
installer files") and add "kimi-cli.js" to the list or change the phrasing to
"e.g. codex.js, github-copilot.js, kilo.js, rovodev.js, kimi-cli.js" / "custom
installer files (e.g. ...)" accordingly.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43cfc01 and 61c6ce1.

📒 Files selected for processing (3)
  • tools/cli/installers/lib/ide/kimi-cli.js
  • tools/cli/installers/lib/ide/manager.js
  • tools/cli/installers/lib/ide/platform-codes.yaml

Comment on lines +17 to +19
constructor() {
super('kimi-cli', 'Kimi Code CLI', true);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent preferred value - constructor says true, platform-codes.yaml says false.

The constructor passes true as the third argument (likely the preferred flag), but platform-codes.yaml line 122 sets preferred: false. This discrepancy may cause inconsistent behavior depending on which source is consulted.

🛠️ Proposed fix
   constructor() {
-    super('kimi-cli', 'Kimi Code CLI', true);
+    super('kimi-cli', 'Kimi Code CLI', false);
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` around lines 17 - 19, The
constructor in the class (constructor calling super('kimi-cli', 'Kimi Code CLI',
true)) sets the preferred flag to true but platform-codes.yaml lists preferred:
false; pick the source of truth and make them consistent—either change the third
argument in the constructor to false or update platform-codes.yaml to true.
Locate the constructor in kimi-cli.js (the super call) and the preferred entry
for "kimi-cli" in platform-codes.yaml and make both values identical; ensure any
related docs/tests that assert preferred for "kimi-cli" are updated accordingly.

Comment on lines +27 to +28
async setup(projectDir, bmadDir, options = {}) {
if (!options.silent) await prompts.log.info(`Setting up ${this.name}...`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing validation for bmadDir parameter.

projectDir is validated in getKimiSkillsDir, but bmadDir is never validated. If bmadDir is null/undefined, cryptic errors will occur when passed to artifact collectors.

🛠️ Proposed fix
   async setup(projectDir, bmadDir, options = {}) {
+    if (!bmadDir) {
+      throw new Error('bmadDir is required for Kimi CLI setup');
+    }
     if (!options.silent) await prompts.log.info(`Setting up ${this.name}...`);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async setup(projectDir, bmadDir, options = {}) {
if (!options.silent) await prompts.log.info(`Setting up ${this.name}...`);
async setup(projectDir, bmadDir, options = {}) {
if (!bmadDir) {
throw new Error('bmadDir is required for Kimi CLI setup');
}
if (!options.silent) await prompts.log.info(`Setting up ${this.name}...`);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` around lines 27 - 28, The setup
method lacks validation of the bmadDir parameter, causing downstream artifact
collectors to receive null/undefined; inside the async setup(projectDir,
bmadDir, options = {}) function add a validation step (similar to
getKimiSkillsDir's projectDir checks) that ensures bmadDir is a non-empty string
(or resolves a sensible default) and throws or logs a clear error if invalid;
reference the setup function and any artifact collector calls that consume
bmadDir so the check runs before those calls.

const agentCount = await this.writeSkillArtifacts(destDir, agentArtifacts, 'agent-launcher');

// Collect and write task skills
const tasks = await getTasksFromBmad(bmadDir, options.selectedModules || []);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Tasks should be global artifacts, not filtered by selectedModules.

Per the BMAD installer pattern, workflows and tasks are global artifacts that should always be installed regardless of selected modules. Only agents should be filtered by selectedModules. Passing selectedModules to getTasksFromBmad violates this design.

🛠️ Proposed fix
-    const tasks = await getTasksFromBmad(bmadDir, options.selectedModules || []);
+    const tasks = await getTasksFromBmad(bmadDir);

Based on learnings: "treat workflows and tasks as global artifacts that are always installed regardless of selected modules. Only agents are module-scoped and should be filtered by selectedModules."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const tasks = await getTasksFromBmad(bmadDir, options.selectedModules || []);
const tasks = await getTasksFromBmad(bmadDir);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` at line 43, Change tasks to be
loaded as global artifacts by removing the selectedModules filter when calling
getTasksFromBmad; replace the call getTasksFromBmad(bmadDir,
options.selectedModules || []) with a call that only passes bmadDir (and update
getTasksFromBmad signature if it currently expects the second argument). Ensure
only agents remain filtered by options.selectedModules (e.g., in
getAgentsFromBmad or wherever agents are loaded), so workflows/tasks are always
installed regardless of selectedModules.

});
}

const tasks = await getTasksFromBmad(bmadDir, selectedModules);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Same module filtering issue on tasks.

This mirrors the issue in setup() — tasks are global artifacts and should not be filtered by selectedModules.

🛠️ Proposed fix
-    const tasks = await getTasksFromBmad(bmadDir, selectedModules);
+    const tasks = await getTasksFromBmad(bmadDir);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` at line 137, The tasks returned by
getTasksFromBmad are global and must not be filtered by selectedModules (same
bug as in setup()); update the call and surrounding logic so tasks remain
unfiltered — e.g., call getTasksFromBmad(bmadDir) or adjust getTasksFromBmad to
accept a flag to skip module filtering, and remove any post-call filtering of
the tasks array based on selectedModules; ensure functions/variables referenced
are getTasksFromBmad, tasks, and selectedModules so the change targets the
correct spot.

`---\n${fm}\n---\n` +
"\nYou must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.\n" +
'\n<agent-activation CRITICAL="TRUE">\n' +
`1. LOAD the FULL agent file from @${agentPath}\n` +
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the file context around line 355
head -n 370 tools/cli/installers/lib/ide/kimi-cli.js | tail -n 30

Repository: bmad-code-org/BMAD-METHOD

Length of output: 1584


🏁 Script executed:

# Search for other uses of agentPath or file references in kimi-cli.js
rg -n "agentPath|@.*path" tools/cli/installers/lib/ide/kimi-cli.js -A 2 -B 2

Repository: bmad-code-org/BMAD-METHOD

Length of output: 1031


🏁 Script executed:

# Look for documentation or config files related to Kimi CLI
find . -type f \( -name "*kimi*" -o -name "*KIMI*" \) | grep -E "\.(md|txt|json|yaml|config)" | head -20

Repository: bmad-code-org/BMAD-METHOD

Length of output: 51


🌐 Web query:

Kimi Code CLI file reference syntax @path agent file loading documentation

💡 Result:

  • File reference syntax (@path) in Kimi Code CLI: In the chat input, type @ followed by a relative file or directory path in your working directory; the CLI will autocomplete paths and you can select with Tab/Enter. Example: Check if there are any issues with @src/components/Button.tsx``. Directories can be referenced the same way (e.g., @src/). [1]

  • Agent file loading (custom agent YAML): Load a custom agent definition file with:
    kimi --agent-file /path/to/my-agent.yaml [2]
    Agent files are YAML, and typically include things like version, agent.name, agent.system_prompt_path, and agent.tools. [2]

Sources: Kimi Code CLI docs on interaction / @ path completion [1] and agent configuration / --agent-file [2].


🏁 Script executed:

# Search for SKILL.md files or examples in the codebase
find . -type f -name "SKILL.md" -o -name "*skill*" -type f | grep -v node_modules | head -20

Repository: bmad-code-org/BMAD-METHOD

Length of output: 463


🏁 Script executed:

# Look for other agent/skill file examples in the repo
rg -l "agent-activation|SKILL\.md" --type js --type md | head -20

Repository: bmad-code-org/BMAD-METHOD

Length of output: 499


🏁 Script executed:

# Check if there are any comments or documentation about Kimi skill syntax
rg "Kimi.*skill|skill.*format|@.*agent" -i --type md --type txt

Repository: bmad-code-org/BMAD-METHOD

Length of output: 629


🌐 Web query:

Kimi Code CLI SKILL.md skill file format file reference syntax documentation

💡 Result:

SKILL.md format (Kimi Code CLI “Agent Skills”)

A skill is a directory that contains a required SKILL.md file. Kimi Code CLI discovers skills at startup and may read SKILL.md when it needs the detailed instructions. [1]

1) File structure

Minimum:

  • some-skill/
    • SKILL.md (required)

Optional companion folders (common convention):

  • scripts/, references/, assets/ [1]

2) SKILL.md contents = YAML frontmatter + Markdown body

SKILL.md is:

  • YAML frontmatter (metadata), then
  • Markdown (the actual guidance/prompt content) [1]

Example pattern: [1]

---
name: code-style
description: My project's code style guidelines
---

## Code Style
- Use 4-space indentation
...

3) Frontmatter fields (metadata)

Supported fields include: [1]

  • name (optional): 1–64 chars; lowercase letters, numbers, hyphens; defaults to directory name if omitted
  • description (optional): 1–1024 chars
  • license (optional): license name or file reference
  • compatibility (optional)
  • metadata (optional): extra key/value attributes

4) File reference / “syntax” inside SKILL.md

  • Use relative paths in SKILL.md when referencing other files in the skill directory (e.g., things you place under scripts/, references/, assets/). [1]

5) Flow skills (special type)

If you set type: flow in the frontmatter, the Markdown body can embed a workflow diagram using either:

  • a mermaid code block, or
  • a d2 code block [1]

Flow diagrams must include one BEGIN node and one END node, and decision nodes require the agent to output <choice>...</choice> to pick a branch. [1]

6) How skills are invoked

  • /skill:<name> loads and sends the skill’s SKILL.md content as a prompt. [1]
  • /flow:<name> executes a flow skill’s diagram as a multi-step workflow. [1]

Source: Kimi Code CLI Docs → Customization → Agent Skills. [1]


🏁 Script executed:

# Look at one of the actual SKILL.md files to see how files are referenced
head -100 ./.claude/skills/bmad-os-audit-file-refs/SKILL.md

Repository: bmad-code-org/BMAD-METHOD

Length of output: 343


🏁 Script executed:

# Check if any SKILL.md files use `@path` syntax
rg "@" ./.claude/skills/ --type md

Repository: bmad-code-org/BMAD-METHOD

Length of output: 1396


🏁 Script executed:

# Look at the agent-command-template to understand the context
cat tools/cli/installers/lib/ide/templates/agent-command-template.md

Repository: bmad-code-org/BMAD-METHOD

Length of output: 667


Use relative path syntax instead of @path for embedded SKILL.md file references.

The code generates LOAD the FULL agent file from @${agentPath}, but Kimi CLI documentation specifies relative paths for file references within skill files. Actual SKILL.md files in the codebase (e.g., ./.claude/skills/bmad-os-audit-file-refs/SKILL.md) use relative paths like prompts/instructions.md. The @path syntax is documented only for interactive CLI chat input (autocomplete), not for embedded markdown directives. Update line 355 to use a relative path (e.g., `1. LOAD the FULL agent file from ${agentPath}\n` or similar) consistent with Kimi CLI skill file conventions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/kimi-cli.js` at line 355, The string that emits
the embedded SKILL.md reference uses the `@${agentPath}` syntax which must be
changed to a relative path form; update the template that builds the line (`1.
LOAD the FULL agent file from @${agentPath}\n`) to remove the `@` so it emits
`1. LOAD the FULL agent file from ${agentPath}\n` (i.e., use the existing
agentPath variable and output a relative path rather than `@path`) so SKILL.md
uses the Kimi CLI relative-path convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant