Installation & Setup
@maestria/kimi-code is a declarative Kimi Code plugin - a manifest, skills, native slash commands, and a system-prompt contribution. The plugin is loaded by Kimi Code at session start, and the orchestrator skill auto-injects the methodology.
Prerequisites
Section titled “Prerequisites”- Kimi Code v0.38.0+ - the verified version for native plugin
systemPromptPath, plugin commands, and the current plugin registry. Older versions may load the skills-only subset, but are outside the supported boundary. - Node.js 18+ - required for
npm packused by the CLI to install the plugin.
Installation via CLI (Recommended)
Section titled “Installation via CLI (Recommended)”The maestria CLI provides a unified interface for installing and managing maestria plugins across all supported platforms:
# Install for this platformnpx maestria install kimi-code# Install for this platformpnpx maestria install kimi-code# Install for this platformyarn dlx maestria install kimi-code# Verify installationnpx maestria status# Verify installationpnpx maestria status# Verify installationyarn dlx maestria statusAlternative: Manual setup
-
Install the plugin
The plugin is distributed via npm. The maestria CLI downloads and extracts it directly:
Terminal window npx maestria install kimi-codeTerminal window pnpx maestria install kimi-codeTerminal window yarn dlx maestria install kimi-codeThis runs
npm pack @maestria/kimi-code@latest, extracts the tarball into a temporary directory, and installs it through Kimi’s native plugin manager.Alternatively, you can install directly from npm with the same commands used internally:
Terminal window npm pack @maestria/kimi-code@latest --pack-destination /tmpmkdir -p /tmp/maestria-kimi-codetar -xzf /tmp/maestria-kimi-code-*.tgz -C /tmp/maestria-kimi-code --strip-components=1# In Kimi Code, run: /plugins install /tmp/maestria-kimi-coderm -f /tmp/maestria-kimi-code-*.tgz -
Verify the plugin (REQUIRED)
Kimi owns the install record and managed copy. Verify both through the native plugin manager:
/plugins list/plugins info maestria -
Add lifecycle hooks to
config.toml(recommended)Open
~/.kimi-code/config.tomland add the following[[hooks]]blocks. These block destructive bash commands, inject a per-turn orchestrator reminder, and observe compaction cycles.# Block destructive bash commands[[hooks]]event = "PreToolUse"matcher = "Bash"command = "node ~/.kimi-code/hooks/block-dangerous-bash.mjs"timeout = 5# Per-turn orchestrator reminder[[hooks]]event = "UserPromptSubmit"matcher = ""command = "echo 'Maestria active: delegate via the orchestrator skill. Prefer adventurer for recon, architect for design, builder for implementation, diagnose for bugs, reviewer for QA, writer for docs, planner for multi-phase work.'"timeout = 5# Observe compaction cycles (observation-only)[[hooks]]event = "PreCompact"matcher = ".*"command = "echo \"compact start: $(date -Is)\" >> ~/.kimi-code/compact.log"timeout = 5[[hooks]]event = "PostCompact"matcher = ".*"command = "echo \"compact end: $(date -Is)\" >> ~/.kimi-code/compact.log"timeout = 5Save the companion script as
~/.kimi-code/hooks/block-dangerous-bash.mjs:let input = '';process.stdin.on('data', (chunk) => {input += chunk;});process.stdin.on('end', () => {const payload = JSON.parse(input);const command = payload.tool_input?.command ?? '';if (command.includes('rm -rf')) {console.error('Dangerous command detected, blocked');process.exit(2);}}); -
Optional: add review-only permission rules
Add the following to
~/.kimi-code/config.toml:# === Builder (coder) - read-only git + test commands ===# 6 separate rules because each `pattern` matches one command.# scope = "session-runtime" applies to the current session only.[[permission.rules]]decision = "allow"pattern = "Bash(git status*)"scope = "session-runtime"reason = "Builder: read-only git status"[[permission.rules]]decision = "allow"pattern = "Bash(git diff*)"scope = "session-runtime"reason = "Builder: read-only git diff"[[permission.rules]]decision = "allow"pattern = "Bash(git log*)"scope = "session-runtime"reason = "Builder: read-only git log"[[permission.rules]]decision = "allow"pattern = "Bash(npm test*)"scope = "session-runtime"reason = "Builder: run npm tests"[[permission.rules]]decision = "allow"pattern = "Bash(pnpm test*)"scope = "session-runtime"reason = "Builder: run pnpm tests"[[permission.rules]]decision = "allow"pattern = "Bash(npx tsc*)"scope = "session-runtime"reason = "Builder: run TypeScript type check"# === Review-only session - deny Write/Edit for every coder subagent ===# Do not use these session-wide denies while running builder or writer work.[[permission.rules]]decision = "deny"pattern = "Write"scope = "session-runtime"reason = "Review-only session: block all Write tools"[[permission.rules]]decision = "deny"pattern = "Edit"scope = "session-runtime"reason = "Review-only session: block all Edit tools"The
scopefield controls temporal granularity (turn-override,session-runtime,project,user) - it is not per-subagent granularity. Subagent tool lists come from the hardcoded profile (coder/explore/plan), not from per-agent rules. These rules provide session-wide tool enforcement for a review-only session; they cannot safely enforce reviewer boundaries while builder or writer work runs in the same session. -
Reload plugins and start a new session
Plugin changes only take effect in new sessions. After installing, run:
/reload/new -
Verify
In the fresh session, ask:
“Review these 5 files for security issues: src/auth.ts, src/api.ts, src/db.ts, src/routes.ts, src/middleware.ts”
The orchestrator should:
- Auto-load (via
sessionStart.skill). - Identify the work as ≥3 uniform items → use
AgentSwarmwith thereviewerpersona. - Dispatch a swarm across the 5 files.
If the orchestrator starts writing code directly, check
/plugins listand confirm the session-start skill loaded. - Auto-load (via
-
Use native workflow commands (optional)
Kimi namespaces commands contributed by plugins:
/maestria:fein/maestria:sonar/maestria:blitz
Troubleshooting
Section titled “Troubleshooting”Orchestrator not loading
Section titled “Orchestrator not loading”- Check
/plugins list-maestriashould appear withenabled: true. - Check
/plugins info maestriafor manifest diagnostics and confirmsessionStart.skillisorchestrator. - Restart Kimi Code completely (not just the session).
AgentSwarm not available
Section titled “AgentSwarm not available”- Use Kimi Code v0.38.0+; older releases are outside the verified support boundary for this package.
System prompt gets truncated
Section titled “System prompt gets truncated”- The 32 KB plugin system-prompt budget is enforced by Kimi Code. Keep long detail in specialist SKILL.md files, loaded on demand via the
Skilltool.
Updating
Section titled “Updating”To update via the maestria CLI:
npx maestria update kimi-codepnpx maestria update kimi-codeyarn dlx maestria update kimi-codeTo pin to a specific version:
npx maestria update kimi-code --version 0.5.2pnpx maestria update kimi-code --version 0.5.2yarn dlx maestria update kimi-code --version 0.5.2Alternative: Manual update
The CLI uses npm to fetch the latest version. The same commands work manually:
npm pack @maestria/kimi-code@latest --pack-destination /tmpmkdir -p /tmp/maestria-kimi-codetar -xzf /tmp/maestria-kimi-code-*.tgz -C /tmp/maestria-kimi-code --strip-components=1# In Kimi Code, run: /plugins install /tmp/maestria-kimi-coderm -f /tmp/maestria-kimi-code-*.tgzUninstalling
Section titled “Uninstalling”npx maestria uninstall kimi-codepnpx maestria uninstall kimi-codeyarn dlx maestria uninstall kimi-code# or from a Kimi Code session:/plugins remove maestriaOptionally remove the [[hooks]] and [[permission.rules]] blocks from ~/.kimi-code/config.toml.
Next Steps
Section titled “Next Steps”- Quick Start - Your first session with the plugin
- Skill Reference - Detailed documentation for each skill