opencode-rules-hub
v1.0.0
Published
OpenCode plugin that connects to opencode-rules-hub — centralized rule management for AI coding agents.
Maintainers
Readme
opencode-rules-hub
OpenCode plugin for centralized rules management.
This plugin connects your OpenCode agent to a self-hosted rules server. Define your coding conventions once, share them across every project automatically.
Installation
Add the plugin to your project's opencode.json:
{
"plugin": ["opencode-rules-hub"]
}Configuration
Create a config file in your repo:
// .opencode/rules.json
{
"server": "http://localhost:3847",
"apiKey": "your-api-key",
"sets": ["typescript", "company-conventions"]
}On session compaction, the plugin fetches your rule sets, saves them to .opencode/rules-local.md, and injects them into the agent's context. Rules only refetch when you run /rules-sync.
Commands
| Command | Description |
| ------------- | -------------------------------------------- |
| /rules-sync | Force re-fetch all rule sets from the server |
| /rules | Display the current locally cached rules |
How It Works
- The plugin reads
.opencode/rules.jsonfrom your project root. - On compaction, it fetches the configured rule sets from the server.
- Rules are cached locally in
.opencode/rules-local.md. - The cached rules are injected into the agent context automatically.
- Use
/rules-syncto force a refresh at any time.
Server Setup
This plugin requires a running opencode-rules-hub server. See the main repository for server setup instructions.
License
MIT — see LICENSE.
