Skip to content

feat(integration): update Kimi integration for Kimi Code CLI#2979

Open
meymchen wants to merge 2 commits into
github:mainfrom
meymchen:feat/1532-kimi-code-cli-compatibility
Open

feat(integration): update Kimi integration for Kimi Code CLI#2979
meymchen wants to merge 2 commits into
github:mainfrom
meymchen:feat/1532-kimi-code-cli-compatibility

Conversation

@meymchen

Copy link
Copy Markdown

Summary

Updates the built-in Kimi integration to align with the new Kimi Code CLI layout from Moonshot AI.

Relates to #1532.

Changes

  • Skills directory moved from .kimi/skills/ to .kimi-code/skills/
  • Context file moved from KIMI.md to AGENTS.md
  • --migrate-legacy now also migrates:
    • old .kimi/skills/ installs to .kimi-code/skills/
    • dotted skill directory names (speckit.xxx) to hyphenated (speckit-xxx)
    • user content from KIMI.md to AGENTS.md
  • teardown() removes leftover Speckit-generated .kimi/skills/speckit-* directories
  • multi_install_safe set to False because Kimi now shares AGENTS.md with Codex
  • Devcontainer installer switched from pipx install kimi-cli to npm install -g @moonshot-ai/kimi-code@latest
  • Updated docs/reference/integrations.md, CHANGELOG.md, and tests

Testing

  • uv run pytest tests/integrations/test_integration_kimi.py — 43 passed
  • uv run pytest tests/integrations/ — 2218 passed
  • uv run pytest tests/ -k kimi — 57 passed

AI Assistance Disclosure

This change was developed with AI assistance for codebase exploration, implementation planning, and test generation. The final design decisions, code review, and verification were done by a human contributor.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the built-in kimi integration to match Moonshot AI’s newer Kimi Code CLI project layout, including new install locations, legacy migration behavior, and devcontainer installation instructions.

Changes:

  • Move Kimi skills install path from .kimi/skills/ to .kimi-code/skills/ and switch the context file from KIMI.md to AGENTS.md.
  • Expand --migrate-legacy to migrate old skill installs and migrate user-authored content from KIMI.mdAGENTS.md.
  • Update docs, changelog, devcontainer installer, and tests to reflect the new Kimi Code CLI integration behavior.
Show a summary per file
File Description
src/specify_cli/integrations/kimi/__init__.py Updates Kimi integration paths, adds migration + legacy cleanup logic, and changes multi-install safety.
tests/integrations/test_integration_kimi.py Updates Kimi integration expectations and adds tests for legacy skills dir + context migration and teardown cleanup.
tests/integrations/test_integration_subcommand.py Adjusts integration switch test expectations for Kimi’s new skills directory.
tests/test_presets.py Updates preset-related tests to use the new Kimi skills directory location.
tests/test_extensions.py Updates parametrized “skill agents” test cases to use .kimi-code/skills.
tests/test_agent_config_consistency.py Ensures runtime and registrar configs match the new .kimi-code/ folder layout.
docs/reference/integrations.md Documents new Kimi paths and expanded --migrate-legacy behavior.
CHANGELOG.md Adds a changelog entry describing the Kimi Code CLI integration update.
.devcontainer/post-create.sh Switches Kimi installation from pipx install kimi-cli to npm install -g @moonshot-ai/kimi-code@latest.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 9/9 changed files
  • Comments generated: 4

Comment thread src/specify_cli/integrations/kimi/__init__.py
Comment thread src/specify_cli/integrations/kimi/__init__.py
Comment thread src/specify_cli/integrations/kimi/__init__.py
Comment thread docs/reference/integrations.md Outdated
@mnriem

mnriem commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

meymchen added 2 commits June 17, 2026 00:27
Update the Kimi integration to target the new Kimi Code CLI
(MoonshotAI/kimi-code) layout:

- Change skills directory from .kimi/skills/ to .kimi-code/skills/
- Change context file from KIMI.md to AGENTS.md
- Extend --migrate-legacy to move old .kimi/skills/ installs and
  migrate KIMI.md user content to AGENTS.md
- Clean up leftover legacy .kimi/skills/ directories on teardown
- Update devcontainer installer to @moonshot-ai/kimi-code
- Update docs and tests

Relates to github#1532
- Override build_command_invocation to emit /skill:speckit-<stem>
  so dispatched commands match Kimi Code CLI's native slash syntax.
- Skip symlinked .kimi/skills directories during legacy migration
  and teardown to avoid operating on files outside the project.
- Remove kimi from the multi-install-safe integrations table.
- Add tests for command invocation and symlink safety.
@meymchen meymchen force-pushed the feat/1532-kimi-code-cli-compatibility branch from 65d3f30 to a5dc347 Compare June 16, 2026 17:05
@meymchen

Copy link
Copy Markdown
Author

@mnriem All Copilot feedback has been addressed in the latest commit (a5dc347).

Changes made:

  • Fixed Kimi skill invocation to use /skill:speckit-<stem> so it matches Kimi Code CLI's native slash command format.
  • Hardened --migrate-legacy to skip symlinked .kimi/skills directories and avoid moving content from outside the project.
  • Updated teardown legacy cleanup to skip symlinks and non-directory entries before removal.
  • Removed kimi from the multi-install-safe integrations table to align with multi_install_safe = False.

I also resolved the Copilot review threads. Let me know if anything else needs adjustment.

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.

3 participants