@koment/opencode-koment
v3.2.0
Published
OpenCode plugin for koment: enforce the no-inline-comment policy through the koment MCP server. Configure @koment/opencode-koment in opencode.json.
Maintainers
Readme
@koment/opencode-koment
The OpenCode plugin keeps one writable koment MCP process alive for the session, checks proposed edits through that process and runs all repository gates when the session closes.
Install
Add the npm package to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@koment/opencode-koment"]
}OpenCode installs configured npm packages at startup. Restart it after changing the configuration.
Requirements
- A released
komentbinary onPATH .koment/policy.yamlin every repository where the plugin should enforce koment policy
Bootstrap a repository with:
koment bootstrap --agents opencode --non-interactiveWhat it does
- At session load, it starts
koment mcp --writeover stdio. - Before an edit or write, it calls
koment_pre_tooland denies ordinary explanatory comment intent. - At disposal, it runs
koment check,koment comments checkandkoment agents check.
The package does not duplicate comment detection or annotation resolution. Without a policy or annotation records, its policy calls are silent no-ops. Annotation records without the policy are treated as incomplete configuration and fail with a bootstrap instruction.
Verify
koment check
koment comments check
koment agents checkAll three must pass before a session can complete.
Generated adapter
koment bootstrap also generates .opencode/plugins/koment.js for a
repository. The generated adapter and npm package share the same policy
protocol; they differ only in distribution. Do not load both in the same
OpenCode configuration.
