Skip to content

feat(kimi-code): emit commands onto the skills surface - #3476

Merged
dyoshikawa merged 6 commits into
mainfrom
resolve-issue-2502-kimi-code-commands
Oct 15, 2026
Merged

dyoshikawa merged 6 commits into
mainfrom
resolve-issue-2502-kimi-code-commands

Conversation

@dyoshikawa

@dyoshikawa dyoshikawa commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Kimi Code has no custom-command directory outside plugins, but it registers every external Skill as a slash command (/skill:<name>, plus a /<name> shorthand when the name is free) and expands $ARGUMENTS, positional $0/$1 and named $<name> placeholders in the Skill body. That is the same contract a rulesync command has, yet the plain kimi-code target still reported commands as unsupported.

This PR emits rulesync commands onto Kimi Code's skills surface, following the existing Devin / Warp / Hermes Agent commands-as-skills pattern.

  • New KimiCodeCommand writes one <slug>/SKILL.md per command to .kimi-code/skills/ (project) and ~/.kimi-code/skills/ (global; $KIMI_CODE_HOME/skills/ when KIMI_CODE_HOME is set).
    • name and description are always written, since Kimi fails to parse a directory-form SKILL.md that lacks either.
    • disableModelInvocation: true keeps the command-derived skill user-invoked. A kimi-code: section in the command frontmatter can set type, whenToUse, disableModelInvocation and arguments. Kimi's alias spellings (when-to-use/when_to_use, disable-model-invocation/disable_model_invocation) are normalized to those keys. A blank description falls back to <name> command.
    • Import and --delete are no-ops for commands on this target because the skills feature owns the tree.
  • KimiCodeSkill.isDirOwned makes the skills feature skip directories named after a current command that targets kimi-code in the Kimi-specific root (rulesyncCommandSlugExists gained an optional toolTarget filter; Devin and Warp are unchanged), so it neither imports them as skills nor deletes them as orphans. The import-only .agents/skills/ root is not affected. KimiCodePluginSkill opts out, because kimi-code-plugin writes commands to commands/.
  • Registered kimi-code in the commands processor and tuple, regenerated the support tables, .gitignore and the embedded docs, and added a Kimi Code note to docs/reference/file-formats.md.
  • Tests: unit tests for the new class and the ownership hook, project/global e2e happy paths plus the KIMI_CODE_HOME e2e, and the Devin orphan-protection e2e case now covers kimi-code as well.

Upstream references:

Remaining on #2502

  • Plugin MCP and hooks for kimi-code-plugin. Kimi only reads these from the kimi.plugin.json manifest, and the target does not write that manifest yet. Whether to write it is a maintainer design decision.
  • Reading the [permission] allow / deny / ask array form on import. This needs an ownership decision: reading the arrays without owning them would duplicate rules, and owning them would delete hand-written arrays.

Refs #2502

🤖 Generated with Claude Code

https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv

dyoshikawa and others added 6 commits October 16, 2026 00:35
Kimi Code has no custom-command directory outside plugins, but it
registers every external Skill as a slash command (/skill:<name>, with a
/<name> shorthand) and expands $ARGUMENTS, positional and named
placeholders in the body. rulesync still reported commands unsupported
for the plain kimi-code target, so .rulesync/commands/*.md produced no
Kimi Code output.

- Add KimiCodeCommand emitting one <slug>/SKILL.md per command into
  .kimi-code/skills/ (project) and ~/.kimi-code/skills/ (global, or
  $KIMI_CODE_HOME/skills/), following the Devin/Warp commands-as-skills
  pattern. name and description are always written because Kimi rejects
  a directory-form SKILL.md without both, and disableModelInvocation is
  set so the skill stays user-invoked; a kimi-code: section can set
  type, whenToUse, disableModelInvocation and arguments.
- KimiCodeSkill.isDirOwned keeps the skills feature from importing or
  orphan-deleting command-emitted directories in the Kimi-specific root;
  the import-only .agents/skills/ root and the kimi-code-plugin skills
  tree are unaffected.

Refs #2502

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
…mi-code-commands

# Conflicts:
#	src/generated/docs-content.ts
…mi-code-commands

# Conflicts:
#	src/generated/docs-content.ts
- rulesyncCommandSlugExists takes an optional toolTarget; KimiCodeSkill
  passes "kimi-code", so a command aimed only at other tools no longer
  disowns a same-named Kimi skill (which was then neither imported nor
  orphan-deleted).
- KimiCodeCommand normalizes Kimi's accepted alias spellings
  (when-to-use / when_to_use, disable-model-invocation /
  disable_model_invocation) in the kimi-code section instead of dropping
  them, with the canonical key winning, and a blank description now falls
  back to "<name> command" so Kimi never sees description: "".
- The KIMI_CODE_HOME e2e now covers commands landing in
  $KIMI_CODE_HOME/skills/<slug>/SKILL.md.

Refs #2502

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
…mi-code-commands

# Conflicts:
#	src/generated/docs-content.ts
…mi-code-commands

# Conflicts:
#	src/generated/docs-content.ts
@dyoshikawa
dyoshikawa merged commit 39b96a7 into main Oct 15, 2026
9 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2502-kimi-code-commands branch October 15, 2026 18:36
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