@oh-my-pi/pi-coding-agent 14.9.9 → 15.0.1

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 (230) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/examples/extensions/plan-mode.ts +0 -1
  3. package/package.json +9 -9
  4. package/scripts/build-binary.ts +5 -0
  5. package/scripts/format-prompts.ts +1 -1
  6. package/src/autoresearch/helpers.ts +17 -0
  7. package/src/autoresearch/tools/log-experiment.ts +9 -17
  8. package/src/autoresearch/tools/run-experiment.ts +2 -17
  9. package/src/capability/skill.ts +7 -0
  10. package/src/cli/args.ts +2 -2
  11. package/src/cli/list-models.ts +1 -1
  12. package/src/cli/shell-cli.ts +3 -13
  13. package/src/cli/update-cli.ts +1 -1
  14. package/src/cli.ts +11 -29
  15. package/src/commands/acp.ts +24 -0
  16. package/src/commands/launch.ts +6 -4
  17. package/src/commit/agentic/prompts/system.md +1 -1
  18. package/src/commit/agentic/tools/propose-changelog.ts +8 -1
  19. package/src/commit/analysis/conventional.ts +8 -66
  20. package/src/commit/map-reduce/reduce-phase.ts +6 -65
  21. package/src/commit/pipeline.ts +2 -2
  22. package/src/commit/shared-llm.ts +89 -0
  23. package/src/config/config-file.ts +210 -0
  24. package/src/config/model-equivalence.ts +8 -11
  25. package/src/config/model-registry.ts +13 -2
  26. package/src/config/model-resolver.ts +31 -4
  27. package/src/config/settings-schema.ts +102 -1
  28. package/src/config/settings.ts +1 -1
  29. package/src/config.ts +3 -219
  30. package/src/edit/index.ts +22 -1
  31. package/src/edit/modes/patch.ts +10 -0
  32. package/src/edit/modes/replace.ts +3 -0
  33. package/src/edit/renderer.ts +17 -1
  34. package/src/eval/js/context-manager.ts +1 -1
  35. package/src/eval/js/executor.ts +3 -0
  36. package/src/eval/js/shared/rewrite-imports.ts +122 -50
  37. package/src/eval/js/shared/runtime.ts +31 -4
  38. package/src/eval/js/tool-bridge.ts +43 -21
  39. package/src/eval/py/executor.ts +5 -0
  40. package/src/exa/factory.ts +2 -2
  41. package/src/exa/mcp-client.ts +74 -1
  42. package/src/exec/bash-executor.ts +5 -1
  43. package/src/export/html/template.generated.ts +1 -1
  44. package/src/export/html/template.js +0 -11
  45. package/src/extensibility/extensions/runner.ts +55 -2
  46. package/src/extensibility/extensions/types.ts +98 -221
  47. package/src/extensibility/hooks/types.ts +89 -314
  48. package/src/extensibility/shared-events.ts +343 -0
  49. package/src/extensibility/skills.ts +42 -1
  50. package/src/goals/index.ts +3 -0
  51. package/src/goals/runtime.ts +500 -0
  52. package/src/goals/state.ts +37 -0
  53. package/src/goals/tools/goal-tool.ts +237 -0
  54. package/src/hashline/anchors.ts +2 -2
  55. package/src/hindsight/mental-models.ts +1 -1
  56. package/src/internal-urls/agent-protocol.ts +1 -20
  57. package/src/internal-urls/artifact-protocol.ts +1 -19
  58. package/src/internal-urls/docs-index.generated.ts +9 -10
  59. package/src/internal-urls/index.ts +1 -0
  60. package/src/internal-urls/issue-pr-protocol.ts +577 -0
  61. package/src/internal-urls/registry-helpers.ts +25 -0
  62. package/src/internal-urls/router.ts +6 -3
  63. package/src/internal-urls/types.ts +22 -1
  64. package/src/main.ts +24 -11
  65. package/src/mcp/oauth-flow.ts +20 -0
  66. package/src/modes/acp/acp-agent.ts +412 -71
  67. package/src/modes/acp/acp-client-bridge.ts +152 -0
  68. package/src/modes/acp/acp-event-mapper.ts +180 -15
  69. package/src/modes/acp/terminal-auth.ts +37 -0
  70. package/src/modes/components/assistant-message.ts +14 -8
  71. package/src/modes/components/bash-execution.ts +24 -63
  72. package/src/modes/components/custom-message.ts +14 -40
  73. package/src/modes/components/eval-execution.ts +27 -57
  74. package/src/modes/components/execution-shared.ts +102 -0
  75. package/src/modes/components/hook-message.ts +17 -49
  76. package/src/modes/components/mcp-add-wizard.ts +26 -5
  77. package/src/modes/components/message-frame.ts +88 -0
  78. package/src/modes/components/model-selector.ts +1 -1
  79. package/src/modes/components/read-tool-group.ts +29 -1
  80. package/src/modes/components/session-observer-overlay.ts +6 -2
  81. package/src/modes/components/session-selector.ts +1 -1
  82. package/src/modes/components/status-line/segments.ts +55 -4
  83. package/src/modes/components/status-line/types.ts +4 -0
  84. package/src/modes/components/status-line.ts +28 -10
  85. package/src/modes/components/tool-execution.ts +7 -8
  86. package/src/modes/controllers/command-controller-shared.ts +108 -0
  87. package/src/modes/controllers/command-controller.ts +27 -10
  88. package/src/modes/controllers/event-controller.ts +60 -18
  89. package/src/modes/controllers/extension-ui-controller.ts +8 -2
  90. package/src/modes/controllers/input-controller.ts +85 -39
  91. package/src/modes/controllers/mcp-command-controller.ts +56 -61
  92. package/src/modes/controllers/ssh-command-controller.ts +18 -57
  93. package/src/modes/interactive-mode.ts +675 -39
  94. package/src/modes/print-mode.ts +16 -86
  95. package/src/modes/rpc/rpc-mode.ts +30 -88
  96. package/src/modes/runtime-init.ts +115 -0
  97. package/src/modes/theme/defaults/dark-poimandres.json +2 -0
  98. package/src/modes/theme/defaults/light-poimandres.json +2 -0
  99. package/src/modes/theme/theme.ts +18 -6
  100. package/src/modes/types.ts +20 -5
  101. package/src/modes/utils/context-usage.ts +13 -13
  102. package/src/modes/utils/ui-helpers.ts +25 -6
  103. package/src/plan-mode/approved-plan.ts +35 -1
  104. package/src/prompts/agents/designer.md +5 -5
  105. package/src/prompts/agents/explore.md +7 -7
  106. package/src/prompts/agents/init.md +9 -9
  107. package/src/prompts/agents/librarian.md +14 -14
  108. package/src/prompts/agents/plan.md +4 -4
  109. package/src/prompts/agents/reviewer.md +5 -5
  110. package/src/prompts/agents/task.md +10 -10
  111. package/src/prompts/commands/orchestrate.md +2 -2
  112. package/src/prompts/compaction/branch-summary.md +3 -3
  113. package/src/prompts/compaction/compaction-short-summary.md +7 -7
  114. package/src/prompts/compaction/compaction-summary-context.md +1 -1
  115. package/src/prompts/compaction/compaction-summary.md +5 -5
  116. package/src/prompts/compaction/compaction-turn-prefix.md +3 -3
  117. package/src/prompts/compaction/compaction-update-summary.md +11 -11
  118. package/src/prompts/goals/goal-budget-limit.md +16 -0
  119. package/src/prompts/goals/goal-continuation.md +28 -0
  120. package/src/prompts/goals/goal-mode-active.md +23 -0
  121. package/src/prompts/memories/consolidation.md +2 -2
  122. package/src/prompts/memories/read-path.md +1 -1
  123. package/src/prompts/memories/stage_one_input.md +1 -1
  124. package/src/prompts/memories/stage_one_system.md +5 -5
  125. package/src/prompts/review-request.md +4 -4
  126. package/src/prompts/system/agent-creation-architect.md +17 -17
  127. package/src/prompts/system/agent-creation-user.md +2 -2
  128. package/src/prompts/system/commit-message-system.md +2 -2
  129. package/src/prompts/system/custom-system-prompt.md +2 -2
  130. package/src/prompts/system/eager-todo.md +6 -6
  131. package/src/prompts/system/handoff-document.md +1 -1
  132. package/src/prompts/system/plan-mode-active.md +25 -24
  133. package/src/prompts/system/plan-mode-approved.md +4 -4
  134. package/src/prompts/system/plan-mode-compact-instructions.md +16 -0
  135. package/src/prompts/system/plan-mode-reference.md +2 -2
  136. package/src/prompts/system/plan-mode-subagent.md +8 -8
  137. package/src/prompts/system/plan-mode-tool-decision-reminder.md +3 -3
  138. package/src/prompts/system/project-prompt.md +4 -4
  139. package/src/prompts/system/subagent-system-prompt.md +7 -7
  140. package/src/prompts/system/subagent-yield-reminder.md +4 -4
  141. package/src/prompts/system/system-prompt.md +72 -71
  142. package/src/prompts/system/ttsr-interrupt.md +1 -1
  143. package/src/prompts/tools/apply-patch.md +1 -1
  144. package/src/prompts/tools/ast-edit.md +3 -3
  145. package/src/prompts/tools/ast-grep.md +3 -3
  146. package/src/prompts/tools/bash.md +6 -0
  147. package/src/prompts/tools/browser.md +3 -3
  148. package/src/prompts/tools/checkpoint.md +3 -3
  149. package/src/prompts/tools/find.md +3 -3
  150. package/src/prompts/tools/github.md +2 -5
  151. package/src/prompts/tools/goal.md +13 -0
  152. package/src/prompts/tools/hashline.md +104 -116
  153. package/src/prompts/tools/image-gen.md +3 -3
  154. package/src/prompts/tools/irc.md +1 -1
  155. package/src/prompts/tools/lsp.md +2 -2
  156. package/src/prompts/tools/patch.md +6 -6
  157. package/src/prompts/tools/read.md +8 -7
  158. package/src/prompts/tools/replace.md +5 -5
  159. package/src/prompts/tools/resolve.md +6 -5
  160. package/src/prompts/tools/retain.md +1 -1
  161. package/src/prompts/tools/rewind.md +2 -2
  162. package/src/prompts/tools/search.md +2 -2
  163. package/src/prompts/tools/ssh.md +2 -2
  164. package/src/prompts/tools/task.md +12 -6
  165. package/src/prompts/tools/web-search.md +2 -2
  166. package/src/prompts/tools/write.md +3 -3
  167. package/src/sdk.ts +81 -17
  168. package/src/session/agent-session.ts +656 -125
  169. package/src/session/blob-store.ts +36 -3
  170. package/src/session/client-bridge.ts +81 -0
  171. package/src/session/compaction/errors.ts +31 -0
  172. package/src/session/compaction/index.ts +1 -0
  173. package/src/session/messages.ts +67 -2
  174. package/src/session/session-manager.ts +131 -12
  175. package/src/session/session-storage.ts +33 -15
  176. package/src/session/streaming-output.ts +309 -13
  177. package/src/slash-commands/acp-builtins.ts +46 -0
  178. package/src/slash-commands/builtin-registry.ts +717 -116
  179. package/src/slash-commands/helpers/context-report.ts +39 -0
  180. package/src/slash-commands/helpers/format.ts +23 -0
  181. package/src/slash-commands/helpers/marketplace-manager.ts +25 -0
  182. package/src/slash-commands/helpers/mcp.ts +532 -0
  183. package/src/slash-commands/helpers/parse.ts +85 -0
  184. package/src/slash-commands/helpers/ssh.ts +193 -0
  185. package/src/slash-commands/helpers/todo.ts +279 -0
  186. package/src/slash-commands/helpers/usage-report.ts +91 -0
  187. package/src/slash-commands/types.ts +126 -0
  188. package/src/ssh/ssh-executor.ts +5 -0
  189. package/src/system-prompt.ts +4 -2
  190. package/src/task/executor.ts +27 -10
  191. package/src/task/index.ts +20 -1
  192. package/src/task/render.ts +27 -18
  193. package/src/task/types.ts +4 -0
  194. package/src/tools/ast-edit.ts +21 -120
  195. package/src/tools/ast-grep.ts +21 -119
  196. package/src/tools/bash-interactive.ts +9 -1
  197. package/src/tools/bash.ts +203 -6
  198. package/src/tools/browser/attach.ts +3 -3
  199. package/src/tools/browser/launch.ts +81 -18
  200. package/src/tools/browser/registry.ts +1 -5
  201. package/src/tools/browser/tab-supervisor.ts +51 -14
  202. package/src/tools/conflict-detect.ts +21 -10
  203. package/src/tools/eval.ts +3 -1
  204. package/src/tools/fetch.ts +15 -4
  205. package/src/tools/find.ts +39 -39
  206. package/src/tools/gh-renderer.ts +0 -12
  207. package/src/tools/gh.ts +689 -182
  208. package/src/tools/github-cache.ts +548 -0
  209. package/src/tools/index.ts +25 -11
  210. package/src/tools/inspect-image.ts +3 -10
  211. package/src/tools/output-meta.ts +176 -37
  212. package/src/tools/path-utils.ts +125 -2
  213. package/src/tools/read.ts +605 -239
  214. package/src/tools/render-utils.ts +92 -0
  215. package/src/tools/renderers.ts +2 -0
  216. package/src/tools/resolve.ts +72 -44
  217. package/src/tools/search.ts +120 -186
  218. package/src/tools/write.ts +67 -10
  219. package/src/tui/code-cell.ts +70 -2
  220. package/src/utils/file-mentions.ts +1 -1
  221. package/src/utils/image-loading.ts +7 -3
  222. package/src/utils/image-resize.ts +32 -43
  223. package/src/vim/parser.ts +0 -17
  224. package/src/vim/render.ts +1 -1
  225. package/src/vim/types.ts +1 -1
  226. package/src/web/search/providers/gemini.ts +35 -95
  227. package/src/prompts/tools/exit-plan-mode.md +0 -6
  228. package/src/tools/exit-plan-mode.ts +0 -97
  229. package/src/utils/fuzzy.ts +0 -108
  230. package/src/utils/image-convert.ts +0 -27
@@ -6,7 +6,7 @@ When a user describes what they want an agent to do:
6
6
  1. Extract core intent
7
7
  - Identify the fundamental purpose, key responsibilities, and success criteria
8
8
  - Consider both explicit requirements and implicit needs
9
- - For code-review agents, **SHOULD** assume the user wants review of recently written code, not the whole codebase, unless explicitly stated otherwise
9
+ - For code-review agents, SHOULD assume the user wants review of recently written code, not the whole codebase, unless explicitly stated otherwise
10
10
  2. Design expert persona
11
11
  - Create an identity with deep domain knowledge relevant to the task
12
12
  - The persona should guide the agent's decision-making approach
@@ -23,13 +23,13 @@ When a user describes what they want an agent to do:
23
23
  - Include efficient workflow patterns
24
24
  - Include clear escalation or fallback strategies
25
25
  5. Create identifier
26
- - **MUST** use lowercase letters, numbers, and hyphens only
27
- - **SHOULD** be 2-4 words joined by hyphens
28
- - **MUST** clearly indicate the agent's primary function
29
- - **SHOULD** be memorable and easy to type
30
- - **MUST NOT** use generic terms like "helper" or "assistant"
26
+ - MUST use lowercase letters, numbers, and hyphens only
27
+ - SHOULD be 2-4 words joined by hyphens
28
+ - MUST clearly indicate the agent's primary function
29
+ - SHOULD be memorable and easy to type
30
+ - NEVER use generic terms like "helper" or "assistant"
31
31
  6. Example agent descriptions
32
- - In the `whenToUse` field, **SHOULD** include examples of when this agent **SHOULD** be used
32
+ - In the `whenToUse` field, SHOULD include examples of when this agent SHOULD be used
33
33
  - Format examples as:
34
34
  ```
35
35
  <example>
@@ -51,10 +51,10 @@ When a user describes what they want an agent to do:
51
51
  </commentary>
52
52
  </example>
53
53
  ```
54
- - If the user mentioned or implied proactive use, **SHOULD** include proactive examples
55
- - **MUST** ensure examples show the assistant using the Agent tool, not responding directly
54
+ - If the user mentioned or implied proactive use, SHOULD include proactive examples
55
+ - MUST ensure examples show the assistant using the Agent tool, not responding directly
56
56
 
57
- Your output **MUST** be a valid JSON object with exactly these fields:
57
+ Your output MUST be a valid JSON object with exactly these fields:
58
58
 
59
59
  ```json
60
60
  {
@@ -65,11 +65,11 @@ Your output **MUST** be a valid JSON object with exactly these fields:
65
65
  ```
66
66
 
67
67
  Key principles for your system prompts:
68
- - **MUST** be specific, not generic — **MUST NOT** use vague instructions
69
- - **SHOULD** include concrete examples when they would clarify behavior
70
- - **MUST** balance comprehensiveness with clarity — every instruction **MUST** add value
71
- - **MUST** ensure the agent has enough context to handle task variations
72
- - **MUST** make the agent proactive in seeking clarification when needed
73
- - **MUST** build in quality assurance and self-correction mechanisms
68
+ - MUST be specific, not generic — NEVER use vague instructions
69
+ - SHOULD include concrete examples when they would clarify behavior
70
+ - MUST balance comprehensiveness with clarity — every instruction MUST add value
71
+ - MUST ensure the agent has enough context to handle task variations
72
+ - MUST make the agent proactive in seeking clarification when needed
73
+ - MUST build in quality assurance and self-correction mechanisms
74
74
 
75
- The agents you create **MUST** be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
75
+ The agents you create MUST be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
@@ -2,5 +2,5 @@ Design a custom agent for this request:
2
2
 
3
3
  {{request}}
4
4
 
5
- You **MUST** return only the JSON object required by your system instructions.
6
- You **MUST NOT** include markdown fences.
5
+ You MUST return only the JSON object required by your system instructions.
6
+ You NEVER include markdown fences.
@@ -1,2 +1,2 @@
1
- Generate a concise git commit message from the provided diff. Use conventional commit format: `type(scope): description` where type is feat/fix/refactor/chore/test/docs and scope is optional. The description **MUST** be lowercase, imperative mood, no trailing period. Keep it under 72 characters.
2
- You **MUST** output ONLY the commit message, nothing else.
1
+ Generate a concise git commit message from the provided diff. Use conventional commit format: `type(scope): description` where type is feat/fix/refactor/chore/test/docs and scope is optional. The description MUST be lowercase, imperative mood, no trailing period. Keep it under 72 characters.
2
+ You MUST output ONLY the commit message, nothing else.
@@ -30,7 +30,7 @@ Main branch: {{git.mainBranch}}
30
30
  {{/ifAny}}
31
31
  {{#if skills.length}}
32
32
  Skills are specialized knowledge. Scan descriptions for your task domain.
33
- If a skill applies, you **MUST** read `skill://<name>` before proceeding.
33
+ If a skill applies, you MUST read `skill://<name>` before proceeding.
34
34
  <skills>
35
35
  {{#list skills join="\n"}}
36
36
  <skill name="{{name}}">
@@ -45,7 +45,7 @@ If a skill applies, you **MUST** read `skill://<name>` before proceeding.
45
45
  {{/each}}
46
46
  {{/if}}
47
47
  {{#if rules.length}}
48
- Rules are local constraints. You **MUST** read `rule://<name>` when working in that domain.
48
+ Rules are local constraints. You MUST read `rule://<name>` when working in that domain.
49
49
  <rules>
50
50
  {{#list rules join="\n"}}
51
51
  <rule name="{{name}}">
@@ -1,12 +1,12 @@
1
1
  <system-reminder>
2
2
  Before substantive work, create a phased todo.
3
3
 
4
- You **MUST** call `todo_write` first in this turn.
5
- You **MUST** initialize the todo list with a single `init` op.
6
- You **MUST** cover the entire request from investigation through implementation and verification — not just the next immediate step.
7
- Task descriptions **MUST** be specific. A future turn **MUST** execute them without re-planning.
8
- You **MUST** keep task `content` to a short label (5-10 words). Put file paths, implementation steps, and specifics in `details`.
9
- You **MUST** keep exactly one task `in_progress` and all later tasks `pending`.
4
+ You MUST call `todo_write` first in this turn.
5
+ You MUST initialize the todo list with a single `init` op.
6
+ You MUST cover the entire request from investigation through implementation and verification — not just the next immediate step.
7
+ Task descriptions MUST be specific. A future turn MUST execute them without re-planning.
8
+ You MUST keep task `content` to a short label (5-10 words). Put file paths, implementation steps, and specifics in `details`.
9
+ You MUST keep exactly one task `in_progress` and all later tasks `pending`.
10
10
 
11
11
  After `todo_write` succeeds, continue the request in the same turn.
12
12
  Do not call `todo_write` again unless task state materially changed.
@@ -1,6 +1,6 @@
1
1
  <critical>
2
2
  Write a handoff document for another instance of yourself.
3
- The handoff **MUST** be sufficient for seamless continuation without access to this conversation.
3
+ The handoff MUST be sufficient for seamless continuation without access to this conversation.
4
4
  Output ONLY the handoff document. No preamble, no commentary, no wrapper text.
5
5
  </critical>
6
6
 
@@ -1,32 +1,33 @@
1
1
  <critical>
2
- Plan mode active. You **MUST** perform READ-ONLY operations only.
2
+ Plan mode active. You MUST perform READ-ONLY operations only.
3
3
 
4
- You **MUST NOT**:
4
+ You NEVER:
5
5
  - Create, edit, or delete files (except plan file below)
6
6
  - Run state-changing commands (git commit, npm install, etc.)
7
7
  - Make any system changes
8
8
 
9
- To implement: call `{{exitToolName}}` → user approves an execution option → full write access is restored.
9
+ To implement: call `resolve` with `action: "apply"`, a `reason`, and `extra: { title: "<PLAN_TITLE>" }` → user approves an execution option → full write access is restored. `<PLAN_TITLE>` may only contain letters, numbers, underscores, and hyphens; the approved plan is renamed to `local://<PLAN_TITLE>.md`.
10
10
 
11
- You **MUST NOT** ask the user to exit plan mode for you; you **MUST** call `{{exitToolName}}` yourself.
11
+ You NEVER ask the user to exit plan mode for you; you MUST call `resolve` yourself.
12
12
  </critical>
13
13
 
14
14
  ## Plan File
15
15
 
16
16
  {{#if planExists}}
17
- Plan file exists at `{{planFilePath}}`; you **MUST** read and update it incrementally.
17
+ Plan file exists at `{{planFilePath}}`; you MUST read and update it incrementally.
18
18
  {{else}}
19
- You **MUST** create a plan at `{{planFilePath}}`.
19
+ You MUST create a plan at `{{planFilePath}}`.
20
20
  {{/if}}
21
21
 
22
- You **MUST** use `{{editToolName}}` for incremental updates; use `{{writeToolName}}` only for create/full replace.
22
+ You MUST use `{{editToolName}}` for incremental updates; use `{{writeToolName}}` only for create/full replace.
23
23
 
24
24
  <caution>
25
25
  The approval selector includes:
26
26
  - **Approve and execute**: starts execution in fresh context (session cleared).
27
+ - **Approve and compact context**: distills the plan-mode discussion into a summary, then starts execution in this session.
27
28
  - **Approve and keep context**: starts execution in this session, preserving exploration history.
28
29
 
29
- You **MUST** still make the plan file self-contained: include requirements, decisions, key findings, and remaining todos.
30
+ You MUST still make the plan file self-contained: include requirements, decisions, key findings, and remaining todos.
30
31
  </caution>
31
32
 
32
33
  {{#if reentry}}
@@ -38,7 +39,7 @@ You **MUST** still make the plan file self-contained: include requirements, deci
38
39
  3. Decide:
39
40
  - **Different task** → Overwrite plan
40
41
  - **Same task, continuing** → Update and clean outdated sections
41
- 4. Call `{{exitToolName}}` when complete
42
+ 4. Call `resolve` with `action: "apply"` and `extra: { title }` when complete
42
43
  </procedure>
43
44
  {{/if}}
44
45
 
@@ -47,18 +48,18 @@ You **MUST** still make the plan file self-contained: include requirements, deci
47
48
 
48
49
  <procedure>
49
50
  ### 1. Explore
50
- You **MUST** use `find`, `search`, `read` to understand the codebase.
51
+ You MUST use `find`, `search`, `read` to understand the codebase.
51
52
 
52
53
  ### 2. Interview
53
- You **MUST** use `{{askToolName}}` to clarify:
54
+ You MUST use `{{askToolName}}` to clarify:
54
55
  - Ambiguous requirements
55
56
  - Technical decisions and tradeoffs
56
57
  - Preferences: UI/UX, performance, edge cases
57
58
 
58
- You **MUST** batch questions. You **MUST NOT** ask what you can answer by exploring.
59
+ You MUST batch questions. You NEVER ask what you can answer by exploring.
59
60
 
60
61
  ### 3. Update Incrementally
61
- You **MUST** use `{{editToolName}}` to update plan file as you learn; **MUST NOT** wait until end.
62
+ You MUST use `{{editToolName}}` to update plan file as you learn; NEVER wait until end.
62
63
 
63
64
  ### 4. Calibrate
64
65
  - Large unspecified task → multiple interview rounds
@@ -68,12 +69,12 @@ You **MUST** use `{{editToolName}}` to update plan file as you learn; **MUST NOT
68
69
  <caution>
69
70
  ### Plan Structure
70
71
 
71
- You **MUST** use clear markdown headers; include:
72
+ You MUST use clear markdown headers; include:
72
73
  - Recommended approach (not alternatives)
73
74
  - Paths of critical files to modify
74
75
  - Verification: how to test end-to-end
75
76
 
76
- The plan **MUST** be scannable yet detailed enough to execute.
77
+ The plan MUST be scannable yet detailed enough to execute.
77
78
  </caution>
78
79
 
79
80
  {{else}}
@@ -81,35 +82,35 @@ The plan **MUST** be scannable yet detailed enough to execute.
81
82
 
82
83
  <procedure>
83
84
  ### Phase 1: Understand
84
- You **MUST** focus on the request and associated code. You **SHOULD** launch parallel explore agents when scope spans multiple areas.
85
+ You MUST focus on the request and associated code. You SHOULD launch parallel explore agents when scope spans multiple areas.
85
86
 
86
87
  ### Phase 2: Design
87
- You **MUST** draft an approach based on exploration. You **MUST** consider trade-offs briefly, then choose.
88
+ You MUST draft an approach based on exploration. You MUST consider trade-offs briefly, then choose.
88
89
 
89
90
  ### Phase 3: Review
90
- You **MUST** read critical files. You **MUST** verify plan matches original request. You **SHOULD** use `{{askToolName}}` to clarify remaining questions.
91
+ You MUST read critical files. You MUST verify plan matches original request. You SHOULD use `{{askToolName}}` to clarify remaining questions.
91
92
 
92
93
  ### Phase 4: Update Plan
93
- You **MUST** update `{{planFilePath}}` (`{{editToolName}}` for changes, `{{writeToolName}}` only if creating from scratch):
94
+ You MUST update `{{planFilePath}}` (`{{editToolName}}` for changes, `{{writeToolName}}` only if creating from scratch):
94
95
  - Recommended approach only
95
96
  - Paths of critical files to modify
96
97
  - Verification section
97
98
  </procedure>
98
99
 
99
100
  <caution>
100
- You **MUST** ask questions throughout. You **MUST NOT** make large assumptions about user intent.
101
+ You MUST ask questions throughout. You NEVER make large assumptions about user intent.
101
102
  </caution>
102
103
  {{/if}}
103
104
 
104
105
  <directives>
105
- - You **MUST** use `{{askToolName}}` only for clarifying requirements or choosing approaches
106
+ - You MUST use `{{askToolName}}` only for clarifying requirements or choosing approaches
106
107
  </directives>
107
108
 
108
109
  <critical>
109
110
  Your turn ends ONLY by:
110
111
  1. Using `{{askToolName}}` to gather information, OR
111
- 2. Calling `{{exitToolName}}` when ready — this triggers user approval, then implementation with full tool access
112
+ 2. Calling `resolve` with `action: "apply"`, `reason`, and `extra: { title: "<PLAN_TITLE>" }` when ready — this triggers user approval, then implementation with full tool access
112
113
 
113
- You **MUST NOT** ask plan approval via text or `{{askToolName}}`; you **MUST** use `{{exitToolName}}`.
114
- You **MUST** keep going until complete.
114
+ You NEVER ask plan approval via text or `{{askToolName}}`; you MUST use `resolve`.
115
+ You MUST keep going until complete.
115
116
  </critical>
@@ -1,5 +1,5 @@
1
1
  <critical>
2
- Plan approved. You **MUST** execute it now.
2
+ Plan approved. You MUST execute it now.
3
3
  </critical>
4
4
 
5
5
  Finalized plan artifact: `{{finalPlanFilePath}}`
@@ -14,8 +14,8 @@ Execution may be in fresh context. Treat the finalized plan as the source of tru
14
14
  {{planContent}}
15
15
 
16
16
  <instruction>
17
- You **MUST** execute this plan step by step from `{{finalPlanFilePath}}`. You have full tool access.
18
- You **MUST** verify each step before proceeding to the next.
17
+ You MUST execute this plan step by step from `{{finalPlanFilePath}}`. You have full tool access.
18
+ You MUST verify each step before proceeding to the next.
19
19
  {{#has tools "todo_write"}}
20
20
  Before execution, initialize todo tracking with `todo_write`.
21
21
  After each completed step, immediately update `todo_write`.
@@ -24,5 +24,5 @@ If `todo_write` fails, fix the payload and retry before continuing.
24
24
  </instruction>
25
25
 
26
26
  <critical>
27
- You **MUST** keep going until complete. This matters.
27
+ You MUST keep going until complete. This matters.
28
28
  </critical>
@@ -0,0 +1,16 @@
1
+ Preparing to execute the approved plan.
2
+
3
+ You MUST distill the plan-mode discussion. Preserve:
4
+ - The plan rationale and the alternatives explicitly rejected.
5
+ - Key decisions and the constraints that drove them.
6
+ - Discovered files, symbols, and code paths the executor will need.
7
+ - Explicit user preferences expressed during planning.
8
+
9
+ You MUST drop:
10
+ - Tool-call noise (file reads, searches) where the result is already captured in the plan or above.
11
+ - Superseded plan drafts.
12
+ - Restated context already present in the plan file.
13
+
14
+ {{#if planFilePath}}
15
+ The approved plan file is at `{{planFilePath}}`; it is the authoritative source of truth and need not be re-summarized in detail.
16
+ {{/if}}
@@ -9,6 +9,6 @@ Plan file from previous session: `{{planFilePath}}`
9
9
  </details>
10
10
 
11
11
  <instruction>
12
- If this plan is relevant to current work and not complete, you **MUST** continue executing it.
13
- If the plan is stale or unrelated, you **MUST** ignore it.
12
+ If this plan is relevant to current work and not complete, you MUST continue executing it.
13
+ If the plan is stale or unrelated, you MUST ignore it.
14
14
  </instruction>
@@ -1,7 +1,7 @@
1
1
  <critical>
2
- Plan mode active. You **MUST** perform READ-ONLY operations only.
2
+ Plan mode active. You MUST perform READ-ONLY operations only.
3
3
 
4
- You **MUST NOT**:
4
+ You NEVER:
5
5
  - Create, edit, delete, move, or copy files
6
6
  - Run state-changing commands
7
7
  - Make any changes to the system
@@ -9,13 +9,13 @@ You **MUST NOT**:
9
9
 
10
10
  <role>
11
11
  Software architect and planning specialist for main agent.
12
- You **MUST** explore the codebase and report findings. Main agent updates plan file.
12
+ You MUST explore the codebase and report findings. Main agent updates plan file.
13
13
  </role>
14
14
 
15
15
  <procedure>
16
- 1. You **MUST** use read-only tools to investigate
17
- 2. You **MUST** describe plan changes in response text
18
- 3. You **MUST** end with a Critical Files section
16
+ 1. You MUST use read-only tools to investigate
17
+ 2. You MUST describe plan changes in response text
18
+ 3. You MUST end with a Critical Files section
19
19
  </procedure>
20
20
 
21
21
  <output>
@@ -29,6 +29,6 @@ List 3-5 files most critical for implementing this plan:
29
29
  </output>
30
30
 
31
31
  <critical>
32
- You **MUST** operate as read-only. You **MUST NOT** write, edit, or modify files, nor execute any state-changing commands, via git, build system, package manager, etc.
33
- You **MUST** keep going until complete.
32
+ You MUST operate as read-only. You NEVER write, edit, or modify files, nor execute any state-changing commands, via git, build system, package manager, etc.
33
+ You MUST keep going until complete.
34
34
  </critical>
@@ -1,9 +1,9 @@
1
1
  <system-reminder>
2
2
  Plan mode turn ended without a required tool call.
3
3
 
4
- You **MUST** choose exactly one next action now:
4
+ You MUST choose exactly one next action now:
5
5
  1. Call `{{askToolName}}` to gather required clarification, OR
6
- 2. Call `{{exitToolName}}` to finish planning and request approval
6
+ 2. Call `resolve` with `action: "apply"`, `reason`, and `extra: { title: "<PLAN_TITLE>" }` to finish planning and request approval
7
7
 
8
- You **MUST NOT** output plain text in this turn.
8
+ You NEVER output plain text in this turn.
9
9
  </system-reminder>
@@ -17,7 +17,7 @@ Follow the context files below for all tasks:
17
17
  {{#if agentsMdSearch.files.length}}
18
18
  <dir-context>
19
19
  Some directories may have their own rules. Deeper rules override higher ones.
20
- **MUST** read before making changes within:
20
+ MUST read before making changes within:
21
21
  {{#list agentsMdSearch.files join="\n"}}- {{this}}{{/list}}
22
22
  </dir-context>
23
23
  {{/if}}
@@ -35,9 +35,9 @@ Working directory layout (sorted by mtime, recent first; depth ≤ 3):
35
35
  Today is {{date}}, and the current working directory is '{{cwd}}'.
36
36
 
37
37
  <critical>
38
- - Each response **MUST** advance the task. There is no stopping condition other than completion.
39
- - You **MUST** default to informed action; do not ask for confirmation when tools or repo context can answer.
40
- - You **MUST** verify the effect of significant behavioral changes before yielding: run the specific test, command, or scenario that covers your change.
38
+ - Each response MUST advance the task. There is no stopping condition other than completion.
39
+ - You MUST default to informed action; do not ask for confirmation when tools or repo context can answer.
40
+ - You MUST verify the effect of significant behavioral changes before yielding: run the specific test, command, or scenario that covers your change.
41
41
  </critical>
42
42
 
43
43
  {{#if appendPrompt}}
@@ -14,7 +14,7 @@ You are operating on a piece of work assigned to you by the main agent.
14
14
  {{#if worktree}}
15
15
  # Working Tree
16
16
  You are working in an isolated working tree at `{{worktree}}` for this sub-task.
17
- You **MUST NOT** modify files outside this tree or in the original repository.
17
+ You NEVER modify files outside this tree or in the original repository.
18
18
  {{/if}}
19
19
 
20
20
  {{#if contextFile}}
@@ -36,19 +36,19 @@ No TODO tracking, no progress updates. Execute, call `yield`, done.
36
36
 
37
37
  While work remains, always continue with another tool call — investigate, edit, run, verify. Save narrative for the final `yield` payload.
38
38
 
39
- When finished, you **MUST** call `yield` exactly once. This is like writing to a ticket: provide what is required and close it.
39
+ When finished, you MUST call `yield` exactly once. This is like writing to a ticket: provide what is required and close it.
40
40
 
41
- This is your only way to return a result. You **MUST NOT** put JSON in plain text, and you **MUST NOT** substitute a text summary for the structured `result.data` parameter.
41
+ This is your only way to return a result. You NEVER put JSON in plain text, and you NEVER substitute a text summary for the structured `result.data` parameter.
42
42
 
43
43
  {{#if outputSchema}}
44
- Your result **MUST** match this TypeScript interface:
44
+ Your result MUST match this TypeScript interface:
45
45
  ```ts
46
46
  {{jtdToTypeScript outputSchema}}
47
47
  ```
48
48
  {{/if}}
49
49
 
50
- Giving up is a last resort. If truly blocked, you **MUST** call `yield` exactly once with `result.error` describing what you tried and the exact blocker.
51
- You **MUST NOT** give up due to uncertainty, missing information obtainable via tools or repo context, or needing a design decision you can derive yourself.
50
+ Giving up is a last resort. If truly blocked, you MUST call `yield` exactly once with `result.error` describing what you tried and the exact blocker.
51
+ You NEVER give up due to uncertainty, missing information obtainable via tools or repo context, or needing a design decision you can derive yourself.
52
52
 
53
- You **MUST** keep going until this ticket is closed. This matters.
53
+ You MUST keep going until this ticket is closed. This matters.
54
54
  [/COMPLETION]
@@ -1,12 +1,12 @@
1
1
  <system-reminder>
2
2
  Your last turn ended without a tool call, so the session went idle. This is reminder {{retryCount}} of {{maxRetries}}.
3
3
 
4
- Every turn **MUST** end with a tool call. Pick exactly one of:
5
- 1. **Resume the work** — if the assignment is not finished, call the next tool you would have called (edit, write, bash, search, etc.). Do **NOT** yield. Do **NOT** treat this reminder as a forced stop.
4
+ Every turn MUST end with a tool call. Pick exactly one of:
5
+ 1. **Resume the work** — if the assignment is not finished, call the next tool you would have called (edit, write, bash, search, etc.). NEVER yield. NEVER treat this reminder as a forced stop.
6
6
  2. **Yield with success** — only if the assignment is genuinely complete: call `yield` with the structured payload in `result.data`.
7
- 3. **Yield with error** — only if you hit a real, concrete blocker you can name (missing file, unavailable API, contradictory spec). Describe what you tried and the exact blocker. Do **NOT** fabricate a "forced immediate-yield" or "system reminder required termination" reason — this reminder is not a blocker.
7
+ 3. **Yield with error** — only if you hit a real, concrete blocker you can name (missing file, unavailable API, contradictory spec). Describe what you tried and the exact blocker. NEVER fabricate a "forced immediate-yield" or "system reminder required termination" reason — this reminder is not a blocker.
8
8
 
9
9
  Default to option 1 unless the work is actually done or actually blocked.
10
10
 
11
- You **MUST NOT** end this turn with text only.
11
+ You NEVER end this turn with text only.
12
12
  </system-reminder>