Skip to content

Commit 376fa8d

Browse files
committed
ai(open-code): establish model switch work vs personal
1 parent 037adb2 commit 376fa8d

8 files changed

Lines changed: 245 additions & 122 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ zsdoc/data
9898

9999
# https://github.com/folke/lazy.nvim
100100
lazy-lock.json
101+
.sisyphus/

nvim/lua/user/plugins/copilot.lua

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,59 @@ return {
3333
-- stylua: ignore end
3434
},
3535
},
36+
37+
{
38+
{
39+
"CopilotC-Nvim/CopilotChat.nvim",
40+
dependencies = {
41+
{ "nvim-lua/plenary.nvim", branch = "master" },
42+
},
43+
build = "make tiktoken",
44+
opts = function()
45+
local model = "claude-sonnet-4.5"
46+
return {
47+
prompts = {
48+
Concise = { prompt = "Please rewrite the following text to make it more concise." },
49+
Naming = { prompt = "Please provide better names for the following variables and functions." },
50+
Wording = { prompt = "Please improve the grammar and wording of the following text." },
51+
},
52+
model = model,
53+
sticky = "buffer",
54+
auto_insert_mode = true, -- Enter insert mode when opening
55+
chat_autocomplete = true,
56+
show_help = true,
57+
}
58+
end,
59+
keys = {
60+
{ "<Leader>cc", "<cmd>CopilotChatToggle<CR>", desc = "Toggle [copilot chat]", mode = { "n", "v" } },
61+
{ "<Leader>cf", "<cmd>CopilotChatFix<cr>", desc = "Fix Diagnostic [copilot chat]", mode = { "n", "v" } },
62+
{ "<Leader>cp", "<cmd>CopilotChatPrompts<CR>", desc = "Prompt [copilot chat]", mode = { "n", "v" } },
63+
{ "<Leader>cs", "<cmd>CopilotChatStop<CR>", desc = "Stop [copilot chat]", mode = { "n", "v" } },
64+
{ "<Leader>cx", "<cmd>CopilotChatReset<CR>", desc = "Clear [copilot chat]", mode = { "n", "v" } },
65+
},
66+
config = function(_, opts)
67+
local select = require("CopilotChat.select")
68+
require("CopilotChat").setup(vim.tbl_extend("force", opts, {
69+
-- Use buffer selection, fallback visual
70+
selection = function(source) return select.buffer(source) or select.visual(source) end,
71+
}))
72+
end,
73+
init = function()
74+
local group = vim.api.nvim_create_augroup("copilot_chat", { clear = true })
75+
vim.api.nvim_create_autocmd("BufEnter", {
76+
group = group,
77+
pattern = "copilot-chat",
78+
callback = function()
79+
vim.opt_local.number = false
80+
vim.opt_local.relativenumber = false
81+
end,
82+
})
83+
vim.api.nvim_create_autocmd("VimLeavePre", {
84+
group = group,
85+
desc = "Close chat before closing editor",
86+
command = "CopilotChatClose",
87+
})
88+
end,
89+
},
90+
},
3691
}

opencode/README.md

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,24 @@
11
# OpenCode
22

3-
## Token Optimization
3+
AI-assisted development setup using [OpenCode](https://opencode.ai) with [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) orchestrator.
44

5-
### What's Configured
5+
## Quick Reference
66

7-
#### Agents (Switch with `opencode --agent <name>` or Tab key)
7+
- **OpenCode Docs:** https://opencode.ai/docs/
8+
- **oh-my-opencode GitHub:** https://github.com/code-yeongyu/oh-my-opencode
9+
- **Provider Setup:** https://opencode.ai/docs/providers/
10+
- **Configuration:** https://opencode.ai/docs/config/
811

9-
- **quick**: `google/gemini-2.5-flash` - Simple edits, fixes (free, fast, **vision support**)
10-
- **deep**: `google/gemini-2.5-pro` - Complex analysis, refactoring (**vision support**)
11-
- **readonly**: `google/gemini-2.5-flash-lite` - Code explanations only (no edits, **vision support**)
12+
## Configuration Modes
1213

13-
**All three agents support image/vision capabilities.** You can:
14-
- Drag and drop images into OpenCode terminal
15-
- Reference images with `@image.png` syntax
16-
- Paste screenshots directly (terminal-dependent)
14+
Switch between work and personal provider configs:
1715

18-
#### Custom Commands
16+
```bash
17+
# Work (GitHub Copilot)
18+
ln -sf "$DOTFILES/opencode/oh-my-opencode-work.json" ~/.config/opencode/oh-my-opencode.json && opencode
1919

20-
- `/analyze <query>` - Uses context-filter agent for minimal token usage
21-
- `/search <term>` - Top 5 results, line numbers only
22-
- `/quickfix <issue>` - Fast fixes with Gemini Flash
23-
- `/docs <topic>` - Context7 docs with <500 token summaries
24-
- `/web <task>` - Enables GitHub MCP (session only)
25-
- `/browser <task>` - Enables Chrome DevTools (session only)
26-
27-
#### MCP Servers
28-
29-
**Disabled by default** (40-60% savings): `chrome-devtools`, `github`
30-
**Always enabled**: `brave-search`, `context7`, `fetch`
31-
32-
#### Custom Agent
33-
34-
`agent/context-filter.md` - Optimized code context gathering (70% savings)
35-
36-
### Expected Savings
37-
38-
- **Overall**: 70-85% token reduction
39-
- **Progressive MCP**: 40-60% (GitHub/Chrome disabled)
40-
- **Context Filter**: 70% (code exploration)
41-
- **Agent Selection**: 30-50% (Gemini Flash for simple tasks)
42-
43-
### Usage Tips
44-
45-
- Use **quick** agent for simple tasks (free tier)
46-
- Use **deep** agent for complex problems (included with GitHub Copilot)
47-
- Enable disabled MCPs only when needed with `/web` or `/browser`
48-
- Monitor token usage shown after each interaction
49-
50-
### Re-enable Disabled MCPs Permanently
51-
52-
Edit `config.json`:
53-
54-
```json
55-
{
56-
"mcp": {
57-
"github": { "enabled": true }
58-
}
59-
}
20+
# Personal (Google Antigravity)
21+
ln -sf "$DOTFILES/opencode/oh-my-opencode-personal.json" ~/.config/opencode/oh-my-opencode.json && opencode
6022
```
6123

62-
Then restart OpenCode.
24+
See [oh-my-opencode.json](./oh-my-opencode-personal.json) for configuration examples.

opencode/config.json

Lines changed: 18 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
{
22
"$schema": "https://opencode.ai/config.json",
3-
"instructions": [
4-
".github/copilot-instructions.md"
5-
],
3+
"instructions": [".github/copilot-instructions.md"],
64
"mcp": {
75
"brave-search": {
86
"type": "local",
9-
"command": [
10-
"npx",
11-
"-y",
12-
"@modelcontextprotocol/server-brave-search"
13-
],
7+
"command": ["npx", "-y", "@modelcontextprotocol/server-brave-search"],
148
"environment": {
159
"BRAVE_API_KEY": "$BRAVE_BROWSER_SEARCH_API_KEY"
1610
},
@@ -22,30 +16,18 @@
2216
"npx",
2317
"chrome-devtools-mcp@latest",
2418
"--executablePath",
25-
"/Users/Angermann/Applications/Chromium.app/Contents/MacOS/Chromium"
19+
"$HOME/Applications/Chromium.app/Contents/MacOS/Chromium"
2620
],
2721
"enabled": true
2822
},
2923
"context7": {
3024
"type": "local",
31-
"command": [
32-
"docker",
33-
"run",
34-
"--interactive",
35-
"--rm",
36-
"context7-mcp"
37-
],
25+
"command": ["docker", "run", "--interactive", "--rm", "context7-mcp"],
3826
"enabled": true
3927
},
4028
"fetch": {
4129
"type": "local",
42-
"command": [
43-
"docker",
44-
"run",
45-
"--interactive",
46-
"--rm",
47-
"mcp/fetch"
48-
],
30+
"command": ["docker", "run", "--interactive", "--rm", "mcp/fetch"],
4931
"enabled": true
5032
},
5133
"github": {
@@ -65,10 +47,7 @@
6547
"enabled": true
6648
}
6749
},
68-
"plugin": [
69-
"oh-my-opencode@3.0.1",
70-
"opencode-antigravity-auth@1.3.1"
71-
],
50+
"plugin": ["oh-my-opencode@3.3.2", "opencode-antigravity-auth@1.4.6"],
7251
"provider": {
7352
"google": {
7453
"name": "Google",
@@ -80,14 +59,8 @@
8059
"output": 65535
8160
},
8261
"modalities": {
83-
"input": [
84-
"text",
85-
"image",
86-
"pdf"
87-
],
88-
"output": [
89-
"text"
90-
]
62+
"input": ["text", "image", "pdf"],
63+
"output": ["text"]
9164
},
9265
"variants": {
9366
"low": {
@@ -105,14 +78,8 @@
10578
"output": 65536
10679
},
10780
"modalities": {
108-
"input": [
109-
"text",
110-
"image",
111-
"pdf"
112-
],
113-
"output": [
114-
"text"
115-
]
81+
"input": ["text", "image", "pdf"],
82+
"output": ["text"]
11683
},
11784
"variants": {
11885
"minimal": {
@@ -136,14 +103,8 @@
136103
"output": 64000
137104
},
138105
"modalities": {
139-
"input": [
140-
"text",
141-
"image",
142-
"pdf"
143-
],
144-
"output": [
145-
"text"
146-
]
106+
"input": ["text", "image", "pdf"],
107+
"output": ["text"]
147108
}
148109
},
149110
"antigravity-claude-sonnet-4-5-thinking": {
@@ -153,14 +114,8 @@
153114
"output": 64000
154115
},
155116
"modalities": {
156-
"input": [
157-
"text",
158-
"image",
159-
"pdf"
160-
],
161-
"output": [
162-
"text"
163-
]
117+
"input": ["text", "image", "pdf"],
118+
"output": ["text"]
164119
},
165120
"variants": {
166121
"low": {
@@ -182,14 +137,8 @@
182137
"output": 64000
183138
},
184139
"modalities": {
185-
"input": [
186-
"text",
187-
"image",
188-
"pdf"
189-
],
190-
"output": [
191-
"text"
192-
]
140+
"input": ["text", "image", "pdf"],
141+
"output": ["text"]
193142
},
194143
"variants": {
195144
"low": {
@@ -206,5 +155,6 @@
206155
}
207156
}
208157
}
209-
}
158+
},
159+
"plugin": ["oh-my-opencode@latest", "opencode-antigravity-auth@1.4.3"]
210160
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
3+
"agents": {
4+
"sisyphus": {
5+
"model": "google/antigravity-claude-sonnet-4-5"
6+
},
7+
"oracle": {
8+
"model": "google/antigravity-claude-opus-4-5-thinking",
9+
"variant": "max"
10+
},
11+
"librarian": {
12+
"model": "google/antigravity-claude-sonnet-4-5"
13+
},
14+
"explore": {
15+
"model": "google/antigravity-gemini-3-flash"
16+
},
17+
"multimodal-looker": {
18+
"model": "google/antigravity-gemini-3-flash"
19+
},
20+
"prometheus": {
21+
"model": "google/antigravity-claude-opus-4-5-thinking",
22+
"variant": "max"
23+
},
24+
"metis": {
25+
"model": "google/antigravity-claude-opus-4-5-thinking",
26+
"variant": "max"
27+
},
28+
"momus": {
29+
"model": "google/antigravity-claude-sonnet-4-5-thinking",
30+
"variant": "max"
31+
},
32+
"atlas": {
33+
"model": "google/antigravity-claude-sonnet-4-5"
34+
},
35+
"hephaestus": {
36+
"model": "google/antigravity-claude-opus-4-5-thinking",
37+
"variant": "medium"
38+
}
39+
},
40+
"categories": {
41+
"visual-engineering": {
42+
"model": "google/antigravity-gemini-3-pro"
43+
},
44+
"ultrabrain": {
45+
"model": "google/antigravity-claude-opus-4-5-thinking",
46+
"variant": "max"
47+
},
48+
"artistry": {
49+
"model": "google/antigravity-gemini-3-pro",
50+
"variant": "max"
51+
},
52+
"quick": {
53+
"model": "google/antigravity-gemini-3-flash"
54+
},
55+
"unspecified-low": {
56+
"model": "google/antigravity-gemini-3-flash"
57+
},
58+
"unspecified-high": {
59+
"model": "google/antigravity-claude-sonnet-4-5"
60+
},
61+
"writing": {
62+
"model": "google/antigravity-gemini-3-flash"
63+
},
64+
"deep": {
65+
"model": "google/antigravity-claude-opus-4-5-thinking",
66+
"variant": "medium"
67+
}
68+
}
69+
}

0 commit comments

Comments
 (0)