Skip to content
    ↑↓ select↵ openesc close
    English中文
    codeg-dev

    0 Injection

    v0.1.0Other
    opencode-0-injection

    OpenCode plugin that prepends a priority-zero operational prompt before the agent prompt via the experimental.chat.system.transform hook.

    GitHub stars

    1

    Monthly installs

    9

    4 in 7 days

    Composite scoreSCORE

    24.8

    Multi-signal model

    Last commit

    2 months ago

    2026-06-06

    Install and configure

    opencode.json

    Writes 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"]
    }

    opencode 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