Skip to content

[FEATURE]: Allow custom system prompts in global, project or custom directories #7101

@dan-and

Description

@dan-and

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

Based on a reddit discussion on shorter system prompts, I checked how it could be implemented in opencode, to allow custom prompts.

This would allow experimenting with the system prompt (especially on low-end models with limited context window)

Perfect would be a similar approach as for opencode.json:

Lowest to highest priority:

  • bundled system prompts inside opencode deployment
  • global system prompts at ~/.config/opencode/prompt/<name.txt>. (following bundled system prompt naming scheme)
  • project-instance prompts at /.opencode/prompt/<name.txt>. (following bundled system prompt naming scheme)
  • environment variable to overrule all other version with a path to a .../prompt/ directory, where the system prompts are provided.

Why it matters?

Foremost, I thought, I could do a similar approach as the author of the reddit post by adding smaller prompts into AGENTS.md / CONTEXT.md, but of course these are appended to the existing bundled system prompts.

First I gave the variant of replacing the prompt inside opencode sources a try, which worked pretty well, but to make faster iterations on the system prompts, it is much more convenient for me (and probably other users) to have the chance to keep system prompts on a global or project level.

Finally I hope that such a feature would accelerate the system prompt development for opencode in general.

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions