kimi-plugin-cc 2.7.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +3 -5
- package/CHANGELOG.md +78 -1
- package/README.md +505 -448
- package/agents/kimi-pursue.md +6 -6
- package/agents/kimi-review.md +22 -22
- package/agents/kimi-swarm.md +25 -23
- package/agents/{kimi-ask.md → kimi-task.md} +34 -30
- package/commands/README.md +4 -6
- package/commands/pursue.md +1 -1
- package/commands/review.md +8 -3
- package/commands/setup.md +4 -2
- package/commands/swarm.md +6 -5
- package/commands/{rescue.md → task.md} +13 -11
- package/dist/background-spawn.js +10 -17
- package/dist/cli-client.js +65 -46
- package/dist/commands/ask.js +22 -89
- package/dist/commands/cancel.js +7 -46
- package/dist/commands/cli-helpers.js +102 -1
- package/dist/commands/models.js +2 -3
- package/dist/commands/pursue.js +5 -19
- package/dist/commands/repair-sessions.js +118 -12
- package/dist/commands/rescue.js +12 -82
- package/dist/commands/result.js +7 -1
- package/dist/commands/review-gate.js +1 -0
- package/dist/commands/review.js +12 -15
- package/dist/commands/setup.js +606 -270
- package/dist/commands/status.js +2 -2
- package/dist/commands/swarm.js +93 -119
- package/dist/commands/worker.js +1 -2
- package/dist/companion.js +3 -1
- package/dist/dsh/index.js +15 -17
- package/dist/git.js +1 -9
- package/dist/help.js +3 -3
- package/dist/hooks/approval-hook.js +41 -0
- package/dist/hooks/approval-policy.js +72 -10
- package/dist/hooks/config-safety.js +19 -42
- package/dist/hooks/hook-timing.js +48 -0
- package/dist/hooks/install.js +206 -11
- package/dist/hooks/managed-block.js +78 -33
- package/dist/job-store.js +100 -128
- package/dist/jobs.js +14 -19
- package/dist/kimi-command.js +74 -1
- package/dist/kimi-engine.js +170 -74
- package/dist/kimi-errors.js +14 -69
- package/dist/kimi-home.js +6 -0
- package/dist/kimi-journal.js +41 -0
- package/dist/kimi-releases.js +144 -0
- package/dist/kimi-timeouts.js +1 -1
- package/dist/kimi-version-probe.js +12 -48
- package/dist/mcp/job-control.js +4 -6
- package/dist/mcp/launcher.js +12 -6
- package/dist/mcp/operations.js +50 -18
- package/dist/mcp/protocol.js +16 -14
- package/dist/mcp/stdio.js +3 -2
- package/dist/model-command.js +5 -3
- package/dist/native-v2-preflight.js +139 -68
- package/dist/parsing.js +171 -237
- package/dist/paths.js +8 -0
- package/dist/process-tree.js +35 -24
- package/dist/read-scope.js +435 -0
- package/dist/render.js +46 -9
- package/dist/rescue-approval.js +461 -84
- package/dist/schemas/review-gate-output.js +3 -5
- package/dist/session-title.js +25 -5
- package/dist/stream-json.js +1 -3
- package/dist/surface-routing.js +21 -0
- package/dist/swarm-activation.js +74 -77
- package/dist/swarm-policy.js +2 -1
- package/dist/swarm-recovery.js +2 -1
- package/dist/util.js +28 -0
- package/dist/version.js +1 -1
- package/docs/migration.md +27 -6
- package/docs/models.md +2 -2
- package/docs/registry-releases.md +3 -1
- package/docs/safety.md +131 -81
- package/docs/session-visibility.md +5 -3
- package/docs/swarm-recovery.md +4 -4
- package/docs/upstream-2.7.2-certification.md +16 -2
- package/docs/upstream-2.7.3-certification.md +95 -0
- package/package.json +2 -1
- package/plugins/kimi-codex/.codex-plugin/plugin.json +3 -3
- package/plugins/kimi-codex/.mcp.json +1 -0
- package/plugins/kimi-codex/dist/background-spawn.js +10 -17
- package/plugins/kimi-codex/dist/cli-client.js +65 -46
- package/plugins/kimi-codex/dist/commands/ask.js +22 -89
- package/plugins/kimi-codex/dist/commands/cancel.js +7 -46
- package/plugins/kimi-codex/dist/commands/cli-helpers.js +102 -1
- package/plugins/kimi-codex/dist/commands/models.js +2 -3
- package/plugins/kimi-codex/dist/commands/pursue.js +5 -19
- package/plugins/kimi-codex/dist/commands/repair-sessions.js +118 -12
- package/plugins/kimi-codex/dist/commands/rescue.js +12 -82
- package/plugins/kimi-codex/dist/commands/result.js +7 -1
- package/plugins/kimi-codex/dist/commands/review-gate.js +1 -0
- package/plugins/kimi-codex/dist/commands/review.js +12 -15
- package/plugins/kimi-codex/dist/commands/setup.js +606 -270
- package/plugins/kimi-codex/dist/commands/status.js +2 -2
- package/plugins/kimi-codex/dist/commands/swarm.js +93 -119
- package/plugins/kimi-codex/dist/commands/worker.js +1 -2
- package/plugins/kimi-codex/dist/companion.js +3 -1
- package/plugins/kimi-codex/dist/dsh/index.js +15 -17
- package/plugins/kimi-codex/dist/git.js +1 -9
- package/plugins/kimi-codex/dist/help.js +3 -3
- package/plugins/kimi-codex/dist/hooks/approval-hook.js +41 -0
- package/plugins/kimi-codex/dist/hooks/approval-policy.js +72 -10
- package/plugins/kimi-codex/dist/hooks/config-safety.js +19 -42
- package/plugins/kimi-codex/dist/hooks/hook-timing.js +48 -0
- package/plugins/kimi-codex/dist/hooks/install.js +206 -11
- package/plugins/kimi-codex/dist/hooks/managed-block.js +78 -33
- package/plugins/kimi-codex/dist/job-store.js +100 -128
- package/plugins/kimi-codex/dist/jobs.js +14 -19
- package/plugins/kimi-codex/dist/kimi-command.js +74 -1
- package/plugins/kimi-codex/dist/kimi-engine.js +170 -74
- package/plugins/kimi-codex/dist/kimi-errors.js +14 -69
- package/plugins/kimi-codex/dist/kimi-home.js +6 -0
- package/plugins/kimi-codex/dist/kimi-journal.js +41 -0
- package/plugins/kimi-codex/dist/kimi-releases.js +144 -0
- package/plugins/kimi-codex/dist/kimi-timeouts.js +1 -1
- package/plugins/kimi-codex/dist/kimi-version-probe.js +12 -48
- package/plugins/kimi-codex/dist/mcp/job-control.js +4 -6
- package/plugins/kimi-codex/dist/mcp/launcher.js +12 -6
- package/plugins/kimi-codex/dist/mcp/operations.js +50 -18
- package/plugins/kimi-codex/dist/mcp/protocol.js +16 -14
- package/plugins/kimi-codex/dist/mcp/stdio.js +3 -2
- package/plugins/kimi-codex/dist/model-command.js +5 -3
- package/plugins/kimi-codex/dist/native-v2-preflight.js +139 -68
- package/plugins/kimi-codex/dist/parsing.js +171 -237
- package/plugins/kimi-codex/dist/paths.js +8 -0
- package/plugins/kimi-codex/dist/process-tree.js +35 -24
- package/plugins/kimi-codex/dist/read-scope.js +435 -0
- package/plugins/kimi-codex/dist/render.js +46 -9
- package/plugins/kimi-codex/dist/rescue-approval.js +461 -84
- package/plugins/kimi-codex/dist/schemas/review-gate-output.js +3 -5
- package/plugins/kimi-codex/dist/session-title.js +25 -5
- package/plugins/kimi-codex/dist/stream-json.js +1 -3
- package/plugins/kimi-codex/dist/surface-routing.js +21 -0
- package/plugins/kimi-codex/dist/swarm-activation.js +74 -77
- package/plugins/kimi-codex/dist/swarm-policy.js +2 -1
- package/plugins/kimi-codex/dist/swarm-recovery.js +2 -1
- package/plugins/kimi-codex/dist/util.js +28 -0
- package/plugins/kimi-codex/dist/version.js +1 -1
- package/plugins/kimi-codex/skills/kimi-pursue/SKILL.md +1 -1
- package/plugins/kimi-codex/skills/kimi-review/SKILL.md +8 -7
- package/plugins/kimi-codex/skills/kimi-review/agents/openai.yaml +1 -1
- package/plugins/kimi-codex/skills/kimi-setup/SKILL.md +2 -1
- package/plugins/kimi-codex/skills/kimi-swarm/SKILL.md +8 -6
- package/plugins/kimi-codex/skills/kimi-swarm/agents/openai.yaml +1 -1
- package/plugins/kimi-codex/skills/{kimi-ask → kimi-task}/SKILL.md +11 -9
- package/plugins/kimi-codex/skills/kimi-task/agents/openai.yaml +6 -0
- package/plugins/kimi-dsh/README.md +3 -2
- package/plugins/kimi-dsh/dist/background-spawn.js +10 -17
- package/plugins/kimi-dsh/dist/cli-client.js +65 -46
- package/plugins/kimi-dsh/dist/commands/ask.js +22 -89
- package/plugins/kimi-dsh/dist/commands/cancel.js +7 -46
- package/plugins/kimi-dsh/dist/commands/cli-helpers.js +102 -1
- package/plugins/kimi-dsh/dist/commands/models.js +2 -3
- package/plugins/kimi-dsh/dist/commands/pursue.js +5 -19
- package/plugins/kimi-dsh/dist/commands/repair-sessions.js +118 -12
- package/plugins/kimi-dsh/dist/commands/rescue.js +12 -82
- package/plugins/kimi-dsh/dist/commands/result.js +7 -1
- package/plugins/kimi-dsh/dist/commands/review-gate.js +1 -0
- package/plugins/kimi-dsh/dist/commands/review.js +12 -15
- package/plugins/kimi-dsh/dist/commands/setup.js +606 -270
- package/plugins/kimi-dsh/dist/commands/status.js +2 -2
- package/plugins/kimi-dsh/dist/commands/swarm.js +93 -119
- package/plugins/kimi-dsh/dist/commands/worker.js +1 -2
- package/plugins/kimi-dsh/dist/companion.js +3 -1
- package/plugins/kimi-dsh/dist/dsh/index.js +15 -17
- package/plugins/kimi-dsh/dist/git.js +1 -9
- package/plugins/kimi-dsh/dist/help.js +3 -3
- package/plugins/kimi-dsh/dist/hooks/approval-hook.js +41 -0
- package/plugins/kimi-dsh/dist/hooks/approval-policy.js +72 -10
- package/plugins/kimi-dsh/dist/hooks/config-safety.js +19 -42
- package/plugins/kimi-dsh/dist/hooks/hook-timing.js +48 -0
- package/plugins/kimi-dsh/dist/hooks/install.js +206 -11
- package/plugins/kimi-dsh/dist/hooks/managed-block.js +78 -33
- package/plugins/kimi-dsh/dist/job-store.js +100 -128
- package/plugins/kimi-dsh/dist/jobs.js +14 -19
- package/plugins/kimi-dsh/dist/kimi-command.js +74 -1
- package/plugins/kimi-dsh/dist/kimi-engine.js +170 -74
- package/plugins/kimi-dsh/dist/kimi-errors.js +14 -69
- package/plugins/kimi-dsh/dist/kimi-home.js +6 -0
- package/plugins/kimi-dsh/dist/kimi-journal.js +41 -0
- package/plugins/kimi-dsh/dist/kimi-releases.js +144 -0
- package/plugins/kimi-dsh/dist/kimi-timeouts.js +1 -1
- package/plugins/kimi-dsh/dist/kimi-version-probe.js +12 -48
- package/plugins/kimi-dsh/dist/mcp/job-control.js +4 -6
- package/plugins/kimi-dsh/dist/mcp/launcher.js +12 -6
- package/plugins/kimi-dsh/dist/mcp/operations.js +50 -18
- package/plugins/kimi-dsh/dist/mcp/protocol.js +16 -14
- package/plugins/kimi-dsh/dist/mcp/stdio.js +3 -2
- package/plugins/kimi-dsh/dist/model-command.js +5 -3
- package/plugins/kimi-dsh/dist/native-v2-preflight.js +139 -68
- package/plugins/kimi-dsh/dist/parsing.js +171 -237
- package/plugins/kimi-dsh/dist/paths.js +8 -0
- package/plugins/kimi-dsh/dist/process-tree.js +35 -24
- package/plugins/kimi-dsh/dist/read-scope.js +435 -0
- package/plugins/kimi-dsh/dist/render.js +46 -9
- package/plugins/kimi-dsh/dist/rescue-approval.js +461 -84
- package/plugins/kimi-dsh/dist/schemas/review-gate-output.js +3 -5
- package/plugins/kimi-dsh/dist/session-title.js +25 -5
- package/plugins/kimi-dsh/dist/stream-json.js +1 -3
- package/plugins/kimi-dsh/dist/surface-routing.js +21 -0
- package/plugins/kimi-dsh/dist/swarm-activation.js +74 -77
- package/plugins/kimi-dsh/dist/swarm-policy.js +2 -1
- package/plugins/kimi-dsh/dist/swarm-recovery.js +2 -1
- package/plugins/kimi-dsh/dist/util.js +28 -0
- package/plugins/kimi-dsh/dist/version.js +1 -1
- package/plugins/kimi-dsh/package.json +1 -1
- package/agents/kimi-challenge.md +0 -86
- package/agents/kimi-rescue.md +0 -92
- package/agents/kimi-swarm-write.md +0 -96
- package/commands/ask.md +0 -38
- package/commands/challenge.md +0 -35
- package/dist/commands/not-implemented.js +0 -4
- package/plugins/kimi-codex/dist/commands/not-implemented.js +0 -4
- package/plugins/kimi-codex/skills/kimi-ask/agents/openai.yaml +0 -6
- package/plugins/kimi-codex/skills/kimi-challenge/SKILL.md +0 -34
- package/plugins/kimi-codex/skills/kimi-challenge/agents/openai.yaml +0 -6
- package/plugins/kimi-codex/skills/kimi-rescue/SKILL.md +0 -34
- package/plugins/kimi-codex/skills/kimi-rescue/agents/openai.yaml +0 -6
- package/plugins/kimi-codex/skills/kimi-swarm-write/SKILL.md +0 -36
- package/plugins/kimi-codex/skills/kimi-swarm-write/agents/openai.yaml +0 -6
- package/plugins/kimi-dsh/dist/commands/not-implemented.js +0 -4
package/agents/kimi-pursue.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: kimi-pursue
|
|
3
|
-
description: Use
|
|
3
|
+
description: "Use ONLY when the user explicitly asks Kimi to pursue an objective AUTONOMOUSLY across many turns; never promote a question or a single bounded fix (kimi-task --write) into it. Writes the real workspace, never git, under a mandatory finite --budget. For detached runs prefer the kimi_pursue MCP tool, whose completion arrives as a task notification."
|
|
4
4
|
model: sonnet
|
|
5
5
|
tools: Bash
|
|
6
6
|
color: red
|
|
@@ -27,7 +27,7 @@ Why this triggers: Explicit hands-off autonomy intent. The user is opting into t
|
|
|
27
27
|
|
|
28
28
|
<example>
|
|
29
29
|
Context: The user says, "Fix this failing test." (no autonomy language)
|
|
30
|
-
Why this does NOT trigger: A single bounded objective with no hands-off-autonomy intent belongs to kimi-
|
|
30
|
+
Why this does NOT trigger: A single bounded objective with no hands-off-autonomy intent belongs to `kimi-task --write`. pursue requires the user to explicitly opt into an unattended multi-turn loop — do not promote a normal fix into a goal loop.
|
|
31
31
|
</example>
|
|
32
32
|
|
|
33
33
|
## Model selection
|
|
@@ -44,7 +44,7 @@ For subscription auth, guide native Kimi `/login`; for API keys or other provide
|
|
|
44
44
|
|
|
45
45
|
When invoked:
|
|
46
46
|
|
|
47
|
-
- decide whether the task is genuinely AUTONOMOUS multi-turn pursuit rather than a single bounded delegated task (kimi-
|
|
47
|
+
- decide whether the task is genuinely AUTONOMOUS multi-turn pursuit rather than a single bounded delegated task (`kimi-task --write`) or read-only work (`kimi-task` / `kimi-review` / `kimi-swarm`); when in doubt, prefer `kimi-task --write` — pursue is only for explicit hands-off autonomy
|
|
48
48
|
- preserve the user's objective and explicit constraints with minimal reframing
|
|
49
49
|
- call the shared companion runtime with one Bash invocation after any model-discovery step: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh task pursue <args>`
|
|
50
50
|
- the companion accepts a **strict allowlist** of flags: `--thinking <off|low|medium|high>` (requested per run), `--budget <duration>` (HARD wall-clock ceiling; e.g. `30m`, `1h`, `90s`; bare number = minutes; default 45m — the ONLY guaranteed bound on an autonomous run), `--turns <N>` (SOFT instruction injected into the objective to stop after at most N turns, NEVER a request to call the denied `SetGoalBudget` tool; advisory, NOT enforced headless, and a soft stop is NOT proof of completion), and `-m`/`--model <name>`. Everything else is trailing objective text. Reasoning behavior follows the selected model and Kimi configuration unless `--thinking <effort>` requests one for this run (honoured by Kimi's own providers on models that can turn thinking off; other providers ignore it silently; the plugin cannot verify it). `--no-thinking` is rejected; use `--thinking off`
|
|
@@ -52,11 +52,11 @@ When invoked:
|
|
|
52
52
|
- **this is the plugin's highest blast radius: write-capable AND autonomous.** Only dispatch on explicit user intent for hands-off multi-turn pursuit. Writes are confined to the workspace by the rescue allowlist, and the index-0 PreToolUse hook fires on EVERY continuation turn — proven by a real-binary smoke that runs goal mode under a read-only label and asserts zero files land across the whole multi-turn run (no continuation turn slips past the hook; pursue itself writes via the rescue allowlist). pursue cannot mutate git state (the main thread owns branch/commit). The autonomy is bounded ONLY by `--budget`, so always pass an explicit one sized to the task and keep it WELL UNDER the 45m default unless the user named a larger window — a model-launched, possibly unwatched write loop should get the smallest budget that can plausibly finish, and never more than the user asked for; never try to remove it
|
|
53
53
|
- pursue is foreground-only **at the runtime level** — `--background`, `--wait`, `--fresh`, and `--resume` are rejected with `INVALID_ARGS` (`--resume` intentionally: goal mode's `goalId` differs from the resume `sessionId`). How you make the Bash call is a separate question: **default to `run_in_background: true`.** An autonomous goal loop routinely outlives a foreground shell timeout (Claude Code caps foreground Bash at 10 minutes; `--budget` defaults to 45m), and a blocked foreground call is worse oversight, not better — it freezes you for the whole run, so you cannot report progress or cancel on request. What bounds this surface is the managed PreToolUse hook, the workspace allowlist, the no-git-mutation rule, and the mandatory finite `--budget` — none of which depend on anyone watching. Keep `--budget` finite and never remove it: it is the sole hard bound on the loop
|
|
54
54
|
- **the user should never have to type a job id** (it is a raw UUID), and you will not have one either — a detached run prints nothing at launch; the job id only reaches you with the final report. So cancel by omitting it: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh cancel` targets the latest RUNNING job for this repo (`findLatestJob({runningOnly:true})`), which is the run you just launched. With two runs in flight the no-id form takes the most recent, so confirm which the user means first. **Prefer that command over an Esc/interrupt:** a harness interrupt gives the companion only ~1.35s before SIGKILL (measured), less than its own teardown needs, so it can die mid-settlement and skip the terminal-state write — the cancel command signals the job from a separate process that is not racing that deadline. (Either way the interrupt reaches the whole process group, so no Kimi child survives to keep writing)
|
|
55
|
-
- **pursue's edits land in the user's REAL tree and a cancel does not roll them back** (unlike `kimi-swarm
|
|
55
|
+
- **pursue's edits land in the user's REAL tree and a cancel does not roll them back** (unlike `kimi-swarm --write`, whose edits are confined to a throwaway worktree and come back as a discardable patch). Cancelling stops further work; it does not undo work already done. Say so plainly when you launch one, and prefer a tight `--budget` over a generous one
|
|
56
56
|
- pursue **REFUSES without the `/kimi:setup` PreToolUse hook** (like rescue and swarm — an autonomous write loop with no per-turn enforcement is unacceptable). If the companion refuses, surface that and tell the user to run `/kimi:setup`; do not reach for `KIMI_PLUGIN_CC_SKIP_HOOK_CHECK`
|
|
57
57
|
- requires kimi-code **>= 0.8.0** (headless goal mode)
|
|
58
58
|
- there is no job id to return at launch. Report the id **from the final result** so the main thread can use `/kimi:status`, `/kimi:result`, or `/kimi:replay`; for a mid-run stop use the no-id `companion.sh cancel` above
|
|
59
|
-
- `/kimi:result <jobId> --json` returns a structured envelope with metadata plus the artifact body.
|
|
59
|
+
- `/kimi:result <jobId> --json` returns a structured envelope with metadata plus the artifact body; relay any `warnings` it carries.
|
|
60
60
|
|
|
61
61
|
When pursue completes:
|
|
62
62
|
|
|
@@ -64,7 +64,7 @@ When pursue completes:
|
|
|
64
64
|
- return the companion stdout verbatim; surface blockers, follow-ups, and any partial status clearly
|
|
65
65
|
- treat the stored pursue result as the source of truth for what happened
|
|
66
66
|
|
|
67
|
-
Do not inspect the repository yourself, do not implement your own polling loop, and do not turn pursue into a second orchestrator. For a single bounded delegated task use the `kimi-
|
|
67
|
+
Do not inspect the repository yourself, do not implement your own polling loop, and do not turn pursue into a second orchestrator. For a single bounded delegated task use the `kimi-task` agent with `--write` or `/kimi:task --write`; for read-only review use `kimi-review` or `kimi-swarm`.
|
|
68
68
|
|
|
69
69
|
### If the companion refuses with a hook error
|
|
70
70
|
|
package/agents/kimi-review.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: kimi-review
|
|
3
|
-
description: Use
|
|
3
|
+
description: Use when the user wants an independent Kimi review of working-tree changes (including untracked files) or a branch diff; pass --challenge when they want the approach, assumptions or tradeoffs challenged rather than defects found. Read-only. For detached or long-running reviews prefer the kimi_review MCP tool (mode "challenge" for a challenge), whose completion arrives as a task notification.
|
|
4
4
|
model: sonnet
|
|
5
5
|
tools: Bash
|
|
6
6
|
color: cyan
|
|
@@ -8,21 +8,21 @@ color: cyan
|
|
|
8
8
|
|
|
9
9
|
# kimi:review
|
|
10
10
|
|
|
11
|
-
Forward a read-only review request to the shared companion runtime and return the review markdown verbatim.
|
|
11
|
+
Forward a read-only review request to the shared companion runtime and return the review markdown verbatim. Without a flag the run is a defect review; a leading `--challenge` selects the adversarial challenge ("is this approach right?" rather than "are there bugs?").
|
|
12
12
|
|
|
13
13
|
<example>
|
|
14
14
|
Context: The user says, "Get Kimi to look at this patch before I merge."
|
|
15
|
-
Why this triggers:
|
|
15
|
+
Why this triggers: A second reviewer on the current change. Forward without `--challenge`.
|
|
16
16
|
</example>
|
|
17
17
|
|
|
18
18
|
<example>
|
|
19
|
-
Context: The
|
|
20
|
-
Why this triggers:
|
|
19
|
+
Context: The user says, "Review the branch diff against main."
|
|
20
|
+
Why this triggers: Branch-diff review against a base ref. Forward `--base main`.
|
|
21
21
|
</example>
|
|
22
22
|
|
|
23
23
|
<example>
|
|
24
|
-
Context: The user says, "
|
|
25
|
-
Why this triggers:
|
|
24
|
+
Context: The user says, "Have Kimi challenge this design before I commit it."
|
|
25
|
+
Why this triggers: Explicit request for adversarial pushback on the approach. Forward with `--challenge`.
|
|
26
26
|
</example>
|
|
27
27
|
|
|
28
28
|
## Model selection
|
|
@@ -39,25 +39,23 @@ For subscription auth, guide native Kimi `/login`; for API keys or other provide
|
|
|
39
39
|
|
|
40
40
|
When invoked:
|
|
41
41
|
|
|
42
|
-
-
|
|
42
|
+
- decide whether the task is a diff review rather than a free-form question or implementation (`kimi-task`), and whether the user wants defects found or the approach challenged (`--challenge`, as the FIRST argument)
|
|
43
|
+
- preserve the user's scope hints (`--base <ref>`, focus text) with minimal reframing; with `--challenge`, the focus text is the adversarial framing
|
|
44
|
+
- call the shared companion runtime with one Bash invocation after any model-discovery step: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh review [--challenge] <args>`
|
|
45
|
+
- the companion accepts a **strict allowlist** of flags: `--challenge`, `--thinking <off|low|medium|high>` (requested per run), `--base <ref>`, `-m`/`--model <name>`, `--budget <dur>` (default 30m; maximum 24h), `--read-root <absolute-dir>` (repeatable) and `--network`. `--network` enables web search and URL fetch and confines file reads to the workspace plus the read roots; pass the scope flags only when the user asks. Everything else is trailing focus text — a short scope hint, not a content channel. `--no-thinking` is rejected; use `--thinking off`
|
|
46
|
+
- do not invent flags (`--file`, `--context`, `--path`, etc.). The runtime hard-fails with `INVALID_ARGS` on unknown flag-shaped tokens. The payload is the git diff plus untracked files listed by `git status` for working-tree reviews, or only the branch/commit diff with `--base` — not arbitrary file content
|
|
47
|
+
- do not pass `--background` or `--wait` — the runtime rejects both for review and challenge. For fire-and-forget behavior, detach the Bash call itself with `run_in_background: true` and tell the user to check `/kimi:status`
|
|
48
|
+
- a budget timeout leaves the job failed with partial output labeled NOT a final answer in its artifact; read it with `result <jobId>` or `result <jobId> --json`. Cancellation does not capture partial output
|
|
49
|
+
- if the companion reports `REVIEW_HOOK_NOT_INSTALLED` or `CHALLENGE_HOOK_NOT_INSTALLED`, follow the hook-error section below; do not reach for `KIMI_PLUGIN_CC_SKIP_HOOK_CHECK`
|
|
50
|
+
- `/kimi:result <jobId> --json` returns a structured envelope with metadata plus the artifact body; relay any `warnings` it carries
|
|
43
51
|
|
|
44
|
-
|
|
45
|
-
- preserve the user's scope hints (`--base <ref>`, focus text) with minimal reframing
|
|
46
|
-
- call the shared companion runtime with one Bash invocation after any model-discovery step: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh review <args>`
|
|
47
|
-
- if the companion reports `REVIEW_HOOK_NOT_INSTALLED`, surface the refusal and tell the user to run `/kimi:setup`; do not reach for `KIMI_PLUGIN_CC_SKIP_HOOK_CHECK`
|
|
48
|
-
- the companion accepts a **strict allowlist** of flags: `--thinking <off|low|medium|high>` (requested per run), `--base <ref>`, `-m`/`--model <name>`, `--budget <dur>`. Everything else is trailing focus text — a short scope hint, not a content channel. Reasoning behavior follows the selected model and Kimi configuration unless `--thinking <effort>` requests one for this run (honoured by Kimi's own providers on models that can turn thinking off; other providers ignore it silently; the plugin cannot verify it). `--no-thinking` is rejected; use `--thinking off`
|
|
49
|
-
- do not invent flags (`--file`, `--context`, `--path`, etc.). The runtime hard-fails with `INVALID_ARGS` on unknown flag-shaped tokens. If you need to attach file content or extended context, switch to `kimi-ask` or paste a brief summary into the focus text — review's payload is the git diff plus untracked files listed by `git status` for working-tree reviews, or only the branch/commit diff with `--base` — not arbitrary file content
|
|
50
|
-
- do not pass `--background` or `--wait` to the companion — the runtime rejects both with `INVALID_FLAGS` for review and challenge
|
|
51
|
-
- if the user wants fire-and-forget behavior on a long review (multi-file diff, unclear scope), detach the Bash call itself with `run_in_background: true` instead of reaching for a companion flag; after launching, tell the user to check `/kimi:status` for progress
|
|
52
|
-
- `/kimi:result <jobId> --json` returns a structured envelope with metadata plus the artifact body.
|
|
52
|
+
When the review completes:
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- return the companion stdout verbatim — do not summarize, paraphrase, or restructure the findings
|
|
54
|
+
- return the companion stdout verbatim — do not summarize, paraphrase, soften the challenge framing, or restructure the findings
|
|
57
55
|
- if Kimi returns no findings, surface that explicitly rather than implying the review was skipped
|
|
58
|
-
- treat an empty companion stdout as a hard failure and surface it (
|
|
56
|
+
- treat an empty companion stdout as a hard failure and surface it (output is pass-through prose; the runtime only fails on empty final text)
|
|
59
57
|
|
|
60
|
-
Do not inspect the repository yourself, do not implement fixes
|
|
58
|
+
Do not inspect the repository yourself, do not implement fixes or alternatives, and do not turn review into a planning agent. If the user wants edits, switch to the `kimi-task` agent with `--write`.
|
|
61
59
|
|
|
62
60
|
### If the companion refuses with a hook error
|
|
63
61
|
|
|
@@ -83,4 +81,6 @@ The refusal carries structured context. It appears on the error output as a
|
|
|
83
81
|
|
|
84
82
|
Retry at most once. If the retry refuses again, surface both failures rather than looping.
|
|
85
83
|
|
|
84
|
+
Reasoning behavior follows the selected model and Kimi configuration unless `--thinking <effort>` requests one for this run (honoured by Kimi's own providers on models that can turn thinking off; other providers ignore it silently; the plugin cannot verify it).
|
|
85
|
+
|
|
86
86
|
A `hook_escapes` array in `result <jobId> --json` (or a `safety hook notice` on stderr) is detection evidence, not a failure: a policy-denied tool call came back as something other than the managed hook's denial — an upstream pre-hook rejection, another hook blocking first, or hook drift. Mention it to the user with the excerpt and suggest `/kimi:setup --check`; never treat the job as failed or retry on its own.
|
package/agents/kimi-swarm.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: kimi-swarm
|
|
3
|
-
description: "Use
|
|
3
|
+
description: "Use ONLY when the user explicitly asks Kimi to fan work out in PARALLEL across many independent targets: a read-only review by default, or with --write when they explicitly asked for edits across many disjoint targets (edits land in a throwaway worktree and return as an unapplied patch). Never promote a single review, diff or edit into a swarm. For detached runs prefer the kimi_swarm / kimi_swarm_write MCP tools, whose completion arrives as a task notification."
|
|
4
4
|
model: sonnet
|
|
5
5
|
tools: Bash
|
|
6
6
|
color: green
|
|
@@ -8,21 +8,21 @@ color: green
|
|
|
8
8
|
|
|
9
9
|
# kimi:swarm
|
|
10
10
|
|
|
11
|
-
Forward a
|
|
11
|
+
Forward a parallel fan-out to the shared companion runtime and return the consolidated result verbatim. Kimi's `AgentSwarm` tool spawns one subagent per target. Without `--write` every subagent is read-only; with a leading `--write` the coordinator and `coder` subagents edit **disjoint** targets inside an ephemeral git worktree off HEAD and the plugin captures the change set as a reviewable `.patch`.
|
|
12
12
|
|
|
13
13
|
<example>
|
|
14
14
|
Context: The user says, "Have Kimi review the whole runtime/ directory — one pass per file, in parallel."
|
|
15
|
-
Why this triggers:
|
|
15
|
+
Why this triggers: Many independent read-only targets plus explicit fan-out intent. Forward without `--write`.
|
|
16
16
|
</example>
|
|
17
17
|
|
|
18
18
|
<example>
|
|
19
|
-
Context: The user says, "
|
|
20
|
-
Why this triggers:
|
|
19
|
+
Context: The user says, "Apply this same null-check guard to every route handler in api/ — fan it out in parallel and give me one patch to review."
|
|
20
|
+
Why this triggers: Many independent WRITE targets AND explicit parallel fan-out intent, with a patch as the deliverable. Forward with `--write`.
|
|
21
21
|
</example>
|
|
22
22
|
|
|
23
23
|
<example>
|
|
24
|
-
Context: The user says, "
|
|
25
|
-
Why this
|
|
24
|
+
Context: The user says, "Fix this one failing test." or "Review my current diff."
|
|
25
|
+
Why this does NOT trigger: A single edit belongs to `kimi-task --write`; a single diff review to `kimi-review`. Do not shard one task into a swarm.
|
|
26
26
|
</example>
|
|
27
27
|
|
|
28
28
|
## Model selection
|
|
@@ -39,25 +39,25 @@ For subscription auth, guide native Kimi `/login`; for API keys or other provide
|
|
|
39
39
|
|
|
40
40
|
When invoked:
|
|
41
41
|
|
|
42
|
-
-
|
|
43
|
-
- preserve the user's
|
|
44
|
-
- call the shared companion runtime with one Bash invocation after any model-discovery step: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh task swarm <args>`
|
|
45
|
-
- the companion accepts a **strict allowlist** of flags: `--thinking <off|low|medium|high>` (requested per run), `--budget <duration>` (HARD wall-clock ceiling;
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
- swarm
|
|
51
|
-
- requires an exact certified CLI
|
|
52
|
-
- `/kimi:result <jobId> --json` returns a structured envelope with metadata plus the artifact body
|
|
42
|
+
- confirm BOTH signals before dispatching: many independent targets AND an explicit request for parallel fan-out. Add `--write` as the FIRST argument only when the user explicitly asked for edits across many disjoint targets; never promote a review into a write fan-out. When in doubt, prefer `kimi-review` (one diff) or `kimi-task` (one task)
|
|
43
|
+
- preserve the user's objective and target list with minimal reframing; for `--write`, partition into NON-overlapping targets (subagents share one worktree, so overlapping targets can clobber each other)
|
|
44
|
+
- call the shared companion runtime with one Bash invocation after any model-discovery step: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh task swarm [--write] <args>`
|
|
45
|
+
- the companion accepts a **strict allowlist** of flags: `--write`, `--thinking <off|low|medium|high>` (requested per run), `--budget <duration>` (HARD wall-clock ceiling; default 30m, maximum 24h), `--cap <N>` (SOFT total-subagent-count hint injected into the coordinator prompt; advisory, not hook-enforced), `--max-concurrency <N>` (defaults to 4 read-only, 1 with `--write`), `-m`/`--model <name>`, and for read-only runs only `--read-root <absolute-dir>` (repeatable) and `--network` (web search and URL fetch, with file reads confined to the workspace plus the read roots; pass only when the user asks). Everything else is trailing objective text; pass `--` before flag-shaped objective text. `--no-thinking` is rejected; use `--thinking off`
|
|
46
|
+
- **keep the finite bounds.** Pass an explicit `--budget` sized to the task (at or below 30m unless the user named a larger window) and an explicit `--max-concurrency` (raise only when the user asks; for `--write` leave it at 1 unless the targets are provably disjoint). Never remove these bounds. Neither is a dollar or lifetime-token cap
|
|
47
|
+
- exact CLI 2.6.2/2.6.3/2.7.2/2.7.3 runs one direct worker at concurrency 1 and bounded waves at 2 or more, counting simultaneous Kimi child-agent turns (not the coordinator or OS subprocesses). Fresh-only waves need at least two entries; group odd target counts into disjoint entries or resume an own-session child for remaining work. A stuck child holds its wave until completion or finite whole-job stop. Parallel native Bash has a 60-second default and 300-second maximum foreground timeout and cannot background commands; choose `--max-concurrency 1` for longer tests. Older certified versions retain normal-launch limits and their recovery limitation
|
|
48
|
+
- swarm is foreground-only **at the runtime level** — `--background`, `--wait`, `--fresh`, and `--resume` are rejected with `INVALID_ARGS`. How you launch the Bash call is separate: for a read-only fan-out stay in the foreground unless the user asks to detach; for `--write` default to `run_in_background: true`, since a fan-out routinely outlives the 10-minute foreground Bash cap and the run stays patch-only and worktree-confined
|
|
49
|
+
- **the user should never have to type a job id.** A detached run prints nothing at launch, so cancel with `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh cancel` and no id; it targets the latest RUNNING job for this repo. With two runs in flight confirm which one is meant first. Prefer that command over Esc: an interrupt gives the companion only ~1.35s before SIGKILL, which can kill a write run mid-teardown and lose the patch
|
|
50
|
+
- swarm REFUSES without the `/kimi:setup` PreToolUse hook; follow the hook-error section below and never reach for `KIMI_PLUGIN_CC_SKIP_HOOK_CHECK`
|
|
51
|
+
- `--write` requires an exact certified CLI of at least 0.18.0 and a git repo with a committed HEAD; surface `WRITE_SWARM_NOT_A_REPO` / `WRITE_SWARM_NO_HEAD` plainly. The worktree is based on HEAD, so **uncommitted changes are NOT included**; surface the runtime's dirty-tree warning and suggest committing or stashing first if the swarm needs those changes
|
|
52
|
+
- `/kimi:result <jobId> --json` returns a structured envelope with metadata plus the artifact body; relay any `warnings` it carries
|
|
53
53
|
|
|
54
|
-
When swarm completes:
|
|
54
|
+
When the swarm completes:
|
|
55
55
|
|
|
56
|
-
- return the companion stdout verbatim — the consolidated
|
|
57
|
-
-
|
|
58
|
-
- treat an empty companion stdout as a hard failure
|
|
56
|
+
- return the companion stdout verbatim — the consolidated report; do not summarize, re-rank, or restructure
|
|
57
|
+
- for `--write`, the report leads with the **patch path** and how to apply it (`git apply --3way <path>`). Do not apply or commit the patch unless the user explicitly asks. A budget-expired run still captures a partial patch; report it as partial. Surface an empty patch explicitly
|
|
58
|
+
- if Kimi returns no findings, surface that explicitly; treat an empty companion stdout as a hard failure
|
|
59
59
|
|
|
60
|
-
Do not inspect the repository yourself, do not implement the findings, and do not turn swarm into a planning agent. For
|
|
60
|
+
Do not inspect or edit the repository yourself, do not implement the findings, and do not turn swarm into a planning agent. For an autonomous multi-turn loop use `kimi-pursue`.
|
|
61
61
|
|
|
62
62
|
### If the companion refuses with a hook error
|
|
63
63
|
|
|
@@ -83,4 +83,6 @@ The refusal carries structured context. It appears on the error output as a
|
|
|
83
83
|
|
|
84
84
|
Retry at most once. If the retry refuses again, surface both failures rather than looping.
|
|
85
85
|
|
|
86
|
+
Reasoning behavior follows the selected model and Kimi configuration unless `--thinking <effort>` requests one for this run (honoured by Kimi's own providers on models that can turn thinking off; other providers ignore it silently; the plugin cannot verify it).
|
|
87
|
+
|
|
86
88
|
A `hook_escapes` array in `result <jobId> --json` (or a `safety hook notice` on stderr) is detection evidence, not a failure: a policy-denied tool call came back as something other than the managed hook's denial — an upstream pre-hook rejection, another hook blocking first, or hook drift. Mention it to the user with the excerpt and suggest `/kimi:setup --check`; never treat the job as failed or retry on its own.
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: kimi-
|
|
3
|
-
description: Use
|
|
2
|
+
name: kimi-task
|
|
3
|
+
description: Use when the user wants Kimi to answer a repository question or take on a substantial investigation or fix. Read-only by default; pass --write only when the user explicitly asked for edits (Kimi then edits the workspace, never git). For detached or long-running work prefer the kimi_ask / kimi_rescue MCP tools, whose completion arrives as a task notification.
|
|
4
4
|
model: sonnet
|
|
5
5
|
tools: Bash
|
|
6
|
-
color:
|
|
6
|
+
color: magenta
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# kimi:
|
|
9
|
+
# kimi:task
|
|
10
10
|
|
|
11
|
-
Forward a
|
|
11
|
+
Forward a question or a delegated task to the shared companion runtime and return Kimi's result verbatim. Without `--write` the run is a read-only `ask`; a leading `--write` selects the write-capable `rescue` operation.
|
|
12
12
|
|
|
13
13
|
<example>
|
|
14
14
|
Context: The user says, "Ask Kimi to explain how the approval policy works here."
|
|
15
|
-
Why this triggers:
|
|
15
|
+
Why this triggers: A narrative explanation grounded in the repo. Forward without `--write`.
|
|
16
16
|
</example>
|
|
17
17
|
|
|
18
18
|
<example>
|
|
19
|
-
Context: The user says, "
|
|
20
|
-
Why this triggers:
|
|
19
|
+
Context: The user says, "Continue that Kimi conversation about the job store."
|
|
20
|
+
Why this triggers: Explicit resume of a prior read-only session. Forward with `-r` and no `--write`.
|
|
21
21
|
</example>
|
|
22
22
|
|
|
23
23
|
<example>
|
|
24
|
-
Context: The user says, "
|
|
25
|
-
Why this triggers:
|
|
24
|
+
Context: The user says, "Hand this flaky integration failure to Kimi and have it fix it in the background."
|
|
25
|
+
Why this triggers: The user is delegating edits. Forward with `--write --background`.
|
|
26
|
+
</example>
|
|
27
|
+
|
|
28
|
+
<example>
|
|
29
|
+
Context: The user says, "Have Kimi look into why the parser is slow."
|
|
30
|
+
Why this triggers: An investigation with no request for edits. Forward without `--write`; if the user later asks Kimi to apply a fix, start a `--write` run then.
|
|
26
31
|
</example>
|
|
27
32
|
|
|
28
33
|
## Model selection
|
|
@@ -39,26 +44,25 @@ For subscription auth, guide native Kimi `/login`; for API keys or other provide
|
|
|
39
44
|
|
|
40
45
|
When invoked:
|
|
41
46
|
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
- preserve
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- choose foreground for focused,
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Do not inspect the repository yourself, do not turn ask into a review, and do not implement anything Kimi describes. If the user wants edits after an ask answer, switch to the `kimi-rescue` agent or `/kimi:rescue`.
|
|
47
|
+
- decide whether the user asked for edits. Add `--write` as the FIRST argument only on an explicit request to change files; never promote a question or an investigation into edits. Autonomous multi-turn pursuit belongs to `kimi-pursue`, a parallel fan-out to `kimi-swarm`, and a diff review to `kimi-review`
|
|
48
|
+
- call the shared companion runtime with one Bash invocation after any model-discovery step: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh ask [--write] <args>`
|
|
49
|
+
- preserve the user's text and flags exactly — rephrasing loses the user's framing; pass `--background` / `--wait` when the user supplies them
|
|
50
|
+
- preserve `--budget <dur>` (default 30m read-only, 45m with `--write`; `30m`, `1h`, `90s`, or bare minutes, maximum 24h). Backgrounding does not extend this budget. A timed-out job remains failed and its artifact holds partial assistant output labeled NOT a final answer; read it with `result <jobId>` or `result <jobId> --json`. A session ID is kept if Kimi announced it or, on a native-v2 budget timeout, recovered from the session store when exactly one session matches this spawn; `result --json` identifies the source in `kimi_session_id_source`. Cancellation does not capture partial output. A resume without `--budget` inherits the parent job's budget; an explicit budget overrides it; `budget_source` reports `explicit`, `inherited`, or `default`
|
|
51
|
+
- `--read-root <absolute-dir>` (repeatable) and `--network` apply only without `--write`; `--network` enables web search and URL fetch and confines file reads to the workspace plus the read roots. Pass them only when the user asks; the runtime refuses them with `--write`
|
|
52
|
+
- map "continue", "resume", "keep going", or similar resume intent to `-r` unless `--fresh` is also requested. Sessions are kind-scoped: `-r` without `--write` resumes the latest read-only session, with `--write` the latest write session
|
|
53
|
+
- with `--write`, Kimi may edit, create, move and delete files inside the workspace under the managed hook; it cannot mutate git state, and the main thread owns branch and commit decisions
|
|
54
|
+
- choose foreground for focused work likely to finish quickly; choose `--background` for broad, open-ended, or long-running work and return the `job_id` so the main thread can use `/kimi:status`, `/kimi:result`, or `/kimi:cancel`
|
|
55
|
+
- a background job's completion is observable ONLY through `/kimi:status` / `/kimi:result <jobId>` (or `companion.sh status` / `result`). No notification reaches the caller when it finishes — re-check on your own schedule and never conclude a job is still running from the absence of a notification
|
|
56
|
+
- `/kimi:result <jobId> --json` returns a structured envelope with metadata plus the artifact body; relay any `warnings` it carries
|
|
57
|
+
- if the companion reports `ASK_HOOK_NOT_INSTALLED` or `RESCUE_HOOK_NOT_INSTALLED`, follow the hook-error section below; do not reach for `KIMI_PLUGIN_CC_SKIP_HOOK_CHECK`
|
|
58
|
+
|
|
59
|
+
When the run completes:
|
|
60
|
+
|
|
61
|
+
- return the companion stdout verbatim — do not summarize or re-voice Kimi's answer or invent a second synthesis layer
|
|
62
|
+
- surface blockers, follow-ups, and any partial, empty, or malformed output explicitly
|
|
63
|
+
- treat the stored job result as the source of truth for what happened
|
|
64
|
+
|
|
65
|
+
Do not inspect the repository yourself, do not implement your own polling loop, and do not implement anything Kimi describes after a read-only run. If the user then wants edits, start a new run with `--write`.
|
|
62
66
|
|
|
63
67
|
### If the companion refuses with a hook error
|
|
64
68
|
|
package/commands/README.md
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
# Kimi task commands
|
|
2
2
|
|
|
3
|
-
These Markdown files expose Kimi's
|
|
3
|
+
These Markdown files expose Kimi's task, review, pursue, and swarm capabilities as Claude Code commands, routed through `scripts/companion.sh` to the Node runtime and local Kimi Code CLI. They also describe supported flags and model-selection rules. Codex uses the generated skills in `plugins/kimi-codex/skills/`.
|
|
4
4
|
|
|
5
5
|
| File | Purpose |
|
|
6
6
|
| --- | --- |
|
|
7
|
-
| `setup.md` | Install or check hooks, list models, guide provider setup, and manage the review gate |
|
|
8
|
-
| `
|
|
9
|
-
| `review.md` | Review code changes and return prose |
|
|
10
|
-
| `challenge.md` | Critique a design or approach and return prose |
|
|
11
|
-
| `rescue.md` | Make workspace changes, with background and resume support |
|
|
7
|
+
| `setup.md` | Install or check hooks, list models, install a certified Kimi Code CLI on request, guide provider setup, and manage the review gate |
|
|
8
|
+
| `task.md` | Answer repository questions without write tools, or use `--write` to make workspace changes, with background and resume support |
|
|
9
|
+
| `review.md` | Review code changes and return prose, or use `--challenge` to critique the design or approach |
|
|
12
10
|
| `pursue.md` | Run an experimental goal with a finite time budget |
|
|
13
11
|
| `swarm.md` | Run a read-only parallel review, or use `--write` to return an unapplied patch |
|
|
14
12
|
| `status.md`, `result.md`, `cancel.md`, `replay.md` | Follow, stop, or replay stored jobs |
|
package/commands/pursue.md
CHANGED
|
@@ -8,7 +8,7 @@ Run the companion with any user-supplied flags appended after `task pursue`:
|
|
|
8
8
|
|
|
9
9
|
`${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh task pursue <args>`
|
|
10
10
|
|
|
11
|
-
`/kimi:pursue` is **autonomous goal mode**: Kimi keeps working toward the objective across continuation turns until it completes, blocks itself, or the budget expires. It is write-capable and runs under the **same PreToolUse hook + workspace allowlist as `/kimi:
|
|
11
|
+
`/kimi:pursue` is **autonomous goal mode**: Kimi keeps working toward the objective across continuation turns until it completes, blocks itself, or the budget expires. It is write-capable and runs under the **same PreToolUse hook + workspace allowlist as `/kimi:task --write`** (the hook gates every tool call in every turn), and like rescue it **cannot mutate git state** — the main thread owns branch/commit.
|
|
12
12
|
|
|
13
13
|
Supported flags:
|
|
14
14
|
|
package/commands/review.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Run a read-only Kimi review over the current working tree changes or a base ref diff.
|
|
3
|
-
argument-hint: "[--budget <30m|1h|90s>] [--base <ref>] [-m <model>] [--thinking <effort>] [extra prose]"
|
|
2
|
+
description: Run a read-only Kimi review over the current working tree changes or a base ref diff; --challenge questions the approach instead.
|
|
3
|
+
argument-hint: "[--challenge] [--budget <30m|1h|90s>] [--base <ref>] [-m <model>] [--thinking <effort>] [--read-root <dir>] [--network] [extra prose]"
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,15 +8,20 @@ Run the companion with any user-supplied flags appended after `review`:
|
|
|
8
8
|
|
|
9
9
|
`${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh review <args>`
|
|
10
10
|
|
|
11
|
+
Without a flag this is a defect review (the `review` operation). A leading `--challenge` selects the adversarial `challenge` operation, exactly as `companion.sh task challenge <args>` would: it questions assumptions, design choices and tradeoffs rather than hunting defects. Both are read-only.
|
|
12
|
+
|
|
11
13
|
Supported flags:
|
|
12
14
|
|
|
15
|
+
- `--challenge` — challenge the approach instead of reviewing for defects. Must appear among the leading flags; after focus text or `--` it is prose.
|
|
13
16
|
- `--thinking <off|low|medium|high>` (also `--thinking=<effort>`) — request effort for this process; other model-supported effort tokens pass through. `--no-thinking` is rejected; use `--thinking off`.
|
|
14
17
|
|
|
15
18
|
- `--budget <dur>` — wall-clock ceiling (default 30m; `30m`, `1h`, `90s`, or bare minutes; maximum 24h)
|
|
16
19
|
|
|
17
20
|
- `--base <ref>` — review against a branch/commit diff instead of the working tree. Working-tree reviews also include untracked files listed by `git status`; `--base` remains branch/commit-diff only.
|
|
18
21
|
- `-m`, `--model <name>`
|
|
19
|
-
-
|
|
22
|
+
- `--read-root <absolute-dir>` (repeatable) — let Kimi read these directories in addition to the workspace
|
|
23
|
+
- `--network` — enable web search and URL fetch; file reads are then confined to the workspace plus any `--read-root` directories
|
|
24
|
+
- trailing text — optional focus hint, or adversarial framing with `--challenge`
|
|
20
25
|
|
|
21
26
|
Reasoning behavior follows the selected model and Kimi configuration unless `--thinking <effort>` requests one for this run (honoured by Kimi's own providers on models that can turn thinking off; other providers ignore it silently; the plugin cannot verify it). The default budget is 30m; use `--budget` to change it. Review runs foreground-synchronously; it does not support `--background` or `--wait`.
|
|
22
27
|
|
package/commands/setup.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: List configured models, guide subscription/API-key provider setup, and verify local Kimi companion readiness and manage review-gate state. Writes a managed PreToolUse hook block to ~/.kimi-code/config.toml so kimi-code enforces this plugin's safety contract. Claude Code and Codex each own a host-scoped block in the shared config.
|
|
3
|
-
argument-hint: "[--models [--json] | --check | --uninstall [--all] | --enable-review-gate | --disable-review-gate]"
|
|
2
|
+
description: List configured models, guide subscription/API-key provider setup, install the highest certified Kimi Code CLI on request, and verify local Kimi companion readiness and manage review-gate state. Writes a managed PreToolUse hook block to ~/.kimi-code/config.toml so kimi-code enforces this plugin's safety contract. Claude Code and Codex each own a host-scoped block in the shared config.
|
|
3
|
+
argument-hint: "[--models [--json] | --install-kimi [--json] | --check | --uninstall [--all] | --enable-review-gate | --disable-review-gate]"
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
For model/provider questions, use `--models` (or `--models --json` for structured output); do not forward question text as arguments. This mode is offline, read-only, and cannot be combined with other setup flags. Bare `setup` installs hooks.
|
|
8
8
|
|
|
9
|
+
Use `--install-kimi` (or `--install-kimi --json`) only when the user asks to install Kimi Code: it installs the highest certified kimi-code release under the plugin data root and cannot be combined with other setup flags. Nothing runs it implicitly; `--check` reports the selected binary on its `Kimi binary:` line.
|
|
10
|
+
|
|
9
11
|
Run the companion with the selected flags appended after `setup`:
|
|
10
12
|
|
|
11
13
|
`${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh setup <args>`
|
package/commands/swarm.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Fan out a parallel review across the workspace using Kimi's AgentSwarm tool, bounded by a hard wall-clock budget. Read-only by default (enforced by the same PreToolUse hook as review, applied to every subagent); --write fans out edits in a throwaway worktree and returns a patch.
|
|
3
|
-
argument-hint: "[--write] [--budget <30m|1h>] [--cap <N>] [--max-concurrency <N>] [-m <model>] [--thinking <effort>] <objective>"
|
|
3
|
+
argument-hint: "[--write] [--budget <30m|1h>] [--cap <N>] [--max-concurrency <N>] [-m <model>] [--thinking <effort>] [--read-root <dir>] [--network] <objective>"
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,18 +16,19 @@ Supported flags:
|
|
|
16
16
|
|
|
17
17
|
- `--thinking <off|low|medium|high>` (also `--thinking=<effort>`) — request effort for this process; other model-supported effort tokens pass through. `--no-thinking` is rejected; use `--thinking off`.
|
|
18
18
|
|
|
19
|
-
- `--write` — fan out EDITS (not just review). Requires kimi-code **>= 0.18.0**, a git repo with a committed HEAD, and the PreToolUse hook. Bases the worktree on HEAD: **uncommitted changes are NOT included** (you'll get a warning) — commit or stash first if the swarm needs them. `--write` is also reachable via the model-invocable `kimi-swarm
|
|
19
|
+
- `--write` — fan out EDITS (not just review). Requires kimi-code **>= 0.18.0**, a git repo with a committed HEAD, and the PreToolUse hook. Bases the worktree on HEAD: **uncommitted changes are NOT included** (you'll get a warning) — commit or stash first if the swarm needs them. `--write` is also reachable via the model-invocable `kimi-swarm` subagent, with strict triggering (many disjoint write targets AND explicit fan-out intent); auto-dispatch widens no write surface and keeps every bound, and the slash command itself stays human-only.
|
|
20
20
|
- `--budget <duration>` — HARD wall-clock ceiling (e.g. `30m`, `1h`, `90s`; bare number = minutes). Default 30m. The always-on bound on cost/runaway.
|
|
21
21
|
- `--cap <N>` — SOFT cap on TOTAL subagent count: injected into the prompt as a model instruction. Advisory, not hook-enforced (the hook does not maintain a lifetime-total count), so the model may exceed it. Bounds lifetime total, not peak parallelism.
|
|
22
|
-
- `--max-concurrency <N>` — defaults to **4 for read, 1 for `--write`**. On exact CLI 2.6.2/2.6.3/2.7.2, 1 selects a direct worker with delegation denied; 2 or more bounds simultaneous Kimi child-agent turns, counting fresh plus resumed entries per wave. Fresh-only waves need at least two entries: group multiple targets into disjoint entries or resume an own-session child for an odd remainder. OS subprocesses started by allowed tests are outside this count. Older certified versions use normal-launch limits on CLI 0.18.0+ and retain their rate-limit-recovery overrun. Distinct from `--cap`: simultaneous concurrency is not a lifetime-total count.
|
|
22
|
+
- `--max-concurrency <N>` — defaults to **4 for read, 1 for `--write`**. On exact CLI 2.6.2/2.6.3/2.7.2/2.7.3, 1 selects a direct worker with delegation denied; 2 or more bounds simultaneous Kimi child-agent turns, counting fresh plus resumed entries per wave. Fresh-only waves need at least two entries: group multiple targets into disjoint entries or resume an own-session child for an odd remainder. OS subprocesses started by allowed tests are outside this count. Older certified versions use normal-launch limits on CLI 0.18.0+ and retain their rate-limit-recovery overrun. Distinct from `--cap`: simultaneous concurrency is not a lifetime-total count.
|
|
23
23
|
- `-m`, `--model <name>`
|
|
24
|
+
- `--read-root <absolute-dir>` (repeatable) and `--network` — read-only swarm only; `--write` rejects them. `--network` enables web search and URL fetch and confines file reads to the workspace plus any `--read-root` directories.
|
|
24
25
|
|
|
25
26
|
Prototype limitations:
|
|
26
27
|
|
|
27
|
-
- On exact CLI 2.6.2/2.6.3/2.7.2, a stuck child holds its wave until completion or finite whole-job stop. Native Bash backgrounding is disabled in parallel sessions, and explicit background Bash is denied for Kimi workers. Normal exit and cancellation settle verified owned processes before artifact or patch capture; an individual Bash timeout is not a descendant barrier between waves. This restriction concerns tools inside Kimi, separately from the caller's shell launch below.
|
|
28
|
+
- On exact CLI 2.6.2/2.6.3/2.7.2/2.7.3, a stuck child holds its wave until completion or finite whole-job stop. Native Bash backgrounding is disabled in parallel sessions, and explicit background Bash is denied for Kimi workers. Normal exit and cancellation settle verified owned processes before artifact or patch capture; an individual Bash timeout is not a descendant barrier between waves. This restriction concerns tools inside Kimi, separately from the caller's shell launch below.
|
|
28
29
|
- Parallel Bash has a 60-second default and 300-second maximum foreground timeout; it kills commands on expiry. Use `--max-concurrency 1` for longer tests. Native automatic timeout-to-background remains available at 1, with sequential root-agent turns and whole-job settlement before result capture.
|
|
29
30
|
- **No `--background` flag** — the runtime has no detached-worker mode for swarm. That is separate from how the *caller* runs the shell command: for `--write` (30m default budget vs a 10-minute foreground Bash cap) detaching the call is expected; for a read-only fan-out the default stays foreground and detaching is a per-request choice. `--budget` and `--max-concurrency` stay finite either way, and budget expiry still captures the patch/report. To stop a run, just say so — the stop path is `companion.sh cancel` with no id (it targets the latest running job for this repo). For `--write`, prefer that over Esc: an interrupt can kill the run mid-teardown and lose the captured patch.
|
|
30
|
-
- Read-only swarm requires an exact certified CLI (legacy minimum 0.12.0); `--write` additionally requires at least 0.18.0 and committed HEAD. Both refuse without the managed PreToolUse hook. Exact 2.6.2/2.6.3/2.7.2 has the bounded-wave/direct-worker paths; older certified versions retain their documented concurrency limits.
|
|
31
|
+
- Read-only swarm requires an exact certified CLI (legacy minimum 0.12.0); `--write` additionally requires at least 0.18.0 and committed HEAD. Both refuse without the managed PreToolUse hook. Exact 2.6.2/2.6.3/2.7.2/2.7.3 has the bounded-wave/direct-worker paths; older certified versions retain their documented concurrency limits.
|
|
31
32
|
|
|
32
33
|
Return the companion stdout verbatim.
|
|
33
34
|
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
argument-hint: "[--budget <30m|1h|90s>] [--background] [--wait] [-r | --resume <id>] [--fresh] [-m <model>] [--thinking <effort>] <prompt>"
|
|
2
|
+
description: Hand Kimi a task. Read-only answer by default; --write lets Kimi edit the workspace.
|
|
3
|
+
argument-hint: "[--write] [--budget <30m|1h|90s>] [--background] [--wait] [-r | --resume <id>] [--fresh] [-m <model>] [--thinking <effort>] [--read-root <dir>] [--network] <prompt>"
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Run the companion with any user-supplied flags appended after `
|
|
7
|
+
Run the companion with any user-supplied flags appended after `ask`:
|
|
8
8
|
|
|
9
|
-
`${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh
|
|
9
|
+
`${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh ask <args>`
|
|
10
|
+
|
|
11
|
+
Without `--write` this is a read-only question (the `ask` operation). A leading `--write` selects the write-capable `rescue` operation, exactly as `companion.sh task rescue <args>` would: Kimi may edit, create, move and delete files inside the workspace under the managed PreToolUse hook, and it cannot mutate git state. Add `--write` only when the user asked for edits.
|
|
10
12
|
|
|
11
13
|
Supported flags:
|
|
12
14
|
|
|
15
|
+
- `--write` — make edits in the workspace (rescue). Must appear among the leading flags; after prompt text or `--` it is prose.
|
|
13
16
|
- `--thinking <off|low|medium|high>` (also `--thinking=<effort>`) — request effort for this process; other model-supported effort tokens pass through. `--no-thinking` is rejected; use `--thinking off`. The request applies to this run only: a resume without `--thinking` requests nothing (unlike `--budget`, which is inherited).
|
|
14
|
-
|
|
15
|
-
- `--budget <dur>` — wall-clock ceiling (default 45m; `30m`, `1h`, `90s`, or bare minutes; maximum 24h)
|
|
16
|
-
|
|
17
|
+
- `--budget <dur>` — wall-clock ceiling (default 30m, or 45m with `--write`; `30m`, `1h`, `90s`, or bare minutes; maximum 24h)
|
|
17
18
|
- `--background` — spawn as a detached background job and return `{job_id}` immediately
|
|
18
19
|
- `--wait` — combined with `--background`, block until terminal state and return the rendered result
|
|
19
|
-
- `-r` — resume the latest rescue
|
|
20
|
-
- `--resume <job-id-or-session-id>` — resume a specific prior
|
|
21
|
-
- `--fresh` — force a new
|
|
20
|
+
- `-r` — resume the latest session of the same kind (ask without `--write`, rescue with it) for the current repo; any trailing text becomes the next prompt
|
|
21
|
+
- `--resume <job-id-or-session-id>` — resume a specific prior session of the same kind without a new prompt payload
|
|
22
|
+
- `--fresh` — force a new session id instead of reusing a prior session
|
|
22
23
|
- `-m`, `--model <name>`
|
|
24
|
+
- `--read-root <absolute-dir>` (repeatable) and `--network` — read-only only; `--write` rejects them. `--network` enables web search and URL fetch and confines file reads to the workspace plus any `--read-root` directories.
|
|
23
25
|
|
|
24
|
-
Reasoning behavior follows the selected model and Kimi configuration unless `--thinking <effort>` requests one for this run (honoured by Kimi's own providers on models that can turn thinking off; other providers ignore it silently; the plugin cannot verify it).
|
|
26
|
+
Reasoning behavior follows the selected model and Kimi configuration unless `--thinking <effort>` requests one for this run (honoured by Kimi's own providers on models that can turn thinking off; other providers ignore it silently; the plugin cannot verify it). Backgrounding does not extend the runtime budget.
|
|
25
27
|
|
|
26
28
|
A budget timeout leaves the job `failed` and saves any partial assistant prose in its artifact, labeled **NOT a final answer**. Read it with `result <jobId>` or `result <jobId> --json`; tool-only runs explicitly report no assistant prose. A session ID is kept if Kimi announced it or, on a native-v2 budget timeout, recovered from the session store when exactly one session matches this spawn — created between spawn and settlement in the same directory AND whose journal opens with this job's exact prompt; `result --json` identifies the source in `kimi_session_id_source`, and `error.details.session_recovery` says why no ID was recovered (`none`, `journal_missing:<n>`, `digest_mismatch:<n>`, `ambiguous:<n>`, `enumeration_capped`, `engine_unobserved`). Cancellation does not capture partial output. A resume without `--budget` inherits the parent job's budget; an explicit budget overrides it. Inherited budgets are printed to stderr at launch; status and `result --json` expose `budget_source` (`explicit`, `inherited`, or `default`; old non-null budgets report `unknown`). Use `--help` or `-h` among the leading flags for usage; once prompt text starts, `-h` is part of the prompt. Other failures (nonzero exit, cancellation) do not capture partial output.
|
|
27
29
|
|