feat(integration): update Kimi integration for Kimi Code CLI
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.mdtoAGENTS.md --migrate-legacynow also migrates:- old
.kimi/skills/installs to.kimi-code/skills/ - dotted skill directory names (
speckit.xxx) to hyphenated (speckit-xxx) - user content from
KIMI.mdtoAGENTS.md
- old
teardown()removes leftover Speckit-generated.kimi/skills/speckit-*directoriesmulti_install_safeset toFalsebecause Kimi now sharesAGENTS.mdwith Codex- Devcontainer installer switched from
pipx install kimi-clitonpm 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 passeduv run pytest tests/integrations/— 2218 passeduv 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.
Please address Copilot feedback
@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-legacyto skip symlinked.kimi/skillsdirectories and avoid moving content from outside the project. - Updated teardown legacy cleanup to skip symlinks and non-directory entries before removal.
- Removed
kimifrom the multi-install-safe integrations table to align withmulti_install_safe = False.
I also resolved the Copilot review threads. Let me know if anything else needs adjustment.
Please address Copilot feedback
Posted on behalf of @meymchen by Kimi Code CLI agent.
Latest Copilot feedback has been addressed in commit a207446:
_migrate_legacy_kimi_context_file()now uses the same marker resolution logic asIntegrationBase.upsert_context_section()viaself._resolve_context_markers(project_root).- Custom
context_markersconfigured in.specify/extensions/agent-context/agent-context-config.ymlare now respected when stripping the managed section from legacyKIMI.mdduring--migrate-legacy. - Added
test_setup_migrate_legacy_uses_custom_context_markersto cover the custom-marker case. - All 49 Kimi integration tests pass after syncing with
upstream/main.
Per project convention, I am leaving the review conversations for the reviewer/PR author to resolve.
@mnriem Posted on behalf of @meymchen by Kimi Code CLI agent.
Latest Copilot feedback has been addressed in commit 2d66414:
- Tightened _is_safe_legacy_dir() to reject any symlink in path components between project_root and the legacy dir, preventing migration/teardown from operating on the wrong in-tree directory (e.g., .kimi -> . making .kimi/skills resolve to ./skills).
- Added symlink guards to _migrate_legacy_kimi_context_file() so a symlinked KIMI.md is never followed and a symlinked AGENTS.md is never written through, blocking arbitrary file reads/writes outside the project root.
- Added regression tests for symlinked legacy parent dirs, symlinked AGENTS.md writes, and symlinked KIMI.md reads.
- All 53 Kimi integration tests pass.
Per project convention, I am leaving the review conversations for the reviewer/PR author to resolve.
Not seeing the latest commit?
Not seeing the latest commit?
Sorry about the mistake, recommitted.
Please address Copilot feedback