Skip to content

feat(cli): add Kimi Code support - #452

Merged
taosu0216 merged 2 commits into
mindfold-ai:mainfrom
lizhangmai:feat/kimi-code-support
Jul 22, 2026
Merged

taosu0216 merged 2 commits into
mindfold-ai:mainfrom
lizhangmai:feat/kimi-code-support

Conversation

@lizhangmai

@lizhangmai lizhangmai commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Kimi Code (kimi) as a first-class platform, modeled on the Pi Agent integration (82a44643).

Kimi Code reads project-level skills from both .kimi-code/skills/ and the shared .agents/skills/ layer (agentskills.io), plus AGENTS.md. It is integrated as a class-2 pull-based platform: agent-capable, but with no project-level hooks (hooks live in user-level ~/.kimi-code/config.toml only) and no project-level custom sub-agent definitions (only the built-in coder / explore / plan sub-agents).

Changes

  • Registry (ai-tools.ts): new kimi entry — configDir: .kimi-code, supportsAgentSkills: true, agentCapable: true, hasHooks: false; new cmdRefPrefix member /skill:trellis- matching Kimi's /skill:<name> invocation syntax
  • Configurator (configurators/kimi.ts):
    • workflow + bundled skills → shared .agents/skills/ via the neutral resolver (byte-identical to Codex/Gemini/Pi writes — covered by a dedicated parity test)
    • session-boundary commands (trellis-start / trellis-continue / trellis-finish-work) and the trellis-implement / trellis-check / trellis-research agent prompts → .kimi-code/skills/<name>/SKILL.md (shipped as skills since Kimi has no named sub-agent mechanism; implement/check carry the pull-based prelude; the prompts instruct the main session to dispatch Kimi's built-in coder/explore sub-agent)
    • no settings/extension file written → no uninstall scrubber needed
  • CLI: --kimi init flag, InitOptions.kimi
  • Python runtime: cli_adapter.py kimi branches (run: kimi -p <prompt> --yolo, resume: kimi --session <id>, verified against kimi --help), task_store.py subagent config dirs, active_task.py known platforms; workflow.md marker blocks classify Kimi as pull-based agent-capable
  • Dogfood copies under .trellis/ kept byte-identical to templates (verified with diff)
  • Tests: templates/kimi.test.ts, configurator detection + configure/collect byte-parity, init/update integration, regression registry + cli_adapter + jsonl-seed assertions, workflow-label mapping
  • Docs: README/README_CN platform lists (count 17 → 20, was already stale at 19), platform-integration.md spec tables, trellis-meta platform-files references

Deliberately out of scope

  • mem session adapter: the reference Pi commit shipped without one (Pi's adapter landed separately later). Kimi's per-agent wire.jsonl session format needs dedicated adapter work — happy to follow up.

Marketplace dependency

⚠️ This PR bumps the marketplace submodule pointer to the mirror-sync commit in mindfold-ai/marketplace#10. CI will fail to check out the submodule until that PR lands — please merge the marketplace PR first, then I (or a maintainer) can re-bump the pointer to the merge commit (same flow as the Grok sync in #435).

Verification

  • pnpm test: 1434 passed (63 files), including the marketplace-mirror diff test
  • pnpm typecheck, pnpm lint, pnpm lint:py (basedpyright): clean
  • Smoke test: built CLI, trellis init --kimi --yes in a temp repo → .kimi-code/skills/ (6 skills), .agents/skills/, AGENTS.md block, /skill:trellis-* refs rendered correctly; trellis update --dry-run reports already-up-to-date (configure/collect hash parity); get_context.py --step 2.1 --platform kimi routes to the pull-based block

Summary by CodeRabbit

  • New Features

    • Added Kimi Code platform support with automatic detection and CLI initialization.
    • Added the --kimi option to initialize Kimi Code skills and workflows.
    • Added Kimi command/skill compatibility (/skill:trellis-*) and built-in sub-agent workflow integration.
    • Initialized Kimi Code files in the correct shared/private locations (.agents/skills/ and .kimi-code/skills/) without project-level hooks/settings.
  • Documentation

    • Updated platform setup/config/workflow and path references to include Kimi Code, plus Trae IDE and Grok.
    • Refreshed platform files and mapping docs (including updated platform/support counts: 17 → 20).

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 10beee6b-a08f-4d07-bbf2-1d87ead3d0c4

📥 Commits

Reviewing files that changed from the base of the PR and between 64dfe31 and e82de3d.

📒 Files selected for processing (52)
  • .agents/skills/trellis-meta/SKILL.md
  • .agents/skills/trellis-meta/references/platform-files/agents.md
  • .agents/skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • .agents/skills/trellis-meta/references/platform-files/overview.md
  • .agents/skills/trellis-meta/references/platform-files/platform-map.md
  • .agents/skills/trellis-meta/references/platform-files/skills-and-commands.md
  • .claude/skills/trellis-meta/SKILL.md
  • .claude/skills/trellis-meta/references/platform-files/agents.md
  • .claude/skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • .claude/skills/trellis-meta/references/platform-files/overview.md
  • .claude/skills/trellis-meta/references/platform-files/platform-map.md
  • .claude/skills/trellis-meta/references/platform-files/skills-and-commands.md
  • .cursor/skills/trellis-meta/SKILL.md
  • .cursor/skills/trellis-meta/references/platform-files/agents.md
  • .cursor/skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • .cursor/skills/trellis-meta/references/platform-files/overview.md
  • .cursor/skills/trellis-meta/references/platform-files/platform-map.md
  • .cursor/skills/trellis-meta/references/platform-files/skills-and-commands.md
  • .trellis/scripts/common/active_task.py
  • .trellis/scripts/common/cli_adapter.py
  • .trellis/scripts/common/task_store.py
  • .trellis/spec/cli/backend/platform-integration.md
  • .trellis/workflow.md
  • README.md
  • README_CN.md
  • marketplace
  • packages/cli/src/cli/index.ts
  • packages/cli/src/commands/init.ts
  • packages/cli/src/configurators/index.ts
  • packages/cli/src/configurators/kimi.ts
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/SKILL.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md
  • packages/cli/src/templates/kimi/agents/trellis-check.md
  • packages/cli/src/templates/kimi/agents/trellis-implement.md
  • packages/cli/src/templates/kimi/agents/trellis-research.md
  • packages/cli/src/templates/kimi/index.ts
  • packages/cli/src/templates/trellis/scripts/common/active_task.py
  • packages/cli/src/templates/trellis/scripts/common/cli_adapter.py
  • packages/cli/src/templates/trellis/scripts/common/task_store.py
  • packages/cli/src/templates/trellis/workflow.md
  • packages/cli/src/types/ai-tools.ts
  • packages/cli/test/commands/init.integration.test.ts
  • packages/cli/test/commands/update.integration.test.ts
  • packages/cli/test/configurators/index.test.ts
  • packages/cli/test/configurators/platforms.test.ts
  • packages/cli/test/regression.test.ts
  • packages/cli/test/templates/kimi.test.ts
  • packages/cli/test/templates/trellis.test.ts
🚧 Files skipped from review as they are similar to previous changes (38)
  • marketplace
  • README.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md
  • README_CN.md
  • .trellis/scripts/common/active_task.py
  • packages/cli/src/templates/kimi/index.ts
  • packages/cli/src/configurators/index.ts
  • packages/cli/src/templates/trellis/scripts/common/task_store.py
  • packages/cli/src/templates/kimi/agents/trellis-check.md
  • .cursor/skills/trellis-meta/references/platform-files/skills-and-commands.md
  • .claude/skills/trellis-meta/references/platform-files/agents.md
  • packages/cli/src/templates/trellis/scripts/common/active_task.py
  • .agents/skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • .cursor/skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md
  • packages/cli/src/configurators/kimi.ts
  • packages/cli/test/templates/trellis.test.ts
  • packages/cli/test/templates/kimi.test.ts
  • packages/cli/src/templates/kimi/agents/trellis-research.md
  • .cursor/skills/trellis-meta/references/platform-files/agents.md
  • packages/cli/src/templates/kimi/agents/trellis-implement.md
  • .agents/skills/trellis-meta/references/platform-files/platform-map.md
  • packages/cli/test/configurators/index.test.ts
  • packages/cli/test/commands/update.integration.test.ts
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • .agents/skills/trellis-meta/references/platform-files/skills-and-commands.md
  • .trellis/scripts/common/task_store.py
  • .cursor/skills/trellis-meta/references/platform-files/platform-map.md
  • .claude/skills/trellis-meta/references/platform-files/skills-and-commands.md
  • .trellis/workflow.md
  • packages/cli/src/cli/index.ts
  • .claude/skills/trellis-meta/references/platform-files/platform-map.md
  • packages/cli/src/types/ai-tools.ts
  • .trellis/spec/cli/backend/platform-integration.md
  • .claude/skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • .trellis/scripts/common/cli_adapter.py
  • packages/cli/src/templates/trellis/workflow.md

📝 Walkthrough

Walkthrough

Adds Kimi Code as a supported Trellis platform, including CLI detection and execution, shared/private skill generation, workflow routing, pull-based context handling, platform documentation, and automated coverage.

Changes

Kimi Code platform integration

Layer / File(s) Summary
Platform contracts and skill generation
packages/cli/src/types/*, packages/cli/src/configurators/*, packages/cli/src/templates/kimi/*, packages/cli/src/cli/index.ts
Registers Kimi, adds --kimi, defines /skill:trellis-* commands, and generates shared and Kimi-private skills.
Runtime adapter and workflow routing
.trellis/scripts/common/*, packages/cli/src/templates/trellis/*, .trellis/spec/cli/backend/platform-integration.md
Adds Kimi detection, command/resume handling, task seeding, pull-based context rules, and workflow routing.
Platform documentation
.agents/skills/trellis-meta/*, .claude/skills/trellis-meta/*, .cursor/skills/trellis-meta/*, packages/cli/src/templates/common/bundled-skills/trellis-meta/*
Updates platform path, skill, command, hook, matrix, and shared-directory documentation.
Validation and release updates
packages/cli/test/*, README*, marketplace
Adds Kimi integration and regression coverage, updates workflow expectations, changes the platform count to 20, and updates the marketplace reference.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant InitCommand
  participant KimiConfigurator
  participant SkillStorage
  participant KimiCLI
  User->>InitCommand: init --kimi
  InitCommand->>KimiConfigurator: configureKimi(cwd)
  KimiConfigurator->>SkillStorage: write shared .agents/skills
  KimiConfigurator->>SkillStorage: write .kimi-code/skills
  User->>KimiCLI: run Trellis skill
  KimiCLI->>SkillStorage: load SKILL.md
  KimiCLI-->>User: execute workflow or sub-agent prompt
Loading

Possibly related PRs

Suggested reviewers: taosu0216

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding Kimi Code support to the CLI and related tooling.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/trellis-meta/references/platform-files/platform-map.md:
- Line 50: Update the Kimi Code sub-agent documentation to include plan
alongside coder and explore, keeping all references synchronized. Apply the same
change in
.agents/skills/trellis-meta/references/platform-files/platform-map.md:50-50,
.claude/skills/trellis-meta/references/platform-files/platform-map.md:50-50,
.claude/skills/trellis-meta/references/platform-files/agents.md:37-37, and
.cursor/skills/trellis-meta/references/platform-files/agents.md:37-37.

In `@packages/cli/src/templates/common/bundled-skills/trellis-meta/SKILL.md`:
- Line 15: Remove the stale hard-coded platform count from the bundled source at
packages/cli/src/templates/common/bundled-skills/trellis-meta/SKILL.md:15-15,
updating any nearby references to avoid claiming a fixed number of supported
platforms. Regenerate .agents/skills/trellis-meta/SKILL.md:15-15 from the
corrected bundled source so both copies match.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f883ffe-006f-4f1e-84a3-f6325b33b9f5

📥 Commits

Reviewing files that changed from the base of the PR and between a0d749e and 64dfe31.

📒 Files selected for processing (52)
  • .agents/skills/trellis-meta/SKILL.md
  • .agents/skills/trellis-meta/references/platform-files/agents.md
  • .agents/skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • .agents/skills/trellis-meta/references/platform-files/overview.md
  • .agents/skills/trellis-meta/references/platform-files/platform-map.md
  • .agents/skills/trellis-meta/references/platform-files/skills-and-commands.md
  • .claude/skills/trellis-meta/SKILL.md
  • .claude/skills/trellis-meta/references/platform-files/agents.md
  • .claude/skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • .claude/skills/trellis-meta/references/platform-files/overview.md
  • .claude/skills/trellis-meta/references/platform-files/platform-map.md
  • .claude/skills/trellis-meta/references/platform-files/skills-and-commands.md
  • .cursor/skills/trellis-meta/SKILL.md
  • .cursor/skills/trellis-meta/references/platform-files/agents.md
  • .cursor/skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • .cursor/skills/trellis-meta/references/platform-files/overview.md
  • .cursor/skills/trellis-meta/references/platform-files/platform-map.md
  • .cursor/skills/trellis-meta/references/platform-files/skills-and-commands.md
  • .trellis/scripts/common/active_task.py
  • .trellis/scripts/common/cli_adapter.py
  • .trellis/scripts/common/task_store.py
  • .trellis/spec/cli/backend/platform-integration.md
  • .trellis/workflow.md
  • README.md
  • README_CN.md
  • marketplace
  • packages/cli/src/cli/index.ts
  • packages/cli/src/commands/init.ts
  • packages/cli/src/configurators/index.ts
  • packages/cli/src/configurators/kimi.ts
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/SKILL.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md
  • packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md
  • packages/cli/src/templates/kimi/agents/trellis-check.md
  • packages/cli/src/templates/kimi/agents/trellis-implement.md
  • packages/cli/src/templates/kimi/agents/trellis-research.md
  • packages/cli/src/templates/kimi/index.ts
  • packages/cli/src/templates/trellis/scripts/common/active_task.py
  • packages/cli/src/templates/trellis/scripts/common/cli_adapter.py
  • packages/cli/src/templates/trellis/scripts/common/task_store.py
  • packages/cli/src/templates/trellis/workflow.md
  • packages/cli/src/types/ai-tools.ts
  • packages/cli/test/commands/init.integration.test.ts
  • packages/cli/test/commands/update.integration.test.ts
  • packages/cli/test/configurators/index.test.ts
  • packages/cli/test/configurators/platforms.test.ts
  • packages/cli/test/regression.test.ts
  • packages/cli/test/templates/kimi.test.ts
  • packages/cli/test/templates/trellis.test.ts

Comment thread .agents/skills/trellis-meta/references/platform-files/platform-map.md Outdated
Add Kimi Code (kimi) as a first-class platform, modeled on the Pi Agent
integration:

- Registry: new kimi entry (configDir .kimi-code, supportsAgentSkills,
  agentCapable, no project-level hooks) and a new /skill:trellis-
  cmdRefPrefix matching Kimi's /skill:<name> invocation syntax
- Configurator: workflow + bundled skills go to the shared .agents/skills/
  root via the neutral resolver (byte-identical to Codex/Gemini/Pi writes);
  session-boundary commands and the trellis-implement/check/research agent
  prompts ship as Kimi skills under .kimi-code/skills/ (Kimi has no
  project-level custom sub-agent definitions, only built-in coder/explore/
  plan sub-agents)
- CLI: --kimi init flag, InitOptions.kimi
- Python runtime: cli_adapter.py kimi branches (run: kimi -p --yolo,
  resume: kimi --session <id>), task_store.py subagent config dirs,
  active_task.py known platforms; workflow.md marker blocks classify Kimi
  as a pull-based agent-capable platform
- Dogfood copies under .trellis/ kept byte-identical to templates
- Tests: templates/kimi.test.ts, configurator detection + byte-parity,
  init/update integration, regression registry + cli_adapter assertions
- Docs: README/README_CN platform lists, platform-integration spec tables,
  trellis-meta platform-files references
- marketplace submodule bumped to the Kimi workflow-mirror sync commit
  (mindfold-ai/marketplace#10; re-bump to the merge commit after it lands)
@lizhangmai
lizhangmai force-pushed the feat/kimi-code-support branch from 64dfe31 to 0fdc1e9 Compare July 21, 2026 05:08
…tform count

- platform-map.md / agents.md: list all three built-in Kimi sub-agents
  (coder/explore/plan), matching the platform matrix entry
- trellis-meta SKILL.md: remove the hard-coded 'all 15 supported
  platforms' count (stale; the registry is at 20 and keeps growing)
- dogfood copies under .agents/.claude/.cursor kept byte-identical
@taosu0216
taosu0216 merged commit bfa7f99 into mindfold-ai:main Jul 22, 2026
1 check passed
@lizhangmai
lizhangmai deleted the feat/kimi-code-support branch July 22, 2026 05:27
Xio-Shark pushed a commit to Xio-Shark/Trellis that referenced this pull request Sep 17, 2026
* feat(cli): add Kimi Code support

Add Kimi Code (kimi) as a first-class platform, modeled on the Pi Agent
integration:

- Registry: new kimi entry (configDir .kimi-code, supportsAgentSkills,
  agentCapable, no project-level hooks) and a new /skill:trellis-
  cmdRefPrefix matching Kimi's /skill:<name> invocation syntax
- Configurator: workflow + bundled skills go to the shared .agents/skills/
  root via the neutral resolver (byte-identical to Codex/Gemini/Pi writes);
  session-boundary commands and the trellis-implement/check/research agent
  prompts ship as Kimi skills under .kimi-code/skills/ (Kimi has no
  project-level custom sub-agent definitions, only built-in coder/explore/
  plan sub-agents)
- CLI: --kimi init flag, InitOptions.kimi
- Python runtime: cli_adapter.py kimi branches (run: kimi -p --yolo,
  resume: kimi --session <id>), task_store.py subagent config dirs,
  active_task.py known platforms; workflow.md marker blocks classify Kimi
  as a pull-based agent-capable platform
- Dogfood copies under .trellis/ kept byte-identical to templates
- Tests: templates/kimi.test.ts, configurator detection + byte-parity,
  init/update integration, regression registry + cli_adapter assertions
- Docs: README/README_CN platform lists, platform-integration spec tables,
  trellis-meta platform-files references
- marketplace submodule bumped to the Kimi workflow-mirror sync commit
  (mindfold-ai/marketplace#10; re-bump to the merge commit after it lands)

* docs(cli): address review — sync Kimi sub-agent lists, drop stale platform count

- platform-map.md / agents.md: list all three built-in Kimi sub-agents
  (coder/explore/plan), matching the platform matrix entry
- trellis-meta SKILL.md: remove the hard-coded 'all 15 supported
  platforms' count (stale; the registry is at 20 and keeps growing)
- dogfood copies under .agents/.claude/.cursor kept byte-identical
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