Skip to content

feat: add Kimi Code CLI support - #17

Merged
rlorenzo merged 1 commit into
mainfrom
claude/orchestrator-skill-improvements-24wxw9
Jul 25, 2026
Merged

feat: add Kimi Code CLI support#17
rlorenzo merged 1 commit into
mainfrom
claude/orchestrator-skill-improvements-24wxw9

Conversation

@rlorenzo

Copy link
Copy Markdown
Owner

Adds Kimi Code (the kimi CLI) as a fifth supported harness.

Kimi discovers user-level Agent Skills as SKILL.md directories, the same mechanism Codex and Copilot use, so it slots into the existing generate → install pipeline without a new command format.

Changes

  • tools/generate — derives .kimi-code/skills/<name>/SKILL.md alongside the Codex/Copilot/Antigravity skills, from the same .claude/commands/*.md sources. The 6 generated skill files are committed.
  • setup — detects kimi, offers it in tool selection, and installs skills to $KIMI_CODE_HOME/skills (default ~/.kimi-code/skills), where Kimi invokes them as /skill:<name>. MCP servers are configured by writing ~/.kimi-code/mcp.json directly: Kimi has no mcp add subcommand, only the interactive /mcp-config TUI editor. A kimi_home helper honors the KIMI_CODE_HOME override throughout.
  • lib/lib-review-loopkimi is now a valid --editor / --reviewer agent, run as kimi -p <prompt>. Non-interactive mode already uses auto permission mode, and Kimi rejects --yolo / --auto when combined with --prompt, so no approval flags are passed.
  • Teststest/generate.bats covers drift in the new skill dir, test/lib-review-loop.bats validates the new agent name, test/smoke includes kimi in its agent list. .pre-commit-config.yaml watches .kimi-code/skills/ for generated-file drift.
  • README — supported-tools table, per-command /skill: usage lines, config docs, MCP notes, and uninstall path.

Deliberately skipped

  • gh agent skill and Impeccable — neither has an identifier for Kimi, so both steps skip it (the existing empty-id guards handle this; no new branching).
  • MCP auto-approve permissions — Kimi's permission rules live in config.toml as a [[permission.rules]] array of tables rather than a JSON allow-list, so setup leaves them to the user, as it already does for Codex.

Known limitations (documented in the README)

  • kimi -p takes the prompt as an argv with no stdin form, so on Windows/Git Bash a very large review-loop prompt can hit the ~32 KB OS argument limit — the same limitation Copilot has.
  • Kimi has no per-run flag to disable MCP servers, so an autonomous loop run still loads whatever is in ~/.kimi-code/mcp.json (Claude, Codex, and Copilot runs disable theirs).

Verification

  • tools/generate --check — in sync
  • test/run — 47/47 passing
  • shellcheck -x on setup, lib/lib-review-loop, tools/generate, both review loops, test/smoke — clean
  • markdownlint-cli2 README.md — clean
  • Exercised install_commands and the MCP helpers against a throwaway $HOME: 6 skills installed with the source marker, re-run reports all 6 up to date, mcp.json written with the expected shape, and KIMI_CODE_HOME respected.

Smoke tests against the real kimi CLI were not run — it is not installed in this environment.

🤖 Generated with Claude Code

https://claude.ai/code/session_019H18Vt8ToMYzD9gX64nKnk


Generated by Claude Code

Kimi Code (https://www.kimi.com/code) ships a `kimi` CLI with the same
user-level Agent Skills mechanism Codex and Copilot use, so it slots into
the existing generate/install pipeline:

- tools/generate derives .kimi-code/skills/<name>/SKILL.md alongside the
  other harnesses; setup installs them to $KIMI_CODE_HOME/skills
  (default ~/.kimi-code/skills), where Kimi invokes them as /skill:<name>
- setup detects `kimi`, offers it in tool selection, and configures MCP
  servers by writing ~/.kimi-code/mcp.json directly — Kimi has no
  `mcp add` subcommand, only the interactive /mcp-config TUI editor
- review loops accept `kimi` as an --editor/--reviewer agent, running it
  as `kimi -p <prompt>`; non-interactive mode already uses auto
  permission mode and rejects --yolo/--auto alongside --prompt

The gh agent skill and Impeccable steps skip Kimi: neither has an
identifier for it. Its permission rules live in config.toml as a
[[permission.rules]] array of tables rather than a JSON allow-list, so
setup leaves MCP auto-approval to the user, as it does for Codex.
@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown

Greptile Summary

Adds Kimi Code CLI as a supported harness.

  • Generates and installs six Kimi-compatible Agent Skills.
  • Adds Kimi detection, custom home-directory support, and direct MCP configuration.
  • Enables Kimi in both review loops and smoke-test discovery.
  • Updates generated-file checks, tests, and user documentation.

Confidence Score: 5/5

The PR appears safe to merge with no concrete correctness or security failures identified.

The Kimi integration consistently extends the existing generation, installation, agent-dispatch, test-discovery, and documentation paths, with its known CLI and MCP limitations explicitly documented.

Important Files Changed

Filename Overview
setup Adds Kimi discovery, skill installation, KIMI_CODE_HOME handling, and MCP JSON configuration without an identified defect.
lib/lib-review-loop Registers Kimi as an editor or reviewer and dispatches non-interactive prompts through kimi -p.
tools/generate Extends the existing deterministic skill-generation pipeline to the Kimi output directory.
test/smoke Includes installed Kimi clients in the existing editor and reviewer smoke-test flow.
README.md Documents Kimi installation, skill invocation, MCP behavior, review-loop support, limitations, and removal.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Claude command sources] --> B[tools/generate]
    B --> C[.kimi-code/skills]
    C --> D[setup]
    D --> E[$KIMI_CODE_HOME/skills]
    D --> F[$KIMI_CODE_HOME/mcp.json]
    G[Review loops] --> H[lib-review-loop]
    H --> I[kimi -p prompt]
Loading

Reviews (1): Last reviewed commit: "feat: add Kimi Code CLI support" | Re-trigger Greptile

@rlorenzo
rlorenzo merged commit 0c08119 into main Jul 25, 2026
5 checks passed
@rlorenzo
rlorenzo deleted the claude/orchestrator-skill-improvements-24wxw9 branch July 25, 2026 00:44
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.

2 participants