@w33ble/opencode-facts
v1.0.0
Published
Readme
opencode-facts
Inject markdown file contents into your OpenCode system prompt — above or below the default prompt.
Install
Add to opencode.json:
{
"plugin": ["opencode-facts"]
}For local development:
bun run build
mkdir -p .opencode/plugins
ln -sf $(pwd)/dist/index.js .opencode/plugins/opencode-facts.tsConfiguration
Project (takes precedence): .opencode/opencode-facts.json
Global (fallback): ~/.config/opencode/opencode-facts.json
{
"top": ["CONTEXT.md", "docs/conventions.md"],
"bottom": ["docs/glossary.md"]
}| Field | Type | Description |
|-------|------|-------------|
| top | string[] | File paths injected right after the provider header (early, high-salience) |
| bottom | string[] | File paths appended at the end of the system prompt |
Paths are relative to the project root. Absolute paths also work.
How it works
- At startup, the plugin reads your config and loads all listed files into memory.
- On every LLM call, file contents are injected into the system prompt —
topfiles spliced in early,bottomfiles appended at the end. - No XML wrapping, no frontmatter parsing — your markdown is injected as-is.
Build & Publish
bun run build # tsup -> dist/index.js + dist/index.d.tstsup traces imports from src/index.ts — only reachable code lands in the bundle.
@opencode-ai/plugin is marked external, so consumers resolve it from their own install.
Only dist/ ships (controlled by "files").
bun publish --access public