Automatically replaces text patterns in your prompts before they're sent to the LLM.
Performs case-insensitive string replacements on user-typed prompts. The primary use case is auto-capitalizing RFC2119 keywords (MUST, SHOULD, MAY, etc.) in technical specifications.
Example: Typing "the system must validate input" becomes "the system MUST validate input".
- Case-insensitive matching:
must,Must, andMUSTall match - Word boundary aware: Won't replace
mustinsidecustomer - Multi-word phrases:
must notis matched as a unit (beforemustalone) - Hot reload: Config changes take effect immediately (no restart needed)
- JSONC support: Comments and trailing commas allowed in config file
- Only replaces text in user-typed prompts
- Does NOT modify file content attached via
@mentions - Does NOT modify slash command output
Config file: ~/.config/opencode/MUST-have-plugin.jsonc
If the config file doesn't exist, it's automatically created with RFC2119 defaults.
Add your own replacement pairs to the replacements object:
{
"replacements": {
// RFC2119 keywords
"must": "MUST",
"should": "SHOULD",
// Custom replacements
"todo": "TODO",
"fixme": "FIXME",
"api": "API",
"url": "URL"
}
}| Option | Type | Default | Description |
|---|---|---|---|
debug |
boolean | false |
Enable debug logging to OpenCode's log file |
replacements |
object | RFC2119 keywords | Key-value pairs for text replacement |
Logs are written to OpenCode's unified log file using the SDK logging system.
Log location: ~/.local/share/opencode/log/dev.log
Enable debug mode to see what replacements are being made:
- Edit
~/.config/opencode/MUST-have-plugin.jsonc - Uncomment or add
"debug": true - View logs in real-time (filtering by this plugin):
tail -f ~/.local/share/opencode/log/dev.log | grep "MUST-have-plugin"Or view all recent plugin logs:
grep "MUST-have-plugin" ~/.local/share/opencode/log/dev.log | tail -20Logs use OpenCode's standard format with structured metadata:
INFO 2026-01-20T15:30:42 +2ms service=MUST-have-plugin Plugin loaded
INFO 2026-01-20T15:31:05 +5ms service=MUST-have-plugin Applied 3 replacement(s) replacements={"must":{"value":"MUST","count":2},"should":{"value":"SHOULD","count":1}}
The default configuration includes all keywords from RFC 2119, which defines requirement levels for use in technical specifications:
| Keyword | Meaning |
|---|---|
| MUST / REQUIRED / SHALL | Absolute requirement |
| MUST NOT / SHALL NOT | Absolute prohibition |
| SHOULD / RECOMMENDED | Recommended, but valid reasons may exist to ignore |
| SHOULD NOT / NOT RECOMMENDED | Not recommended, but may be acceptable in some cases |
| MAY / OPTIONAL | Truly optional |
- Check that the config file exists:
cat ~/.config/opencode/MUST-have-plugin.jsonc - Verify JSONC syntax is valid (comments and trailing commas are allowed)
- Enable debug mode and check the log file
- Replacements use word boundaries, so
mustwon't match insidecustomer - Multi-word phrases are matched first, so
must notwon't becomeMUST not - Check for typos in your replacement keys
The plugin re-reads the config on every message, so changes should be immediate. If not:
- Verify you saved the config file
- Check for JSONC syntax errors
- Restart OpenCode as a last resort
{ // Uncomment to enable debug logging (logs appear in OpenCode's log file) // "debug": true, "replacements": { "must": "MUST", "must not": "MUST NOT", "required": "REQUIRED", "shall": "SHALL", "shall not": "SHALL NOT", "should": "SHOULD", "should not": "SHOULD NOT", "recommended": "RECOMMENDED", "not recommended": "NOT RECOMMENDED", "may": "MAY", "optional": "OPTIONAL" } }