feat(#2505): Phase 2 — kimi-code Agent Skills install layout (#2520)

* feat(#2454): PR 2 — kimi-code Agent Skills converter + install layout

PR 1 registered the kimi-code EoS descriptor with empty artifactLayout
(SKIP_INSTALL_CONTRACT excluded it from the end-to-end install test).
PR 2 fills in the install surface:

- src/runtime-artifact-conversion.cts: new convertClaudeCommandToKimiCodeSkill
  function. Today it delegates to convertClaudeCommandToKimiSkill (Python
  kimi-cli) because Kimi Code uses the same Agent Skills format + /skill:
  invocation per official docs. The distinct function name lets a future
  divergence land cleanly if Kimi Code's skill format evolves independently.
- gsd-core/bin/lib/capability-validator.cjs: add to ALLOWED_SKILLS_CONVERTERS.
- capabilities/kimi-code/capability.json: artifactLayout.global now declares
  the skills kind with converter='convertClaudeCommandToKimiCodeSkill' +
  home='.kimi-code' (auto-discovered at ~/.kimi-code/skills/ per Kimi Code
  docs: merge_all_available_skills = true default).
- tests/installer-migration-install.integration.test.cjs: REMOVE the
  SKIP_INSTALL_CONTRACT exclusion — kimi-code now has a full install surface.
- Regenerated capability-registry + capability-matrix + golden install
  parity + install tree fixtures for kimi-code.

* fix(#2454): wire kimi-code converter into SKILLS_CONVERTER_REGISTRY + count bump

- src/install-engine.cts: add convertClaudeCommandToKimiCodeSkill to
  SKILLS_CONVERTER_REGISTRY so the layout-driven skills install path
  can dispatch off the descriptor's converter string.
- tests/capability-registry.test.cjs: bump VALID_CONVERTER_NAMES count
  26 → 27 (added convertClaudeCommandToKimiCodeSkill).

* fix(#2454): remove home override from kimi-code skills (inherit configDir)

The home:'.kimi-code' override made the install plan resolve skills dest
to ~/.kimi-code/skills instead of <configDir>/skills, causing the test's
temp configDir to miss the install. Removing it lets skills inherit
configDir like most runtimes.

* fix(#2454): kimi-code install contract surface is flat-skills (no agents)

Kimi Code has NO custom named subagents (per official docs: 3 built-in
coder/explore/plan only). The kimi-skills-agents surface expects agents/
gsd.yaml + subagents/*.yaml which kimi-code does not produce. Changed
to flat-skills which only checks for skills/gsd-* dirs.

* docs(changeset): Phase 2 kimi-code install layout Added (#2509)

* docs(changeset): backfill PR #2520 for Phase 2 (#2509)
This commit is contained in:
Tom Boucher
2026-07-22 00:58:58 -04:00
committed by GitHub
parent bf8f320083
commit c2a305c44d
10 changed files with 211 additions and 159 deletions

View File

@@ -135,6 +135,7 @@ function convertClaudeCommandToKiloSkill(content: string, skillName: string): st
const SKILLS_CONVERTER_REGISTRY: Record<string, (content: string, skillName: string) => string> = {
convertClaudeCommandToOpencodeSkill,
convertClaudeCommandToKiloSkill,
convertClaudeCommandToKimiCodeSkill: runtimeArtifactConversion.convertClaudeCommandToKimiCodeSkill,
};
// ---------------------------------------------------------------------------

View File

@@ -544,6 +544,29 @@ function convertClaudeCommandToKimiSkill(content, skillName, _runtime = null, cm
return `---\nname: ${kimiSkillName}\ndescription: ${yamlQuote(toSingleLine(description))}\n---\nInvoke this Kimi skill with \`/skill:${kimiSkillName}\`.\n\n${normalizedBody}`;
}
/**
* Convert a Claude command-markdown source into a Kimi Code Agent Skill.
*
* Kimi Code (Moonshot's Node CLI) uses the standard Agent Skills format —
* a directory containing SKILL.md with frontmatter (name/description) and
* body — auto-discovered from `~/.kimi-code/skills/` (per Kimi Code docs:
* "Agent Skills is an open format for adding specialized knowledge and
* workflows to AI agents"). The invocation prefix is `/skill:<name>`,
* identical to Python kimi-cli.
*
* Today the output is byte-identical to `convertClaudeCommandToKimiSkill`
* (the Python kimi-cli converter) because both products consume the same
* Agent Skills format + `/skill:` invocation. The distinct function name
* lets a future divergence land cleanly if Kimi Code's skill format evolves
* independently of Python kimi-cli.
*
* Registered as `convertClaudeCommandToKimiCodeSkill` in the capabilities/
* kimi-code/capability.json `artifactLayout` `converter` field (#2454 PR 2).
*/
function convertClaudeCommandToKimiCodeSkill(content, skillName, _runtime = null, cmdNames = null) {
return convertClaudeCommandToKimiSkill(content, skillName, _runtime, cmdNames);
}
const KIMI_CANONICAL_GSD_AGENT_RE = /^gsd-[a-z0-9-]+$/;
function parseKimiAgentSource(source) {
@@ -2854,6 +2877,7 @@ export = {
convertClaudeCommandToAntigravitySkill,
convertClaudeCommandToClaudeSkill,
convertClaudeCommandToKimiSkill,
convertClaudeCommandToKimiCodeSkill,
buildKimiAgentArtifacts,
convertClaudeToCursorMarkdown,
convertClaudeCommandToCursorSkill,