跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    mdementev

    Misrules

    opencode-misrules·v0.1.2·代码智能

    opencode plugin: persistent session rules that survive compaction

    GitHub 星标

    1

    月装机量

    43

    近 7 天 6

    综合评分

    30.9

    生态多维模型

    最近提交

    1 个月前

    2026-09-15

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-misrules@0.1.2"]
    }

    OpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    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

    同类生态推荐