From 6eee2509a405501e96e34cd9a52ba038d8c8fbde Mon Sep 17 00:00:00 2001 From: Lap Tran Date: Sat, 18 Jul 2026 23:03:12 -0400 Subject: [PATCH] Add Grok Build agent config adapted from Claude Code setup Wire shared AGENTS.md and Claude settings through home-manager, plus a native Grok config (always-approve, rose-pine) and a `gb` yolo alias. --- AGENTS.md | 15 +++++++++++++++ home.nix | 24 ++++++++++++++++++++++-- home/.claude/settings.json | 7 +++++++ home/.grok/config.toml | 28 ++++++++++++++++++++++++++++ home/AGENTS.md | 14 ++++++++++++++ 5 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 AGENTS.md create mode 100644 home/.claude/settings.json create mode 100644 home/.grok/config.toml create mode 100644 home/AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..7127cbe --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,15 @@ +# Project notes for agents + +Deliberate decisions in this repo - do NOT silently revert them: + +- `homebrew.onActivation.cleanup = "zap"` in `configuration.nix` is intentional. It forces the good habit of declaring every Homebrew package in the Nix config instead of installing things ad-hoc, which keeps the machine reproducible. Do not soften it to `uninstall` or `none`. Users are warned about its effect; this note is for anyone tempted to change the setting itself. +- Agent configs under `home/` are the source of truth. `home.nix` installs them with `mkOutOfStoreSymlink`, so edits to files in `home/` apply live after the first rebuild that creates the symlink. Prefer editing those paths, not the live `~/.claude` / `~/.grok` copies. +- Grok Build is first-class here: `home/.grok/config.toml` and `home/AGENTS.md` (linked as `~/.grok/AGENTS.md`). Claude, Codex, and opencode still share the same `home/AGENTS.md` for multi-agent work. +- Shell aliases: `cc` (Claude skip-permissions), `co` (Codex full-auto), `gb` (Grok --yolo). They are intentional high-agency shortcuts. + +## Maintaining this file + +Keep this file for knowledge useful to almost every future agent session in this project. +Do not repeat what the codebase already shows; point to the authoritative file or command instead. +Prefer rewriting or pruning existing entries over appending new ones. +When updating this file, preserve this bar for all agents and keep entries concise. diff --git a/home.nix b/home.nix index 7da2e0d..2d1eb02 100644 --- a/home.nix +++ b/home.nix @@ -34,8 +34,10 @@ in push = "git push"; pull = "git pull"; m = "git switch main"; + # High-agency agent launchers (same idea across tools) cc = "claude --dangerously-skip-permissions"; co = "codex --full-auto"; + gb = "grok --yolo"; }; }; @@ -52,11 +54,29 @@ in }; }; - # Edit-in-place: the real file stays in my repo, ~/.config just points at it. + # Edit-in-place: the real file stays in my repo, the live path just points at it. home.file.".config/wezterm".source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/wezterm"; home.file.".config/nvim".source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/nvim"; - home.file.".config/herdr".source = + home.file.".config/herdr".source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/herdr"; + + # Claude Code settings (also read by Grok for permissions/compat) + home.file.".claude/settings.json".source = + config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.claude/settings.json"; + + # Shared agent policy - one file, many harnesses + home.file.".claude/CLAUDE.md".source = + config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md"; + home.file.".codex/AGENTS.md".source = + config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md"; + home.file.".config/opencode/AGENTS.md".source = + config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md"; + home.file.".grok/AGENTS.md".source = + config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md"; + + # Grok Build native config + home.file.".grok/config.toml".source = + config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.grok/config.toml"; } diff --git a/home/.claude/settings.json b/home/.claude/settings.json new file mode 100644 index 0000000..e3ab775 --- /dev/null +++ b/home/.claude/settings.json @@ -0,0 +1,7 @@ +{ + "theme": "dark-ansi", + "statusLine": { + "type": "command", + "command": "input=$(cat); model=$(echo \"$input\" | jq -r '.model.display_name'); used=$(echo \"$input\" | jq -r '.context_window.used_percentage // empty'); if [ -n \"$used\" ]; then printf \"%s | ctx: %.0f%% used\" \"$model\" \"$used\"; else printf \"%s\" \"$model\"; fi" + } +} diff --git a/home/.grok/config.toml b/home/.grok/config.toml new file mode 100644 index 0000000..19072f0 --- /dev/null +++ b/home/.grok/config.toml @@ -0,0 +1,28 @@ +# Grok Build user config - managed via home-manager (edit here, then rebuild if needed). +# Adapted from Claude Code setup in kunchenguid/dotfiles + local preferences. +# +# Mapping notes: +# Claude --dangerously-skip-permissions -> permission_mode = "always-approve" / --yolo +# Claude theme dark-ansi + rose-pine stack -> theme = "rosepine" +# Claude statusLine (model | ctx %) -> no direct equivalent; TUI shows this natively +# Shared AGENTS.md -> ~/.grok/AGENTS.md (via home.nix) + +[marketplace] +official_marketplace_auto_installed = true + +[[marketplace.sources]] +name = "xAI Official" +git = "https://github.com/xai-org/plugin-marketplace.git" + +[models] +default = "grok-build" + +[ui] +theme = "rosepine" +max_thoughts_width = 120 +fork_secondary_model = "grok-build" +# High-agency default, same idea as `claude --dangerously-skip-permissions` / `codex --full-auto`. +# Toggle per session with Ctrl+O or /always-approve. Shell alias `gb` also launches with --yolo. +permission_mode = "always-approve" +yolo = false +compact_mode = false diff --git a/home/AGENTS.md b/home/AGENTS.md new file mode 100644 index 0000000..794bb9d --- /dev/null +++ b/home/AGENTS.md @@ -0,0 +1,14 @@ +# global agent instructions + +- Never use the em dash "—". Use plain dash "-" instead +- When writing commit messages, NEVER auto-add your agent name as co-author +- Never manually modify CHANGELOG.md files or any files that are marked as auto-generated +- When making technical decisions, do not give much weight to development cost. + Instead, prefer quality, simplicity, robustness, scalability, and long term maintainability. +- When doing bug fixes, always start with reproducing the bug in an E2E setting as closely aligned with how an end user would experience it as possible. + This makes sure you find the real problem so your fix will actually solve it. +- When end-to-end testing a product, be picky about the UI you see and be obsessed with pixel perfection. + If something clearly looks off, even if it is not directly related to what you are doing, try to get it fixed along the way. +- Apply that same high standard to engineering excellence: lint, test failures, and test flakiness. + If you see one, even if it is not caused by what you are working on right now, still get it fixed. +- Before using "dynamic workflows", "ultra code" or any harness feature that immediately spawns a large swarm of subagents, always explain the tradeoffs and ask the user for explicit approval.