feat: add opencode configuration with MCP servers and DCP plugin

- Configure context7, gh_grep, and linear MCP servers
- Add DCP plugin for context pruning with detailed summaries
- Symlink AGENTS.md and commit-staged command from claude config
- Add chezmoiignore for opencode ephemeral/generated files
This commit is contained in:
2025-12-20 00:52:46 -06:00
parent 80c4082878
commit 6f3faca5af
6 changed files with 88 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
# Opencode ephemeral files and machine-specific data
.local/share/opencode/auth.json
.local/share/opencode/mcp-auth.json
.local/share/opencode/log/
.local/share/opencode/snapshot/
.local/share/opencode/storage/
.local/share/opencode/bin/
# Opencode plugin dependencies and generated files
.config/opencode/node_modules/
.config/opencode/bun.lock
.config/opencode/package.json
.config/opencode/.gitignore
.config/opencode/.claude/
.config/opencode/plugin/
+1
View File
@@ -0,0 +1 @@
# This file ensures the command directory is created by chezmoi
@@ -0,0 +1 @@
../../../.claude/commands/commit-staged.md
+44
View File
@@ -0,0 +1,44 @@
{
// Enable or disable the plugin
"enabled": true,
// Enable debug logging to ~/.config/opencode/logs/dcp/
"debug": false,
// Summary display: "off", "minimal", or "detailed"
"pruningSummary": "detailed",
// Strategies for pruning tokens from chat history
"strategies": {
// Remove duplicate tool calls (same tool with same arguments)
"deduplication": {
"enabled": true,
// Additional tools to protect from pruning
"protectedTools": []
},
// Prune write tool inputs when the file has been subsequently read
"supersedeWrites": {
"enabled": true
},
// Exposes a prune tool to your LLM to call when it determines pruning is necessary
"pruneTool": {
"enabled": true,
// Additional tools to protect from pruning
"protectedTools": [],
// Nudge the LLM to use the prune tool (every <frequency> tool results)
"nudge": {
"enabled": true,
"frequency": 10
}
},
// (Legacy) Run an LLM to analyze what tool calls are no longer relevant on idle
"onIdle": {
"enabled": false,
// Additional tools to protect from pruning
"protectedTools": [],
// Override model for analysis (format: "provider/model")
// "model": "anthropic/claude-haiku-4-5",
// Show toast notifications when model selection fails
"showModelErrorToasts": true,
// When true, fallback models are not permitted
"strictModelSelection": false
}
}
}
@@ -0,0 +1,26 @@
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"@tarquinen/opencode-dcp@latest",
"@franlol/opencode-md-table-formatter@0.0.3",
// "file:///home/xevion/projects/opencode-anthropic-websearch/dist/index.js"
],
"mcp": {
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp",
"headers": {
"CONTEXT7_API_KEY": "{{ dopplerProjectJson.CONTEXT7_API_KEY }}"
}
},
"gh_grep": {
"type": "remote",
"url": "https://mcp.grep.app"
},
"linear": {
"type": "remote",
"url": "https://mcp.linear.app/mcp",
"oauth": {}
}
}
}
@@ -0,0 +1 @@
../../.claude/CLAUDE.md