Skip to content

Commit 3664961

Browse files
docs: document configurable plan reminders
1 parent fa871bf commit 3664961

4 files changed

Lines changed: 63 additions & 4 deletions

File tree

packages/core/src/config/agent.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ export class Info extends Schema.Class<Info>("ConfigV2.Agent")({
1515
variant: Schema.String.pipe(Schema.optional),
1616
request: ConfigProvider.Request.pipe(Schema.optional),
1717
system: Schema.String.pipe(Schema.optional),
18-
plan_reminder: Schema.String.pipe(Schema.optional),
19-
build_switch_reminder: Schema.String.pipe(Schema.optional),
18+
plan_reminder: Schema.String.pipe(Schema.optional).annotate({
19+
description:
20+
"Override the reminder injected when the plan agent enters plan mode. Supports ${planInfo} interpolation.",
21+
}),
22+
build_switch_reminder: Schema.String.pipe(Schema.optional).annotate({
23+
description:
24+
"Override the reminder injected when switching from plan mode back to the build agent. Supports ${planInfo} interpolation.",
25+
}),
2026
description: Schema.String.pipe(Schema.optional),
2127
mode: Schema.Literals(["subagent", "primary", "all"]).pipe(Schema.optional),
2228
hidden: Schema.Boolean.pipe(Schema.optional),

packages/core/src/v1/config/agent.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ const AgentSchema = Schema.StructWithRest(
1818
temperature: Schema.optional(Schema.Finite),
1919
top_p: Schema.optional(Schema.Finite),
2020
prompt: Schema.optional(Schema.String),
21-
plan_reminder: Schema.optional(Schema.String),
22-
build_switch_reminder: Schema.optional(Schema.String),
21+
plan_reminder: Schema.optional(Schema.String).annotate({
22+
description:
23+
"Override the reminder injected when the plan agent enters plan mode. Supports ${planInfo} interpolation.",
24+
}),
25+
build_switch_reminder: Schema.optional(Schema.String).annotate({
26+
description:
27+
"Override the reminder injected when switching from plan mode back to the build agent. Supports ${planInfo} interpolation.",
28+
}),
2329
tools: Schema.optional(Schema.Record(Schema.String, Schema.Boolean)).annotate({
2430
description: "@deprecated Use 'permission' field instead",
2531
}),

packages/web/src/content/docs/agents.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,30 @@ Specify a custom system prompt file for this agent with the `prompt` config. The
346346

347347
This path is relative to where the config file is located. So this works for both the global OpenCode config and the project specific config.
348348

349+
### Plan reminders
350+
351+
The built-in `plan` and `build` agents also support reminder-specific overrides that are separate from the main `prompt`.
352+
353+
- `plan_reminder` customizes the reminder injected when the `plan` agent enters plan mode.
354+
- `build_switch_reminder` customizes the reminder injected when control returns from `plan` to `build`.
355+
356+
Both fields support `${planInfo}`, which expands to the current plan-file guidance.
357+
358+
```json title="opencode.json"
359+
{
360+
"agent": {
361+
"plan": {
362+
"plan_reminder": "You are in planning mode.\n\n${planInfo}"
363+
},
364+
"build": {
365+
"build_switch_reminder": "Implementation can begin.\n\n${planInfo}"
366+
}
367+
}
368+
}
369+
```
370+
371+
Use these when you want to customize plan-mode guidance without replacing the agent's full system prompt.
372+
349373
---
350374

351375
### Model

packages/web/src/content/docs/config.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,29 @@ You can configure specialized agents for specific tasks through the `agent` opti
519519

520520
You can also define agents using markdown files in `~/.config/opencode/agents/` or `.opencode/agents/`. [Learn more here](/docs/agents).
521521

522+
Agent configs also support reminder overrides for the built-in plan workflow:
523+
524+
- `plan_reminder` overrides the reminder injected when the `plan` agent enters plan mode.
525+
- `build_switch_reminder` overrides the reminder injected when control switches back to the `build` agent.
526+
527+
Both fields support `${planInfo}`, which expands to the current plan-file guidance.
528+
529+
```jsonc title="opencode.jsonc"
530+
{
531+
"$schema": "https://opencode.ai/config.json",
532+
"agent": {
533+
"plan": {
534+
"plan_reminder": "Plan mode is active.\n\n${planInfo}\n\nKeep the plan concise and execution-ready."
535+
},
536+
"build": {
537+
"build_switch_reminder": "Plan approved. Resume implementation.\n\n${planInfo}"
538+
}
539+
}
540+
}
541+
```
542+
543+
These fields only affect the injected reminder text. They do not change the agent's main `prompt`, and they are unrelated to model catalog settings like `OPENCODE_MODELS_PATH`.
544+
522545
---
523546

524547
### Default agent

0 commit comments

Comments
 (0)