Misrules
opencode plugin: persistent session rules that survive compaction
1
43
6 in 7 days
30.9
Multi-signal model
1 month ago
2026-09-15
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-misrules@0.1.2"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-misrules@0.1.2"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-misrulesOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
Keep your project conventions in the agent's head — for good.
Load the .md files you need (code style, examples, agreements) and the agent follows them for the whole session. Even after compaction, they're never forgotten. No relying on skills deciding on their own whether to kick in — you control exactly what the agent follows.
opencode plugin opencode-misrules -g
Manual install
The plugin is a single self-contained file. Copy it into your global plugin folder and restart opencode:
mkdir -p ~/.config/opencode/plugin
cp plugin/misrules.ts ~/.config/opencode/plugin/misrules.ts
@opencode-ai/plugin is already available under
~/.config/opencode/node_modules, so no extra install step is needed.
Use
Ask the agent to load your project docs:
Load
docs/style.mdanddocs/testing/as rules.
Behind the scenes the agent calls misrules_add. From then on, those rules are always in effect — no re-reading, no reminding.
| Tool | What it does |
|---|---|
misrules_add |
Load .md files or folders as session rules |
misrules_remove |
Stop following rules |
misrules_list |
See what's loaded |
Lock it down
.opencode/misrules.json (or ~/.config/opencode/misrules.json) — block sensitive files from ever being loaded:
{ "denyPatterns": ["*.env*", "*secret*"] }
License
MIT
Similar plugins
Persona
opencode-persona
OpenCode plugin that asks for the user's professional role once, persists it in Engram, and injects role instructions, communication preferences, and project conventions at the start of every session
Fast Jev Opencode
fast-jev-opencode
Verbatim context pruning for OpenCode v1 and v2: prune stale tool calls and truncate bulky tool results from the outgoing model request using TypeSafe Jev decisions, instead of summarizing context.
Router
@s-berdia/opencode-router
Automatic model routing and quota failover for OpenCode Go, Go Plus, and Free. Switches models before you hit your limit.