mixdog 0.8.0 → 0.9.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.
Files changed (285) hide show
  1. package/README.md +47 -23
  2. package/package.json +33 -27
  3. package/scripts/_test-folder-dialog.mjs +30 -0
  4. package/scripts/agent-parallel-smoke.mjs +388 -0
  5. package/scripts/agent-tag-reuse-smoke.mjs +183 -0
  6. package/scripts/background-task-meta-smoke.mjs +38 -0
  7. package/scripts/boot-smoke.mjs +52 -9
  8. package/scripts/build-runtime-linux.sh +348 -0
  9. package/scripts/build-runtime-macos.sh +217 -0
  10. package/scripts/build-runtime-windows.ps1 +242 -0
  11. package/scripts/compact-active-turn-test.mjs +68 -0
  12. package/scripts/compact-smoke.mjs +859 -129
  13. package/scripts/compact-trigger-migration-smoke.mjs +187 -0
  14. package/scripts/fix-brief-fn.mjs +35 -0
  15. package/scripts/fix-format-tool-surface.mjs +24 -0
  16. package/scripts/fix-tool-exec-visible.mjs +42 -0
  17. package/scripts/generate-runtime-manifest.mjs +166 -0
  18. package/scripts/hook-bus-test.mjs +330 -0
  19. package/scripts/lead-workflow-smoke.mjs +33 -39
  20. package/scripts/live-worker-smoke.mjs +43 -37
  21. package/scripts/llm-trace-summary.mjs +315 -0
  22. package/scripts/memory-meta-concurrency-test.mjs +20 -0
  23. package/scripts/output-style-smoke.mjs +56 -15
  24. package/scripts/parent-abort-link-test.mjs +44 -0
  25. package/scripts/patch-agent-brief.mjs +48 -0
  26. package/scripts/patch-app.mjs +21 -0
  27. package/scripts/patch-app2.mjs +18 -0
  28. package/scripts/patch-dist-brief.mjs +96 -0
  29. package/scripts/patch-tool-exec.mjs +70 -0
  30. package/scripts/pretool-ask-runtime-test.mjs +54 -0
  31. package/scripts/provider-toolcall-test.mjs +376 -0
  32. package/scripts/reactive-compact-persist-smoke.mjs +124 -0
  33. package/scripts/sanitize-tool-pairs-test.mjs +260 -0
  34. package/scripts/session-context-bench.mjs +344 -0
  35. package/scripts/session-ingest-smoke.mjs +177 -0
  36. package/scripts/set-effort-config-test.mjs +41 -0
  37. package/scripts/smoke-runtime-negative.ps1 +106 -0
  38. package/scripts/smoke-runtime-negative.sh +97 -0
  39. package/scripts/smoke.mjs +25 -0
  40. package/scripts/tool-result-hook-test.mjs +48 -0
  41. package/scripts/tool-smoke.mjs +1223 -95
  42. package/scripts/toolcall-args-test.mjs +150 -0
  43. package/scripts/tui-background-failure-smoke.mjs +73 -0
  44. package/scripts/usage-metrics-epoch-smoke.mjs +114 -0
  45. package/src/agents/debugger/AGENT.md +8 -0
  46. package/src/agents/explore/AGENT.md +4 -0
  47. package/src/agents/heavy-worker/AGENT.md +9 -3
  48. package/src/agents/maintainer/AGENT.md +4 -0
  49. package/src/agents/reviewer/AGENT.md +8 -0
  50. package/src/agents/scheduler-task/AGENT.md +12 -0
  51. package/src/agents/scheduler-task/agent.json +6 -0
  52. package/src/agents/webhook-handler/AGENT.md +12 -0
  53. package/src/agents/webhook-handler/agent.json +6 -0
  54. package/src/agents/worker/AGENT.md +9 -3
  55. package/src/app.mjs +77 -3
  56. package/src/defaults/hidden-roles.json +17 -12
  57. package/src/headless-role.mjs +117 -0
  58. package/src/help.mjs +30 -0
  59. package/src/hooks/lib/permission-evaluator.cjs +11 -475
  60. package/src/lib/keychain-cjs.cjs +9 -1
  61. package/src/lib/mixdog-debug.cjs +0 -7
  62. package/src/lib/rules-builder.cjs +240 -96
  63. package/src/lib/text-utils.cjs +1 -1
  64. package/src/mixdog-session-runtime.mjs +2325 -450
  65. package/src/output-styles/default.md +12 -28
  66. package/src/output-styles/extreme-simple.md +9 -6
  67. package/src/output-styles/simple.md +22 -9
  68. package/src/repl.mjs +118 -59
  69. package/src/rules/agent/00-common.md +15 -0
  70. package/src/rules/{bridge → agent}/20-skip-protocol.md +1 -2
  71. package/src/rules/agent/30-explorer.md +22 -0
  72. package/src/rules/{bridge → agent}/40-cycle1-agent.md +7 -0
  73. package/src/rules/{bridge → agent}/41-cycle2-agent.md +7 -0
  74. package/src/rules/{bridge → agent}/42-cycle3-agent.md +7 -0
  75. package/src/rules/lead/01-general.md +9 -5
  76. package/src/rules/lead/04-workflow.md +51 -12
  77. package/src/rules/lead/lead-tool.md +6 -0
  78. package/src/rules/shared/01-tool.md +12 -1
  79. package/src/runtime/agent/orchestrator/activity-bus.mjs +7 -18
  80. package/src/runtime/agent/orchestrator/agent-owner.mjs +11 -0
  81. package/src/runtime/agent/orchestrator/{smart-bridge/bridge-llm.mjs → agent-runtime/agent-dispatch.mjs} +138 -111
  82. package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +94 -0
  83. package/src/runtime/agent/orchestrator/{smart-bridge → agent-runtime}/cache-strategy.mjs +32 -23
  84. package/src/runtime/agent/orchestrator/{smart-bridge → agent-runtime}/session-builder.mjs +33 -27
  85. package/src/runtime/agent/orchestrator/{bridge-trace.mjs → agent-trace.mjs} +132 -81
  86. package/src/runtime/agent/orchestrator/cache-mtime.mjs +0 -21
  87. package/src/runtime/agent/orchestrator/config.mjs +174 -55
  88. package/src/runtime/agent/orchestrator/context/collect.mjs +195 -487
  89. package/src/runtime/agent/orchestrator/dispatch-persist.mjs +1 -1
  90. package/src/runtime/agent/orchestrator/internal-roles.mjs +77 -29
  91. package/src/runtime/agent/orchestrator/internal-tools.mjs +5 -6
  92. package/src/runtime/agent/orchestrator/mcp/client.mjs +15 -9
  93. package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +7 -1
  94. package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +377 -243
  95. package/src/runtime/agent/orchestrator/providers/anthropic.mjs +146 -93
  96. package/src/runtime/agent/orchestrator/providers/api-usage.mjs +236 -4
  97. package/src/runtime/agent/orchestrator/providers/custom-tool-wire.mjs +49 -0
  98. package/src/runtime/agent/orchestrator/providers/gemini.mjs +58 -13
  99. package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +67 -149
  100. package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +132 -2
  101. package/src/runtime/agent/orchestrator/providers/model-catalog.mjs +4 -1
  102. package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +45 -0
  103. package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +61 -116
  104. package/src/runtime/agent/orchestrator/providers/openai-compat-presets.mjs +25 -0
  105. package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +79 -255
  106. package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +221 -70
  107. package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +477 -147
  108. package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +343 -496
  109. package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +6 -6
  110. package/src/runtime/agent/orchestrator/providers/registry.mjs +88 -51
  111. package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +31 -11
  112. package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +41 -8
  113. package/src/runtime/agent/orchestrator/session/cache/post-edit-marks.mjs +4 -4
  114. package/src/runtime/agent/orchestrator/session/cache/read-cache.mjs +1 -1
  115. package/src/runtime/agent/orchestrator/session/compact.mjs +1173 -267
  116. package/src/runtime/agent/orchestrator/session/context-utils.mjs +199 -36
  117. package/src/runtime/agent/orchestrator/session/loop.mjs +851 -674
  118. package/src/runtime/agent/orchestrator/session/manager.mjs +1593 -466
  119. package/src/runtime/agent/orchestrator/session/manager.reactive-persist.test.mjs +107 -0
  120. package/src/runtime/agent/orchestrator/session/store.mjs +291 -46
  121. package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +2 -2
  122. package/src/runtime/agent/orchestrator/stall-policy.mjs +31 -16
  123. package/src/runtime/agent/orchestrator/tool-loop-guard.mjs +3 -219
  124. package/src/runtime/agent/orchestrator/tools/bash-session.mjs +34 -7
  125. package/src/runtime/agent/orchestrator/tools/builtin/advisory-lock.mjs +1 -1
  126. package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +19 -0
  127. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +9 -9
  128. package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +60 -37
  129. package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +21 -2
  130. package/src/runtime/agent/orchestrator/tools/builtin/device-paths.mjs +1 -1
  131. package/src/runtime/agent/orchestrator/tools/builtin/diagnostics-tool.mjs +0 -7
  132. package/src/runtime/agent/orchestrator/tools/builtin/glob-walk.mjs +1 -3
  133. package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +36 -12
  134. package/src/runtime/agent/orchestrator/tools/builtin/read-args.mjs +2 -0
  135. package/src/runtime/agent/orchestrator/tools/builtin/read-constants.mjs +2 -2
  136. package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +5 -12
  137. package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +1 -1
  138. package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +4 -36
  139. package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +2 -40
  140. package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +148 -27
  141. package/src/runtime/agent/orchestrator/tools/builtin/search-builders.mjs +2 -2
  142. package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +43 -75
  143. package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +90 -20
  144. package/src/runtime/agent/orchestrator/tools/builtin/snapshot-store.mjs +1 -1
  145. package/src/runtime/agent/orchestrator/tools/builtin.mjs +59 -5
  146. package/src/runtime/agent/orchestrator/tools/code-graph-state.mjs +86 -0
  147. package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +11 -11
  148. package/src/runtime/agent/orchestrator/tools/code-graph.mjs +4106 -4019
  149. package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +33 -4
  150. package/src/runtime/agent/orchestrator/tools/patch.mjs +90 -6
  151. package/src/runtime/agent/orchestrator/tools/progress-message.mjs +6 -4
  152. package/src/runtime/agent/orchestrator/tools/result-compression.mjs +4 -4
  153. package/src/runtime/agent/orchestrator/tools/shell-command.mjs +8 -1
  154. package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +4 -4
  155. package/src/runtime/channels/index.mjs +152 -24
  156. package/src/runtime/channels/lib/scheduler.mjs +18 -14
  157. package/src/runtime/channels/lib/session-discovery.mjs +3 -2
  158. package/src/runtime/channels/lib/tool-format.mjs +0 -2
  159. package/src/runtime/channels/lib/transcript-discovery.mjs +3 -2
  160. package/src/runtime/channels/lib/webhook.mjs +1 -1
  161. package/src/runtime/channels/tool-defs.mjs +29 -29
  162. package/src/runtime/memory/index.mjs +635 -107
  163. package/src/runtime/memory/lib/agent-ipc.mjs +29 -12
  164. package/src/runtime/memory/lib/core-memory-store.mjs +2 -2
  165. package/src/runtime/memory/lib/embedding-model-config.mjs +55 -0
  166. package/src/runtime/memory/lib/embedding-provider.mjs +31 -4
  167. package/src/runtime/memory/lib/embedding-worker.mjs +19 -10
  168. package/src/runtime/memory/lib/memory-cycle1.mjs +38 -17
  169. package/src/runtime/memory/lib/memory-cycle2.mjs +6 -7
  170. package/src/runtime/memory/lib/memory-cycle3.mjs +4 -4
  171. package/src/runtime/memory/lib/memory-ops-policy.mjs +2 -1
  172. package/src/runtime/memory/lib/memory-session-merge.mjs +38 -0
  173. package/src/runtime/memory/lib/memory.mjs +88 -9
  174. package/src/runtime/memory/lib/model-profile.mjs +1 -1
  175. package/src/runtime/memory/lib/pg/adapter.mjs +15 -1
  176. package/src/runtime/memory/lib/pg/supervisor.mjs +12 -0
  177. package/src/runtime/memory/lib/runtime-fetcher.mjs +37 -3
  178. package/src/runtime/memory/lib/session-ingest.mjs +194 -0
  179. package/src/runtime/memory/lib/trace-store.mjs +96 -51
  180. package/src/runtime/memory/tool-defs.mjs +46 -37
  181. package/src/runtime/search/index.mjs +102 -466
  182. package/src/runtime/search/lib/web-tools.mjs +45 -25
  183. package/src/runtime/search/tool-defs.mjs +16 -23
  184. package/src/runtime/shared/abort-controller.mjs +1 -1
  185. package/src/runtime/shared/atomic-file.mjs +4 -3
  186. package/src/runtime/shared/background-tasks.mjs +122 -11
  187. package/src/runtime/shared/child-spawn-gate.mjs +145 -0
  188. package/src/runtime/shared/config.mjs +7 -4
  189. package/src/runtime/shared/err-text.mjs +131 -4
  190. package/src/runtime/shared/llm/cost.mjs +2 -2
  191. package/src/runtime/shared/llm/http-agent.mjs +23 -7
  192. package/src/runtime/shared/llm/index.mjs +34 -11
  193. package/src/runtime/shared/llm/usage-log.mjs +4 -4
  194. package/src/runtime/shared/markdown-frontmatter.mjs +56 -0
  195. package/src/runtime/shared/singleton-owner.mjs +104 -0
  196. package/src/runtime/shared/tool-execution-contract.mjs +199 -20
  197. package/src/runtime/shared/tool-execution-contract.test.mjs +183 -0
  198. package/src/runtime/shared/tool-surface.mjs +624 -98
  199. package/src/runtime/shared/user-data-guard.mjs +0 -2
  200. package/src/standalone/agent-task-status.mjs +203 -0
  201. package/src/standalone/agent-task-status.test.mjs +76 -0
  202. package/src/standalone/agent-tool.mjs +1913 -0
  203. package/src/standalone/channel-worker.mjs +370 -14
  204. package/src/standalone/explore-tool.mjs +165 -70
  205. package/src/standalone/folder-dialog.mjs +314 -0
  206. package/src/standalone/hook-bus.mjs +898 -22
  207. package/src/standalone/memory-runtime-proxy.mjs +320 -0
  208. package/src/standalone/projects.mjs +226 -0
  209. package/src/standalone/provider-admin.mjs +41 -24
  210. package/src/standalone/seeds.mjs +2 -69
  211. package/src/standalone/usage-dashboard.mjs +96 -8
  212. package/src/tui/App.jsx +4798 -2153
  213. package/src/tui/components/AnsiText.jsx +39 -28
  214. package/src/tui/components/ContextPanel.jsx +87 -29
  215. package/src/tui/components/Markdown.jsx +43 -77
  216. package/src/tui/components/MarkdownTable.jsx +9 -184
  217. package/src/tui/components/Message.jsx +28 -11
  218. package/src/tui/components/Picker.jsx +95 -56
  219. package/src/tui/components/PromptInput.jsx +367 -239
  220. package/src/tui/components/QueuedCommands.jsx +1 -1
  221. package/src/tui/components/SlashCommandPalette.jsx +27 -21
  222. package/src/tui/components/Spinner.jsx +67 -38
  223. package/src/tui/components/StatusLine.jsx +606 -38
  224. package/src/tui/components/TextEntryPanel.jsx +128 -9
  225. package/src/tui/components/ToolExecution.jsx +617 -368
  226. package/src/tui/components/TurnDone.jsx +3 -3
  227. package/src/tui/components/UsagePanel.jsx +3 -5
  228. package/src/tui/components/tool-output-format.mjs +365 -0
  229. package/src/tui/components/tool-output-format.test.mjs +220 -0
  230. package/src/tui/dist/index.mjs +8915 -2418
  231. package/src/tui/engine-runtime-notification.test.mjs +115 -0
  232. package/src/tui/engine-tool-result-text.test.mjs +75 -0
  233. package/src/tui/engine.mjs +1455 -279
  234. package/src/tui/figures.mjs +21 -40
  235. package/src/tui/index.jsx +75 -31
  236. package/src/tui/input-editing.mjs +25 -0
  237. package/src/tui/markdown/format-token.mjs +511 -68
  238. package/src/tui/markdown/format-token.test.mjs +216 -0
  239. package/src/tui/markdown/render-ansi.mjs +94 -0
  240. package/src/tui/markdown/render-ansi.test.mjs +108 -0
  241. package/src/tui/markdown/stream-fence.mjs +34 -0
  242. package/src/tui/markdown/stream-fence.test.mjs +26 -0
  243. package/src/tui/markdown/table-layout.mjs +250 -0
  244. package/src/tui/paste-attachments.mjs +0 -7
  245. package/src/tui/spinner-verbs.mjs +1 -2
  246. package/src/tui/statusline-ansi-bridge.mjs +172 -0
  247. package/src/tui/statusline-ansi-bridge.test.mjs +159 -0
  248. package/src/tui/theme.mjs +746 -24
  249. package/src/tui/time-format.mjs +1 -1
  250. package/src/tui/transcript-tool-failures.mjs +67 -0
  251. package/src/tui/transcript-tool-failures.test.mjs +111 -0
  252. package/src/ui/ansi.mjs +1 -2
  253. package/src/ui/markdown.mjs +85 -26
  254. package/src/ui/markdown.test.mjs +70 -0
  255. package/src/ui/model-display.mjs +121 -0
  256. package/src/ui/session-stats.mjs +44 -0
  257. package/src/ui/statusline-context-label.test.mjs +15 -0
  258. package/src/ui/statusline.mjs +386 -178
  259. package/src/ui/tool-card.mjs +3 -16
  260. package/src/vendor/statusline/bin/statusline-lib.mjs +8 -4
  261. package/src/vendor/statusline/bin/statusline-route.mjs +169 -37
  262. package/src/vendor/statusline/bin/statusline-route.test.mjs +80 -0
  263. package/src/vendor/statusline/scripts/lib/gateway-settings.mjs +3 -3
  264. package/src/vendor/statusline/src/gateway/claude-current.mjs +1 -1
  265. package/src/vendor/statusline/src/gateway/route-meta.mjs +44 -6
  266. package/src/vendor/statusline/src/gateway/session-routes.mjs +1 -1
  267. package/src/workflows/default/WORKFLOW.md +12 -5
  268. package/src/workflows/default/workflow.json +0 -1
  269. package/src/workflows/solo/WORKFLOW.md +15 -0
  270. package/src/workflows/solo/workflow.json +7 -0
  271. package/vendor/ink/build/output.js +6 -1
  272. package/src/agents/scheduler-task.md +0 -3
  273. package/src/agents/web-researcher/AGENT.md +0 -3
  274. package/src/agents/web-researcher/agent.json +0 -6
  275. package/src/agents/webhook-handler.md +0 -3
  276. package/src/rules/bridge/00-common.md +0 -5
  277. package/src/rules/bridge/30-explorer.md +0 -4
  278. package/src/rules/lead/00-tool-lead.md +0 -5
  279. package/src/rules/shared/00-language.md +0 -3
  280. package/src/runtime/agent/orchestrator/tools/builtin/native-edit-runner.mjs +0 -110
  281. package/src/runtime/agent/orchestrator/tools/mutation-content-cache.mjs +0 -67
  282. package/src/runtime/memory/lib/bridge-trace-queries.mjs +0 -120
  283. package/src/runtime/shared/llm/pid-cleanup.mjs +0 -27
  284. package/src/standalone/bridge-tool.mjs +0 -1414
  285. package/src/tui/runtime/shared/process-shutdown.mjs +0 -1
@@ -1,38 +1,22 @@
1
1
  ---
2
2
  name: default
3
- description: Default concise engineering replies
3
+ title: Summary
4
+ description: Concise engineering summaries
4
5
  keep-coding-instructions: true
5
6
  ---
6
7
 
7
8
  # Output Style
8
9
 
9
- Default concise engineering replies. Technical substance stays; fluff dies.
10
- Uniformity beats local cleverness.
10
+ Mixdog default — concise engineering summaries.
11
11
 
12
- - Answer first. No pleasantries, hedging, task restatement, or tool narration.
13
- - One answer only. Do not repeat the conclusion in a second paragraph or trailing
14
- sentence.
15
- - Tool work: one short intent line, then batch silently. For long chains, one
16
- checkpoint only: learned + next.
17
- - Default final: one sentence. If crowded, max 2 flat bullets. Code-change final:
18
- max 3 flat bullets, but prefer one sentence with semicolons. Omit empty fields.
19
- - Hard cap user-visible replies at 2 short sentences unless the user asks for
20
- detail. If a previous reply was too long, answer with one short sentence.
21
- - Keep the same shape for the same task type: explanation = one sentence;
22
- implementation = changed + verified in one sentence; diagnosis = cause +
23
- evidence + fix in one sentence.
24
- - No report headings/labels, nested bullets, tables, numbered lists, tool traces,
25
- searched-path lists, agent/model/session metadata, timings, or token counts
26
- unless user asks or it is decisive evidence.
27
- - Do not use label prefixes such as `Changed:`, `Verified:`, `변경:`, `검증:`,
28
- `원인:`, or `결론:`. Use plain clauses instead.
29
- - Bridge/agent results: synthesize outcome; never forward full report.
30
- - Explore/retrieval results are evidence only; do not paste their bullets or file
31
- lists into the answer unless the user explicitly asked for candidates/details.
12
+ - Lead with the outcome plus a single decisive piece of evidence: a path,
13
+ command, error, or verification result. Drop everything non-essential.
14
+ - Use labels such as `바뀐 점`, `확인한 것`, and `남은 리스크/다음 단계`
15
+ only in final reports; do not add titles/labels to interim progress text.
16
+ - Collapse trivial tasks to a single short sentence.
17
+ - Synthesize agent or retrieval results; never forward raw reports, long file
18
+ lists, tool traces, or session metadata.
19
+ - Do not hide blockers, failed verification, or required follow-up; surface them
20
+ in one short clause rather than omitting them.
32
21
  - Keep paths, commands, symbols, API names, code, and exact errors verbatim.
33
- Localize prose only.
34
- - Quote only the shortest decisive error. No raw logs or long file lists unless
35
- asked.
36
- - Relax compression for security, destructive actions, ambiguity, or user
37
- confusion.
38
22
  - Never name this style unless asked.
@@ -8,10 +8,13 @@ keep-coding-instructions: true
8
8
 
9
9
  # Output Style
10
10
 
11
- Extreme simple completion replies.
11
+ Extreme one ultra-short completion sentence. The most minimal of the styles.
12
12
 
13
- - Reply with one ultra-short completion sentence whenever possible.
14
- - Preferred completion pattern: `<target> 변경되었습니다. <verification> 통과 완료입니다.`
15
- - If verification was not run, use one short sentence that says the change is done and verification was not run.
16
- - Avoid headings, bullets, labels, explanations, tool traces, and metadata unless the user explicitly asks.
17
- - Preserve exact paths, commands, symbols, API names, code, and errors when they are the only decisive detail.
13
+ - Reply with a single completion sentence whenever possible.
14
+ - Preferred pattern: `<target> 변경되었습니다. <verification> 통과 완료입니다.`
15
+ - If verification was not run, use one short sentence saying the change is done
16
+ and verification was not run.
17
+ - No headings, bullets, labels, explanations, tool traces, or metadata unless
18
+ the user explicitly asks.
19
+ - Preserve only the single decisive path, command, symbol, API name, code, or
20
+ error verbatim.
@@ -1,17 +1,30 @@
1
1
  ---
2
2
  name: simple
3
- title: Simple
4
- description: 1-2 concise sentences
3
+ title: Practical Concise
4
+ description: Outcome-first concise handoffs for coding work
5
+ aliases: summary, concise, handoff
5
6
  keep-coding-instructions: true
6
7
  ---
7
8
 
8
9
  # Output Style
9
10
 
10
- Simple concise replies.
11
+ Practical concise — outcome-first handoffs for coding work without report bloat.
11
12
 
12
- - Answer in 1-2 concise sentences by default.
13
- - Keep technical substance, paths, commands, symbols, API names, code, and exact errors verbatim.
14
- - Use bullets only when a sentence would become crowded.
15
- - Avoid headings, labels, nested bullets, tool traces, and metadata unless the user asks.
16
- - For code changes, say what changed and the decisive verification in one short sentence when possible.
17
- - If verification was not run, say so briefly.
13
+ - Open with the outcome in one sentence: done, blocked, or awaiting a decision.
14
+ - Add only high-signal evidence next: changed paths (use `file_path:line_number`
15
+ when it helps navigation), commands, lint/test results, or the exact error —
16
+ not step-by-step narration.
17
+ - Keep controlled detail: usually 1–3 short bullets or 2–4 sentences total.
18
+ Expand only when the user asks, scope is ambiguous, or a blocker needs concrete
19
+ next steps.
20
+ - On final handoffs, optional labels such as `바뀐 점`, `확인한 것`, and
21
+ `남은 리스크/다음 단계` fit Korean-facing profiles; use plain English labels
22
+ when the thread is English. Do not label interim progress.
23
+ - Synthesize agent or retrieval results; never forward raw reports, long file
24
+ lists, tool traces, or session metadata.
25
+ - Do not hide blockers, failed verification, or required follow-up; state them
26
+ in one short clause.
27
+ - Keep paths, commands, symbols, API names, code, and exact errors verbatim.
28
+ - Skip filler, acknowledgments, and repeated conclusions; if verification was
29
+ not run, say so once.
30
+ - Never name this style unless asked.
package/src/repl.mjs CHANGED
@@ -25,37 +25,42 @@ import { stdin, stdout } from 'node:process';
25
25
  import { basename } from 'node:path';
26
26
 
27
27
  import { bold, dim, cyan, green, red, yellow, colorEnabled } from './ui/ansi.mjs';
28
- import { renderMarkdown } from './ui/markdown.mjs';
29
- import { renderToolCard } from './ui/tool-card.mjs';
30
- import { createSessionStats, applyUsageDelta, renderStatusline } from './ui/statusline.mjs';
31
- import { createMixdogSessionRuntime } from './mixdog-session-runtime.mjs';
32
- import { installProcessSignalCleanup } from './runtime/shared/process-shutdown.mjs';
33
-
34
- /** Help text shared by `--help` and the `/help` slash command. */
35
- const HELP_LINES = [
36
- 'mixdog — standalone mixdog CLI/TUI coding agent.',
37
- '',
38
- 'Usage:',
39
- ' mixdog [--provider <name>] [--model <name>] [--readonly]',
40
- ' mixdog --help',
41
- '',
42
- 'Slash commands (inside the REPL):',
43
- ' /help show this help',
44
- ' /clear reset the conversation and clear the screen',
45
- ' /compact compact older conversation context',
46
- ' /model <name> switch model/preset for subsequent turns',
47
- ' /OutputStyle [name] show or switch Lead output style',
48
- ' /mode <name> switch tool surface: full | readonly',
49
- ' /exit quit',
50
- '',
51
- 'History: use ↑ / ↓ to recall previous inputs.',
52
- ];
53
-
54
- /** Print the `--help` text. Routed here so app.mjs stays untouched. */
55
- export function printHelp(write = (s) => stdout.write(s)) {
56
- write(HELP_LINES.join('\n') + '\n');
28
+ import { printHelp } from './help.mjs';
29
+ import { createSessionStats, applyUsageDelta } from './ui/session-stats.mjs';
30
+
31
+ let runtimeModulePromise = null;
32
+ let markdownModulePromise = null;
33
+ let toolCardModulePromise = null;
34
+ let statuslineModulePromise = null;
35
+ let shutdownModulePromise = null;
36
+
37
+ function loadRuntimeModule() {
38
+ runtimeModulePromise ??= import('./mixdog-session-runtime.mjs');
39
+ return runtimeModulePromise;
40
+ }
41
+
42
+ async function renderMarkdownLazy(text) {
43
+ const mod = await (markdownModulePromise ??= import('./ui/markdown.mjs'));
44
+ return mod.renderMarkdown(text);
45
+ }
46
+
47
+ async function renderToolCardLazy(call) {
48
+ const mod = await (toolCardModulePromise ??= import('./ui/tool-card.mjs'));
49
+ return mod.renderToolCard(call);
50
+ }
51
+
52
+ async function renderStatuslineLazy(opts) {
53
+ const mod = await (statuslineModulePromise ??= import('./ui/statusline.mjs'));
54
+ return mod.renderStatusline(opts);
57
55
  }
58
56
 
57
+ async function loadShutdownModule() {
58
+ shutdownModulePromise ??= import('./runtime/shared/process-shutdown.mjs');
59
+ return shutdownModulePromise;
60
+ }
61
+
62
+ export { printHelp };
63
+
59
64
  export async function runRepl({ provider: providerName, model, toolMode = 'full' } = {}) {
60
65
  // `--help` short-circuits before any provider init so the smoke test (which
61
66
  // invokes `src/cli.mjs --help`) gets clean help output and a 0 exit. We read
@@ -65,19 +70,44 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
65
70
  return 0;
66
71
  }
67
72
 
68
- const runtime = await createMixdogSessionRuntime({ provider: providerName, model, toolMode });
69
73
  const stats = createSessionStats();
70
74
  const cwd = process.cwd();
71
75
  let rl = null;
76
+ let runtime = null;
77
+ let runtimePromise = null;
72
78
  let closed = false;
79
+
80
+ const ensureRuntime = async () => {
81
+ if (closed) throw new Error('runtime closed');
82
+ if (runtime) return runtime;
83
+ if (!runtimePromise) {
84
+ runtimePromise = (async () => {
85
+ const { createMixdogSessionRuntime } = await loadRuntimeModule();
86
+ const next = await createMixdogSessionRuntime({ provider: providerName, model, toolMode });
87
+ runtime = next;
88
+ return next;
89
+ })().finally(() => {
90
+ runtimePromise = null;
91
+ });
92
+ }
93
+ const next = await runtimePromise;
94
+ if (closed) {
95
+ try { await next.close('cli-exit'); } catch {}
96
+ if (runtime === next) runtime = null;
97
+ throw new Error('runtime closed');
98
+ }
99
+ return next;
100
+ };
101
+
73
102
  const closeRuntime = async (reason = 'cli-exit') => {
74
103
  if (closed) return;
75
104
  closed = true;
76
105
  try { rl?.close(); } catch {}
77
- await runtime.close(reason);
106
+ const pendingRuntime = runtime || (runtimePromise ? await runtimePromise.catch(() => null) : null);
107
+ if (pendingRuntime) await pendingRuntime.close(reason);
78
108
  };
79
109
 
80
- printBanner(runtime.provider, runtime.model, cwd, runtime.toolMode);
110
+ printBanner(providerName, model, cwd, toolMode);
81
111
 
82
112
  rl = createInterface({
83
113
  input: stdin,
@@ -86,6 +116,7 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
86
116
  // historySize > 0 enables readline's built-in ↑/↓ recall of prior inputs.
87
117
  historySize: 200,
88
118
  });
119
+ const { installProcessSignalCleanup } = await loadShutdownModule();
89
120
  const signalCleanup = installProcessSignalCleanup({
90
121
  name: 'mixdog-repl',
91
122
  timeoutMs: 6500,
@@ -110,9 +141,13 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
110
141
  if (line.startsWith('/')) {
111
142
  const handled = await handleSlash(line, {
112
143
  rl,
113
- runtime,
144
+ ensureRuntime,
145
+ getRuntime: () => runtime,
114
146
  stats,
115
147
  cwd,
148
+ providerName,
149
+ model,
150
+ toolMode,
116
151
  closeRuntime,
117
152
  });
118
153
  if (handled === 'exit') {
@@ -128,11 +163,12 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
128
163
  let streamedText = '';
129
164
  let printedAny = false;
130
165
  try {
166
+ const runtime = await ensureRuntime();
131
167
  const { result } = await runtime.ask(
132
168
  line,
133
169
  {
134
170
  onToolCall: async (_iter, calls) => {
135
- for (const c of calls || []) stdout.write('\n' + renderToolCard(c) + '\n');
171
+ for (const c of calls || []) stdout.write('\n' + (await renderToolCardLazy(c)) + '\n');
136
172
  },
137
173
  onTextDelta: (chunk) => {
138
174
  printedAny = true;
@@ -152,10 +188,10 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
152
188
  if (finalText) {
153
189
  if (printedAny && colorEnabled()) {
154
190
  eraseStreamedBlock(streamedText);
155
- stdout.write(renderMarkdown(finalText) + '\n');
191
+ stdout.write(await renderMarkdownLazy(finalText) + '\n');
156
192
  } else if (!printedAny) {
157
193
  // Nothing streamed live (provider without onTextDelta) — render once.
158
- stdout.write(renderMarkdown(finalText) + '\n');
194
+ stdout.write(await renderMarkdownLazy(finalText) + '\n');
159
195
  } else {
160
196
  // Non-TTY / NO_COLOR: leave the raw stream, just terminate the line.
161
197
  stdout.write('\n');
@@ -163,7 +199,7 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
163
199
  }
164
200
 
165
201
  // Per-turn statusline footer.
166
- stdout.write('\n' + (await renderStatusline({
202
+ stdout.write('\n' + (await renderStatuslineLazy({
167
203
  provider: runtime.provider,
168
204
  model: runtime.model,
169
205
  cwd,
@@ -195,7 +231,9 @@ function promptText() {
195
231
 
196
232
  function printBanner(providerName, model, cwd, toolMode) {
197
233
  const title = bold('mixdog');
198
- const id = cyan(`${providerName}/${model}`);
234
+ const providerLabel = providerName || 'auto';
235
+ const modelLabel = model || 'default';
236
+ const id = cyan(`${providerLabel}/${modelLabel}`);
199
237
  stdout.write(`${title} ${dim('—')} ${id} ${dim('·')} ${dim(toolMode)} ${dim('·')} ${dim(basename(cwd))}\n`);
200
238
  stdout.write(dim('Type a message, or /help for commands. Ctrl+C to exit.') + '\n\n');
201
239
  }
@@ -236,63 +274,80 @@ async function handleSlash(line, ctx) {
236
274
  return;
237
275
 
238
276
  case 'clear':
239
- await ctx.runtime.clear();
240
277
  {
278
+ const runtime = await ctx.ensureRuntime();
279
+ await runtime.clear();
241
280
  const fresh = createSessionStats();
242
281
  for (const k of Object.keys(fresh)) ctx.stats[k] = fresh[k];
282
+ // Clear screen + scrollback and home the cursor.
283
+ stdout.write(colorEnabled() ? '\x1b[2J\x1b[3J\x1b[H' : '\n');
284
+ stdout.write(dim('conversation reset.') + '\n');
285
+ stdout.write((await renderStatuslineLazy({
286
+ provider: runtime.provider,
287
+ model: runtime.model,
288
+ cwd: ctx.cwd,
289
+ stats: ctx.stats,
290
+ contextWindow: runtime.contextWindow,
291
+ rawContextWindow: runtime.rawContextWindow,
292
+ })) + '\n');
243
293
  }
244
- // Clear screen + scrollback and home the cursor.
245
- stdout.write(colorEnabled() ? '\x1b[2J\x1b[3J\x1b[H' : '\n');
246
- stdout.write(dim('conversation reset.') + '\n');
247
- stdout.write((await renderStatusline({
248
- provider: ctx.runtime.provider,
249
- model: ctx.runtime.model,
250
- cwd: ctx.cwd,
251
- stats: ctx.stats,
252
- contextWindow: ctx.runtime.contextWindow,
253
- rawContextWindow: ctx.runtime.rawContextWindow,
254
- })) + '\n');
255
294
  return;
256
295
 
257
296
  case 'compact':
258
297
  {
259
- const r = await ctx.runtime.compact();
298
+ const runtime = await ctx.ensureRuntime();
299
+ const r = await runtime.compact();
260
300
  if (!r) {
261
301
  stdout.write(yellow('compact failed') + '\n');
262
302
  return;
263
303
  }
304
+ if (r.error) {
305
+ stdout.write(red('compact failed') + '\n');
306
+ return;
307
+ }
264
308
  if (r.changed === false && r.reason) {
265
309
  stdout.write(yellow(r.reason) + '\n');
266
310
  return;
267
311
  }
312
+ if (r.changed === false) {
313
+ stdout.write(yellow('nothing to compact') + '\n');
314
+ return;
315
+ }
268
316
  stdout.write(green(`✓ compacted context: ${r.beforeMessages}→${r.afterMessages} messages, context ${r.beforeTokens}→${r.afterTokens}`) + '\n');
269
317
  }
270
318
  return;
271
319
 
272
320
  case 'model':
273
321
  if (!arg) {
274
- stdout.write(yellow(`current model: ${ctx.runtime.provider}/${ctx.runtime.model}`) + '\n');
322
+ const runtime = ctx.getRuntime?.();
323
+ const provider = runtime?.provider || ctx.providerName || 'auto';
324
+ const currentModel = runtime?.model || ctx.model || 'default';
325
+ stdout.write(yellow(`current model: ${provider}/${currentModel}`) + '\n');
275
326
  stdout.write(dim('usage: /model <preset-or-model>') + '\n');
276
327
  return;
277
328
  }
278
- await ctx.runtime.setRoute({ model: arg });
279
- stdout.write(green(`✓ model ${ctx.runtime.provider}/${ctx.runtime.model}`) + '\n');
329
+ {
330
+ const runtime = await ctx.ensureRuntime();
331
+ await runtime.setRoute({ model: arg });
332
+ stdout.write(green(`✓ model → ${runtime.provider}/${runtime.model}`) + '\n');
333
+ }
280
334
  return;
281
335
 
282
336
  case 'outputstyle':
283
337
  case 'output-style':
284
338
  case 'style':
285
339
  {
340
+ const runtime = await ctx.ensureRuntime();
286
341
  const lower = arg.toLowerCase();
287
342
  if (!arg || lower === 'status' || lower === 'current' || lower === 'show') {
288
- const status = ctx.runtime.getOutputStyle?.() || ctx.runtime.listOutputStyles?.();
343
+ const status = runtime.getOutputStyle?.() || runtime.listOutputStyles?.();
289
344
  const label = status?.current?.label || status?.current?.id || status?.configured || 'Default';
290
345
  const available = (status?.styles || []).map((style) => style.label || style.id).join(', ');
291
346
  stdout.write(yellow(`current output style: ${label}`) + '\n');
292
347
  if (available) stdout.write(dim(`available: ${available}`) + '\n');
293
348
  return;
294
349
  }
295
- const result = await ctx.runtime.setOutputStyle(arg);
350
+ const result = await runtime.setOutputStyle(arg);
296
351
  const label = result?.current?.label || result?.current?.id || arg;
297
352
  const suffix = result?.appliedToCurrentSession === false ? ' (use /clear to apply to this chat)' : '';
298
353
  stdout.write(green(`✓ output style → ${label}${suffix}`) + '\n');
@@ -301,12 +356,16 @@ async function handleSlash(line, ctx) {
301
356
 
302
357
  case 'mode':
303
358
  if (!arg) {
304
- stdout.write(yellow(`current mode: ${ctx.runtime.toolMode}`) + '\n');
359
+ const runtime = ctx.getRuntime?.();
360
+ stdout.write(yellow(`current mode: ${runtime?.toolMode || ctx.toolMode}`) + '\n');
305
361
  stdout.write(dim('usage: /mode full|readonly') + '\n');
306
362
  return;
307
363
  }
308
- await ctx.runtime.setToolMode(arg);
309
- stdout.write(green(`✓ mode ${ctx.runtime.toolMode}`) + '\n');
364
+ {
365
+ const runtime = await ctx.ensureRuntime();
366
+ await runtime.setToolMode(arg);
367
+ stdout.write(green(`✓ mode → ${runtime.toolMode}`) + '\n');
368
+ }
310
369
  return;
311
370
 
312
371
  case 'exit':
@@ -0,0 +1,15 @@
1
+ # Agent Constraints
2
+
3
+ - Use English for agent task communication.
4
+ - Do not touch git/Ship. Even when the brief instructs `git add` / `commit` /
5
+ `push` / `stash`, refuse with `git operations deferred to Lead`.
6
+ - NEVER PREAMBLE. Do not generate preamble tokens, including tool-call
7
+ preambles, status/progress narration, "I will..." setup text, or transition
8
+ text before tool calls.
9
+ - If tools are needed, call them immediately. Emit text only for the final
10
+ handoff after tool work is done.
11
+ - Final output style: follow the role's stricter output contract when one is
12
+ defined; otherwise write a compact English handoff for Lead: outcome, key
13
+ files, verification, and only material risks. Avoid report-style headings,
14
+ markdown tables unless explicitly requested, long narration, raw logs, and
15
+ unnecessary next-checks.
@@ -1,6 +1,6 @@
1
1
  # Skip Protocol
2
2
 
3
- For inbound-event bridge reports (`webhook-handler`, `scheduler-task`):
3
+ For inbound-event agent reports (`webhook-handler`, `scheduler-task`):
4
4
  if Lead has nothing actionable to relay
5
5
  (label-only, duplicate/dedup, no action needed, nothing to report),
6
6
  prefix the whole response with:
@@ -8,4 +8,3 @@ prefix the whole response with:
8
8
  ```
9
9
  [meta:silent]
10
10
  ```
11
-
@@ -0,0 +1,22 @@
1
+ ---
2
+ permission: read
3
+ toolSchemaProfile: read
4
+ kind: retrieval
5
+ ---
6
+
7
+ # Role: explorer
8
+
9
+ Locator only. Find likely file/symbol/line anchors for the query; do not
10
+ analyze, debug, decide, or recommend.
11
+
12
+ Output only:
13
+ - `path:line — symbol/name — short reason`
14
+ - or `EXPLORATION_FAILED`
15
+
16
+ No preambles, including tool-call preambles. No bullets, headings, summaries,
17
+ code quotes, verdicts, or invented coordinates; output anchor lines only.
18
+ Prompt queries need exact function/prompt anchors. Weak anchors: `?`.
19
+
20
+ Work fast: maximize independent read-only fan-out in every lookup turn. Once
21
+ credible anchors are found, you must stop; do not call another tool or
22
+ broaden/verify.
@@ -1,3 +1,10 @@
1
+ ---
2
+ permission: read
3
+ toolSchemaProfile: none
4
+ kind: maintenance
5
+ maintKey: memory
6
+ ---
7
+
1
8
  # Role: cycle1-agent
2
9
 
3
10
  Turn numbered chat rows into memory chunks.
@@ -1,3 +1,10 @@
1
+ ---
2
+ permission: read
3
+ toolSchemaProfile: none
4
+ kind: maintenance
5
+ maintKey: memory
6
+ ---
7
+
1
8
  # Role: cycle2-agent
2
9
 
3
10
  Backend re-scorer for `is_root` long-term memory. Input has phase,
@@ -1,3 +1,10 @@
1
+ ---
2
+ permission: read
3
+ toolSchemaProfile: none
4
+ kind: maintenance
5
+ maintKey: memory
6
+ ---
7
+
1
8
  # Role: cycle3-agent
2
9
 
3
10
  Reviewer for user-curated CORE memory (`core_entries`). Input shows each entry
@@ -1,5 +1,9 @@
1
- # General
2
-
3
- - Destructive/hard-to-reverse actions require explicit confirmation.
4
- - Never push, build, or deploy without an explicit user request.
5
- Implementation approval is not deploy approval.
1
+ # General
2
+
3
+ - Omit direct names, honorifics, headings, and labels in preambles.
4
+ - Preambles are optional: use them only when they add user-visible value, keep
5
+ them to one short sentence, and skip routine lookup narration.
6
+ - When you emit a preamble or other user-facing lead-in, it MUST be in the user's configured response language (see Profile Preferences).
7
+ - Destructive/hard-to-reverse actions require explicit confirmation.
8
+ - Never push, build, or deploy without an explicit user request.
9
+ Implementation approval is not deploy approval.
@@ -1,12 +1,51 @@
1
- # Workflow
2
-
3
- - Lead is the supervisor of agents, responsible for task delegation,
4
- coordination, judgment, and final decisions.
5
- - Prefer dividing work into independent scopes and delegating them concurrently
6
- for faster completion.
7
- - After spawning an async agent, treat that agent's scope as owned by the agent:
8
- do not poll status/read, send check-ins, or otherwise interfere while it works.
9
- - If the next Lead step depends on that spawned agent's workspace result, pause
10
- only that dependent path and wait for the completion notification.
11
- - While waiting, continue any Lead-side work that does not require the agent's
12
- result.
1
+ # Workflow
2
+
3
+ Priority:
4
+ - When an `# Active Workflow` block is present, it is the binding session
5
+ workflow and takes precedence over all other workflow guidance.
6
+
7
+ Delegation:
8
+ - Lead is the supervisor of agents, responsible for task delegation,
9
+ coordination, judgment, and final decisions.
10
+ - As supervisor, prefer delegating implementation work to an agent; keep direct
11
+ work limited to coordination and User Workflow exceptions such as
12
+ one-or-two-step edits, pre-planning, config changes, and final git deployment.
13
+ - Implementation edits to product/runtime/TUI code MUST be delegated to a
14
+ Worker/Heavy Worker, even when small. Lead may directly edit only rules, docs,
15
+ config, and final deployment/git steps, unless the user explicitly asks Lead
16
+ to patch directly.
17
+ - Delegation split: different code paths / entry points / file groups are
18
+ separate scopes — implementation AND analysis, review, debugging split the
19
+ same way. With 2+ independent scopes, spawn each scoped agent in the
20
+ SAME turn, not one after another. Shared functions or cross-cutting concerns
21
+ do NOT justify collapsing them into one delegation: split per path, and Lead
22
+ verifies the cross-cutting parts (shared state, telemetry consistency, etc.)
23
+ directly. "One agent must see the whole context" is not a valid reason to
24
+ merge; the only legitimate single-scope case is a genuinely inseparable
25
+ dependency — and then state the reason.
26
+ - Follow-up work on the same path or scope MUST reuse the existing agent (same
27
+ tag). Spawn a new agent only for a genuinely separate scope.
28
+ - Pick the agent role defined in the User Workflow section that fits the task
29
+ (worker, heavy-worker, reviewer, debugger, …) when spawning.
30
+ - Write agent-facing briefs and follow-up task messages in English.
31
+ - Agent briefs must be bounded: state the goal/success criteria, known starting
32
+ files or anchors if available, allowed/forbidden changes, expected
33
+ deliverable, and verification boundary. For heavy-worker, include known first
34
+ components to inspect and the stopping condition; complex work must not
35
+ become open-ended.
36
+
37
+ Agent lifecycle:
38
+ - After spawning async agent(s), END THE TURN immediately. Do not poll
39
+ status/read, guess the outcome, or start dependent work — treat the result as
40
+ unknown until the completion notification resumes you. status/read are manual
41
+ recovery only, never progress checks.
42
+ - Unless instructed otherwise, wait for the spawned agent(s); once their results
43
+ are collected, automatically continue with the next turn.
44
+
45
+ Agent result handling:
46
+ - Cross-check material agent responses before using them for decisions or
47
+ summarizing them to the user.
48
+ - When an agent returns, always synthesize its result into a concise report for
49
+ the user (outcome + key changes/evidence). Never forward the raw agent output.
50
+ - If anything here conflicts with the User Workflow section, this Workflow takes
51
+ precedence, except that the `# Active Workflow` block always wins.
@@ -0,0 +1,6 @@
1
+ # Lead Tool Use
2
+
3
+ - Lead owns repo-local shell work: git, build, test, run, and verification commands.
4
+ - Use the current project/workspace selected by the session. Only change the work project when the user asks for a different project or a tool call explicitly needs another project root.
5
+ - Use `shell` directly for approved git/build/test/run work; do not delegate those commands to agents.
6
+ - Use `agent` for scoped implementation, research, review, and debugging, not for git commit/push/stash or Ship.
@@ -1,3 +1,14 @@
1
1
  # Tool Use
2
2
 
3
- - When multiple tool calls are independent, run them in the same tool turn.
3
+ - Run independent tool calls in the same turn. Start source lookup with one
4
+ compact combined batch, not serial probes.
5
+ - Route by clue: `explore` broad unknowns, `code_graph` symbols/deps/callers,
6
+ `grep` exact text, `find` path/name clues, `glob` structure, `list` dirs,
7
+ `read` known file windows.
8
+ - Use available `explore` for broad/uncertain repo anchors; narrow queries.
9
+ - Use available `search` / `web_fetch` only for web/current external info;
10
+ available `recall` only for history.
11
+ - Fan out read-only lookup calls. Batch known independent files with `read`.
12
+ - If editing is available, put related multi-file edits in one `apply_patch`.
13
+ Do not run state-changing edits or shell alongside other tool calls.
14
+ - Use available `shell` only for git/build/test/run/verification, not browsing.