r/opencode • u/Goldziher • 11d ago
Generating an OpenCode subagent and MCP settings from repo-owned config
Hi people,
I'm glad to announce ai-rulez v5. It's a CLI and MCP for managing the instructions, skills, and settings that coding agents use in a repository. It's available through Homebrew, Scoop, npm, PyPI, and Go (see the installation instructions for details). The tool covers the following parts of AI Governance:
- Author agent definitions and MCP settings in the repository.
- Generate OpenCode’s native configuration and check it for drift.
I maintain ai-rulez. Here’s an example I ran with v5.13.2 in a scratch Git repo:
- Run
ai-rulez init opencode-demo --yes --skip-content. Setpresets = ["opencode"]in.ai-rulez/config.toml. - Run
ai-rulez add agent doc-review --description "Review documentation examples" --content "Check examples against the CLI help.". - Run
ai-rulez generate. It writes.opencode/agents/doc-review.mdandopencode.json. Runai-rulez generate --checkto verify there is no drift.
The OpenCode preset matrix also shows where commands and configured hooks go. If your team uses OpenCode alongside another client, you can add its preset to the same configuration and inspect each client’s output in Git.
I'm happy to hear any comments. If you find the tool useful, star it. It really does help. And of course, I'd love to see people use it and get involved with the project.