r/opencode • • 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:

  1. Run ai-rulez init opencode-demo --yes --skip-content. Set presets = ["opencode"] in .ai-rulez/config.toml.
  2. Run ai-rulez add agent doc-review --description "Review documentation examples" --content "Check examples against the CLI help.".
  3. Run ai-rulez generate. It writes .opencode/agents/doc-review.md and opencode.json. Run ai-rulez generate --check to 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.

4 Upvotes

0 comments sorted by