Repository navigation
feat(kimi-code): emit commands onto the skills surface - #3476
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/$1and named$<name>placeholders in the Skill body. That is the same contract a rulesync command has, yet the plainkimi-codetarget still reportedcommandsas unsupported.This PR emits rulesync commands onto Kimi Code's skills surface, following the existing Devin / Warp / Hermes Agent commands-as-skills pattern.
KimiCodeCommandwrites one<slug>/SKILL.mdper command to.kimi-code/skills/(project) and~/.kimi-code/skills/(global;$KIMI_CODE_HOME/skills/whenKIMI_CODE_HOMEis set).nameanddescriptionare always written, since Kimi fails to parse a directory-formSKILL.mdthat lacks either.disableModelInvocation: truekeeps the command-derived skill user-invoked. Akimi-code:section in the command frontmatter can settype,whenToUse,disableModelInvocationandarguments. Kimi's alias spellings (when-to-use/when_to_use,disable-model-invocation/disable_model_invocation) are normalized to those keys. A blankdescriptionfalls back to<name> command.--deleteare no-ops for commands on this target because the skills feature owns the tree.KimiCodeSkill.isDirOwnedmakes the skills feature skip directories named after a current command that targetskimi-codein the Kimi-specific root (rulesyncCommandSlugExistsgained an optionaltoolTargetfilter; 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.KimiCodePluginSkillopts out, becausekimi-code-pluginwrites commands tocommands/.kimi-codein the commands processor and tuple, regenerated the support tables,.gitignoreand the embedded docs, and added a Kimi Code note todocs/reference/file-formats.md.KIMI_CODE_HOMEe2e, and the Devin orphan-protection e2e case now coverskimi-codeas well.Upstream references:
name/description, body placeholders, skill locations)/skill:<name>and the/<name>shorthand)Remaining on #2502
kimi-code-plugin. Kimi only reads these from thekimi.plugin.jsonmanifest, and the target does not write that manifest yet. Whether to write it is a maintainer design decision.[permission]allow/deny/askarray 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