Skip to content

Commit 26c22c7

Browse files
committed
refactor: restructure agent docs and update opencode plugin config
1 parent 8d70a71 commit 26c22c7

File tree

11 files changed

+159
-186
lines changed

11 files changed

+159
-186
lines changed

.config/nvim/lua/plugins/ai/opencode.lua

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
return {
22
{
33
"NickvanDyke/opencode.nvim",
4-
-- NOTE: plugin/ directory contains autoload files that prevent full lazy loading
5-
-- Using keys-only trigger for best balance
6-
keys = {
7-
{ "<leader>ac", mode = { "n", "x" }, desc = "Ask opencode" },
8-
{ "<leader>as", mode = { "n", "x" }, desc = "opencode actions" },
9-
{ "ga", mode = { "n", "x" }, desc = "Add to opencode" },
10-
{ "<A-a>", mode = { "n", "t" }, desc = "Toggle opencode" },
11-
{ "<A-x>", mode = { "n", "v" }, desc = "Send to opencode" },
12-
{ "<leader>ae", mode = { "n", "v" }, desc = "Explain code" },
13-
{ "<leader>ao", mode = { "n", "v" }, desc = "Optimize code" },
14-
{ "<leader>ad", mode = { "n", "v" }, desc = "Add documentation" },
15-
{ "<leader>aa", mode = { "n", "v" }, desc = "Add tests" },
16-
{ "<leader>ar", mode = { "n", "v" }, desc = "Review code" },
17-
{ "<leader>af", mode = { "n", "v" }, desc = "Fix diagnostics" },
18-
{ "<leader>ax", mode = { "n", "v" }, desc = "Explain diagnostics" },
19-
{ "<leader>ag", mode = { "n", "v" }, desc = "Grammar correction" },
20-
{ "<leader>ak", mode = { "n", "v" }, desc = "Extract keywords" },
21-
{ "<leader>al", mode = { "n", "v" }, desc = "Code readability" },
22-
},
4+
lazy = false,
235
dependencies = {
246
"folke/snacks.nvim",
257
},

.config/nvim/spell/en.utf-8.add

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,3 +1536,4 @@ SignModel
15361536
I-kunde
15371537
G-kunde
15381538
K-customer
1539+
theming
6 Bytes
Binary file not shown.

AGENTS.md

Lines changed: 22 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -1,169 +1,24 @@
11
# Dotfiles Repository - Agent Guide
22

3-
## ⚠️ DO NOT EDIT - Auto-Generated Files
4-
5-
- `lazy-lock.json` - Neovim plugin lockfile (managed by Lazy.nvim)
6-
- `Brewfile.lock.json` - Homebrew bundle lockfile
7-
- `.config/nvim/.sessions/`, `.config/nvim/.undo/`, `.config/nvim/.backup/` - Neovim state
8-
- `.config/fish/{fish_variables,completions,conf.d,functions}/` - Fish shell state (managed by fisher)
9-
- `.config/lazygit/state.yml` - Lazygit state
10-
- `.config/ags/@girs/` - AGS TypeScript type definitions (regenerate with `ags types`)
11-
- **Focus on source configs only!**
12-
13-
## 📦 Repository Overview
14-
15-
Personal dotfiles managed with GNU Stow for symlink management. Primary configs:
16-
17-
- **Neovim:** 128+ Lua files, Lazy.nvim plugin manager, LSP, Treesitter, custom utils
18-
- **Shell:** Fish (primary), dash (Cursor/VSCode fallback)
19-
- **Terminal:** WezTerm
20-
- **Display:** Hyprland (Linux)
21-
- **Theme:** Zenwritten Dark (consistent across nvim, wezterm, bat, opencode, etc.)
22-
23-
## 🔧 Common Operations
24-
25-
### Setup & Installation
26-
27-
```bash
28-
brew bundle install # Install/update all dependencies
29-
stow . # Apply dotfiles (creates symlinks from ~/)
30-
stow -n . # Dry-run to preview changes
31-
bash ./scripts/install.sh # Fresh system setup (installs everything)
32-
```
33-
34-
### Neovim
35-
36-
```bash
37-
nvim --headless +"Lazy! sync" +qa # Update plugins
38-
nvim --headless +checkhealth +qa # Validate setup
39-
```
40-
41-
### Vicinae Extensions
42-
43-
```bash
44-
./scripts/vicinae-build-extensions.sh # Build all extensions
45-
# See .config/vicinae/extensions/AGENTS.md for extension development guide
46-
```
47-
48-
### Testing Changes
49-
50-
```bash
51-
fish -c "source ~/.config/fish/config.fish" # Test fish config
52-
bat cache --build # Rebuild bat cache after theme changes
53-
stow -n . # Preview stow changes before applying
54-
```
55-
56-
## 📝 Lua Style (Neovim Configs)
57-
58-
### Module Pattern
59-
60-
```lua
61-
local M = {}
62-
63-
-- Private function (local)
64-
local function helper_function()
65-
-- implementation
66-
end
67-
68-
-- Public function
69-
function M.public_function()
70-
-- implementation
71-
end
72-
73-
return M
74-
```
75-
76-
### Conventions
77-
78-
- **Imports:** Group at top: `local git = require("utils.git")`
79-
- **Functions:** `snake_case` - `function M.word_wrap()`, `local function get_terminal_width()`
80-
- **Indentation:** 2 spaces, `expandtab`, `smartindent`
81-
- **Error handling:** Guard clauses, nil checks: `if handle == nil then return nil end`
82-
- **Keymaps:** Use `require("utils").set_keymap()` NOT `vim.keymap.set()` directly
83-
- Signature: `set_keymap(mode, lhs, rhs, opts_or_desc)`
84-
- Provides defaults: `noremap = true, silent = true`
85-
- **User commands:** Use `require("utils").set_usrcmd()` NOT `vim.api.nvim_create_user_command()`
86-
87-
### Plugin Structure (Lazy.nvim)
88-
89-
- Files in `.config/nvim/lua/plugins/{category}/` return table(s) with plugin specs
90-
- Categories: `ai/`, `core/`, `lang/`, `misc/`, `ui/`, `workflow/`
91-
- Example spec:
92-
93-
```lua
94-
return {
95-
{
96-
"author/plugin-name",
97-
dependencies = { "other/plugin" },
98-
event = "VeryLazy", -- or cmd, keys, ft, etc.
99-
config = function()
100-
require("plugin-name").setup({ ... })
101-
end,
102-
},
103-
}
104-
```
105-
106-
## 🐟 Fish Shell Style
107-
108-
- **Abbreviations:** Prefer `abbr` over `alias` for shell expansion (e.g., `abbr n nvim`)
109-
- **Functions:** Use for complex logic, `snake_case` naming
110-
- **Conditionals:** `switch/case` for platform detection
111-
- **Cross-platform compatibility:** Terminal emulator and shell scripts should work across macOS, Linux, and BSD unless otherwise specified
112-
- Use `switch (uname)` to handle platform-specific behavior
113-
- Test for command availability with `command -v` before using platform-specific tools
114-
- Prefer standard POSIX utilities when possible
115-
116-
## 📂 File Organization
117-
118-
```
119-
.config/{app}/ # App-specific configs
120-
.config/nvim/
121-
lua/
122-
config/ # Core nvim config (opts, keymaps, autocmd, etc.)
123-
keymaps/{category}/ # Organized keybindings
124-
hls/ # Highlight groups
125-
plugins/{category}/ # Lazy.nvim plugin specs by category
126-
utils/ # Reusable utility modules (git, format, fn, etc.)
127-
snippets/ # Snippet files
128-
spell/ # Custom spellcheck dictionaries
129-
.config/fish/
130-
config.fish # Main config (sources other files)
131-
aliases.fish # Aliases and abbreviations
132-
profile.fish # Environment variables
133-
scripts.fish # Helper functions
134-
.config/vicinae/extensions/ # Custom Vicinae extensions (see AGENTS.md in this dir)
135-
scripts/ # Repo maintenance scripts (ignored by stow)
136-
Brewfile # All Homebrew dependencies
137-
```
138-
139-
## 🎨 Theme & Consistency
140-
141-
- **Colorscheme:** Zenwritten Dark everywhere
142-
- **Fonts:** Zenbones Brainy, JetBrains Mono, BabelStone Runic, Symbols Nerd Font
143-
- When modifying themes: Update `.config/{nvim,wezterm,bat,opencode,rofi,waybar,etc.}`
144-
145-
## 🖥️ Platform-Specific Notes
146-
147-
- Check platform: `require("utils.platform")` in Lua, `switch (uname)` in Fish
148-
- **macOS (Darwin):** Uses Homebrew from `/opt/homebrew` or `/usr/local`
149-
- **Linux:** May use Homebrew from `/home/linuxbrew/.linuxbrew` or native package managers
150-
- **Cursor/VSCode:** Fish auto-switches to dash (see `.config/fish/config.fish:1-4`)
151-
152-
## 🚫 Git Commit Policy
153-
154-
**NEVER commit changes unless explicitly asked by the user.**
155-
156-
- You may stage files for review (`git add`) if the user asks to see what would be committed
157-
- You may show diffs and suggest commit messages
158-
- You may prepare changes and inform the user they are ready to commit
159-
- But ONLY create commits when the user explicitly requests it with commands like "commit this", "make a commit", etc.
160-
161-
## 🧪 Validation Checklist
162-
163-
Before committing config changes:
164-
165-
1. [ ] Run `stow -n .` to preview symlink changes
166-
2. [ ] Test Neovim: `nvim --headless +checkhealth +qa`
167-
3. [ ] Test Fish: `fish -c "source ~/.config/fish/config.fish"`
168-
4. [ ] Verify no auto-generated files are staged: `git status`
169-
5. [ ] Check `.gitignore` patterns match
3+
Personal dotfiles managed with GNU Stow for symlink management across macOS and Linux.
4+
5+
## Essentials
6+
7+
- Do not edit auto-generated files:
8+
- `lazy-lock.json` (Lazy.nvim lockfile)
9+
- `Brewfile.lock.json` (Homebrew lockfile)
10+
- `.config/nvim/.sessions/`, `.config/nvim/.undo/`, `.config/nvim/.backup/` (Neovim state)
11+
- `.config/fish/{fish_variables,completions,conf.d,functions}/` (Fish shell state)
12+
- `.config/lazygit/state.yml` (Lazygit state)
13+
- `.config/ags/@girs/` (AGS TypeScript type definitions; regenerate with `ags types`)
14+
- Package manager: Homebrew via `brew bundle install`.
15+
16+
## More Guidance
17+
18+
- [Common operations](docs/agents/operations.md)
19+
- [Neovim Lua style](docs/agents/nvim-lua.md)
20+
- [Fish shell style](docs/agents/fish-shell.md)
21+
- [File organization](docs/agents/file-organization.md)
22+
- [Theme and consistency](docs/agents/theme.md)
23+
- [Platform notes](docs/agents/platform.md)
24+
- [Git workflow and validation](docs/agents/git-workflow.md)

docs/agents/file-organization.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# File Organization
2+
3+
```
4+
.config/{app}/ # App-specific configs
5+
.config/nvim/
6+
lua/
7+
config/ # Core nvim config (opts, keymaps, autocmd, etc.)
8+
keymaps/{category}/ # Organized keybindings
9+
hls/ # Highlight groups
10+
plugins/{category}/ # Lazy.nvim plugin specs by category
11+
utils/ # Reusable utility modules (git, format, fn, etc.)
12+
snippets/ # Snippet files
13+
spell/ # Custom spellcheck dictionaries
14+
.config/fish/
15+
config.fish # Main config (sources other files)
16+
aliases.fish # Aliases and abbreviations
17+
profile.fish # Environment variables
18+
scripts.fish # Helper functions
19+
.config/vicinae/extensions/ # Custom Vicinae extensions (see AGENTS.md in this dir)
20+
scripts/ # Repo maintenance scripts (ignored by stow)
21+
Brewfile # All Homebrew dependencies
22+
```

docs/agents/fish-shell.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Fish Shell Style
2+
3+
- Abbreviations: prefer `abbr` over `alias` (example: `abbr n nvim`)
4+
- Functions: use for complex logic, `snake_case` naming
5+
- Conditionals: use `switch/case` for platform detection
6+
- Cross-platform compatibility: terminal emulator and shell scripts should work across macOS, Linux, and BSD unless otherwise specified
7+
- Use `switch (uname)` for platform-specific behavior
8+
- Test command availability with `command -v` before platform-specific tools
9+
- Prefer standard POSIX utilities when possible

docs/agents/git-workflow.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Git Workflow and Validation
2+
3+
## Validation Checklist
4+
5+
Before committing config changes:
6+
7+
1. [ ] Run `stow -n .` to preview symlink changes
8+
2. [ ] Test Neovim: `nvim --headless +checkhealth +qa`
9+
3. [ ] Test Fish: `fish -c "source ~/.config/fish/config.fish"`
10+
4. [ ] Verify no auto-generated files are staged: `git status`
11+
5. [ ] Check `.gitignore` patterns match

docs/agents/nvim-lua.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Neovim Lua Style
2+
3+
## Module Pattern
4+
5+
```lua
6+
local M = {}
7+
8+
-- Private function (local)
9+
local function helper_function()
10+
-- implementation
11+
end
12+
13+
-- Public function
14+
function M.public_function()
15+
-- implementation
16+
end
17+
18+
return M
19+
```
20+
21+
## Conventions
22+
23+
- Imports at top: `local git = require("utils.git")`
24+
- Functions use `snake_case`: `function M.word_wrap()`, `local function get_terminal_width()`
25+
- Indentation: 2 spaces, `expandtab`, `smartindent`
26+
- Error handling: guard clauses, nil checks like `if handle == nil then return nil end`
27+
- Keymaps: use `require("utils").set_keymap()` (not `vim.keymap.set()`)
28+
- Signature: `set_keymap(mode, lhs, rhs, opts_or_desc)`
29+
- Defaults: `noremap = true, silent = true`
30+
- User commands: use `require("utils").set_usrcmd()` (not `vim.api.nvim_create_user_command()`)
31+
32+
## Plugin Structure (Lazy.nvim)
33+
34+
- Files in `.config/nvim/lua/plugins/{category}/` return table(s) with plugin specs
35+
- Categories: `ai/`, `core/`, `lang/`, `misc/`, `ui/`, `workflow/`
36+
37+
Example spec:
38+
39+
```lua
40+
return {
41+
{
42+
"author/plugin-name",
43+
dependencies = { "other/plugin" },
44+
event = "VeryLazy", -- or cmd, keys, ft, etc.
45+
config = function()
46+
require("plugin-name").setup({ ... })
47+
end,
48+
},
49+
}
50+
```

docs/agents/operations.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Common Operations
2+
3+
## Setup & Installation
4+
5+
```bash
6+
brew bundle install # Install/update all dependencies
7+
stow . # Apply dotfiles (creates symlinks from ~/)
8+
stow -n . # Dry-run to preview changes
9+
bash ./scripts/install.sh # Fresh system setup (installs everything)
10+
```
11+
12+
## Neovim
13+
14+
```bash
15+
nvim --headless +"Lazy! sync" +qa # Update plugins
16+
nvim --headless +checkhealth +qa # Validate setup
17+
```
18+
19+
## Vicinae Extensions
20+
21+
```bash
22+
./scripts/vicinae-build-extensions.sh # Build all extensions
23+
# See .config/vicinae/extensions/AGENTS.md for extension development guide
24+
```
25+
26+
## Testing Changes
27+
28+
```bash
29+
fish -c "source ~/.config/fish/config.fish" # Test fish config
30+
bat cache --build # Rebuild bat cache after theme changes
31+
stow -n . # Preview stow changes before applying
32+
```

docs/agents/platform.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Platform Notes
2+
3+
- Check platform: `require("utils.platform")` in Lua, `switch (uname)` in Fish
4+
- macOS (Darwin): Homebrew from `/opt/homebrew` or `/usr/local`
5+
- Linux: Homebrew from `/home/linuxbrew/.linuxbrew` or native package managers
6+
- Cursor/VSCode: Fish auto-switches to dash (see `.config/fish/config.fish:1-4`)

0 commit comments

Comments
 (0)