Skip to content
    ↑↓ select↵ openesc close
    mdementev

    Misrules

    opencode-misrules·v0.1.2·Code Intelligence

    opencode plugin: persistent session rules that survive compaction

    GitHub stars

    1

    Monthly installs

    43

    6 in 7 days

    Composite score

    30.9

    Multi-signal model

    Last commit

    1 month ago

    2026-09-15

    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-misrules@0.1.2"]
    }

    OpenCode 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.

    npm version

    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.md and docs/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