opencode-priority-rule-plugin
v0.1.2
Published
Priority-rules server plugin for OpenCode
Downloads
13
Readme
opencode-priority-rule-plugin
Priority-rules server plugin for OpenCode. It injects the following block into the first user message:
<PriorityRules> ALWAYS use the QUESTION TOOL if you need to ask user. ALWAYS think and respond in Traditional Chinese (zh_TW). </PriorityRules>Compatible with OpenCode >=1.4.6 <2.
Install in current project
opencode plugin opencode-priority-rule-plugin@latestGlobal install
opencode plugin opencode-priority-rule-plugin@latest --globalConfig alternative
If you would rather configure plugins directly, use:
{ "plugin": ["opencode-priority-rule-plugin@latest"] }TUI controls in OpenCode
This plugin has two TUI control surfaces:
- Built-in Plugins dialog: controls whether the whole
opencode-priority-rule-pluginpackage is enabled. Priority Rules settingscommand: controls only whether PriorityRules injection is enabled while the plugin itself stays installed and active.
Open the command palette and run Priority Rules settings to manage the PriorityRules injection toggle.
State combinations
- Plugin enabled + priority rules enabled: the plugin is on, and future user messages get the PriorityRules block injected.
- Plugin enabled + priority rules disabled: the plugin stays on, but future user messages are sent without the PriorityRules block.
- Plugin disabled: the plugin is off from the Plugins dialog, so no PriorityRules injection runs at all.
Persistence
The state is persisted across restarts.
It uses the existing config-root resolution order:
OPENCODE_CONFIG_DIR- the nearest workspace
.opencodedirectory inside the current worktree XDG_CONFIG_HOME/opencode~/.config/opencode
That means both the plugin-level enabled state and the PriorityRules injection state continue to follow the same config-root behavior OpenCode already uses.
Local development
From the repository root, build first, then install the local plugin with a path spec:
npm run build
opencode plugin "$(pwd)" --forceAfter changing code, run npm run build again and then reinstall or refresh the local plugin so OpenCode picks up the updated dist/ output.
Development
npm ci
npm test
npm run buildPublish
Use GitHub Actions release workflow only (OIDC trusted publishing).
- In npm package settings, add this repository workflow as a trusted publisher.
- Open Actions -> Release -> Run workflow.
- Select bump type (
patchormajor) and run on the default branch.
The workflow will automatically:
- run
npm test - run
npm run build - bump version in
package.json+package-lock.json - create and push the release commit and
v*tag - publish to npm with
npm publish --provenance --access public
