opencode-misrules
v0.1.2
Published
opencode plugin: persistent session rules that survive compaction
Maintainers
Readme
opencode-misrules
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 -gManual 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
