feat(cli): install trellis sub-agents for Kimi Code platform - #529
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughKimi now installs Trellis agent prompts as both skills and project-level custom sub-agent files under ChangesKimi custom sub-agents
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant KimiConfigurator
participant ProjectFiles
participant MainSession
KimiConfigurator->>ProjectFiles: Write skills and custom sub-agent definitions
MainSession->>ProjectFiles: Dispatch trellis-* custom sub-agent
ProjectFiles-->>MainSession: Load agent prompt and execute task
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Kimi Code now supports project-level custom sub-agents under .kimi-code/agents/ with Claude Code-compatible frontmatter (name/description/tools), so the trellis-implement / trellis-check / trellis-research prompts no longer need to ride on the built-in coder/explore sub-agents. - collectKimiTemplates additionally writes .kimi-code/agents/trellis-*.md, mirroring the skill copies (pull-based prelude included) - kimi agent templates gain a tools: frontmatter line and updated dispatch notes that reference the custom sub-agents instead of the built-in coder - refresh stale "no custom sub-agent definitions" comments in the kimi configurator, template module, ai-tools registry, and trellis-meta reference docs - extend kimi configurator/template/init tests for the new agent files Refs mindfold-ai#349
3f907ab to
2d893ff
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
packages/cli/test/templates/kimi.test.ts (1)
94-112: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the tool values, not only the key.
Line 104 checks only that
tools:exists. It accepts the invalidmcp__*value, so this test passes while the research agent cannot use MCP tools. Assert the expected built-in tools and validate server-specific MCP patterns. (kimi.com)🤖 Prompt for 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. In `@packages/cli/test/templates/kimi.test.ts` around lines 94 - 112, Update the agent assertions in the loop over trellis-implement, trellis-check, and trellis-research so they validate the actual tools values rather than only the tools key. Assert the expected built-in tools for each agent and verify server-specific MCP entries use the required valid patterns, ensuring trellis-research includes usable MCP tools.
🤖 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 `@packages/cli/src/configurators/kimi.ts`:
- Around line 18-20: Update the documentation comment for the Kimi configurator
to state that Trellis does not generate project-local Kimi settings or hooks,
while acknowledging the workspace-local .kimi-code/local.toml settings file and
keeping hooks scoped to $KIMI_CODE_HOME/config.toml.
In `@packages/cli/src/templates/kimi/agents/trellis-check.md`:
- Around line 24-27: Update the Kimi main-session dispatch documentation around
the trellis-check prompt contract to include an example or acceptance test for
dispatching trellis-check, trellis-implement, and trellis-research with prompts
beginning “Active task: <path>”. Add coverage verifying that an omitted
subagent_type selects the built-in coder sub-agent.
In `@packages/cli/src/templates/kimi/agents/trellis-research.md`:
- Around line 7-9: Update the tools declaration in the trellis-research agent
configuration to remove the unsupported mcp__* wildcard; use only explicit
supported MCP server globs if required by this agent, otherwise omit the MCP
entry.
---
Nitpick comments:
In `@packages/cli/test/templates/kimi.test.ts`:
- Around line 94-112: Update the agent assertions in the loop over
trellis-implement, trellis-check, and trellis-research so they validate the
actual tools values rather than only the tools key. Assert the expected built-in
tools for each agent and verify server-specific MCP entries use the required
valid patterns, ensuring trellis-research includes usable MCP tools.
🪄 Autofix
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: 43912122-bd0e-4777-9955-e56fa53cac89
📒 Files selected for processing (13)
packages/cli/src/configurators/kimi.tspackages/cli/src/templates/common/bundled-skills/trellis-meta/SKILL.mdpackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.mdpackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.mdpackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.mdpackages/cli/src/templates/kimi/agents/trellis-check.mdpackages/cli/src/templates/kimi/agents/trellis-implement.mdpackages/cli/src/templates/kimi/agents/trellis-research.mdpackages/cli/src/templates/kimi/index.tspackages/cli/src/types/ai-tools.tspackages/cli/test/commands/init.integration.test.tspackages/cli/test/configurators/index.test.tspackages/cli/test/templates/kimi.test.ts
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
- Copy the updated trellis-meta reference files (SKILL.md, agents.md, platform-map.md, hooks-and-settings.md) byte-identically to the six dogfood skill roots (.agents/.claude/.cursor/.omp/.opencode/.pi) - Update .trellis/spec/cli/backend/platform-integration.md: Kimi Code now installs .kimi-code/agents/trellis-*.md custom sub-agents alongside the skill copies; drop the outdated "no custom sub-agent definitions" notes Refs mindfold-ai#349
- Reword the kimi.ts header note: Trellis does not generate project-local Kimi settings/hooks; project-local settings live in .kimi-code/local.toml and hooks in $KIMI_CODE_HOME/config.toml - Assert the sub-agent dispatch contract in kimi template tests (Agent tool dispatch + Active task: prompt first line) Refs mindfold-ai#349
…d-ai#529) Kimi Code now supports project-level custom sub-agents (`.kimi-code/agents/*.md` with Claude Code-compatible frontmatter), so Trellis installs `trellis-implement`, `trellis-check` and `trellis-research` there rather than relying on the built-in `coder`/`explore` agents alone. Registry, configurator, trellis-meta platform reference, spec and tests are updated together, and the dogfood copies are regenerated. Refs mindfold-ai#349.
Background
Kimi Code platform support landed in #452. At that time Kimi Code had no project-level custom sub-agent definitions, so the Trellis agent prompts (trellis-implement / trellis-check / trellis-research) shipped only as
.kimi-code/skills/SKILL.md files and the main session dispatched the built-incoder/exploresub-agents with those instructions.Kimi Code now supports project-level custom agents under
.kimi-code/agents/*.md(also.agents/agents/), with Claude Code-compatible frontmatter (name/description/tools, comma-separated; unknown fields are ignored). Docs: https://www.kimi.com/code/docs/kimi-code-cli/customization/agents.htmlChanges
collectKimiTemplatesadditionally writes.kimi-code/agents/trellis-{implement,check,research}.md. Content mirrors the skill copies (same templates, pull-based prelude included), so dispatching atrellis-<name>sub-agent directly behaves the same as the previous skill-based path. The skill copies are kept for guidance/backward compatibility.tools:frontmatter line (same tool sets as the Claude agents) and their dispatch notes now reference the.kimi-code/agents/custom sub-agents instead of the built-incoder.templates/kimi/index.ts, theai-tools.tsregistry entry, and the trellis-meta reference docs (agents.md,platform-map.md,hooks-and-settings.md,SKILL.md).Testing
pnpm vitest runinpackages/cli: 1651 passed, 3 failed — all 3 failures reproduce on an unmodifiedmaincheckout in my environment and are unrelated to this change:test/utils/template-fetcher.test.ts > classifies missing refs without falling back to direct mode(network-dependent)test/regression.test.tstwo[gitignore-trellis]tests (they match git's English stderr, but this machine's git outputs a localized message)pnpm typecheckandpnpm lintpass (afterpnpm --filter @mindfoldhq/trellis-core build).--no-verify) because it runs the full suite, which hits the pre-existing failures above.Follow-up (intentionally out of scope)
packages/cli/src/templates/trellis/workflow.mdstill tells the main session to "dispatch the built-incoder/exploresub-agent" for Kimi Code. Updating it breaks themarketplace native workflow mirror matches the bundled workflowtest, which requires byte-parity with themarketplacesubmodule repo — that sync needs a companion change inmindfold-ai/marketplace, so I left it untouched.Refs #349
Summary by CodeRabbit
New Features
.kimi-code/agents/.Documentation
Tests
Compatibility
toolsaccepts a YAML list or a comma-separated string, andmcp__-prefixed entries are glob-matched (per the Kimi Code agents docs), sotools: Read, Write, Glob, Grep, Bash, Skill, mcp__*on trellis-research loads as-is..kimi-code/agents/support. On older versions the agent files are simply not discovered and behavior degrades gracefully to the previous skills-only mode (the.kimi-code/skills/copies are kept), so there is no breakage.Follow-ups (out of scope for this PR)
marketplacesubmodule mirror and the docs-site (github.com/mindfold-ai/docs) EN/CN platform pages / capability matrix need a separate sync for the new.kimi-code/agents/path.