feat: add Kimi Code plugin adapter - #657
Open
Phoen1xCode wants to merge 2 commits into
Open
Conversation
kimi.plugin.json at the repo root makes the repo installable via /plugins install: the six skills, the shared .opencode/command/*.md files as /ponytail:<command>, AGENTS.md via systemPromptPath, and the ponytail skill at session start. No hooks: Kimi Code's hook payload differs from the Claude/Codex event shapes the lifecycle hooks emit, so level switches live for the session.
Move the manifest to .kimi-plugin/plugin.json and ship dedicated command copies in .kimi-plugin/commands/ instead of pointing at .opencode/command/, so the two adapters evolve independently. tests/commands.test.js now pins one Kimi command file per registered command, and tests/kimi-plugin.test.js byte-compares the two command sets so a one-sided edit fails loudly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a Kimi Code adapter so the repo installs directly as a Kimi Code plugin:
(or
/plugins→ Custom tab → paste the repo URL, then/reload)How
A self-contained plugin dir,
.kimi-plugin/(a manifest location Kimi Code recognizes, mirroring.qoder-plugin/and friends), wiring the repo's shared files plus its own command copies:skills./skills/commands./.kimi-plugin/commands//ponytail:ponytail,/ponytail:ponytail-review, …systemPromptPath./AGENTS.mdsessionStart.skillponytailThe command files are Kimi-specific copies rather than pointers at
.opencode/command/, so the two adapters evolve independently;tests/commands.test.jspins one file per registered command andtests/kimi-plugin.test.jsbyte-compares the two sets, so a one-sided edit fails loudly instead of drifting.Also:
scripts/check-versions.jsnow pins.kimi-plugin/plugin.jsonwith the other eight version files, plus README (Install / Commands / Uninstall) anddocs/agent-portability.mdentries.Why no hooks
Ponytail's lifecycle hooks emit per-host output shapes hardcoded for Claude/Codex/Copilot/Qoder (
hooks/ponytail-runtime.js). Kimi Code's hook protocol (stdin payload, stdout contract) doesn't match any of them, so declaring the existing scripts would append Claude-shaped JSON verbatim to the user's context. The system-prompt contribution plus the session-start skill already cover always-on behavior; the trade-off is that/ponytail:ponytail ultralevel switches live for the session instead of persisting via the flag file.Test plan
tests/kimi-plugin.test.js(new, 9 tests):./path stays inside the plugin root and existssystemPromptPathcarries the rule invariants within the 32 KB budgetsessionStart.skillresolves to a shipped skilltests/commands.test.js: every registered command now also needs a.kimi-plugin/commands/*.mdfile.npm test- 118 tests pass (incl. the new ones). Note: the csv correctness test needspandasinstalled locally, as documented in the README.node scripts/check-rule-copies.jsandnode scripts/check-versions.jspass.