[FEATURE]: Agent-specific instructions array #7638

Open
opened 2026-02-16 18:07:48 -05:00 by yindo · 3 comments
Owner

Originally created by @marchellodev on GitHub (Jan 26, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

It's currently not possible to add instructions scoped to a single built-in agent without overriding its entire system prompt. agent.<name>.prompt replaces the base prompt, while AGENTS.md and instructions are applied globally across all agents.

Example use case -- adding instruction "Always use Researcher agent for looking up information" only to the build agent (so that context of the researcher agent is not polluted, and it doesn't use subagents where not necessary)

Request:

Add an agent.<name>.instructions array that behaves like global instructions array, but only for that agent.

Example:

{
  "agent": {
    "build": {
      "instructions": [
        "~/.config/opencode/prompts/build-only.md"
      ]
    }
  }
}

Rationale:

  • Enables per-agent customization without losing default prompts.
  • Avoids global rules affecting unrelated agents.
  • Keeps config composable and avoids duplicating the entire default system prompt.
Originally created by @marchellodev on GitHub (Jan 26, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request ### Problem It's currently not possible to add instructions scoped to a single built-in agent without overriding its entire system prompt. `agent.<name>.prompt` replaces the base prompt, while `AGENTS.md` and `instructions` are applied globally across all agents. Example use case -- adding instruction "Always use Researcher agent for looking up information" only to the build agent (so that context of the researcher agent is not polluted, and it doesn't use subagents where not necessary) ### Request: Add an `agent.<name>.instructions` array that behaves like global `instructions` array, but only for that agent. Example: ```json { "agent": { "build": { "instructions": [ "~/.config/opencode/prompts/build-only.md" ] } } } ``` #### Rationale: - Enables per-agent customization without losing default prompts. - Avoids global rules affecting unrelated agents. - Keeps config composable and avoids duplicating the entire default system prompt.
yindo added the discussion label 2026-02-16 18:07:48 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 26, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #7101: Allow custom system prompts in global, project or custom directories
  • #3195: Dynamic system prompts for custom agents
  • #7369: Shared prompt in agent markdown definition
  • #1668: Separate instructions for the 'main' agent vs. sub-agents
  • #4483: Subagents inappropriately inherit main agent instructions from CLAUDE.md/AGENTS.md

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 26, 2026): This issue might be a duplicate of existing issues. Please check: - #7101: Allow custom system prompts in global, project or custom directories - #3195: Dynamic system prompts for custom agents - #7369: Shared prompt in agent markdown definition - #1668: Separate instructions for the 'main' agent vs. sub-agents - #4483: Subagents inappropriately inherit main agent instructions from CLAUDE.md/AGENTS.md Feel free to ignore if none of these address your specific case.
Author
Owner

@marchellodev commented on GitHub (Jan 26, 2026):

If this is something opencode should support, here's a PR -- https://github.com/anomalyco/opencode/pull/10695

Thanks!

@marchellodev commented on GitHub (Jan 26, 2026): If this is something opencode should support, here's a PR -- https://github.com/anomalyco/opencode/pull/10695 Thanks!
Author
Owner

@marchellodev commented on GitHub (Jan 26, 2026):

This other PR https://github.com/anomalyco/opencode/pull/7310 indeed does something similar, but we already support the global instructions array, so this approach (of simply extending it to be agent-specific) feels cleaner

@marchellodev commented on GitHub (Jan 26, 2026): This other PR https://github.com/anomalyco/opencode/pull/7310 indeed does something similar, but we already support the global `instructions` array, so this approach (of simply extending it to be agent-specific) feels cleaner
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7638