You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,43 @@ If you want reproducible installs instead of automatic plugin refreshes, pin an
34
34
- adds a `plan` agent intended for design and implementation planning
35
35
- constrains that agent to read-only tools plus markdown plan editing
36
36
- injects a system reminder that keeps the planning workflow explicit
37
+
- lets users replace the plugin's base `plan` prompt with their own `agent.plan.prompt`
38
+
- exposes a `plan_prompt` tool so the `plan` agent can show the plugin's prompt basis for customization
37
39
- uses `submit_plan` for review when available, otherwise falls back to manual chat review
38
40
- can leave planner mode with `plan_exit` after approval when experimental plan mode is enabled in the CLI runtime
39
41
42
+
## Customize the plan prompt
43
+
44
+
If you set `agent.plan.prompt`, it replaces the plugin's base prompt instead of being appended to it.
45
+
46
+
```json
47
+
{
48
+
"agent": {
49
+
"plan": {
50
+
"prompt": "You are my planning agent. Focus on migration risk, rollout steps, and testing strategy."
51
+
}
52
+
}
53
+
}
54
+
```
55
+
56
+
The runtime planner reminder still applies, so the agent stays in planner mode and continues to use the review handoff flow. That reminder is injected by the plugin at runtime and is not customized through `agent.plan.prompt`.
57
+
58
+
## Reveal the plugin prompt basis
59
+
60
+
The plugin also adds a read-only `plan_prompt` tool. Ask the `plan` agent to use it when you want the plugin's own prompt text as a starting point for customization.
61
+
62
+
Example:
63
+
64
+
```text
65
+
Use the plan_prompt tool and show me the plugin prompt so I can customize it.
66
+
```
67
+
68
+
The tool returns:
69
+
70
+
- the plugin base prompt
71
+
- the injected planner reminder, which is plugin-controlled runtime guidance and is not customized via `agent.plan.prompt`
72
+
- a short note explaining that the final runtime prompt can still differ because of user config, other plugins, or runtime tool availability like `plan_exit`
73
+
40
74
## Auto-updates
41
75
42
76
OpenCode installs npm plugins automatically. During the prerelease phase, `opencode-planner@beta` gives the smoothest update path for most users.
@@ -57,7 +91,7 @@ npm run debug:plan
57
91
npm run opencode:no-plannotator -- debug config
58
92
```
59
93
60
-
`npm run debug:plan` checks the active OpenCode runtime and reports whether the local repo plugin is loaded, whether `submit_plan` and `plan_exit` are allowed by the `plan` agent, and whether they are actually registered as runtime tools.
94
+
`npm run debug:plan` checks the active OpenCode runtime and reports whether the local repo plugin is loaded, whether `plan_prompt`, `submit_plan`, and `plan_exit` are allowed by the `plan` agent, and whether they are actually registered as runtime tools.
Copy file name to clipboardExpand all lines: index.js
+58-15Lines changed: 58 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@ import path from "path"
2
2
3
3
constagent="plan"
4
4
constroot=".opencode/plans"
5
+
constdefaultPlanTarget=file("<session-id>")
5
6
6
7
functiontruthy(key){
7
8
constvalue=process.env[key]?.toLowerCase()
@@ -25,6 +26,50 @@ function reviewInstruction(target) {
25
26
].join(" ")
26
27
}
27
28
29
+
functionagentPrompt(target=defaultPlanTarget){
30
+
constplanExit=hasPlanExit()
31
+
32
+
return[
33
+
"Use this agent when the user wants a design, implementation plan, or scoped investigation before coding.",
34
+
"Stay in planning mode: inspect the codebase, ask targeted questions when needed, and write a concise execution plan before implementation.",
35
+
`Default plan path: ${target}.`,
36
+
"Prefer the task tool with the explore and general subagents for deeper research.",
37
+
reviewInstruction(target),
38
+
...(planExit
39
+
? [
40
+
"After approval, if the user or Plannotator says something like 'Proceed with implementation', call plan_exit to hand off back to implementation mode.",
"This tool shows the prompt text and planner reminder supplied by the opencode-planner plugin itself.",
50
+
"The final runtime prompt can still differ if the user overrides `agent.plan.prompt`, another plugin edits `agent.plan`, or runtime tool availability changes.",
51
+
"## Base prompt",
52
+
agentPrompt(defaultPlanTarget),
53
+
"## Planner reminder",
54
+
"This reminder is injected by the plugin at runtime to keep the `plan` agent in planner mode and enforce the review handoff workflow. It is plugin-controlled and is not customized through `agent.plan.prompt`.",
"After approval, if the user or Plannotator says something like 'Proceed with implementation', call plan_exit to hand off back to implementation mode.",
0 commit comments