@oh-my-pi/pi-coding-agent 14.9.9 → 15.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.
Files changed (128) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/package.json +7 -7
  3. package/scripts/format-prompts.ts +1 -1
  4. package/src/cli/args.ts +2 -2
  5. package/src/cli.ts +1 -0
  6. package/src/commands/acp.ts +24 -0
  7. package/src/commands/launch.ts +6 -4
  8. package/src/commit/agentic/prompts/system.md +1 -1
  9. package/src/config/model-resolver.ts +30 -0
  10. package/src/config/settings-schema.ts +31 -0
  11. package/src/edit/index.ts +22 -1
  12. package/src/edit/modes/patch.ts +10 -0
  13. package/src/edit/modes/replace.ts +3 -0
  14. package/src/edit/renderer.ts +10 -0
  15. package/src/eval/js/context-manager.ts +1 -1
  16. package/src/eval/js/shared/rewrite-imports.ts +120 -48
  17. package/src/eval/js/shared/runtime.ts +31 -4
  18. package/src/eval/js/tool-bridge.ts +43 -21
  19. package/src/extensibility/extensions/runner.ts +54 -1
  20. package/src/extensibility/extensions/types.ts +11 -0
  21. package/src/extensibility/skills.ts +33 -1
  22. package/src/internal-urls/docs-index.generated.ts +6 -6
  23. package/src/internal-urls/index.ts +1 -0
  24. package/src/internal-urls/issue-pr-protocol.ts +577 -0
  25. package/src/internal-urls/router.ts +6 -3
  26. package/src/internal-urls/types.ts +22 -1
  27. package/src/main.ts +13 -9
  28. package/src/modes/acp/acp-agent.ts +361 -54
  29. package/src/modes/acp/acp-client-bridge.ts +152 -0
  30. package/src/modes/acp/acp-event-mapper.ts +180 -15
  31. package/src/modes/acp/terminal-auth.ts +37 -0
  32. package/src/modes/components/read-tool-group.ts +29 -1
  33. package/src/modes/controllers/command-controller.ts +14 -6
  34. package/src/modes/controllers/event-controller.ts +24 -11
  35. package/src/modes/controllers/extension-ui-controller.ts +8 -2
  36. package/src/modes/controllers/input-controller.ts +72 -39
  37. package/src/modes/interactive-mode.ts +71 -7
  38. package/src/modes/rpc/rpc-mode.ts +17 -2
  39. package/src/modes/types.ts +6 -2
  40. package/src/modes/utils/ui-helpers.ts +15 -3
  41. package/src/prompts/agents/designer.md +5 -5
  42. package/src/prompts/agents/explore.md +7 -7
  43. package/src/prompts/agents/init.md +9 -9
  44. package/src/prompts/agents/librarian.md +14 -14
  45. package/src/prompts/agents/plan.md +4 -4
  46. package/src/prompts/agents/reviewer.md +5 -5
  47. package/src/prompts/agents/task.md +10 -10
  48. package/src/prompts/commands/orchestrate.md +2 -2
  49. package/src/prompts/compaction/branch-summary.md +3 -3
  50. package/src/prompts/compaction/compaction-short-summary.md +7 -7
  51. package/src/prompts/compaction/compaction-summary-context.md +1 -1
  52. package/src/prompts/compaction/compaction-summary.md +5 -5
  53. package/src/prompts/compaction/compaction-turn-prefix.md +3 -3
  54. package/src/prompts/compaction/compaction-update-summary.md +11 -11
  55. package/src/prompts/memories/consolidation.md +2 -2
  56. package/src/prompts/memories/read-path.md +1 -1
  57. package/src/prompts/memories/stage_one_input.md +1 -1
  58. package/src/prompts/memories/stage_one_system.md +5 -5
  59. package/src/prompts/review-request.md +4 -4
  60. package/src/prompts/system/agent-creation-architect.md +17 -17
  61. package/src/prompts/system/agent-creation-user.md +2 -2
  62. package/src/prompts/system/commit-message-system.md +2 -2
  63. package/src/prompts/system/custom-system-prompt.md +2 -2
  64. package/src/prompts/system/eager-todo.md +6 -6
  65. package/src/prompts/system/handoff-document.md +1 -1
  66. package/src/prompts/system/plan-mode-active.md +22 -21
  67. package/src/prompts/system/plan-mode-approved.md +4 -4
  68. package/src/prompts/system/plan-mode-compact-instructions.md +16 -0
  69. package/src/prompts/system/plan-mode-reference.md +2 -2
  70. package/src/prompts/system/plan-mode-subagent.md +8 -8
  71. package/src/prompts/system/plan-mode-tool-decision-reminder.md +2 -2
  72. package/src/prompts/system/project-prompt.md +4 -4
  73. package/src/prompts/system/subagent-system-prompt.md +7 -7
  74. package/src/prompts/system/subagent-yield-reminder.md +4 -4
  75. package/src/prompts/system/system-prompt.md +72 -71
  76. package/src/prompts/system/ttsr-interrupt.md +1 -1
  77. package/src/prompts/tools/apply-patch.md +1 -1
  78. package/src/prompts/tools/ast-edit.md +3 -3
  79. package/src/prompts/tools/ast-grep.md +3 -3
  80. package/src/prompts/tools/browser.md +3 -3
  81. package/src/prompts/tools/checkpoint.md +3 -3
  82. package/src/prompts/tools/exit-plan-mode.md +2 -2
  83. package/src/prompts/tools/find.md +3 -3
  84. package/src/prompts/tools/github.md +2 -5
  85. package/src/prompts/tools/hashline.md +6 -6
  86. package/src/prompts/tools/image-gen.md +3 -3
  87. package/src/prompts/tools/irc.md +1 -1
  88. package/src/prompts/tools/lsp.md +2 -2
  89. package/src/prompts/tools/patch.md +6 -6
  90. package/src/prompts/tools/read.md +7 -7
  91. package/src/prompts/tools/replace.md +5 -5
  92. package/src/prompts/tools/retain.md +1 -1
  93. package/src/prompts/tools/rewind.md +2 -2
  94. package/src/prompts/tools/search.md +2 -2
  95. package/src/prompts/tools/ssh.md +2 -2
  96. package/src/prompts/tools/task.md +12 -6
  97. package/src/prompts/tools/web-search.md +2 -2
  98. package/src/prompts/tools/write.md +3 -3
  99. package/src/sdk.ts +69 -12
  100. package/src/session/agent-session.ts +231 -22
  101. package/src/session/client-bridge.ts +81 -0
  102. package/src/session/compaction/errors.ts +31 -0
  103. package/src/session/compaction/index.ts +1 -0
  104. package/src/slash-commands/acp-builtins.ts +46 -0
  105. package/src/slash-commands/builtin-registry.ts +699 -116
  106. package/src/slash-commands/helpers/context-report.ts +39 -0
  107. package/src/slash-commands/helpers/format.ts +23 -0
  108. package/src/slash-commands/helpers/marketplace-manager.ts +25 -0
  109. package/src/slash-commands/helpers/mcp.ts +532 -0
  110. package/src/slash-commands/helpers/parse.ts +85 -0
  111. package/src/slash-commands/helpers/ssh.ts +193 -0
  112. package/src/slash-commands/helpers/todo.ts +279 -0
  113. package/src/slash-commands/helpers/usage-report.ts +91 -0
  114. package/src/slash-commands/types.ts +126 -0
  115. package/src/task/executor.ts +10 -3
  116. package/src/task/index.ts +17 -1
  117. package/src/task/render.ts +6 -3
  118. package/src/tools/bash.ts +176 -2
  119. package/src/tools/conflict-detect.ts +6 -6
  120. package/src/tools/fetch.ts +15 -4
  121. package/src/tools/find.ts +19 -1
  122. package/src/tools/gh-renderer.ts +0 -12
  123. package/src/tools/gh.ts +682 -176
  124. package/src/tools/github-cache.ts +548 -0
  125. package/src/tools/index.ts +3 -0
  126. package/src/tools/read.ts +110 -27
  127. package/src/tools/write.ts +23 -1
  128. package/src/tui/code-cell.ts +70 -2
@@ -1,9 +1,9 @@
1
- You **MUST** summarize what was done in this conversation, written like a pull request description.
1
+ You MUST summarize what was done in this conversation, written like a pull request description.
2
2
 
3
3
  Rules:
4
- - **MUST** be 2-3 sentences max
5
- - **MUST** describe the changes made, not the process
6
- - **MUST NOT** mention running tests, builds, or other validation steps
7
- - **MUST NOT** explain what the user asked for
8
- - **MUST** write in first person (I added…, I fixed…)
9
- - **MUST NOT** ask questions
4
+ - MUST be 2-3 sentences max
5
+ - MUST describe the changes made, not the process
6
+ - NEVER mention running tests, builds, or other validation steps
7
+ - NEVER explain what the user asked for
8
+ - MUST write in first person (I added…, I fixed…)
9
+ - NEVER ask questions
@@ -1,4 +1,4 @@
1
- Another language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. You **MUST** use this to build on the work that has already been done and **MUST NOT** duplicate work. Here is the summary produced by the other language model; you **MUST** use the information in this summary to assist with your own analysis:
1
+ Another language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. You MUST use this to build on the work that has already been done and NEVER duplicate work. Here is the summary produced by the other language model; you MUST use the information in this summary to assist with your own analysis:
2
2
 
3
3
  <summary>
4
4
  {{summary}}
@@ -1,8 +1,8 @@
1
- You **MUST** summarize the conversation above into a structured context checkpoint handoff summary for another LLM to resume task.
1
+ You MUST summarize the conversation above into a structured context checkpoint handoff summary for another LLM to resume task.
2
2
 
3
- IMPORTANT: If conversation ends with unanswered question to user or imperative/request awaiting user response (e.g., "Please run command and paste output"), you **MUST** preserve that exact question/request.
3
+ IMPORTANT: If conversation ends with unanswered question to user or imperative/request awaiting user response (e.g., "Please run command and paste output"), you MUST preserve that exact question/request.
4
4
 
5
- You **MUST** use this format (sections can be omitted if not applicable):
5
+ You MUST use this format (sections can be omitted if not applicable):
6
6
 
7
7
  ## Goal
8
8
  [User goals; list multiple if session covers different tasks.]
@@ -33,6 +33,6 @@ You **MUST** use this format (sections can be omitted if not applicable):
33
33
  ## Additional Notes
34
34
  [Anything else important not covered above]
35
35
 
36
- You **MUST** output only the structured summary; you **MUST NOT** include extra text.
36
+ You MUST output only the structured summary; you NEVER include extra text.
37
37
 
38
- Sections **MUST** be kept concise. You **MUST** preserve exact file paths, function names, error messages, and relevant tool outputs or command results. You **MUST** include repository state changes (branch, uncommitted changes) if mentioned.
38
+ Sections MUST be kept concise. You MUST preserve exact file paths, function names, error messages, and relevant tool outputs or command results. You MUST include repository state changes (branch, uncommitted changes) if mentioned.
@@ -1,6 +1,6 @@
1
1
  This is the PREFIX of a turn that was too large to keep. The SUFFIX (recent work) is retained.
2
2
 
3
- You **MUST** summarize the prefix to provide context for the retained suffix:
3
+ You MUST summarize the prefix to provide context for the retained suffix:
4
4
 
5
5
  ## Original Request
6
6
 
@@ -12,6 +12,6 @@ You **MUST** summarize the prefix to provide context for the retained suffix:
12
12
  ## Context for Suffix
13
13
  - [Information needed to understand the retained recent work]
14
14
 
15
- You **MUST** output only the structured summary. You **MUST NOT** include extra text.
15
+ You MUST output only the structured summary. You NEVER include extra text.
16
16
 
17
- You **MUST** be concise. You **MUST** preserve exact file paths, function names, error messages, and relevant tool outputs or command results if they appear. You **MUST** focus on what's needed to understand the kept suffix.
17
+ You MUST be concise. You MUST preserve exact file paths, function names, error messages, and relevant tool outputs or command results if they appear. You MUST focus on what's needed to understand the kept suffix.
@@ -1,15 +1,15 @@
1
- You **MUST** incorporate new messages above into the existing handoff summary in <previous-summary> tags, used by another LLM to resume task.
1
+ You MUST incorporate new messages above into the existing handoff summary in <previous-summary> tags, used by another LLM to resume task.
2
2
  RULES:
3
- - **MUST** preserve all information from previous summary
4
- - **MUST** add new progress, decisions, and context from new messages
5
- - **MUST** update Progress: move items from "In Progress" to "Done" when completed
6
- - **MUST** update "Next Steps" based on what was accomplished
7
- - **MUST** preserve exact file paths, function names, and error messages
8
- - You **MAY** remove anything no longer relevant
3
+ - MUST preserve all information from previous summary
4
+ - MUST add new progress, decisions, and context from new messages
5
+ - MUST update Progress: move items from "In Progress" to "Done" when completed
6
+ - MUST update "Next Steps" based on what was accomplished
7
+ - MUST preserve exact file paths, function names, and error messages
8
+ - You MAY remove anything no longer relevant
9
9
 
10
- IMPORTANT: If new messages end with unanswered question or request to user, you **MUST** add it to Critical Context (replacing any previous pending question if answered).
10
+ IMPORTANT: If new messages end with unanswered question or request to user, you MUST add it to Critical Context (replacing any previous pending question if answered).
11
11
 
12
- You **MUST** use this format (omit sections if not applicable):
12
+ You MUST use this format (omit sections if not applicable):
13
13
 
14
14
  ## Goal
15
15
  [Preserve existing goals; add new ones if task expanded]
@@ -40,6 +40,6 @@ You **MUST** use this format (omit sections if not applicable):
40
40
  ## Additional Notes
41
41
  [Other important info not fitting above]
42
42
 
43
- You **MUST** output only the structured summary; you **MUST NOT** include extra text.
43
+ You MUST output only the structured summary; you NEVER include extra text.
44
44
 
45
- Sections **MUST** be kept concise. You **MUST** preserve relevant tool outputs/command results. You **MUST** include repository state changes (branch, uncommitted changes) if mentioned.
45
+ Sections MUST be kept concise. You MUST preserve relevant tool outputs/command results. You MUST include repository state changes (branch, uncommitted changes) if mentioned.
@@ -4,7 +4,7 @@ Input corpus (raw memories):
4
4
  {{raw_memories}}
5
5
  Input corpus (rollout summaries):
6
6
  {{rollout_summaries}}
7
- Produce strict JSON only with this schema — you **MUST NOT** include any other output:
7
+ Produce strict JSON only with this schema — you NEVER include any other output:
8
8
  {
9
9
  "memory_md": "string",
10
10
  "memory_summary": "string",
@@ -24,7 +24,7 @@ Requirements:
24
24
  - skills: reusable playbooks. Empty array allowed.
25
25
  - skill.name maps to skills/<name>/.
26
26
  - skill.content maps to skills/<name>/SKILL.md.
27
- - scripts/templates/examples: optional. Each entry **MUST** write to skills/<name>/<bucket>/<path>.
27
+ - scripts/templates/examples: optional. Each entry MUST write to skills/<name>/<bucket>/<path>.
28
28
  - Only include files worth keeping long-term. Omit stale assets so they are pruned.
29
29
  - Preserve useful prior themes. Remove stale or contradictory guidance.
30
30
  - Treat memory as advisory: current repository state wins.
@@ -6,6 +6,6 @@ Operational rules:
6
6
  3) Trust memory for heuristics and process context. Trust current repo files, runtime output, and user instruction for factual state and final decisions.
7
7
  4) When memory changes your plan, cite the artifact path (e.g. `memory://root/skills/<name>/SKILL.md`) and pair it with current-repo evidence.
8
8
  5) If memory disagrees with repo state or user instruction, prefer repo/user. Treat memory as stale. Proceed with corrected behavior, then update/regenerate memory artifacts.
9
- 6) Escalate confidence only after repository verification. Memory alone **MUST NOT** be treated as sufficient proof.
9
+ 6) Escalate confidence only after repository verification. Memory alone is NEVER sufficient proof.
10
10
  Memory summary:
11
11
  {{memory_summary}}
@@ -3,4 +3,4 @@ thread_id: {{thread_id}}
3
3
  Persistable response items (JSON):
4
4
  {{response_items_json}}
5
5
 
6
- You **MUST** extract durable memory now.
6
+ You MUST extract durable memory now.
@@ -1,11 +1,11 @@
1
1
  You are memory-stage-one extractor.
2
2
 
3
- You **MUST** return strict JSON only — no markdown, no commentary.
3
+ You MUST return strict JSON only — no markdown, no commentary.
4
4
 
5
5
  Extraction goals:
6
- - You **MUST** distill reusable durable knowledge from rollout history.
7
- - You **MUST** keep concrete technical signal (constraints, decisions, workflows, pitfalls, resolved failures).
8
- - You **MUST NOT** include transient chatter and low-signal noise.
6
+ - You MUST distill reusable durable knowledge from rollout history.
7
+ - You MUST keep concrete technical signal (constraints, decisions, workflows, pitfalls, resolved failures).
8
+ - You NEVER include transient chatter and low-signal noise.
9
9
 
10
10
  Output contract (required keys):
11
11
  {
@@ -18,4 +18,4 @@ Rules:
18
18
  - rollout_summary: compact synopsis of what future runs should remember.
19
19
  - rollout_slug: short lowercase slug (letters/numbers/_), or null.
20
20
  - raw_memory: detailed durable memory blocks with enough context to reuse.
21
- - If no durable signal exists, you **MUST** return empty strings for rollout_summary/raw_memory and null rollout_slug.
21
+ - If no durable signal exists, you MUST return empty strings for rollout_summary/raw_memory and null rollout_slug.
@@ -30,15 +30,15 @@ Group files by locality, e.g.:
30
30
  - Related functionality → same agent
31
31
  - Tests with their implementation files → same agent
32
32
 
33
- You **MUST** use Task tool with `agent: "reviewer"` and `tasks` array.
33
+ You MUST use Task tool with `agent: "reviewer"` and `tasks` array.
34
34
  {{/if}}
35
35
 
36
36
  ### Reviewer Instructions
37
37
 
38
- Reviewer **MUST**:
38
+ Reviewer MUST:
39
39
  1. Focus ONLY on assigned files
40
- 2. {{#if skipDiff}}**MUST** run `git diff`/`git show` for assigned files{{else}}**MUST** use diff hunks below (**MUST NOT** re-run git diff){{/if}}
41
- 3. **MAY** read full file context as needed via `read`
40
+ 2. {{#if skipDiff}}MUST run `git diff`/`git show` for assigned files{{else}}MUST use diff hunks below (NEVER re-run git diff){{/if}}
41
+ 3. MAY read full file context as needed via `read`
42
42
  4. Call `report_finding` per issue
43
43
  5. Call `yield` with verdict when done
44
44
 
@@ -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
9
  To implement: call `{{exitToolName}}` → user approves an execution option → full write access is restored.
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 `{{exitToolName}}` 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}}
@@ -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,28 +82,28 @@ 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>
@@ -110,6 +111,6 @@ Your turn ends ONLY by:
110
111
  1. Using `{{askToolName}}` to gather information, OR
111
112
  2. Calling `{{exitToolName}}` 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 `{{exitToolName}}`.
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
6
  2. Call `{{exitToolName}}` 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>