opencode-0-injectionOpenCode plugin that prepends a priority-zero operational prompt before the agent prompt via the experimental.chat.system.transform hook.
1
9
4 in 7 days
24.8
Multi-signal model
2 months ago
2026-06-06
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-0-injection@0.1.0"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-0-injection@0.1.0"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-0-injectionopencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
English | العربية | বাংলা | Português (Brasil) | Bosanski | Dansk | Deutsch | Español | Français | Ελληνικά | Italiano | 日本語 | 한국어 | Norsk | Polski | Русский | ไทย | Türkçe | Українська | Tiếng Việt | 简体中文 | 繁體中文
opencode-0-injection
Local OpenCode server plugin that prepends a priority-zero operational prompt before the agent prompt.
Purpose
OpenCode builds its final system prompt in this broad order:
agent prompt → environment → Instructions from AGENTS.md
This plugin keeps OpenCode core behavior intact, but prepends one operator-controlled prompt file at the very front:
0-injection-prompt → agent prompt → environment → instruction
The default prompt file is 0-injection-prompt.md.
OpenCode config
{
"plugin": [
[
"./plugins/opencode-0-injection",
{
"file": "0-injection-prompt.md"
}
]
]
}
When this repository is checked out separately, either copy it into ~/.config/opencode/plugins/opencode-0-injection or point the plugin entry at the absolute checkout path.
Behavior
The plugin uses OpenCode's experimental.chat.system.transform hook. It wraps the injected prompt with markers so retries or repeated transforms do not accumulate duplicate blocks:
<opencode-0-injection-prompt>
...
</opencode-0-injection-prompt>
Smoke test
npm test
The smoke test imports the plugin, runs the transform against a synthetic system prompt, and verifies this ordering:
0-injection < agent prompt < environment < instruction