Skip to content

codeg-dev/opencode-0-injection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors