feat: auto-register plugin-compaction-init slash command

Adds a custom OpenCode command that scaffolds the compaction memory
file with ## Keep and ## Discard sections of classification rules.
The configured memoryFile path is substituted into both the command
description and the prompt template, and any arguments passed after
the command name are appended as user instructions.
This commit is contained in:
2026-08-11 12:48:11 +05:30
parent edb5bb47f4
commit e8c76ea922
4 changed files with 165 additions and 1 deletions
+5
View File
@@ -36,6 +36,11 @@ You can also add it manually to your global `opencode.jsonc`:
Create `.opencode/compaction.md` in the project when you have project-specific context to preserve. The file is optional.
### /plugin-compaction-init <instructions>
- Writes the memory file at the configured `memoryFile` path with a top instruction line and `## Keep` and `## Discard` sections containing classification rules for which messages to preserve or drop.
- **Recommended**: pass user instructions to extend the default rules with concrete topics — specific areas of discussion you want kept or dropped.
## Options
| Option | Default | Description |