Compare commits

..
Author SHA1 Message Date
Lap Tran 8a35b39aa3 no-mistakes(document): Update stale security-audit sandbox note in home.nix 2026-10-25 12:49:13 -04:00
Lap Tran 78424d2778 no-mistakes(test): Verify timeout enforces limit before sandbox exec 2026-10-25 12:43:36 -04:00
Lap Tran 59bdaa6e2a no-mistakes(review): Remove silent stale run-dir deletion from start 2026-10-25 12:33:40 -04:00
Lap Tran c45d61387f no-mistakes(review): Fix stop guard order, accumulate EXCLUDE lines, drop run-parent override 2026-10-25 12:29:39 -04:00
Lap Tran 76ff344ff5 feat(home): add security-audit-sandbox wrapper 2026-10-25 12:22:48 -04:00
hermes a2968cdcef Merge pull request 'Put /usr/bin on the security-audit activation PATH' (#10) from fm/dotfiles-security-audit-git-path into main 2026-10-25 11:22:47 -04:00
Lap Tran 84c26cca45 no-mistakes(document): Document git prerequisite for the security-audit skill install 2026-10-24 21:02:35 -04:00
Lap Tran 75088e1f15 fix(home): put /usr/bin on the security-audit activation PATH
The Skills CLI spawns git to clone the skill. The activation block only
prepended /opt/homebrew/bin, so git at /usr/bin/git was not resolvable and
the rebuild failed with "spawn git ENOENT". Prepend /usr/bin too.
2026-10-24 20:55:01 -04:00
hermes d01d13ff1c Merge pull request 'Add security-audit skill install and restore paid Go crew dispatch' (#9) from fm/dotfiles-security-audit-skill into main 2026-10-24 20:45:55 -04:00
Lap Tran 788a97a61d no-mistakes(document): Prune incident narrative and duplicate skill commands 2026-10-24 20:34:29 -04:00
Lap Tran aaeadb50d5 no-mistakes(test): Name only runtime-later activation blocks in opencode2 comment 2026-10-24 20:23:10 -04:00
Lap Tran b1869a1afd no-mistakes(review): Correct Grok scope and opencode path claims in skill docs 2026-10-24 20:12:10 -04:00
Lap Tran 1a3c38406a Add security-audit skill install and restore paid Go crew dispatch
Install cloudflare/security-audit through the Skills CLI with Homebrew npx
so the multi-file skill stays upstream-identical. The universal target
~/.agents/skills is read by OpenCode, Codex, Pi, and Grok; the CLI also
links it into ~/.claude/skills for Claude Code. Skip when installed, warn
instead of failing when GitHub is unreachable, and never target the
read-only ~/.config/opencode/skills store link.

Return crew dispatch to opencode-go/deepseek-v4.1-flash in both the UI
rule and the default, per the captain's 2026-10-21 order, and correct the
AGENTS.md routing note.

Stop opencode2's activation from calling exit 0: activation blocks are
inlined into one flat script, so it silently skipped every later block
(securityAuditSkill, setupLaunchAgents, syncMusic).
2026-10-24 19:54:36 -04:00
hermes b37ee69be1 Merge pull request 'Add OpenSuperWhisper local voice input' (#8) from fm/dotfiles-opensuperwhisper into main 2026-10-24 17:58:13 -04:00
Lap Tran 86844a3646 no-mistakes(document): Fix OpenSuperWhisper cask comment and Settings model label 2026-10-24 15:56:33 -04:00
Lap Tran 16677278ba no-mistakes(review): Seed OpenSuperWhisper model path only, stop overwriting app settings 2026-10-24 15:46:06 -04:00
Lap Tran 4a4ce6c585 Add OpenSuperWhisper local voice input
Install the opensuperwhisper cask and add home.activation.openSuperWhisper
to download the Whisper V3 Large turbo model once, verify its SHA256, and
set the app defaults. Model and defaults stay outside the Nix store; macOS
TCC grants remain manual. Document first-run steps, permissions, and the
default shortcut in readme.md and AGENTS.md.
2026-10-24 15:30:10 -04:00
hermes 7603df3666 Merge pull request 'Switch crew dispatch to free DeepSeek V4.1 Flash' (#7) from fm/dotfiles-crew-dispatch-free-model into main 2026-10-21 10:03:10 -04:00
Lap Tran 7f5bf7b111 no-mistakes(review): Update AGENTS.md crew-routing note for free DeepSeek Flash 2026-10-20 21:53:02 -04:00
Lap Tran 738c1de3f9 Switch crew dispatch to free DeepSeek V4.1 Flash 2026-10-20 21:27:50 -04:00
Lap Tran ee43a5cd8f Route firstmate crews to paid Go DeepSeek V4.1 Flash
The free DeepSeek tier is metered, and exhausting it stalls a crew mid-task:
one build sat waiting for free quota to reset hours later. Crews now run
opencode-go/deepseek-v4.1-flash on the OpenCode Go subscription, which
OpenCode documents as zero-retention and not used for training.

The AGENTS.md line documenting crew routing is updated to match.
2026-10-16 16:50:14 -04:00
Lap Tran b2081fa14f Update lazy.nvim and record Pi changelog marker
lazy.nvim moved to 85c7ff3 after a plugin-manager update on this machine.
Both files are tracked so a fresh setup installs the same versions instead
of drifting to whatever is newest.

Also restore the trailing newline on settings.json, which a tool rewrote
without one.
2026-10-16 16:39:31 -04:00
Lap Tran efe174ba64 Route firstmate crews to the free DeepSeek model
Crews were routed to the paid OpenCode Go account. They now use the free
DeepSeek V4.1 Flash model, which OpenCode documents as zero-retention and
not used for training, so no repository code or prompt leaves retention.

The AGENTS.md line documenting crew routing is updated to match, and now
records which free models to avoid: the muse-spark contributor models train
on prompts, the exo-free, mimo and nemotron free models may use data to
improve the model, and cat-jam-free retains for 30 days.
2026-10-16 16:39:29 -04:00
Lap Tran b31fadd85a config: OpenCode Go deepseek routing, no-mistakes review split, settings
Route firstmate crews and both OpenCode sessions to opencode-go/deepseek-v4.1-flash. Split the no-mistakes pipeline so the implementer and fixer run deepseek-v4.1-flash and the reviewer runs opencode-go/glm-5.3-flash. Add Pi context-window overrides for the deepseek models, Pi package updates, a lavish-axi Claude SessionStart hook, and the AGENTS.md response-style rules.
2026-10-08 18:27:59 -04:00
hermes acbad2d954 Merge pull request 'fix: ignore herdr agent socket and session snapshots' (#6) from fm/fm-dotfiles-herdr-ignore-gap into main 2026-10-06 17:58:45 -04:00
hermes 26790706c8 Merge pull request 'fix(opencode): set 256k context limit for Muse Spark models' (#5) from fm/fm-crew-context-256k into main 2026-10-06 17:20:30 -04:00
hermes 96e8d4ce51 Merge pull request 'Route firstmate crews to opencode harness' (#4) from fm/fm-crew-opencode-routing into main 2026-10-06 17:18:21 -04:00
Lap Tran 9eaba6aae6 fix(opencode): set 256k context limit for Muse Spark models 2026-10-06 17:14:13 -04:00
Lap Tran 2e7bee5f61 feat: route firstmate crews to opencode harness
crew-dispatch.json: UI/image rule and default select opencode;
models (muse-spark-1.3-contributor, deepseek-v4.1-flash), providers,
and reasons unchanged. AGENTS.md records opencode crews and the
spawn-owned opencode-store login instead of Pi ambient auth.
2026-10-06 11:18:16 -04:00
Lap Tran e8447c3c28 fix: ignore herdr agent socket and session snapshots
*.sock never matched herdr.sock.agent and nothing covered
session-snapshots/, so both dirtied the working tree. The
home.activation.herdrConfigDir cleanup list already names them;
this brings .gitignore in line so a tree containing those runtime
paths reads clean.
2026-10-06 11:15:17 -04:00
hermes ca3c7fa45a Merge pull request 'fix: keep herdr runtime state out of the dotfiles working tree' (#3) from fm/fm-clone-runtime-dirt-dotfiles into main 2026-10-06 10:25:44 -04:00
Lap Tran 2bcaf5fd32 no-mistakes(document): Point herdr state-file rationale at the cleanup list 2026-10-05 23:19:25 -04:00
Lap Tran b0d7087a46 fix(rebuild): rotate herdr config.toml backup as a file target
~/.config/herdr moved from a whole-directory home.file target to a file
target, so rebuild.sh must follow. Treat ~/.config/herdr/config.toml as a
managed file backup target and stop listing ~/.config/herdr as a directory
target, otherwise a real config.toml backed up to config.toml.backup would
fail the next switch with "would be clobbered".
2026-10-05 22:58:29 -04:00
Lap Tran 1eb147f3d3 no-mistakes(document): Record herdr config-dir invariant; flag stale rebuild.sh rotation 2026-10-05 22:49:57 -04:00
Lap Tran b6095c8a20 no-mistakes(review): home: add herdr-client.log and sessions to herdr cleanup 2026-10-05 22:32:40 -04:00
Lap Tran d5fc8758a5 no-mistakes(review): home: move herdr migration after writeBoundary before linkGeneration 2026-10-05 22:24:32 -04:00
Lap Tran bafec48ceb no-mistakes(review): home: narrow herdr cleanup and respect DRY_RUN via run 2026-10-05 22:14:44 -04:00
Lap Tran d5eb744fb4 no-mistakes(review): Purge leaked herdr runtime files from dotfiles repo on activation 2026-10-05 22:00:15 -04:00
Lap Tran 6e1ee6ef67 fix(home): stop herdr writing runtime state into the repo
herdr resolves its config directory as ~/.config/herdr and writes all of its
runtime state beside config.toml: herdr.sock, herdr-client.sock,
herdr-server.log, .plugins.lock, session.json and session-snapshots/. It offers
no option to relocate that directory, so linking the whole directory into this
repo made ~/.config/herdr resolve into the tracked tree and left every clone
permanently dirty with herdr's live sockets and snapshots.

Link only config.toml and let ~/.config/herdr be a real directory, so herdr's
state lands in $HOME instead of the working tree.

home-manager links a file by resolving the existing directory symlink, which
would move this repo's own tracked config.toml to config.toml.backup and leave
a symlink inside the tree. Add a one-time activation step that drops the stale
symlink before home-manager checks link targets; it is a no-op once
~/.config/herdr is a real directory.
2026-10-05 21:25:29 -04:00
Lap Tran 6e0bc81e85 chore(codex): route Codex to OpenCode Go without clobbering ChatGPT auth
The ChatGPT desktop app owns and rewrites ~/.codex/config.toml, so symlinking
that file into the repo leaked the app's own config (model, [desktop],
[plugins], [mcp_servers]) into git and got clobbered on launch.

- Stop symlinking ~/.codex/config.toml; keep it app-owned and merge the repo
  fragment home/.codex/config.toml into it on every activation
  (home.activation.codexOpenCodeGo + home/bin/codex-opencode-go-sync).
- Replace requires_openai_auth with a command-backed token
  (~/.local/bin/opencode-go-token reads the key from the opencode store), so
  ~/.codex/auth.json stays in ChatGPT mode and ChatGPT sign-in coexists with Go.
- Add the Codex 0.160+ profile file home/.codex/luna.config.toml (gpt-6-luna).
- Declare the chatgpt + codex casks; document the decision in AGENTS.md.

Verified: default deepseek-v4.1-flash and --profile luna both return over the Go
Responses API while auth.json remains in chatgpt mode.
2026-10-04 15:07:33 -04:00
hermes 1f13c6eb1a Merge pull request 'chore(pi): select Pi as no-mistakes gate agent and DeepSeek V4.1 Flash default' (#2) from fm/dotfiles-pi-defaults into main 2026-09-30 21:59:42 -04:00
Lap Tran d61193561f no-mistakes(document): fix stale firstmate crew-harness value in AGENTS.md 2026-09-30 21:05:39 -04:00
Lap Tran 65adb4cceb no-mistakes(test): Fix no-mistakes agent:auto to [pi] migration using sed 2026-09-30 21:05:39 -04:00
Lap Tran 258dc2afa1 chore: select Pi gate agent and DeepSeek default 2026-09-30 21:05:39 -04:00
hermes 03e872eebc Merge pull request 'feat(nix): add client-only psql client (libpq) for read-only DB investigation' (#1) from fm/dotfiles-psql-client into main 2026-09-30 20:06:14 -04:00
Lap Tran a180dddff1 feat(nix): add client-only psql client (libpq) to Darwin config 2026-09-30 19:36:01 -04:00
Lap Tran 8169978311 chore(opencode): cap Luna and DeepSeek V4.1 Flash context under Luna's 272K pricing cliff 2026-09-28 15:49:15 -04:00
Lap Tran f02cbefa74 chore: ignore runtime state and build artifacts 2026-09-28 15:26:59 -04:00
Lap Tran e6fdd6884d chore: move agent routing to OpenCode Go; add firstmate tooling
- crew-dispatch.json: route crew tasks to OpenCode Go models
- opencode/opencode2: pin opencode-go/gpt-6-luna
- grok: default to grok-4.5 with high reasoning, permission auto
- home.nix: axiTools activation for the *-axi CLIs; crewmate harness
  opencode; no-mistakes agent list opencode-only
2026-09-27 21:30:11 -04:00
Lap Tran a35c0bb744 Manage opencode 1.x config via home-manager and isolate opencode2
- Symlink ~/.config/opencode/opencode.json and skills/ from dotfiles
  so opencode 1.x config survives rebuild with zap cleanup
- Track cloud-deploy, cloudflared, github-cli, no-mistakes,
  playwright-cli, and read-tweet skills in repo
- Update opencode2 model to opencode/muse-spark-1.2-contributor-free
- Rotate opencode.json/skills in rebuild.sh alongside existing
  managed paths
2026-09-21 21:55:00 -04:00
Lap Tran ab3b67af92 gate: add kunchenguid/no-mistakes for all Nix harnesses
- home.nix: add home.activation.noMistakes (declarative install to
  ~/.no-mistakes/bin + daemon via launchd, global config fallback
  agent: [pi, opencode, grok, claude, codex] covering every harness
  declared in Nix; fix shadowing of jonathanong npm no-mistakes)
- ~/.no-mistakes/config.yaml: switched from auto to ordered fallback,
  pi first (firstmate crewmates), then opencode/grok
- home/.pi/agent/*, home/.grok/config.toml, home/.config/opencode2:
  align to oMLX/qwen3.6-35b local model (was mixed Talos/genesis)
- rebuild.sh: ensure grok-build upgrade and OpenCode 1.x install on
  rebuild (stable CLI for free-tier, opencode2 beta is 426 there)
- dotfiles repo: no-mistakes init (gate at
  ~/.no-mistakes/repos/916cb6ded81b.git, remote no-mistakes)
2026-09-21 17:38:35 -04:00
Lap Tran 8bcc11c108 Silence Determinate Nix options.json warning on rebuild
Disable Home Manager's home-configuration.nix manpage so rebuilds no longer generate options.json with a nixpkgs store path that lacks string context. Package man pages are unchanged.
2026-09-18 15:14:43 -04:00
26 changed files with 2230 additions and 215 deletions

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
# Nix build result symlink
/result
# Runtime state and caches (not user config)
home/.config/beets/state.pickle
home/.config/herdr/.plugins.lock
home/.config/herdr/*.log
home/.config/herdr/*.sock
home/.config/herdr/herdr.sock.agent
home/.config/herdr/session.json
home/.config/herdr/release-notes.json
home/.config/herdr/session-snapshots/
+4 -1
View File
@@ -6,9 +6,12 @@ Deliberate decisions in this repo - do NOT silently revert them:
- Agent configs under `home/` are the source of truth. `home.nix` installs them with `mkOutOfStoreSymlink` + `force = true`, 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` / `~/.pi` copies. `rebuild.sh` rotates stale `*.backup` files before switch so home-manager never fails with "would be clobbered".
- Grok Build is first-class here: `home/.grok/config.toml` and `home/AGENTS.md` (linked as `~/.grok/AGENTS.md`). Claude, Codex, opencode, and Pi share the same `home/AGENTS.md` for multi-agent work.
- Pi is managed the same way: `home/.pi/agent/{settings,models}.json`, `themes/`, and custom extensions (`terminal-status-title`, `calm`). Do not symlink the whole `~/.pi/agent` tree - sessions, auth, npm cache, and herdr's `extensions/herdr-agent-state.ts` stay live.
- firstmate lives at `~/Documents/firstmate` as a mutable git clone (not in the Nix store). `home.activation.firstmate` clones it if missing and seeds `config/backend=herdr` + `config/crew-harness=pi` only when those files are absent. Launch with shell alias `fm` (`cd` + OpenCode 2 via `~/.local/bin/oc2`). Self-update via `/updatefirstmate`, not rebuild.
- herdr stores runtime state beside its config, so `~/.config/herdr` stays a real directory and only `config.toml` is symlinked; `home.activation.herdrConfigDir` migrates the old whole-directory symlink and clears leaked artifacts. Do not symlink the whole directory - rationale and artifact list are in `home.nix`.
- Codex runs on the OpenCode Go subscription. The ChatGPT app owns and rewrites the live `~/.codex/config.toml`, so it is NOT symlinked; `home.activation.codexOpenCodeGo` merges the repo fragment `home/.codex/config.toml` into it on every rebuild, and the app's own sections (`[desktop]`, `[plugins]`, `[mcp_servers]`, ...) survive. Auth is command-backed via `~/.local/bin/opencode-go-token` (prints the key from the opencode store), so `~/.codex/auth.json` stays in ChatGPT mode and ChatGPT sign-in coexists with Go. Only Go models that speak the Responses API work (`deepseek-v4.1-flash`, `gpt-6-luna`, `gpt-5.6-luna`, `grok-4.7/4.6`); GLM/Kimi/MiMo/LongCat are chat-completions-only and need a proxy. Desktop Codex is now the `chatgpt` cask - do not use the deprecated `codex-app` cask.
- firstmate lives at `~/Documents/firstmate` as a mutable git clone (not in the Nix store). `home.activation.firstmate` clones it if missing and seeds `config/backend=herdr` + `config/crew-harness=opencode` only when those files are absent. Crew routing is `home/.config/firstmate/crew-dispatch.json` (symlinked in): per the captain's order 2026-10-21, every coding crewmate and scout uses `opencode` + `opencode-go/deepseek-v4.1-flash` through the OpenCode CLI. The free `deepseek-v4.1-flash-free` order of 2026-10-20 resumes when that lane resets. The validation pipeline stays on Pi with `opencode-go/deepseek-v4.1-flash` steps and the `opencode-go/glm-5.3-flash` reviewer. Avoid the `muse-spark-*-contributor` models, which train on prompts, and the `exo-free`, `mimo-*-free`, and `nemotron-*-free` models, whose data may be used to improve the model. `cat-jam-free` retains for 30 days. Crews inherit the primary's OpenCode login through the spawn-owned symlink (the isolated worker data root links the primary `<XDG_DATA_HOME>/opencode/auth.json`; no `~/.pi/agent/auth.json` reliance). Launch with shell alias `fm` (`cd` + OpenCode 2 via `~/.local/bin/oc2`); the primary stays OpenCode 2, only crews run on the opencode harness. Self-update via `/updatefirstmate`, not rebuild.
- OpenCode 2 is the firstmate primary. It is not a Homebrew formula: install `@opencode-ai/cli@beta` with Homebrew's npm (`home.activation.opencode2`). Launch through `home/bin/oc2` so `OPENCODE_CONFIG` stays at `home/.config/opencode2/opencode.json` and cannot rewrite OpenCode 1.x's `~/.config/opencode`. Do not add a brew `opencode` / `opencode2` formula; `zap` would fight the npm install. firstmate harness detection matches `*opencode*`, so the `opencode2` process name still classifies as OpenCode.
- Shell aliases: `cc` (Claude skip-permissions), `co` (Codex full-auto), `gb` (Grok --yolo), `fm` (firstmate via OpenCode 2), `oc2` (OpenCode 2, isolated). They are intentional high-agency shortcuts.
- OpenSuperWhisper is installed by the `opensuperwhisper` cask, and `home.activation.openSuperWhisper` downloads its Whisper model (`ggml-large-v3-turbo.bin` under the app's Application Support directory, never the Nix store) and seeds the model selection only when it is missing or dangling. All other app settings (trigger, language, paste behavior) belong to the app and must not be rewritten by a rebuild, so `modifierOnlyHotkey = rightOption` on this machine stays the effective trigger. Microphone/Accessibility/Input Monitoring grants stay manual because macOS TCC cannot be declarative; do not kill a running app to apply defaults. The model is local-only.
## Maintaining this file
+11
View File
@@ -47,6 +47,12 @@
"ffmpeg"
"gh"
"herdr"
# Client-only psql for read-only DB investigation. libpq is the keg-only
# PostgreSQL client (no postgres server binary, no service); link = true
# forces `brew link --force` so psql lands on /opt/homebrew/bin and
# resolves on the normal PATH. No server, service, database, or
# connection is configured.
{ name = "libpq"; link = true; }
"node" # required: opencode2 is an npm global, not a Homebrew formula
"pi-coding-agent"
"tea" # Gitea CLI - PRs for firstmate crewmates on unraid.local:3003
@@ -54,8 +60,13 @@
"treehouse"
];
casks = [
# Codex desktop home: the standalone Codex.app was folded into the ChatGPT
# app (2026-07); the deprecated `codex-app` cask must not be used.
"chatgpt"
"codex" # Codex CLI; shares ~/.codex/config.toml with the desktop app
"docker-desktop"
"grok-build"
"opensuperwhisper" # local Whisper dictation; model seed in home.nix
"puremac"
"utm"
"wezterm"
+281 -14
View File
@@ -10,6 +10,10 @@ in
home.username = "laptran";
home.homeDirectory = "/Users/laptran";
home.stateVersion = "24.11";
# home-configuration.nix(5) is generated via options.json that embeds a
# nixpkgs store path without string context. Determinate Nix warns on every
# rebuild. Package man pages are unaffected.
manual.manpages.enable = false;
home.packages = with pkgs; [
ripgrep
fd
@@ -42,7 +46,7 @@ in
cc = "claude --dangerously-skip-permissions";
co = "codex --full-auto";
gb = "grok --yolo";
# firstmate primary session via OpenCode 2 (isolated config; crewmates = Pi)
# firstmate primary session via OpenCode 2 (isolated config; crewmates = OpenCode)
fm = "cd ${firstmateHome} && exec ${home}/.local/bin/oc2";
oc2 = "${home}/.local/bin/oc2";
# Sync ~/Music into the beets library on Unraid (requires NAS mounted).
@@ -77,11 +81,52 @@ in
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/nvim";
force = true;
};
home.file.".config/herdr" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/herdr";
# herdr treats ~/.config/herdr as both its config directory and its state
# directory: it writes its sockets, logs, lock files and session state beside
# config.toml, and it offers no option to relocate them. Keep that directory a
# real directory and link only the config file - a whole-directory symlink into
# this repo makes every running herdr server dirty the working tree. The exact
# artifact list is the cleanup below, so it cannot drift from the code.
home.file.".config/herdr/config.toml" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/herdr/config.toml";
force = true;
};
# Migration from the previous whole-directory symlink at ~/.config/herdr.
# home-manager links ~/.config/herdr/config.toml by following the existing
# ~/.config/herdr symlink, which would move this repo's own tracked config.toml
# to config.toml.backup and leave a symlink inside the tree. Drop the stale
# symlink in the write phase, after writeBoundary and before linkGeneration:
# checkLinkTargets already skips this target because the file is force = true,
# and linkGeneration then creates the real directory. A real directory (the
# post-migration state) is left untouched, so this is idempotent. The old
# whole-directory symlink also left herdr runtime state (sockets, logs,
# session.json, session-snapshots/, ...) in this repo; that state now resolves
# to the real directory, so remove the known runtime artifacts by name.
# config.toml and any other repo content in that directory are never touched.
# Removing a live socket or log only drops the path - the running herdr server
# keeps its own file handles.
home.activation.herdrConfigDir = lib.hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] ''
set -euo pipefail
if [ -L "$HOME/.config/herdr" ]; then
run ${pkgs.coreutils}/bin/rm "$HOME/.config/herdr"
fi
repoHerdr="${dotfiles}/home/.config/herdr"
if [ -d "$repoHerdr" ]; then
run ${pkgs.coreutils}/bin/rm -rf \
"$repoHerdr/herdr.sock" \
"$repoHerdr/herdr-client.sock" \
"$repoHerdr/herdr.sock.agent" \
"$repoHerdr/herdr-server.log" \
"$repoHerdr/herdr-client.log" \
"$repoHerdr/.plugins.lock" \
"$repoHerdr/session.json" \
"$repoHerdr/release-notes.json" \
"$repoHerdr/session-snapshots" \
"$repoHerdr/sessions"
fi
'';
# Beets music library manager - managed by nixpkgs package, config symlinked below.
home.file.".config/beets" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/beets";
@@ -103,10 +148,33 @@ in
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md";
force = true;
};
# Codex provider routing -> OpenCode Go. ~/.codex/config.toml is deliberately
# NOT symlinked: the ChatGPT desktop app owns and rewrites that file. The repo
# fragment home/.codex/config.toml is merged into it by
# home.activation.codexOpenCodeGo instead. The provider's command-backed auth
# runs this helper, which reads the key from the opencode store.
home.file.".local/bin/opencode-go-token" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/bin/opencode-go-token";
force = true;
};
# Codex 0.160+ profiles live in $CODEX_HOME/<name>.config.toml. The app does not
# touch these, so they can be symlinked normally.
home.file.".codex/luna.config.toml" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.codex/luna.config.toml";
force = true;
};
home.file.".config/opencode/AGENTS.md" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md";
force = true;
};
home.file.".config/opencode/opencode.json" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/opencode/opencode.json";
force = true;
};
home.file.".config/opencode/skills" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/opencode/skills";
force = true;
};
# OpenCode 2 isolated config - never share ~/.config/opencode with 1.x
home.file.".config/opencode2/opencode.json" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/opencode2/opencode.json";
@@ -120,6 +188,10 @@ in
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/bin/oc2";
force = true;
};
home.file.".local/bin/security-audit-sandbox" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/bin/security-audit-sandbox";
force = true;
};
home.file.".grok/AGENTS.md" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md";
force = true;
@@ -158,10 +230,10 @@ in
};
# firstmate is a mutable agent distro (self-update, state/, projects/). Clone once;
# never put it in the Nix store. Seed Pi+herdr defaults only when absent.
# never put it in the Nix store. Seed OpenCode+herdr defaults only when absent.
# Do NOT npm install -g here: activation PATH often resolves Nix's npm, which
# cannot write into the store (EACCES). Use Homebrew's node for globals:
# /opt/homebrew/bin/npm install -g tasks-axi quota-axi no-mistakes gh-axi lavish-axi chrome-devtools-axi
# cannot write into the store (EACCES). The firstmate companion CLIs (*-axi)
# are installed by home.activation.axiTools below via Homebrew's node.
home.activation.firstmate = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
fm="${firstmateHome}"
@@ -176,11 +248,11 @@ in
# Local gitignored operating choices (do not overwrite captain edits)
[ -f "$fm/config/backend" ] || printf 'herdr\n' > "$fm/config/backend"
[ -f "$fm/config/crew-harness" ] || printf 'pi\n' > "$fm/config/crew-harness"
[ -f "$fm/config/crew-harness" ] || printf 'opencode\n' > "$fm/config/crew-harness"
# Crew dispatch profile - source of truth in dotfiles (reproducible across
# machines). Symlinked into firstmate config so a rebuild restores routing.
# Crewmates run on Pi + opencode-go/mimo-v2.5-pro (see crew-dispatch.json).
# Crew harness and model routing are task-specific in crew-dispatch.json.
ln -sfn "${dotfiles}/home/.config/firstmate/crew-dispatch.json" "$fm/config/crew-dispatch.json"
# Gitea PR helper for local-only mode: after the first mate (opencode)
@@ -188,6 +260,33 @@ in
ln -sfn "${dotfiles}/home/bin/fm-gitea-pr.sh" "$HOME/.local/bin/fm-gitea-pr.sh"
'';
# Firstmate companion CLIs (*-axi). None is a Homebrew or Nix formula, so
# install them through Homebrew's npm. tasks-axi is version-gated by firstmate
# (>= 0.2.6 is required before a spawn/teardown automatic backlog transition
# will run), so pin it and reinstall on drift; the rest install when absent.
home.activation.axiTools = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
# Activation PATH lacks /opt/homebrew/bin, so npm's `#!/usr/bin/env node`
# shebang and the installed shims would fail. Prepend only - replacing PATH
# breaks the rest of the HM activation (nix-env, gettext).
export PATH="/opt/homebrew/bin:$PATH"
npm=/opt/homebrew/bin/npm
if [ ! -x "$npm" ]; then
echo "axiTools: /opt/homebrew/bin/npm missing (declare node in homebrew.brews)" >&2
exit 1
fi
# Pin tasks-axi; reinstall only when the installed version differs.
want_tasks_axi="0.2.6"
have_tasks_axi="$(tasks-axi --version 2>/dev/null | head -1 | tr -d '[:space:]')"
if [ "$have_tasks_axi" != "$want_tasks_axi" ]; then
"$npm" install -g "tasks-axi@$want_tasks_axi"
fi
# Companion CLIs without a firstmate-enforced version floor: install once.
for tool in quota-axi gh-axi lavish-axi chrome-devtools-axi; do
[ -x "/opt/homebrew/bin/$tool" ] || "$npm" install -g "$tool"
done
'';
# Authorize the SSH key so the phone can log in through the ngrok tunnel.
# (home-manager 26.05 removed programs.ssh.authorizedKeys; manage the file
# here so ~/.ssh is 0700 and authorized_keys is 0600. Public key is not a secret.)
@@ -207,21 +306,189 @@ in
ln -sfn "${dotfiles}/home/bin/sync-music" "$HOME/.local/bin/sync-music"
'';
# Codex (desktop app + CLI) -> OpenCode Go. The ChatGPT app owns and rewrites
# ~/.codex/config.toml, so it must not be a symlink into the repo. Merge the
# repo fragment into the live file on every activation instead; the app's own
# sections survive. See home/bin/codex-opencode-go-sync.
home.activation.codexOpenCodeGo = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
mkdir -p "$HOME/.codex"
${pkgs.python3.withPackages (ps: [ ps.tomlkit ])}/bin/python3 \
"${dotfiles}/home/bin/codex-opencode-go-sync" \
"${dotfiles}/home/.codex/config.toml" \
"$HOME/.codex/config.toml"
'';
# OpenCode 2 is not on Homebrew (beta). Install via Homebrew's npm, never
# Nix's npm (EACCES on the store). Skip when already present so a rebuild
# does not pull a new beta under a live TUI.
# does not pull a new beta under a live TUI. Activation blocks are inlined
# into one flat script, so never `exit 0` here: that would skip every later
# block (securityAuditSkill, setupLaunchAgents, syncMusic).
home.activation.opencode2 = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
npm=/opt/homebrew/bin/npm
bin=/opt/homebrew/bin/opencode2
if [ -x "$bin" ]; then
exit 0
if [ ! -x "$bin" ]; then
if [ ! -x "$npm" ]; then
echo "opencode2: /opt/homebrew/bin/npm missing (declare node in homebrew.brews)" >&2
exit 1
fi
"$npm" install -g --allow-scripts=@opencode-ai/cli @opencode-ai/cli@beta
fi
'';
# backpass (kunchenguid/backpass) - gradient descent for agent memory: reads
# the transcript stores of the harnesses this config already declares
# (claude/codex/pi/opencode/grok), proposes evidence-backed edits to AGENTS.md
# and skills, gated by `backpass apply`. Every model call goes through `acpx`
# to a harness you already authenticated, so acpx is a hard runtime dep and
# must be on PATH. Homebrew node v26 satisfies backpass (>= 22.5) and acpx
# (>= 22.13). Neither is a Homebrew formula: install via Homebrew's npm,
# never Nix's npm (EACCES on the store). Skip-if-present like opencode2 so a
# rebuild never pulls a new version mid-session; refresh manually with
# /opt/homebrew/bin/npm update -g backpass acpx
home.activation.backpass = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
# Activation PATH lacks /opt/homebrew/bin, so npm's `#!/usr/bin/env node`
# shebang fails with "env: node: No such file or directory". Prepend only -
# replacing PATH breaks the rest of the HM activation (nix-env, gettext).
export PATH="/opt/homebrew/bin:$PATH"
npm=/opt/homebrew/bin/npm
if [ ! -x "$npm" ]; then
echo "opencode2: /opt/homebrew/bin/npm missing (declare node in homebrew.brews)" >&2
echo "backpass: /opt/homebrew/bin/npm missing (declare node in homebrew.brews)" >&2
exit 1
fi
"$npm" install -g --allow-scripts=@opencode-ai/cli @opencode-ai/cli@beta
if [ ! -x /opt/homebrew/bin/acpx ]; then
"$npm" install -g acpx@latest
fi
if [ ! -x /opt/homebrew/bin/backpass ]; then
"$npm" install -g backpass
fi
'';
# kunchenguid/no-mistakes gate (git push no-mistakes) - declarative install + daemon + global config
# Uses Pi for pipeline steps (the opencode-go subscription), by the captain's
# decision: Pi is a neutralization-capable gate agent, which opencode is not, so
# it is required to run the gate in firstmate's own checkout. Binary lives in
# ~/.no-mistakes/bin
# with symlink ~/.local/bin/no-mistakes (installer default). Do NOT npm install -g no-mistakes
# - that npm name is jonathanong's static-analysis tool (shadowing bug fixed 2026-09-21).
home.activation.noMistakes = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
bin="$HOME/.no-mistakes/bin/no-mistakes"
link="$HOME/.local/bin/no-mistakes"
# Install/refresh via upstream installer if missing or not kunchenguid build
if [ ! -x "$bin" ] || ! "$bin" --version 2>/dev/null | grep -q "kunchenguid\|v1\."; then
if [ -x "$bin" ]; then
echo "no-mistakes: replacing unexpected binary at $bin" >&2
fi
curl -fsSL https://raw.githubusercontent.com/kunchenguid/no-mistakes/main/docs/install.sh | sh
fi
# Ensure global config uses Pi (idempotent - only writes if missing or still `agent: auto`)
cfg="$HOME/.no-mistakes/config.yaml"
if [ -f "$cfg" ] && grep -qE '^[[:space:]]*agent:[[:space:]]*auto[[:space:]]*$' "$cfg"; then
tmp="$(mktemp)"
sed 's|^[[:space:]]*agent:[[:space:]]*auto[[:space:]]*$|# Managed by dotfiles/home.nix home.activation.noMistakes\nagent: [pi]|' "$cfg" > "$tmp" && mv "$tmp" "$cfg"
fi
if [ ! -f "$cfg" ]; then
mkdir -p "$(dirname "$cfg")"
printf 'agent: [pi]\n' > "$cfg"
fi
# Ensure the captain's model split (idempotent and additive, so hand edits survive).
# Implementer, pipeline default, and pipeline fixer run deepseek-v4.1-flash;
# the review role runs glm-5.3-flash, so review never uses the implementing model.
if ! grep -qE '^[[:space:]]*agent_config:' "$cfg"; then
printf 'agent_config:\n pi:\n model: opencode-go/deepseek-v4.1-flash\n' >> "$cfg"
fi
if ! grep -qE '^[[:space:]]*review_agents:' "$cfg"; then
printf 'review_agents:\n reviewer:\n agent: pi\n model: opencode-go/glm-5.3-flash\n' >> "$cfg"
fi
# Ensure daemon running (launchd on macOS)
"$bin" daemon restart >/dev/null 2>&1 || "$bin" daemon start >/dev/null 2>&1 || true
'';
# cloudflare/security-audit - vulnerability-hunting skill for the coding agents.
# Installed by the upstream Skills CLI through Homebrew's npx, because the skill
# is a multi-file bundle and an upstream refresh must stay byte-identical.
# Scope: the CLI's "universal" target is ~/.agents/skills, which Codex, Pi, and
# OpenCode read as a user-level skill directory; Claude Code reads
# ~/.claude/skills, so the CLI also links the skill there. Grok Build is out of
# scope for this install: its skill directory is ~/.grok/skills, and the CLI
# only populates it when `grok` is named in --agent. Never target
# ~/.config/opencode/skills: home-manager owns that path with force = true and
# mkOutOfStoreSymlink into the mutable dotfiles checkout, so a rebuild would
# clobber the CLI's link and CLI writes would land in the git checkout. Skip
# when installed, like opencode2/backpass, so a rebuild never pulls a new skill
# version mid-session. The skill's own README still requires an OS-enforced
# sandbox before it may run target-controlled builds, tests, browsers, or
# fuzzers. That sandbox is home/bin/security-audit-sandbox; without it, those
# leads stay `needs_validation`.
# Install and refresh commands, plus the sandbox docs, are in readme.md.
home.activation.securityAuditSkill = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
# Activation PATH lacks /opt/homebrew/bin, so npx's `#!/usr/bin/env node`
# shebang fails. It also lacks /usr/bin, so the Skills CLI cannot spawn
# /usr/bin/git and the clone fails with "spawn git ENOENT". Prepend both -
# replacing PATH breaks the rest of the HM activation (nix-env, gettext).
export PATH="/opt/homebrew/bin:/usr/bin:$PATH"
npx=/opt/homebrew/bin/npx
# Canonical copy plus the Claude Code link: rerun when either is missing so a
# half-removed install heals, then skip while both exist. No `exit 0` here:
# activation blocks are inlined into one flat script, and later blocks must
# still run.
if [ ! -f "$HOME/.agents/skills/security-audit/SKILL.md" ] \
|| [ ! -e "$HOME/.claude/skills/security-audit" ]; then
if [ ! -x "$npx" ]; then
echo "securityAuditSkill: /opt/homebrew/bin/npx missing (declare node in homebrew.brews)" >&2
exit 1
fi
# A rebuild must not fail when GitHub or npm is unreachable: the skill is an
# enhancement, so warn and keep the rest of the switch going.
if ! "$npx" --yes skills add https://github.com/cloudflare/security-audit-skill \
--skill security-audit --global \
--agent claude-code codex pi opencode --yes; then
echo "securityAuditSkill: WARNING: skill install failed (network or Skills CLI unavailable); rebuild continues." >&2
echo "securityAuditSkill: rerun ./rebuild.sh or install manually with the command in readme.md." >&2
fi
fi
'';
# OpenSuperWhisper - local voice-first prompting (cask in configuration.nix).
# The app reads its model from its own Application Support directory, so the
# 1.6 GB Whisper model is downloaded here once and kept outside the Nix store.
# A failed download must not fail the switch: warn, drop the partial file, and
# let the app's Settings download it later. Only a missing or unusable model
# selection is seeded; every other setting belongs to the app and survives the
# rebuild. Never write hasCompletedOnboarding - onboarding must still run so the
# captain can grant Microphone/Accessibility (macOS TCC grants are manual by
# design). A running app picks up new defaults on its next launch; do not kill
# it here.
home.activation.openSuperWhisper = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
supportDir="$HOME/Library/Application Support/ru.starmel.OpenSuperWhisper"
modelDir="$supportDir/whisper-models"
modelPath="$modelDir/ggml-large-v3-turbo.bin"
modelUrl="https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo.bin?download=true"
modelSha="1fc70f774d38eb169993ac391eea357ef47c88757ef72ee5943879b7e8e2bc69"
curl="${pkgs.curl}/bin/curl"
mkdir -p "$modelDir"
if [ ! -f "$modelPath" ]; then
tmp="$(${pkgs.coreutils}/bin/mktemp "$modelDir/.ggml-large-v3-turbo.XXXXXX")"
if "$curl" -fL --retry 3 --connect-timeout 30 -o "$tmp" "$modelUrl" \
&& printf '%s %s\n' "$modelSha" "$tmp" | ${pkgs.coreutils}/bin/sha256sum -c - >/dev/null 2>&1; then
mv "$tmp" "$modelPath"
else
echo "openSuperWhisper: WARNING: could not download or verify the Whisper model." >&2
echo "openSuperWhisper: the app still works; download \"Whisper V3 Large\" in Settings later." >&2
${pkgs.coreutils}/bin/rm -f "$tmp"
fi
fi
defaults=/usr/bin/defaults
selectedModel="$("$defaults" read ru.starmel.OpenSuperWhisper selectedWhisperModelPath 2>/dev/null || true)"
if [ -f "$modelPath" ] && { [ -z "$selectedModel" ] || [ ! -f "$selectedModel" ]; }; then
"$defaults" write ru.starmel.OpenSuperWhisper selectedWhisperModelPath -string "$modelPath"
fi
'';
}
+14
View File
@@ -3,5 +3,19 @@
"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"
},
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "lavish-axi",
"timeout": 10
}
]
}
]
}
}
+27
View File
@@ -0,0 +1,27 @@
# Codex -> OpenCode Go subscription (fragment, NOT the live config).
#
# The ChatGPT desktop app owns and rewrites ~/.codex/config.toml, so home-manager
# must not symlink this file into place. Instead
# home.activation.codexOpenCodeGo merges the keys below into the live file on
# every rebuild (home/bin/codex-opencode-go-sync). The app's own sections
# ([desktop], [plugins], [mcp_servers], [marketplaces], ...) are preserved.
#
# No secret lives here. Auth is command-backed: the provider runs
# ~/.local/bin/opencode-go-token, which prints the key from the opencode auth
# store. That leaves ~/.codex/auth.json in ChatGPT mode, so the ChatGPT app and
# the Go subscription coexist in the same Codex install.
#
# Only models Go serves over the Responses API work here. Verified 2026-10-03:
# deepseek-v4.1-flash, gpt-6-luna, gpt-5.6-luna, grok-4.7, grok-4.6.
model = "deepseek-v4.1-flash"
model_provider = "opencode-go"
# Switch models with `codex --profile luna` (settings in luna.config.toml; Codex
# 0.160+ no longer accepts a [profiles.*] table here).
[model_providers.opencode-go]
name = "OpenCode Go"
base_url = "https://opencode.ai/zen/go/v1"
wire_api = "responses" # Codex only supports the Responses API
[model_providers.opencode-go.auth]
command = "/Users/laptran/.local/bin/opencode-go-token"
+7
View File
@@ -0,0 +1,7 @@
# Codex profile: gpt-6-luna on OpenCode Go.
#
# Codex 0.160+ reads profiles from $CODEX_HOME/<name>.config.toml, so this file
# is symlinked in as ~/.codex/luna.config.toml. Select it with
# `codex --profile luna` (or `codex --profile luna exec ...`).
model = "gpt-6-luna"
model_provider = "opencode-go"
+16 -14
View File
@@ -1,20 +1,22 @@
{
"rules": [
{
"when": "pure-function implementation with tests (indicators, slots, seasonal wiring, repositories)",
"use": [{ "harness": "pi", "model": "opencode-go/mimo-v2.5-pro" }],
"why": "MiMo V2.5 Pro (opencode-go, 1M ctx) produces clean correct code; flat-rate sub so $0 marginal cost. Pi drives it in an isolated worktree."
},
{
"when": "adapter or external-fetch integration (COT, seed backfills, vendor seams)",
"use": [{ "harness": "pi", "model": "opencode-go/mimo-v2.5-pro" }],
"why": "Pattern-following work against existing adapter contracts; MiMo handles iterative fetch/debug loops."
},
{
"when": "frontend page or tRPC wiring (UI panels, router procedures, client exposure)",
"use": [{ "harness": "pi", "model": "opencode-go/mimo-v2.5-pro" }],
"why": "Mechanical wiring against existing components/routers; the contract carries the specialization."
"when": "UI work where supplied screenshots or other image context materially affect the implementation or verification.",
"use": [
{
"harness": "opencode",
"model": "opencode-go/deepseek-v4.1-flash",
"provider": "opencode-go"
}
],
"why": "Captain's order 2026-10-21: paid Go for every crewmate and scout after the free lane hit 'Free usage exceeded' with a 10.5 hour retry, which ended five sessions in forty minutes. The free deepseek-v4.1-flash-free order of 2026-10-20 resumes when that lane resets; paid Go had 5 percent of its monthly window left, projected empty 2026-10-22T05:43Z."
}
],
"default": [{ "harness": "pi", "model": "opencode-go/mimo-v2.5-pro" }]
"default": [
{
"harness": "opencode",
"model": "opencode-go/deepseek-v4.1-flash",
"provider": "opencode-go"
}
]
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"gitsigns.nvim": { "branch": "main", "commit": "31d6fb2d618bca1482b9f274751ead5f03461408" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"neogit": { "branch": "master", "commit": "f8674ec894315c02449b61c9de9a116c5aafeb90" },
"oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
+90
View File
@@ -0,0 +1,90 @@
{
"$schema": "https://opencode.ai/config.json",
"model": "opencode-go/deepseek-v4.1-flash",
"instructions": ["AGENTS.md"],
"provider": {
"omlx": {
"npm": "@ai-sdk/openai-compatible",
"name": "oMLX (Local)",
"options": {
"baseURL": "http://localhost:8000/v1",
"apiKey": "none"
},
"models": {
"qwen3.6-35b": {
"id": "Jundot/Qwen3.6-35B-A3B-oQ4-mtp",
"name": "Qwen 3.6 35B (o4-mtp)",
"tool_call": true,
"limit": {
"context": 65536,
"output": 65536
}
}
}
},
"opencode": {
"models": {
"muse-spark-1.3-contributor-free": {
"limit": {
"context": 256000,
"input": 256000,
"output": 128000
}
},
"muse-spark-1.3": {
"limit": {
"context": 256000,
"input": 256000,
"output": 128000
}
},
"muse-spark-1.2": {
"limit": {
"context": 256000,
"input": 256000,
"output": 128000
}
}
}
},
"opencode-go": {
"models": {
"gpt-6-luna": {
"limit": {
"context": 256000,
"input": 256000,
"output": 128000
}
},
"deepseek-v4.1-flash": {
"limit": {
"context": 256000,
"input": 256000,
"output": 128000
}
},
"muse-spark-1.3-contributor": {
"limit": {
"context": 256000,
"input": 256000,
"output": 128000
}
},
"muse-spark-1.2-contributor": {
"limit": {
"context": 256000,
"input": 256000,
"output": 128000
}
}
}
}
},
"plugin": ["/Users/laptran/.automaton/plugins/automaton-guard"],
"command": {
"no-mistakes": {
"description": "Validate code changes through the no-mistakes pipeline",
"template": "Read $HOME/.config/opencode/skills/no-mistakes/SKILL.md and follow it. User request: {{args}}"
}
}
}
@@ -0,0 +1,150 @@
---
name: cloud-deploy-cli
description: Use when the user asks to deploy a project, create/manage a cloud deployment, roll back a release, tail production logs, or run a cloud command for Railway, Vercel, AWS, Azure, or Google Cloud. Triggers on keywords like "deploy", "railway up", "vercel deploy", "aws cli", "az ", "gcloud", "ship it", "push to prod", "cloud CLI", "rollback". Installs and drives the cloud provider's CLI so the agent can deploy on its own.
---
# Cloud deployment CLIs — let the agent deploy on its own
The agent should run the deploy command itself, not hand the user a link to a web console. Pick the CLI for the user's cloud and run it.
## Pick the CLI by what the user named
| Cloud | CLI binary | Install (macOS) | Install (other) |
|---|---|---|---|
| Railway | `railway` | `brew install railway` / `npm i -g @railway/cli` | `sh -c "$(curl -fsSL cli.railway.app/install.sh)"` |
| Vercel | `vercel` | `npm i -g vercel` | same |
| AWS | `aws` | `brew install awscli` | `pip install awscli` / `winget install Amazon.AWSCLI` |
| Azure | `az` | `brew install azure-cli` | `winget install Microsoft.AzureCLI` / `curl -sL https://aka.ms/InstallAzureCLIDeb \| sudo bash` |
| Google Cloud | `gcloud` | `brew install --cask google-cloud-sdk` | `winget install Google.CloudSDK` / install from cloud.google.com/sdk |
If the user said "deploy" without naming a cloud, ask which one (use the `question` tool) — or infer from repo files: `vercel.json` → Vercel, `railway.toml`/`Railway.json` → Railway, `appspec.yml`/`.ebextensions` → AWS, `azure-pipelines.yml`/`appservice` → Azure, `app.yaml`/`Dockerfile`+GCP files → GCP.
Verify install: `<cli> --version`. If missing, install it (table above) then continue.
## Authenticate (one-time per CLI)
```bash
railway login # browser login
vercel login # browser login (vercel link on first deploy in a repo)
aws configure # prompts for Access Key ID, Secret, region, output
az login # browser login
gcloud auth login # browser login; then gcloud config set project <PROJECT_ID>
```
For headless/agent runs use env vars instead of interactive login:
| CLI | Env vars |
|---|---|
| Railway | `RAILWAY_TOKEN` (from Railway dashboard → Settings → API Tokens) |
| Vercel | `VERCEL_TOKEN` (or `VERCEL_ORG_ID` + `VERCEL_PROJECT_ID` after `vercel link`) |
| AWS | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION` (or `AWS_PROFILE`) |
| Azure | `az login --service-principal -u <app-id> -p <cert/password> --tenant <tenant>` |
| Google | `gcloud auth activate-service-account --key-file=<sa.json>` then `GOOGLE_APPLICATION_CREDENTIALS=<sa.json>` |
## Railway
```bash
railway link # bind cwd to a Railway project/service
railway up # deploy current directory (detected buildpack or Dockerfile)
railway up --service api # deploy to a specific service
railway status # current deployment, URL
railway logs # tail live logs
railway variables # view env vars (railway variables set KEY=val to add)
railway rollback # revert to the previous deployment
```
## Vercel
```bash
vercel link # bind repo (writes .vercel/ with org + project IDs)
vercel # preview deploy; prints a *.vercel.app URL
vercel --prod # production deploy (uses production domain)
vercel logs <url> # tail function/build logs
vercel env ls # vercel env add KEY (then vercel --prod to redeploy)
vercel rm <url> # remove a deployment
vercel inspect <url> # build/runtime details
```
For a fully scripted agent deploy:
```bash
vercel --prod --yes --token "$VERCEL_TOKEN"
# --yes skips all prompts; requires .vercel/ linked (vercel link --yes --token $TOKEN)
```
## AWS
AWS is broad — only use it when the user names a specific AWS service. Common agent tasks:
```bash
# S3
aws s3 sync ./dist s3://<bucket>/ --delete
aws s3 presign s3://<bucket>/file.zip --expires-in 3600
# Lambda
aws lambda update-function-code --function-name <fn> --zip-file fileb://fn.zip
aws lambda invoke --function-name <fn> --payload fileb://event.json out.json
# ECS
aws ecs update-service --cluster <c> --service <s> --force-new-deployment
aws ecs describe-services --cluster <c> --services <s>
# Logs (CloudWatch Logs)
aws logs tail /aws/lambda/<fn> --follow
aws logs get-log-events --log-group-name <g> --log-stream-name <s>
# Elastic Beanstalk
eb deploy # needs `eb` CLI (brew install aws-elasticbeanstalk)
```
Always pass `--region <region>` or rely on `aws configure`'s default. For `--query`/`--output text|json` to get parseable results.
## Azure
```bash
az group list -o table
az webapp up --runtime "NODE:20-lts" --sku F1 -n <app> -g <group> # one-shot deploy from cwd
az webapp deployment source config --name <app> -g <group> --repo-url <git> --branch main
az webapp log tail -n <app> -g <group>
az webapp config appsettings set -n <app> -g <group> --settings KEY=val
az functionapp deployment source config-zip -g <group> -n <fn> --src ./deploy.zip
```
`-o table|json|tsv` controls output; `--query` for JMESPath filtering.
## Google Cloud
```bash
gcloud config set project <PROJECT_ID>
gcloud app deploy # App Engine
gcloud run deploy <svc> --source . --region <r> --allow-unauthenticated # Cloud Run
gcloud run services list
gcloud run services describe <svc> --region <r>
gcloud functions deploy <fn> --runtime nodejs20 --trigger-http --allow-unauthenticated
gcloud app logs tail -s default
gcloud builds submit --tag gcr.io/<proj>/<img>
```
## When to use
- "Deploy this" / "ship to prod" / "push to staging" with a cloud named or inferable from repo files
- "Roll back the last deploy" / "tail the logs" / "restart the service"
- "Set env var KEY=val on the deployed app" then redeploy
- Any cloud CLI operation where the agent would otherwise say "go to the dashboard"
## When NOT to use
- Just running the app locally → use the project's dev server, not a cloud deploy
- Building a Docker image for local use → `docker build`; only deploy to cloud if the user asks
- Provisioning infra from scratch (VPCs, databases, IAM) → confirm scope first; these CLIs can do it but the user should explicitly ask before the agent creates billable resources
## Gotchas
- Always confirm the **environment** (production vs preview/staging) before `--prod`/production deploys. Prefer a preview deploy first; ask before promoting.
- `vercel` without `--prod` is a safe preview; `vercel --prod` hits the real domain.
- Railway/Vercel deploys read the repo's build config — check `package.json` scripts / `Dockerfile` / `vercel.json` / `railway.toml` before deploying so the agent knows what will run.
- AWS/Azure/GCP commands can create billable resources; only run provisioning when the user explicitly asked for it.
## Source
Referenced in https://x.com/heyshruti7/status/2069083108092350823 — "Your cloud's CLI — every cloud ships one so your agent can deploy on its own: Railway, Vercel, AWS, Azure, Google Cloud."
@@ -0,0 +1,102 @@
---
name: cloudflared
description: Use when the user asks to expose a local server to the internet, share a localhost URL publicly, test a webhook from a third-party, demo a local dev server to someone else, or get a public HTTPS URL for a port on this machine. Triggers on keywords like "cloudflared", "tunnel", "expose localhost", "public URL", "share local server", "webhook test", "ngrok alternative", "quick tunnel". Installs and runs `cloudflared` to put a localhost port on the public internet in one command.
---
# cloudflared — expose localhost to the world
Use this when the user needs a public HTTPS URL pointing at a port on this machine — for demos, webhook callbacks, or letting someone else hit a local server. One command, no account, no firewall changes.
## Install (first use)
If `cloudflared` is not on PATH:
```bash
brew install cloudflared # macOS
# or: sudo apt install cloudflared # Debian/Ubuntu (or download the .deb from github.com/cloudflare/cloudflared)
# or: winget install Cloudflare.cloudflared # Windows
```
Verify: `cloudflared --version`.
## Quick tunnel (no account, no config)
The fastest path — gives you a random `https://<random>.trycloudflare.com` URL instantly:
```bash
cloudflared tunnel --url http://localhost:3000
```
Output contains a line like:
```
+--------------------------------------------------------------------------------------------+
| Your quick Tunnel has been created! Visit it at (it may take some time to be reachable): |
| https://example-words-tomorrow.trycloudflare.com |
+--------------------------------------------------------------------------------------------+
```
Share that URL. The tunnel stays up as long as the process runs; kill it with Ctrl-C. No Cloudflare account needed. Random URL each run.
## Named tunnel (stable URL, requires account)
For a persistent hostname you can point clients/webhooks at repeatedly:
```bash
cloudflared tunnel login # browser auth, one-time
cloudflared tunnel create my-tunnel # creates tunnel UUID
cloudflared tunnel route dns my-tunnel dev.example.com # bind a hostname to it
```
Then run it with a config file `~/.cloudflared/config.yml`:
```yaml
tunnel: <tunnel-UUID>
credentials-file: /Users/<you>/.cloudflared/<tunnel-UUID>.json
ingress:
- hostname: dev.example.com
service: http://localhost:3000
- service: http_status:404
```
```bash
cloudflared tunnel run my-tunnel
# or as a service:
sudo cloudflared service install # macOS/Linux daemon
```
## Common patterns
| Goal | Command |
|---|---|
| Expose port 3000 with random URL | `cloudflared tunnel --url http://localhost:3000` |
| Expose a different local port | `cloudflared tunnel --url http://localhost:8080` |
| Expose HTTPS local server | `cloudflared tunnel --url https://localhost:3000` |
| Point a hostname at local server | named tunnel + `route dns` (above) |
| Run named tunnel in background | `cloudflared tunnel run my-tunnel &` or `cloudflared service install` |
| TCP port (e.g. SSH) | `cloudflared tunnel --url tcp://localhost:22` (needs named tunnel + `cloudflared access` client) |
## When to use
- "Give me a public URL for this local server" / "share this with my teammate"
- "I need to test a Stripe/GitHub/Slack webhook hitting my local machine"
- "Demo the dev server without deploying"
- "ngrok alternative" / "expose localhost"
## When NOT to use
- Production ingress → set up a real CDN/reverse proxy; quick tunnels are for dev/demo
- Internal-only access on the same machine → just use `localhost:PORT`
- Long-running stable hostnames without a Cloudflare account → quick tunnels are random and not persistent; use a named tunnel or a different tool
## Gotchas
- Quick tunnel URLs are random per run and can take 10-30s to become reachable after the banner prints.
- Cloudflare's free tier is fine for dev; rate limits and TOS apply to high-volume production traffic.
- If the local server binds to `127.0.0.1` only, that's fine — cloudflared connects from the same machine.
- Webhooks that verify SSL: the `*.trycloudflare.com` URL is real HTTPS with a valid cert, so verifiers pass.
## Source
Referenced in https://x.com/heyshruti7/status/2069083108092350823 — "cloudflared — expose localhost to the world with one prompt. Demo links in seconds."
@@ -0,0 +1,135 @@
---
name: github-cli
description: Use when the user asks to open a PR, review or merge a PR, list/check/review issues, react to or comment on PRs, create/manage releases, browse a repo's metadata, or do any GitHub operation without opening the web UI. Triggers on keywords like "gh", "GitHub CLI", "open a PR", "merge the PR", "review request", "list my PRs", "create release". Installs and drives the `gh` CLI so the agent never needs the browser for GitHub workflows.
---
# GitHub CLI (`gh`) — GitHub without the web UI
The agent should open PRs, review, merge, and manage issues/releases from the terminal instead of telling the user to "go to GitHub and click merge."
## Install (first use)
If `gh` is not on PATH:
```bash
brew install gh # macOS
# or: sudo apt install gh # Debian/Ubuntu
# or: winget install GitHub.cli # Windows
```
Authenticate (one-time):
```bash
gh auth login
# choose GitHub.com → HTTPS → "Login with a web browser"
# or use a token: echo "$GH_TOKEN" | gh auth login --with-token
```
Verify: `gh auth status`.
If automation is needed and interactive login isn't possible, set `GH_TOKEN` (or `GITHUB_TOKEN`) env var from a fine-grained PAT with the repo scopes needed (contents, pull-requests, workflows, issues).
## Core workflows
### Open a PR from the current branch
```bash
gh pr create --title "<title>" --body "<body>" --base main
# body supports markdown; can also read from a file: --body-file pr.md
# add reviewers/assignees/labels:
gh pr create --title "..." --body "..." --reviewer alice,bob --label "needs review" --assignee @me
```
The opencode convention: only open PRs when the user explicitly asks. Inspect `git status`, `git diff`, and `git log --oneline -10` first, and stage only intended files.
### Review and merge
```bash
gh pr view <N> # PR details, checks, mergeable state
gh pr view <N> --comments # read the discussion
gh pr diff <N> # the diff in the terminal
gh pr checks <N> # CI status
gh pr review <N> --approve --body "lgtm"
gh pr review <N> --request-changes --body "please fix X"
gh pr merge <N> --squash --delete-branch
# --merge / --squash / --rebase match repo allowed methods
# --auto waits for required checks before merging
```
### List and filter
```bash
gh pr list --author @me --state open
gh pr list --search "review-requested:@me"
gh issue list --assignee @me --state open
gh pr list --state closed --limit 5
```
### Issues
```bash
gh issue create --title "..." --body "..." --label bug --assignee @me
gh issue view <N>
gh issue close <N>
gh issue comment <N> --body "..."
```
### Releases
```bash
gh release create v1.2.3 --notes "..." --title "v1.2.3"
gh release create v1.2.3 ./dist/* # attach build artifacts
gh release list
gh release view v1.2.3
gh release download v1.2.3
```
### Repo metadata & browsing
```bash
gh repo view # current repo info
gh repo view owner/repo # another repo
gh repo clone owner/repo
gh repo create <name> --private --source=. --push # create + push cwd
gh repo fork owner/repo --clone
```
### Cross-repo / search
```bash
gh search prs --author @me --state open
gh search issues "is:open label:bug"
gh search repos "topic:local-llm"
```
## Aliases (optional quality-of-life)
```bash
gh alias set co 'pr checkout'
gh alias set rv 'pr review --view'
# then: gh co 123 → gh pr checkout 123
```
## When to use
- "Open a PR for this branch" / "merge it" / "what's the status of PR #123"
- "Review the latest PR" / "request changes on #45"
- "List my open issues" / "create an issue for this bug"
- "Cut a release" / "attach these binaries to v2.0"
- Any GitHub action where the agent would otherwise say "go to the web UI"
## When NOT to use
- Reading the repo's source code → use Read/Glob/Grep on the working copy, not `gh`
- Git operations (commit, push, branch) → use `git` directly; `gh` wraps GitHub, not git
- Long-form PR body authoring → write to a file first, pass `--body-file`
## Auth troubleshooting
- `gh auth status` fails → run `gh auth login` again, or confirm `GH_TOKEN` is exported in the shell.
- "could not find any releases" on a fork → releases live on the upstream repo; use `gh release list --repo owner/repo`.
- 403 on merge → the token lacks `pull-requests: write` (or repo `contents: write`); regenerate with the scope and re-login.
## Source
Referenced in https://x.com/heyshruti7/status/2069083108092350823 — "GitHub CLI — open PRs, review, merge. Your agent never touches the web UI."
@@ -0,0 +1,392 @@
---
name: no-mistakes
description: Validate your code changes through the no-mistakes pipeline - automated code review, tests, lint, docs, push, PR, and CI - before they reach the configured push target. Use when the user asks to run no-mistakes, gate or ship or validate their changes, push safely, asks you to do a task and then validate it, or invokes /no-mistakes.
user-invocable: true
---
# no-mistakes
`no-mistakes` is a local gate that validates your code changes through a pipeline
(intent, rebase, review, test, document, lint, push, PR, CI) before they reach
the configured push target. You drive it through the `no-mistakes axi` command family, which prints
machine-readable [TOON](https://toonformat.dev) to stdout and progress to stderr.
## Active validation-step boundary
A no-mistakes validation-step agent is already inside an active outer run. It
must inspect, fix, and return only its assigned phase. It must never initialize,
start, reattach, rerun, respond to, synchronize, abort, eject, or directly push
a no-mistakes pipeline. Delivery requirements in user intent remain
acceptance context, but the outer executor alone performs the other validation,
push, PR, and CI phases.
`NO_MISTAKES_GATE` is fast diagnostic evidence, not authorization by
itself. The runtime combines managed Git identity with authenticated process
ancestry. If a pipeline-control command returns
`error.code: nested_gate_context`, stop immediately and
return control to the outer executor. Safe inspection remains available through
`no-mistakes axi status`, `no-mistakes axi logs`, help, and
`no-mistakes doctor`.
When the user invokes `/no-mistakes`, report the outcome at the end. If the user
asks for something specific, translate that request into the matching `axi run`
flags yourself - for example, "skip the lint step" becomes `--skip=lint`. Run
`no-mistakes axi run --help` to see the available flags.
## Two ways to invoke
`/no-mistakes` works in two modes, depending on whether the user hands you a
task along with the command:
- **Validate-only** - bare `/no-mistakes` (optionally with flag-style requests
like "skip the lint step"). The user's code changes are already committed;
validate them and report the outcome.
- **Task-first** - `/no-mistakes <task>`, e.g.
`/no-mistakes add a --json flag to the status command`. First carry out the
task yourself, then validate the result through the pipeline:
1. **Check scope.** Inspect `git status` before you change or commit anything.
Preserve unrelated pre-existing uncommitted changes, and when you commit,
commit only the changes that belong to the user's task.
2. **Do the work.** Make the changes the task describes, then **commit them on
a feature branch**. If the user is on the repository's default branch,
create a feature branch first - the gate validates committed history on a
non-default branch, so the work must land there before you run.
3. **Then validate**, passing the user's task as your `--intent`. The task
text is exactly what the user set out to accomplish, in their own words, so
it *is* the intent - preserve requirements stated directly by the user,
including constraints, exclusions, acceptance criteria, and later decisions;
do not condense them into a diff summary or drop them while adding
implementation context. Enrich it with the decisions and tradeoffs you
made while doing the work (see
[Intent is required](#intent-is-required)).
## Test-quality rule
Never add a test whose only evidence is that it opens, reads, greps, parses, or
snapshots implementation source code and finds or omits particular strings,
tokens, lines, commands, function names, prompt phrases, regex matches, AST
shapes, or incidental snapshots. That does not prove behavior: matching text
can be dead or commented out, and a behavior-preserving refactor can change it.
Instead execute a public or executable interface and assert observable behavior,
state, output, side effects, and failure modes. For machine-consumed declarative
artifacts such as workflow YAML, JSON, policy, .gitignore, or generated
configuration, invoke the real consumer when feasible or parse into a typed or
normalized semantic model and assert meaning. A raw substring or regex over the
file is still the anti-pattern.
Reading a file is legitimate when the file is itself generated public output, a
serialized protocol, persisted state, an intentional snapshot, or another
explicitly owned text or byte contract. Name that contract, and do not use its
contents as a proxy that unrelated code works. A natural-language prompt or
instruction is not proven effective because its source contains a sentence.
Deterministic CI may test the final emitted prompt delivered to an agent as an
intentional generated interface; model interpretation belongs in
development-only evaluation, not live-LLM CI.
For a regression, reproduce the reported failure when feasible: the test should
fail before the fix and pass after it.
Everything below - preconditions, intent, the validate-and-decide loop - applies
the same way once the work is committed on a feature branch.
## Before you start
- The work you want validated must be **committed** on a branch. The gate
validates committed history, not your uncommitted working tree.
- You must be on a **feature branch**, not the repository's default branch.
- The repository must already be initialized with `no-mistakes init`.
- The daemon must have a runnable configured pipeline agent: a supported native
agent binary, the `agent: cursor` ACP alias, or an explicit `acp:<target>` through
`acpx`. You are the AXI driver, not
an implicit pipeline-agent backend. If none is available, the run fails
before its first step; `no-mistakes doctor` reports the configuration problem.
If any of these is not met, `axi run` returns an `error:` with the exact command
to fix it - read it and act on it (commit your work, or create a branch). If the
repository is not initialized, run `no-mistakes init` first; if the `no-mistakes`
command itself is missing or misbehaving, `no-mistakes doctor` reports what is
wrong.
Before starting, run `no-mistakes axi` (home view).
If it shows an active run on your current branch, inspect it with `no-mistakes axi status`.
If it is parked at a gate, drive it with `no-mistakes axi respond`.
Reattach an in-flight run by re-running `no-mistakes axi run` when it still matches your current `HEAD` - either as the submitted head or as the current pipeline head.
Only `no-mistakes axi abort` it when you mean to discard that run before starting over; aborting is a between-runs action, never a way to take over or bypass a gate while a run is still going (see [Validate and decide](#validate-and-decide)).
If it shows an active run on another branch, leave that run alone and start validation for your current branch with `no-mistakes axi run --intent "..."`.
## Intent is required
When you start a run you must pass `--intent`: **what the user set out to
accomplish** - the goal or request behind this work, in their terms. This is not
a description of the diff or the files you changed; it is the objective the
change is meant to achieve. You know it from the conversation, so pass it
directly - no-mistakes uses it verbatim instead of inferring it from local agent
transcripts (slower and flakier).
Err on the side of completeness, not brevity. The review step uses `--intent`
to tell a deliberate decision apart from a mistake, so a thin one-line summary
makes it flag things the user already chose. Capture the nuance: the user's
goal, the specific decisions and tradeoffs they made along the way, any
constraints or approaches they ruled in or out, and anything they explicitly
asked for that might otherwise look surprising in the diff. A few sentences to a
short paragraph is normal - write down what you learned from the conversation
that a reviewer reading only the diff would not know.
## Validate and decide
Run the pipeline and decide on its findings as they come up:
1. Start the run. It blocks until the first decision point or the end:
```sh
no-mistakes axi run --intent "<what the user set out to accomplish>"
```
`axi run` and every `axi respond` block synchronously - the review, test,
and CI steps can each take **several minutes**, so a single call may not
return for a while. That is normal; do not cancel or re-issue the command
because it seems slow. Both commands default to `--wait 8m` so a harness
with a 10-minute tool cap gets a structured return instead of an unbounded
hang. If the command returns because that wait elapsed, it is not a failed
run and does not mean the daemon is dead: inspect with `no-mistakes axi status`
and re-run `axi run` or `axi respond` to reattach. A slow live daemon is
retried after a health probe rather than treated as I/O failure. To check
progress without disturbing the run, use `no-mistakes axi status` from a
separate call.
A long-running call is working, not stalled - background it if your harness
needs to, but the run **never advances past a gate on its own**. Read every
return; on a `gate:`, respond; loop until an `outcome:`. Never idle-wait
for the run to move forward by itself.
When that status output includes `awaiting_agent: parked <duration>` under the run,
the run is parked at an approval or fix-review gate and waiting for you to
send `axi respond`. The field is observability only: it does not change
gate resolution, auto-resume the run, or make `--yes` the default.
While a step is actively `running` or `fixing`, `axi status` may include
`active_steps` with step-scoped `active_for`, current-round `round_active_for`,
`last_activity`, a native `agent_pid` when a subprocess agent is running, and the current round such as `round 1`,
`auto-fix 1/3`, or `fix 2`. If `last_activity` is prefixed with
`quiet`, no step log or native-agent lifecycle activity has arrived for
longer than `step_quiet_warning`. Treat that as a liveness clue, not as
permission to cancel, rerun, or edit the worktree yourself.
2. If the output contains a `gate:` object, the pipeline is waiting on you.
Read its `findings` table. Each finding has an `id`, `severity`,
`file`, `description`, and an `action` that tells you how the
pipeline classified it:
- `auto-fix` - mechanical and low-risk; you can authorize the fix on
your own judgment by responding with `--action fix`.
- `no-op` - informational only; nothing to do.
- `ask-user` - the finding challenges the user's deliberate intent or
touches product behavior. This is a call only the user can make - see
[Escalate `ask-user` findings](#escalate-ask-user-findings) below.
**Review auto-fix is disabled by default** (`auto_fix.review: 0`; a repo
or global `auto_fix.review > 0` override re-enables it), so blocking and
ask-user review findings park for your decision rather than being silently
self-fixed. (Other steps such as test and lint may auto-fix within the
pipeline and re-run before they ever gate.)
Choose one response:
```sh
# accept the step as-is and continue
no-mistakes axi respond --action approve
# have the pipeline fix specific findings, then continue
no-mistakes axi respond --action fix --findings <id1,id2> --instructions "<optional guidance>"
# skip this step
no-mistakes axi respond --action skip
```
While a run is active, never fix findings by editing the code yourself -
the pipeline owns both the findings and the fixes. Your job at a gate is to
decide and respond; `--action fix` has the pipeline apply the fix and
re-review the result. For the same reason, while a run is active do **not**
`abort` or `rerun` to go fix a finding yourself - even a real bug in
your own code - because that discards the pipeline's in-flight work and
forces a full re-validation. `abort` and `rerun` are for *between*
runs (after a `failed` or `cancelled` outcome), never to circumvent a
gate.
Each `respond` blocks until the next `gate:`, `checks-passed` decision point, or final outcome, subject to the same default `--wait 8m` hold.
Extra flags on `respond`:
- `--wait` bounds the hold (default 8m).
- `--reason "the operator's explanation"` records an explicitly authorized Test exception with `--step test --action approve`.
This does not grant approval authority; escalate ask-user findings as before.
Without a reason, Test approval remains effective; an approval past a failing command, `no-go`, or `inconclusive` verdict is reported as an exception with no operator reason supplied.
- `--add-finding '<json>'` (with `--action fix`) folds a finding you
spotted yourself - one the pipeline did not surface - into the fix round,
as a JSON finding object. Use it for a problem you noticed that is not in
the gate's own `findings` table.
- `--step <name>` responds to a specific step instead of the one currently
awaiting approval. You rarely need this; omit it to answer the active gate.
3. Repeat step 2 until the output has an `outcome:` instead of a `gate:`. The
outcomes are:
- `checks-passed` - the change is validated and CI is green (or the
trusted default-branch config declares `no_ci: true` and no checks are
registered - the help line names that declaration when it applies), but
the PR is not merged yet. **You are done driving the pipeline.** Do not
wait for the merge: tell the user the PR is ready and ask them to review
and merge it (the PR link is in the `help` line). A generic empty forge
check list without that declaration is not ready. no-mistakes keeps
monitoring the PR in the background until it is merged, closed, or its
configured idle timeout elapses, so a human can watch it in the TUI.
- `passed` - the pipeline completed under the requested steps, including any
explicit per-run skips. This alone is not evidence that a PR was merged.
- `passed-with-override` - the pipeline completed with an explicitly approved Test exception or CI failure.
Report the exception, not a clean pass.
Test evidence is in `run.test_override_reason`, including when CI readiness returns `checks-passed`; do not omit it from the summary.
- `passed-with-skips` - publication or CI verification automatically skipped.
Report the missing evidence and its cause from `run.automatic_skips`,
bound to the full `run.head_sha`. This is neither CI readiness nor a
failing code verdict. Explicit per-run skips retain their existing behavior.
- `failed` or `cancelled` - they did not; read the output and address it.
Follow the custody guidance below before fixing whatever the output
points at (a failing test, a lint error, a finding you skipped). Commit the
fix on the same feature branch, then submit it with
`no-mistakes axi run --intent "..."`. A fresh run or `rerun` is a
*between-runs* action, correct only after a terminal outcome like this -
never mid-run to circumvent a gate. Do not leave the user at a `failed`
outcome without either retrying or explaining what blocks it.
`no-mistakes rerun` keeps its existing head selection: the gate head, or the
latest terminal run's verified unpublished preserved head while custody remains
outstanding. If a known clean caller `HEAD` differs from that selected head,
it refuses before starting or superseding any run and reports both full SHAs.
It never substitutes the caller head or moves either branch to make them match.
On refusal, inspect `no-mistakes axi status` and follow the custody guidance
below. Dirty callers and callers without clean-head evidence retain existing
selection behavior.
Before any post-pipeline local commit or fresh run, read the structured `branch_sync` object returned by AXI home, status, or a drive result.
Only when its `next_action.code` is `sync`, run `no-mistakes axi sync` first.
That guarded sync may be a strict fast-forward or a content-equivalent diverged advance that anchors the pre-sync head before moving the branch with reset semantics; genuine divergence stays blocked.
If it reports `next_action.code` is `continue_active_run`, the pipeline still owns the branch: run the reported command, keep driving the active run, and do not make local follow-up commits.
When `next_action.code` is `recover_custody`, run its exact `next_action.command` rather than reconstructing one. That is `no-mistakes axi sync --recover` to take a still-available preserved pipeline head, or `no-mistakes axi sync --recover --keep-local` in two keep-local cases: when an accessible gate confirms the verified preserved head is missing and you are explicitly discarding those unpublished commits, or when a bound archive proves divergent later work remains preserved while recovery keeps the branch at the exact reported required head and never selects, merges, or replays the archive. Do not substitute plain `--recover` or `rerun` for a reported keep-local action. `no-mistakes rerun` can resume validating a still-available ordinary preserved head instead, subject to the clean-head check above.
Ordinary recovery takes that head by fast-forward, or by adopting a diverged preserved head proven to carry every local change - the ordinary result of the pipeline rebasing your commits onto a newer base - after anchoring your pre-recovery head under `refs/no-mistakes/recover-local/<run>`.
The ordinary containment proof is deliberately narrow, so a rebase whose fix rounds also rewrote your own lines refuses instead of being adopted: when nothing can tell a deliberate pipeline fix from a dropped change, the decision is yours.
A `branch_sync.state` of `user_owned` means the run went terminal before changing the submitted head and cancellation released the branch: the exact branch and head are yours and immediately usable for whichever delivery path is authorized - no sync action is needed, and a repeated `--recover` there is a harmless no-op.
A dirty worktree, or divergence that cannot be proven contained, makes the recovery refuse with explicit choices; `--keep-local` keeps your current head while the preserved commits stay anchored under `refs/no-mistakes/recover/<run>`. The same flag is the recovery when an accessible gate confirms that the verified preserved head is missing and recovery refs are compatible: it returns custody at the current local head without requiring that object.
If synchronization is blocked, process that structured state instead of improvising reset, stash, merge, rebase, force, or branch replacement.
After synchronization, commit the follow-up on top and re-run `no-mistakes axi run --intent "..."` with the original user intent.
This preserves every prior gate-fix commit regardless of its configured subject.
The CI step deliberately keeps watching the PR after checks pass, so
`axi run` returns `checks-passed` the moment checks are green (or a trusted
`no_ci: true` declaration covers a zero-check repository) rather than
blocking on the human merge. Never poll or re-run waiting for the merge yourself.
Never treat "no CI checks reported" alone as green.
Because that monitor stays live, a PR that falls behind the default branch or
hits a merge conflict after checks pass - commonly because another PR merged
first - needs **no command from you**: never hand-rebase. When the CI monitor
sees an actual conflict it **rebases onto the base, resolves it, revalidates from Review
because rebasing cannot prove continuity with the reviewed head, and re-pushes
the branch through Push**; a PR that is merely behind but still clean needs nothing
either, since the platform merges it. The one exception is when that monitor is
no longer running - the PR was closed, the run was aborted or superseded, it
idle-timed-out, or its auto-fix attempts were exhausted - in which case recover
with `no-mistakes rerun`, subject to the clean-head check above. An accepted
rerun cancels the stale monitor and re-runs the full pipeline including a
deterministic rebase step. Do **not** reach for
`no-mistakes axi run` to refresh a still-active PR: after `checks-passed` it
reattaches to the running monitor (HEAD unchanged) and returns its output
without rebasing.
On a successful outcome (`checks-passed` or `passed`), close the loop with the
user: summarize what happened during the pipeline in a concise, easily readable
format - what was validated and what was found. If the output includes a
`fixes` table, the pipeline fixed findings your original change missed:
acknowledge those misses and explicitly list each fix so the user can easily
review them.
## Escalate `ask-user` findings
A gate whose findings are all `auto-fix` or `no-op` is safe to drive on your
own judgment: respond with `--action fix` or `--action approve` as
appropriate. But a finding marked
`ask-user` is a decision that belongs to the user, not you - the pipeline
flagged it because it challenges their deliberate intent or changes product
behavior. Do not approve, fix, or skip it on your own. Instead, stop and bring
it to the user before you respond:
- Relay each `ask-user` finding to them as the pipeline wrote it - its
`id`, `file`, and full `description` verbatim. Do not paraphrase,
summarize away the detail, or pre-judge the answer.
- Ask how they want to proceed, then translate their decision into the matching
`respond` call: `--action fix` (pass their guidance through
`--instructions`), `--action approve`, or `--action skip`.
The exception is `--yes` (below): it is the user's standing consent to
drive eligible gates unattended, so under `--yes` you resolve ordinary
`ask-user` findings automatically instead of stopping to ask.
If you have clear consent to drive the run automatically, pass `--yes` to `axi run`
or `axi respond`. For eligible gates, it treats actionable findings - `auto-fix` and
`ask-user` alike - as consent to fix it, selects every current finding for one
fix round, accepts the resulting fix review, and approves gates with only
`no-op` findings. Only use it when the user has asked you to drive the whole
run without checking back.
A `protected-path-refusal` gate still requires an explicit operator response
under `--yes`. Relay its path and rule; do not automatically fix, approve,
or skip it. Approval is rejected. Have the operator inspect and resolve the
reported edit, then send `--action fix` to retry the unfinished step.
The [protected-path reference](https://kunchenguid.github.io/no-mistakes/reference/repo-config/#protected_paths)
owns the staging guard's scope and limitations.
A `test-agent-unvalidated-work` finding means a timed-out Test agent left
commits or changes no Test turn validated. Approval is rejected, so `--yes`
stops at that gate without responding. Relay what the finding names and do
not skip Test, which would publish that work. Ask the operator to choose:
`--action fix` spends another agent budget to validate the work, and
`no-mistakes axi abort` stops the run.
## Inspecting state
```sh
no-mistakes axi # home view: current branch, active runs, next steps
no-mistakes axi status # full detail plus cached branch_sync when relevant
no-mistakes axi sync --check # freshly verify an offered synchronization plan
no-mistakes axi sync # apply only an offered guarded synchronization
no-mistakes axi sync --recover # return custody after a terminal run left unpublished pipeline commits
no-mistakes axi logs --step <name> --full # full log output of one step
no-mistakes axi abort # cancel the current-branch active run
no-mistakes axi abort --run <id> # cancel a specific run by id (works outside its worktree)
```
## Reading the output
- Output is TOON: `key: value` pairs, `name[N]{cols}:` tables, and `help[N]:` hints.
- `axi status` is scoped to your current branch when `--run` is omitted: with a known current branch, an implicitly resolved `run:` is this branch's. A run under `other_branch_run:` is one you named with `--run <id>` that belongs to another branch - never read its status or outcome as your own work. An explicit `--run <id>` rendered under `run:` while the current branch is unknown (detached `HEAD` or a branch-lookup failure) encodes no branch relationship. In a successful status response, no run object at all means this branch has no run yet, whatever the recent-runs table lists; an `error:` response proves nothing about run ownership, so act on the error instead of concluding the branch is idle.
- A non-terminal run object may include `awaiting_agent: parked <duration>` immediately after `status`; that means the run is parked at a gate. Only an implicitly resolved current-branch gate offers `axi respond`; an explicit `--run <id>` status is inspection-only even when its branch matches, because the branch may have a newer active run. Follow the response's `help`.
- A run object with a `running` or `fixing` step may include an `active_steps` table. `active_for` is the enclosing step duration; `round_active_for` is the displayed execution or fix round duration and resets for a fix round. Older runs without round timing leave `round_active_for` empty.
- The `help` list at the bottom of most responses tells you the next commands to run.
- Errors are printed as `error: ...` on stdout with a `help` list; act on the suggestion.
- Exit codes: `0` success, no-op, or normal decision gates, `1` failed or cancelled final outcomes, `2` bad usage.
A `gate:` waiting on you looks roughly like this - a `gate:` line naming the step, optional step-specific fields such as `note`, a `findings[N]{...}:` table with one row per finding, and a `help[N]:` list of next commands:
```
gate: review
note: Review auto-fix is disabled by default (auto_fix.review: 0; a repo or global auto_fix.review > 0 override re-enables it), so blocking and ask-user review findings park for your decision rather than being silently self-fixed.
findings[2]{id,severity,file,line,action,description}:
r1,warning,internal/pipeline/executor.go,,auto-fix,Error from os.Remove is ignored
r2,error,cmd/no-mistakes/main.go,,ask-user,New --force flag bypasses the confirm prompt
help[6]:
Run `no-mistakes axi respond --action approve` to accept this step and continue
Run `no-mistakes axi respond --action fix --findings <ids>` to have the pipeline fix the selected findings (do not edit files yourself)
Run `no-mistakes axi respond --action skip` to skip this step
Run `no-mistakes axi logs --step review --full` to read the full step log
A long-running call is working, not stalled - background it if your harness needs to, but the run never advances past a gate on its own. Read every return; on a `gate:`, respond; loop until an `outcome:`.
Commit post-pipeline follow-up work on top of the existing branch so every pipeline fix commit remains present. Never abort-and-restart, reset, or replace the branch in a way that drops prior gate-fix commits.
```
Read the `action` column per row: decide `r1` (auto-fix) on your own
judgment - `respond --action fix --findings r1` hands it to the pipeline to
fix - but stop and escalate `r2` (ask-user) to the user before responding. A
final state
instead shows `outcome: <checks-passed|passed|passed-with-override|passed-with-skips|failed|cancelled>` with no
`findings` table. Field names and exact columns can vary by step and version,
so read the actual `findings` header rather than assuming this layout.
@@ -0,0 +1,87 @@
---
name: playwright-cli
description: Use when the user asks to test a web app in a real browser, automate browser clicks/form submissions, take screenshots of flows, verify a UI works end-to-end, or do end-to-end (E2E) testing. Triggers on keywords like "browser test", "E2E test", "click through", "playwright", "verify the flow", "screenshot the page". Installs and drives the Playwright CLI to let the agent act as a real browser user.
---
# Playwright CLI — agent-driven browser testing
The agent should not say "looks good to me" about a UI it never opened. Use Playwright to actually click through the flow, fill forms, assert outcomes, and screenshot the result.
## Install (first use)
If `playwright` is not on PATH, install it:
```bash
npm install -g @playwright/mcp@latest
npx playwright install --with-deps
```
`npx playwright install` downloads the browser binaries (chromium, firefox, webkit). `--with-deps` installs OS libraries they need (Linux only; on macOS it's a no-op for the deps portion).
Verify: `npx playwright --version`.
## Core CLI commands
| Task | Command |
|---|---|
| Scaffold a new test project | `npm init playwright@latest` (creates `tests/`, `playwright.config.ts`) |
| Run all tests | `npx playwright test` |
| Run one file | `npx playwright test tests/login.spec.ts` |
| Run by title grep | `npx playwright test -g "logs in"` |
| Run headed (see the browser) | `npx playwright test --headed` |
| Run with browser visible + slow | `npx playwright test --headed --workers=1` |
| UI mode (interactive watcher) | `npx playwright test --ui` |
| Trace viewer (post-mortem) | `npx playwright show-trace trace.zip` |
| Codegen a flow by clicking | `npx playwright codegen <url>` |
| Codegen to a file | `npx playwright codegen <url> -o tests/flow.spec.ts` |
| Screenshot a page | `npx playwright screenshot --browser chromium <url> out.png` |
| PDF a page | `npx playwright pdf <url> out.pdf` |
| Open a page in a real browser | `npx playwright open <url>` |
## When to use
- User says "test the login flow", "verify the checkout works", "click through and make sure nothing breaks"
- User asks to record a new E2E test from a manual flow → `playwright codegen`
- User wants a screenshot/PDF of a rendered page for verification
- After touching auth, forms, navigation, or anything with state, run the relevant spec instead of asserting "should work"
## When NOT to use
- Unit testing component logic → use the project's existing unit test runner (vitest, jest, etc.)
- API/endpoint testing → use `curl`/httpie or the API test framework already in the repo
- Load testing → Playwright is functional, not perf; suggest k6 or similar
## Writing tests (codegen first, edit second)
The fastest path to a working test is `codegen`, not hand-writing:
```bash
npx playwright codegen http://localhost:3000 -o tests/auth.spec.ts
```
Click through the flow in the browser that pops up; Playwright writes the spec live. Then edit the generated file to add assertions (`expect(locator).toHaveText(...)`, `expect(page).toHaveURL(...)`) and clean up selectors (prefer `getByRole`, `getByLabel` over CSS).
## Assertions quick reference
```ts
import { test, expect } from '@playwright/test';
test('user can log in', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('Email').fill('user@example.com');
await page.getByLabel('Password').fill('secret');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page).toHaveURL(/dashboard/);
await expect(page.getByRole('heading', { name: 'Welcome' })).toBeVisible();
});
```
## Debugging a failing test
1. `npx playwright test tests/x.spec.ts --headed --workers=1` — watch it run.
2. If still unclear, add `--trace on` then `npx playwright show-trace trace.zip`.
3. `page.pause()` in the spec drops into the Playwright Inspector (step through, try selectors live).
## Source
Referenced in https://x.com/heyshruti7/status/2069083108092350823 — "Playwright CLI — your agent tests the browser itself. No more 'looks good to me.' It actually clicks through the flow."
@@ -0,0 +1,35 @@
---
name: read-tweet
description: Use when the user asks to read, fetch, or show the content of an X (Twitter) tweet or thread by URL or ID. Triggers on x.com/twitter.com URLs or tweet IDs. Uses the local `bird` CLI to pull content via the browser cookie session.
---
# Read X/Twitter Tweet Content with bird
When the user asks to read, fetch, view, or summarize a tweet (or thread), use the locally installed `bird` CLI instead of `webfetch` — it authenticates via the active browser session and returns full tweet content + metadata.
## Commands
Use `/opt/homebrew/bin/bird` (absolute path since PATH can be sparse in non-interactive shells):
- Single tweet: `bird read <tweet-url-or-id> --json`
- Full thread/conversation: `bird thread <tweet-url-or-id> --json`
- Replies to a tweet: `bird replies <tweet-url-or-id> --json`
Prefer `--json` for parseable output (author, text, media, created_at, metrics). Drop `--json` only if the user wants pretty-printed terminal output.
## When to use
- User pastes an `x.com`/`twitter.com` URL and asks anything about it
- User references a tweet by numeric ID
- User asks for "the thread", "the replies", or "what does this tweet say"
## When NOT to use
- User asks to post, reply, like, bookmark, follow, or search tweets — use other `bird` subcommands directly (see `bird --help`)
- User asks about article content linked FROM a tweet — `bird` only returns tweet text/metadata, not outbound article bodies; fall back to `webfetch` on the linked URL
## Notes
- `bird` reads `auth_token` and `ct0` cookies from Safari/Chrome/Firefox; no paid dev account needed
- If a fetch fails with auth errors, tell the user to sign in to x.com in their browser and retry
- Quote tweets and retweets include the referenced tweet in the JSON payload
+15 -87
View File
@@ -1,52 +1,8 @@
{
"$schema": "https://opencode.ai/config.json",
"model": "talos/ornith-worker-1",
"model": "opencode-go/deepseek-v4.1-flash",
"autoupdate": false,
"providers": {
"talos": {
"name": "Talos Cluster",
"package": "@opencode-ai/ai/providers/openai-compatible",
"settings": {
"baseURL": "http://10.37.0.165:30081/v1"
},
"models": {
"ornith-worker-1": {
"modelID": "ornith-worker-1",
"name": "Ornith Worker 1 (RTX 4070 Super)",
"capabilities": {
"tools": true,
"input": ["text"],
"output": ["text"]
},
"limit": {
"context": 132768,
"output": 65536
}
}
}
},
"talos-worker-2": {
"name": "Talos Worker 2",
"package": "@opencode-ai/ai/providers/openai-compatible",
"settings": {
"baseURL": "http://10.37.0.219:30082/v1"
},
"models": {
"genesis-hermes-worker-2": {
"modelID": "/models/Hermes3.6-35B-A3B-Uncensored-Genesis-V6-APEX.gguf",
"name": "Genesis Hermes V6 APEX (RTX 3080 12GB, vision)",
"capabilities": {
"tools": true,
"input": ["text"],
"output": ["text"]
},
"limit": {
"context": 131072,
"output": 65536
}
}
}
},
"omlx": {
"name": "oMLX (Local)",
"package": "@opencode-ai/ai/providers/openai-compatible",
@@ -54,48 +10,9 @@
"baseURL": "http://localhost:8000/v1"
},
"models": {
"ornith-35b": {
"modelID": "Ornith-35B",
"name": "Ornith 35B (Qwen3.5 MoE, 4-bit, 131K ctx)",
"capabilities": {
"tools": true,
"input": ["text"],
"output": ["text"]
},
"limit": {
"context": 131072,
"output": 65536
}
},
"ornith-5bit": {
"modelID": "Ornith-1.0-35B-5bit-mlx",
"name": "Ornith 35B (5-bit, 262K ctx)",
"capabilities": {
"tools": true,
"input": ["text"],
"output": ["text"]
},
"limit": {
"context": 262144,
"output": 65536
}
},
"ternary-bonsai": {
"modelID": "Ternary-Bonsai-27B-mlx-2bit",
"name": "Ternary Bonsai 27B (2-bit, ternary weights)",
"capabilities": {
"tools": true,
"input": ["text"],
"output": ["text"]
},
"limit": {
"context": 131072,
"output": 65536
}
},
"dagger-qwen36-27b": {
"modelID": "Dagger-Qwen3.6-27B-MLX",
"name": "Dagger Qwen3.6 27B MLX (M5, 32GB)",
"qwen3.6-35b": {
"modelID": "Jundot/Qwen3.6-35B-A3B-oQ4-mtp",
"name": "Qwen 3.6 35B (o4-mtp)",
"capabilities": {
"tools": true,
"input": ["text"],
@@ -107,6 +24,17 @@
}
}
}
},
"opencode-go": {
"models": {
"gpt-6-luna": {
"limit": {
"context": 256000,
"input": 256000,
"output": 128000
}
}
}
}
}
}
+14 -23
View File
@@ -1,45 +1,36 @@
# Grok Build user config - managed via home-manager (edit here, then rebuild if needed).
# Source of truth: home/.grok/config.toml in dotfiles.
[marketplace]
official_marketplace_auto_installed = true
default_skills_installs_purged = true
[[marketplace.sources]]
name = "xAI Official"
git = "https://github.com/xai-org/plugin-marketplace.git"
[models]
default = "ornith"
default = "grok-4.5"
default_reasoning_effort = "high"
[model.ornith]
model = "/models/ornith-1.0-35b-Q6_K.gguf"
base_url = "http://10.37.0.165:30081/v1"
name = "Ornith 1.0 35B (Talos)"
description = "Local Ornith-1.0-35B Q6_K via llama.cpp on Talos worker 1 (RTX 4070 Super)"
[model.qwen]
model = "Jundot/Qwen3.6-35B-A3B-oQ4-mtp"
base_url = "http://localhost:8000/v1"
name = "Qwen 3.6 35B (o4-mtp)"
description = "Qwen3.6-35B-A3B with o4-mtp on oMLX"
api_backend = "chat_completions"
temperature = 0.7
top_p = 0.95
context_window = 132768
max_completion_tokens = 16384
[model.genesis]
model = "/models/Hermes3.6-35B-A3B-Uncensored-Genesis-V6-APEX.gguf"
base_url = "http://10.37.0.219:30082/v1"
name = "Genesis Hermes V6 (Talos W2)"
description = "Local Qwen3.6-35B-A3B Genesis Hermes V6 APEX + vision via llama.cpp on Talos worker 2 (RTX 3080)"
api_backend = "chat_completions"
temperature = 0.7
top_p = 0.95
context_window = 131072
max_completion_tokens = 16384
context_window = 65536
max_completion_tokens = 65536
[ui]
theme = "rosepine"
max_thoughts_width = 120
fork_secondary_model = "grok-build"
permission_mode = "always-approve"
permission_mode = "auto"
yolo = false
compact_mode = false
[cli]
installer = "internal"
[privacy]
privacy_banner_acked = "2026-09-24T02:33:29Z"
+39 -57
View File
@@ -1,57 +1,5 @@
{
"providers": {
"genesis": {
"baseUrl": "http://10.37.0.219:30082/v1",
"api": "openai-completions",
"apiKey": "none",
"compat": {
"maxTokensField": "max_tokens"
},
"models": [
{
"id": "genesis",
"name": "Hermes3.6-35B-A3B-Uncensored-Genesis-V6-APEX (Local)",
"reasoning": false,
"input": [
"text"
],
"contextWindow": 132864,
"maxTokens": 32768,
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
}
}
]
},
"ornith": {
"baseUrl": "http://10.37.0.165:30081/v1",
"api": "openai-completions",
"apiKey": "none",
"compat": {
"maxTokensField": "max_tokens"
},
"models": [
{
"id": "ornith",
"name": "Ornith 1.0 35B (Local)",
"reasoning": false,
"input": [
"text"
],
"contextWindow": 132864,
"maxTokens": 32768,
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
}
}
]
},
"omlx": {
"baseUrl": "http://localhost:8000/v1",
"api": "openai-completions",
@@ -61,12 +9,14 @@
},
"models": [
{
"id": "Dagger-Qwen3.6-27B-MLX",
"name": "Dagger Qwen3.6 27B MLX (M5, 32GB)",
"reasoning": true,
"input": ["text"],
"id": "Jundot/Qwen3.6-35B-A3B-oQ4-mtp",
"name": "Qwen 3.6 35B (o4-mtp)",
"reasoning": false,
"input": [
"text"
],
"contextWindow": 65536,
"maxTokens": 32768,
"maxTokens": 65536,
"cost": {
"input": 0,
"output": 0,
@@ -88,6 +38,38 @@
"contextWindow": 272000
}
}
},
"opencode-go": {
"modelOverrides": {
"deepseek-v4-flash": {
"contextWindow": 256000
},
"deepseek-v4-flash-vision-exp": {
"contextWindow": 256000
},
"deepseek-v4-pro": {
"contextWindow": 256000
},
"deepseek-v4.1-flash": {
"contextWindow": 256000
}
}
},
"opencode": {
"modelOverrides": {
"deepseek-v4-flash": {
"contextWindow": 256000
},
"deepseek-v4-flash-vision-exp": {
"contextWindow": 256000
},
"deepseek-v4-pro": {
"contextWindow": 256000
},
"deepseek-v4.1-flash": {
"contextWindow": 256000
}
}
}
}
}
+7 -17
View File
@@ -1,23 +1,13 @@
{
"lastChangelogVersion": "0.84.1",
"lastChangelogVersion": "1.0.4",
"theme": "rose-pine-moon",
"defaultProvider": "ornith",
"defaultModel": "ornith",
"defaultProvider": "opencode-go",
"defaultModel": "deepseek-v4.1-flash",
"models": [
{
"name": "Genesis (Local)",
"provider": "genesis",
"model": "/models/Hermes3.6-35B-A3B-Uncensored-Genesis-V6-APEX.gguf"
},
{
"name": "Ornith 1.0 35B (Local)",
"provider": "ornith",
"model": "/models/ornith-1.0-35b-Q6_K.gguf"
},
{
"name": "Dagger Qwen3.6 27B MLX (M5)",
"name": "Qwen 3.6 35B (o4-mtp)",
"provider": "omlx",
"model": "Dagger-Qwen3.6-27B-MLX"
"model": "Jundot/Qwen3.6-35B-A3B-oQ4-mtp"
}
],
"compaction": {
@@ -27,8 +17,8 @@
},
"packages": [
"npm:pi-context",
"npm:pi-web-access@0.14.0",
"npm:@ryan_nookpi/pi-extension-codex-fast-mode@0.2.6",
"npm:pi-web-access@0.36.0",
"npm:@ryan_nookpi/pi-extension-codex-fast-mode@0.2.8",
"git:github.com/algal/pi-openai-server-compaction@c6d593087709e9481223dc6c6c2269b371b5e055",
"../../.automaton/plugins/pi-read-tweet"
],
+16
View File
@@ -12,3 +12,19 @@
- 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.
## Response style (ASD-STE100, evidence-backed 2026-10-06)
Source: 10 randomly sampled interactive transcripts from the past week (seed 20261006; population was 11: 8 Codex sessions Oct 3-4, 3 opencode backpass sessions Oct 5). The sampled assistant texts repeatedly violated the same STE rules at the exact points where the conversation stalled or confused. Follow these rules in every assistant response:
- Short sentences: max 20 words per instruction, 25 per explanation (STE 5.1/6.3). Observed worst case was a 57-word status sentence; split it instead.
- One instruction per sentence; use a vertical list for multi-step directions (STE 5.2/4.3).
- Instructions in the imperative; status in simple present or past. Report results, do not narrate intentions ("Let me X" appeared ~20 times in one session) (STE 5.3/3.2).
- Active voice with a named agent. "Commands are being rejected" hid who rejects them (STE 3.6).
- Condition before command: "If X, do Y" (STE 5.4). A buried proxy precondition sent the user to a dead URL first.
- One name per thing for the whole response (STE 1.11/9.4). Observed rotation: proxy/server/relay and page/app/calculator for single objects.
- Plain verbs, no phrasal verbs or jargon verbs: fall back, fill in, queued, wiring, smoke-test (STE 9.3).
- No -ing forms as verbs or subjects, no contractions, no dropped objects ("Confirming:" with no object; "isn't running") (STE 3.5/4.2).
- Only can/will/must as modals. The would/could/should sentences were exactly the untested claims that later confused (STE 3.2).
- Max three words per noun stack; define thread slang on first use (STE 2.1/1.10).
- No semicolons, including inside JSON rationale strings; write two sentences (STE 8.1).
- American spelling ("colour-coded" slipped through) and keep the articles a/the (STE 1.14/4.5).
+66
View File
@@ -0,0 +1,66 @@
#!/usr/bin/env python3
"""Reconcile the OpenCode Go fragment into Codex's live config.
Codex (the ChatGPT desktop app and the CLI) both read ~/.codex/config.toml, and
the ChatGPT app owns and rewrites that file. So home-manager must not symlink it.
Instead this script merges the repo fragment (argv[1]) into the live file
(argv[2]) on every activation:
* only the keys the fragment defines are forced (fragment wins),
* the whole model_providers.opencode-go table is replaced, so stale keys such
as a previous `requires_openai_auth = true` are dropped,
* everything the app wrote itself ([desktop], [plugins], [mcp_servers],
[marketplaces], ...) is preserved.
Run with a Python that has tomlkit (home.activation.codexOpenCodeGo does).
"""
import copy
import os
import sys
import tomlkit
def _table(doc, key):
if key not in doc:
doc[key] = tomlkit.table()
return doc[key]
def main() -> int:
fragment_path, live_path = sys.argv[1], sys.argv[2]
with open(fragment_path) as fh:
fragment = tomlkit.parse(fh.read())
if os.path.exists(live_path):
with open(live_path) as fh:
live = tomlkit.parse(fh.read())
else:
live = tomlkit.document()
# Root keys the fragment owns.
for key in ("model", "model_provider"):
if key in fragment:
live[key] = fragment[key]
# Replace the fragment provider tables wholesale (drops stale keys).
incoming = fragment.get("model_providers") or {}
target = _table(live, "model_providers")
for name, table in incoming.items():
target[name] = copy.deepcopy(table)
# Codex 0.160+ rejects the legacy [profiles.*] table; profiles now live in
# $CODEX_HOME/<name>.config.toml. Drop one if an older config left it behind.
if "profiles" in live:
del live["profiles"]
with open(live_path, "w") as fh:
fh.write(tomlkit.dumps(live))
return 0
if __name__ == "__main__":
raise SystemExit(main())
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
# Print the OpenCode Go API key on stdout.
#
# Codex uses this as its command-backed provider auth
# ([model_providers.opencode-go.auth].command). That keeps ~/.codex/auth.json
# untouched in ChatGPT mode, so the ChatGPT desktop app and the OpenCode Go
# subscription coexist in the same Codex install. The key is never committed; it
# is read live from the opencode auth store (the same source oc2 and Hermes use).
set -eu
auth="${XDG_DATA_HOME:-$HOME/.local/share}/opencode/auth.json"
py="$(command -v python3 || true)"
if [ -z "$py" ]; then
py=/usr/bin/python3
fi
exec "$py" -c 'import json, sys; print(json.load(open(sys.argv[1]))["opencode-go"]["key"])' "$auth"
+576
View File
@@ -0,0 +1,576 @@
#!/usr/bin/env bash
# security-audit-sandbox - OS-enforced Docker sandbox for the security-audit skill.
#
# Copies target code into a scratch directory and runs it in a locked-down
# container: no network, read-only root, scratch-only writes, dropped
# capabilities, no-new-privileges, and CPU/memory/PID limits.
#
# Usage:
# security-audit-sandbox start <app> [--image <image>] [--exclude <pattern>]...
# security-audit-sandbox exec <app> [--timeout <seconds>] -- <command>...
# security-audit-sandbox stop <app> [--keep]
# security-audit-sandbox status <app>
# security-audit-sandbox --help
#
# Optional <app>/security-audit.conf (simple KEY=value lines, never sourced):
# IMAGE=node:22-bookworm
# EXCLUDE="node_modules dist coverage"
#
# Default exclusions: .git, .env*, and the top-level /data directory.
# The original app directory is never mounted into the container.
set -euo pipefail
PROG=security-audit-sandbox
RUN_PARENT="$HOME/security-audit-runs"
STATE_ROOT="${XDG_STATE_HOME:-$HOME/.local/state}/security-audit-sandbox"
CONF_NAME=security-audit.conf
DEFAULT_TIMEOUT=600
die() {
printf '%s: %s\n' "$PROG" "$*" >&2
exit 1
}
usage() {
cat <<'EOF'
Copy target code into a scratch directory and run it in a locked-down Docker
container: no network, read-only root, scratch-only writes, dropped
capabilities, no-new-privileges, and CPU/memory/PID limits.
Usage:
security-audit-sandbox start <app> [--image <image>] [--exclude <pattern>]...
Copy <app> to $HOME/security-audit-runs/<slug>.XXXXXX and start the
container. Repeat --exclude to add rsync exclusions.
security-audit-sandbox exec <app> [--timeout <seconds>] -- <command>...
Run <command> inside the running container from /scratch/app under
`timeout --signal=KILL`. Default timeout: 600 seconds.
security-audit-sandbox stop <app> [--keep]
Remove the container and state file. Remove the run directory too,
unless --keep is given.
security-audit-sandbox status <app>
Print the container name, run directory, and whether it is running.
security-audit-sandbox --help
Show this help.
Optional <app>/security-audit.conf (simple KEY=value lines, never sourced):
IMAGE=node:22-bookworm
EXCLUDE="node_modules dist coverage"
Image resolution order:
1. --image
2. IMAGE= in security-audit.conf
3. package.json -> node:22-bookworm
pyproject.toml or requirements.txt -> python:3.12-slim
go.mod -> golang:1.24-bookworm
Cargo.toml -> rust:1-bookworm
Gemfile -> ruby:3.3-bookworm
Always excluded from the copy: .git, .env*, and the top-level /data directory.
The original app directory is never mounted into the container.
Docker Desktop on macOS may refuse the fsize ulimit. The wrapper then starts
the container without that one limit and prints a warning; nofile stays in
place. On Linux hosts that accept fsize, the 100 MiB file-size cap is applied.
EOF
}
need_docker() {
command -v docker >/dev/null 2>&1 || die "docker is not installed or not on PATH"
docker info >/dev/null 2>&1 || die "cannot reach the Docker daemon; is Docker running?"
}
canonical_app() {
local app=$1
[ -d "$app" ] || die "app directory not found: $app"
(cd -P "$app" && pwd -P)
}
app_slug() {
local name
name=$(basename "$1")
name=${name//[^A-Za-z0-9_.-]/-}
[ -n "$name" ] || name=app
printf '%s' "$name"
}
app_hash() {
printf '%s' "$1" | shasum -a 256 | cut -c1-8
}
state_file_for() {
local app=$1 slug hash
slug=$(app_slug "$app")
hash=$(app_hash "$app")
printf '%s/state-%s-%s' "$STATE_ROOT" "$slug" "$hash"
}
container_name_for() {
local app=$1 slug hash
slug=$(app_slug "$app")
hash=$(app_hash "$app")
printf 'security-audit-%s-%s' "$slug" "$hash"
}
strip_quotes() {
local value=$1
case $value in
\"*\") value=${value#\"}; value=${value%\"} ;;
\'*\') value=${value#\'}; value=${value%\'} ;;
esac
printf '%s' "$value"
}
trim() {
local value=$1
value=${value#"${value%%[![:space:]]*}"}
value=${value%"${value##*[![:space:]]}"}
printf '%s' "$value"
}
CONF_IMAGE=""
CONF_EXCLUDE=""
load_conf() {
local app=$1 conf line key value
conf="$app/$CONF_NAME"
[ -f "$conf" ] || return 0
while IFS= read -r line || [ -n "$line" ]; do
line=${line%$'\r'}
line=$(trim "$line")
case $line in
''|'#'*) continue ;;
esac
case $line in
*=*) ;;
*) continue ;;
esac
key=$(trim "${line%%=*}")
value=$(trim "${line#*=}")
value=$(strip_quotes "$value")
case $key in
IMAGE) CONF_IMAGE=$value ;;
EXCLUDE) CONF_EXCLUDE="${CONF_EXCLUDE:+$CONF_EXCLUDE }$value" ;;
esac
done < "$conf"
}
infer_image() {
local app=$1
if [ -f "$app/package.json" ]; then
printf 'node:22-bookworm'
elif [ -f "$app/pyproject.toml" ] || [ -f "$app/requirements.txt" ]; then
printf 'python:3.12-slim'
elif [ -f "$app/go.mod" ]; then
printf 'golang:1.24-bookworm'
elif [ -f "$app/Cargo.toml" ]; then
printf 'rust:1-bookworm'
elif [ -f "$app/Gemfile" ]; then
printf 'ruby:3.3-bookworm'
else
printf ''
fi
}
load_state() {
local app=$1 file key value
file=$(state_file_for "$app")
[ -f "$file" ] || return 1
STATE_CONTAINER=""
STATE_RUN_DIR=""
STATE_APP=""
STATE_IMAGE=""
STATE_FSIZE=""
while IFS='=' read -r key value || [ -n "$key" ]; do
case $key in
CONTAINER) STATE_CONTAINER=$value ;;
RUN_DIR) STATE_RUN_DIR=$value ;;
APP) STATE_APP=$value ;;
IMAGE) STATE_IMAGE=$value ;;
FSIZE) STATE_FSIZE=$value ;;
esac
done < "$file"
[ -n "$STATE_CONTAINER" ] && [ -n "$STATE_RUN_DIR" ]
}
container_running() {
local name=$1 state
state=$(docker inspect -f '{{.State.Running}}' "$name" 2>/dev/null) || return 1
[ "$state" = "true" ]
}
container_exists() {
docker inspect "$1" >/dev/null 2>&1
}
WALL_CLOCK_PROBE_SECS=2
check_wall_clock_guard() {
local container=$1 status elapsed out
SECONDS=0
set +e
out=$(docker exec "$container" timeout --signal=KILL "$WALL_CLOCK_PROBE_SECS" sleep 10 2>&1)
status=$?
set -e
elapsed=$SECONDS
case $status in
124|137) ;;
*)
[ -z "$out" ] || printf '%s\n' "$out" >&2
die "image $STATE_IMAGE's 'timeout' does not enforce '--signal=KILL'; refusing to run without a wall-clock limit"
;;
esac
if [ "$elapsed" -lt 1 ] || [ "$elapsed" -gt $((WALL_CLOCK_PROBE_SECS + 4)) ]; then
die "image $STATE_IMAGE's 'timeout' did not stop the probe after ${WALL_CLOCK_PROBE_SECS}s; refusing to run without a wall-clock limit"
fi
}
check_run_dir() {
local dir=$1
case $dir in
"$RUN_PARENT"/*) ;;
*) die "refusing to remove unexpected run directory: $dir" ;;
esac
}
rm_run_dir() {
local dir=$1
check_run_dir "$dir"
rm -rf "$dir"
}
cleanup_failed_start() {
local run_dir=$1 state_file=$2
[ -n "$run_dir" ] && [ -d "$run_dir" ] && rm_run_dir "$run_dir"
[ -n "$state_file" ] && rm -f "$state_file"
}
cmd_start() {
local app_arg="" image_opt="" conf_image inferred
local app app_dir run_dir container state_file fsize_note out
local -a cli_excludes rsync_cmd docker_cmd
cli_excludes=()
while [ $# -gt 0 ]; do
case $1 in
--image)
[ $# -ge 2 ] || die "--image needs a value"
image_opt=$2
shift 2
;;
--image=*)
image_opt=${1#--image=}
shift
;;
--exclude)
[ $# -ge 2 ] || die "--exclude needs a value"
cli_excludes+=("$2")
shift 2
;;
--exclude=*)
cli_excludes+=("${1#--exclude=}")
shift
;;
-h|--help)
usage
exit 0
;;
-*)
die "unknown option for start: $1"
;;
*)
[ -z "$app_arg" ] || die "unexpected argument for start: $1"
app_arg=$1
shift
;;
esac
done
[ -n "$app_arg" ] || die "start needs an app directory"
need_docker
app_dir=$(canonical_app "$app_arg")
load_conf "$app_dir"
conf_image=$CONF_IMAGE
if [ -n "$image_opt" ]; then
image=$image_opt
elif [ -n "$conf_image" ]; then
image=$conf_image
else
inferred=$(infer_image "$app_dir")
[ -n "$inferred" ] || die "cannot infer an image for $app_dir; pass --image or set IMAGE= in $CONF_NAME"
image=$inferred
fi
state_file=$(state_file_for "$app_dir")
container=$(container_name_for "$app_dir")
if load_state "$app_dir"; then
if container_running "$STATE_CONTAINER"; then
die "a sandbox for $app_dir is already running (container $STATE_CONTAINER); run '$PROG stop $app_arg' first"
fi
if container_exists "$STATE_CONTAINER"; then
docker rm -f "$STATE_CONTAINER" >/dev/null 2>&1 || true
fi
rm -f "$state_file"
printf '%s: removed stale state for stopped container %s\n' "$PROG" "$STATE_CONTAINER" >&2
fi
if container_exists "$container"; then
die "container $container already exists but is not recorded in state; remove it with 'docker rm -f $container'"
fi
mkdir -p "$RUN_PARENT" || die "cannot create $RUN_PARENT"
run_dir=$(mktemp -d "$RUN_PARENT/$(app_slug "$app_dir").XXXXXX") || die "cannot create run directory under $RUN_PARENT"
mkdir -p "$run_dir/app" "$run_dir/home" "$run_dir/tmp" "$run_dir/cache" || {
cleanup_failed_start "$run_dir" "$state_file"
die "cannot prepare run directory $run_dir"
}
rsync_cmd=(rsync -a --exclude=.git --exclude='.env*' --exclude=/data)
if [ -n "$CONF_EXCLUDE" ]; then
local conf_pat
local -a conf_pats
read -r -a conf_pats <<< "$CONF_EXCLUDE"
for conf_pat in "${conf_pats[@]}"; do
rsync_cmd+=("--exclude=$conf_pat")
done
fi
if [ ${#cli_excludes[@]} -gt 0 ]; then
local cli_pat
for cli_pat in "${cli_excludes[@]}"; do
rsync_cmd+=("--exclude=$cli_pat")
done
fi
if ! "${rsync_cmd[@]}" "$app_dir/" "$run_dir/app/"; then
cleanup_failed_start "$run_dir" "$state_file"
die "rsync failed while copying $app_dir"
fi
docker_cmd=(docker run -d --name "$container"
--network none
--read-only
-v "$run_dir:/scratch"
--tmpfs '/tmp:rw,nosuid,size=512m'
-e HOME=/scratch/home
-e TMPDIR=/scratch/tmp
-e XDG_CACHE_HOME=/scratch/cache
--user "$(id -u):$(id -g)"
--memory 4g
--cpus 2
--pids-limit 256
--cap-drop ALL
--security-opt no-new-privileges
--init
--ulimit nofile=1024:1024
--workdir /scratch/app)
fsize_note=""
if out=$("${docker_cmd[@]}" --ulimit fsize=104857600 "$image" sleep infinity 2>&1); then
STATE_FSIZE=on
fsize_note=on
else
case $out in
*fsize*|*FSIZE*)
printf '%s: Docker refused the fsize ulimit; starting without the file-size cap\n' "$PROG" >&2
if out=$("${docker_cmd[@]}" "$image" sleep infinity 2>&1); then
STATE_FSIZE=off
fsize_note=off
else
cleanup_failed_start "$run_dir" "$state_file"
die "docker run failed: $out"
fi
;;
*)
cleanup_failed_start "$run_dir" "$state_file"
die "docker run failed: $out"
;;
esac
fi
mkdir -p "$STATE_ROOT" || {
docker rm -f "$container" >/dev/null 2>&1 || true
cleanup_failed_start "$run_dir" "$state_file"
die "cannot create state directory $STATE_ROOT"
}
if ! {
printf 'CONTAINER=%s\n' "$container"
printf 'RUN_DIR=%s\n' "$run_dir"
printf 'APP=%s\n' "$app_dir"
printf 'IMAGE=%s\n' "$image"
printf 'FSIZE=%s\n' "$STATE_FSIZE"
} > "$state_file"; then
docker rm -f "$container" >/dev/null 2>&1 || true
cleanup_failed_start "$run_dir" "$state_file"
die "cannot write state file $state_file"
fi
printf 'container: %s\n' "$container"
printf 'run dir: %s\n' "$run_dir"
printf 'scratch: %s\n' "$run_dir (mounted at /scratch)"
printf 'app copy: %s/app (mounted at /scratch/app)\n' "$run_dir"
printf 'image: %s\n' "$image"
if [ "$fsize_note" = off ]; then
printf 'note: fsize ulimit refused by Docker; no file-size cap applied\n'
fi
}
cmd_exec() {
local app_arg="" timeout_secs=$DEFAULT_TIMEOUT saw_sep=0
local app_dir container
while [ $# -gt 0 ]; do
case $1 in
--timeout)
[ $# -ge 2 ] || die "--timeout needs a value"
timeout_secs=$2
shift 2
;;
--timeout=*)
timeout_secs=${1#--timeout=}
shift
;;
--)
shift
saw_sep=1
break
;;
-h|--help)
usage
exit 0
;;
-*)
die "unknown option for exec: $1"
;;
*)
[ -z "$app_arg" ] || die "unexpected argument for exec: $1"
app_arg=$1
shift
;;
esac
done
[ -n "$app_arg" ] || die "exec needs an app directory"
[ "$saw_sep" = 1 ] || die "exec needs -- before the command"
[ $# -gt 0 ] || die "exec needs a command after --"
case $timeout_secs in
''|*[!0-9]*) die "--timeout must be a positive integer number of seconds" ;;
esac
[ "$timeout_secs" -gt 0 ] || die "--timeout must be greater than zero"
need_docker
app_dir=$(canonical_app "$app_arg")
load_state "$app_dir" || die "no sandbox recorded for $app_dir; run '$PROG start $app_arg' first"
container=$STATE_CONTAINER
container_running "$container" || die "container $container is not running; run '$PROG stop $app_arg' and start again"
check_wall_clock_guard "$container"
docker exec --workdir /scratch/app "$container" timeout --signal=KILL "$timeout_secs" "$@"
}
cmd_stop() {
local app_arg="" keep=0 app_dir run_dir
while [ $# -gt 0 ]; do
case $1 in
--keep)
keep=1
shift
;;
-h|--help)
usage
exit 0
;;
-*)
die "unknown option for stop: $1"
;;
*)
[ -z "$app_arg" ] || die "unexpected argument for stop: $1"
app_arg=$1
shift
;;
esac
done
[ -n "$app_arg" ] || die "stop needs an app directory"
app_dir=$(canonical_app "$app_arg")
load_state "$app_dir" || die "no sandbox recorded for $app_dir"
run_dir=$STATE_RUN_DIR
[ "$keep" = 1 ] || check_run_dir "$run_dir"
docker rm -f "$STATE_CONTAINER" >/dev/null 2>&1 || true
rm -f "$(state_file_for "$app_dir")"
if [ "$keep" = 1 ]; then
printf 'removed container %s; kept run dir %s\n' "$STATE_CONTAINER" "$run_dir"
else
rm_run_dir "$run_dir"
printf 'removed container %s and run dir %s\n' "$STATE_CONTAINER" "$run_dir"
fi
}
cmd_status() {
local app_arg="" app_dir running
while [ $# -gt 0 ]; do
case $1 in
-h|--help)
usage
exit 0
;;
-*)
die "unknown option for status: $1"
;;
*)
[ -z "$app_arg" ] || die "unexpected argument for status: $1"
app_arg=$1
shift
;;
esac
done
[ -n "$app_arg" ] || die "status needs an app directory"
app_dir=$(canonical_app "$app_arg")
load_state "$app_dir" || die "no sandbox recorded for $app_dir"
if container_running "$STATE_CONTAINER"; then
running=running
elif container_exists "$STATE_CONTAINER"; then
running=stopped
else
running=missing
fi
printf 'container: %s\n' "$STATE_CONTAINER"
printf 'run dir: %s\n' "$STATE_RUN_DIR"
printf 'app: %s\n' "$STATE_APP"
printf 'image: %s\n' "$STATE_IMAGE"
printf 'fsize cap: %s\n' "$STATE_FSIZE"
printf 'state: %s\n' "$running"
}
main() {
[ $# -gt 0 ] || {
usage >&2
exit 1
}
local cmd=$1
shift
case $cmd in
start) cmd_start "$@" ;;
exec) cmd_exec "$@" ;;
stop) cmd_stop "$@" ;;
status) cmd_status "$@" ;;
-h|--help|help) usage ;;
*)
die "unknown command: $cmd (try --help)"
;;
esac
}
main "$@"
+85
View File
@@ -14,3 +14,88 @@ The firstmate crew dispatch + Gitea PR helper are wired by `darwin-rebuild`, but
git remote set-url origin http://unraid.local:3003/transnet/investor-flow
Verify: `fm` launches OpenCode 2 as the first mate (isolated `~/.config/opencode2`); `oc2 --version` prints an OpenCode 2 version; `pi --list-models mimo` shows `opencode-go/mimo-v2.5-pro`; `tea pulls list --repo transnet/investor-flow` works.
## security-audit skill (agent security reviews)
`home.activation.securityAuditSkill` installs Cloudflare's `security-audit` skill from `https://github.com/cloudflare/security-audit-skill` so the coding agents can run a structured vulnerability audit. The exact command:
```bash
/opt/homebrew/bin/npx --yes skills add https://github.com/cloudflare/security-audit-skill \
--skill security-audit --global \
--agent claude-code codex pi opencode --yes
```
The install needs Homebrew's `node`, which `configuration.nix` already declares, plus the system Git at `/usr/bin/git` for the clone. Renew or update the skill by hand with:
```bash
/opt/homebrew/bin/npx --yes skills update security-audit --global --yes
```
Agent scope: the Skills CLI installs the bundle once under `~/.agents/skills/security-audit`, the universal user-level directory that Codex, Pi, and OpenCode read, and it links that directory into `~/.claude/skills` for Claude Code. Grok Build is out of scope for this install: its skill directory is `~/.grok/skills`, and the CLI only populates it when `grok` is named in `--agent`. The install leaves `~/.config/opencode/skills` alone because home-manager owns that path with `force = true` and `mkOutOfStoreSymlink` into the mutable dotfiles checkout: a rebuild would clobber the CLI's link, and CLI writes would land in the git checkout. That is why the install uses the shared directory instead.
The activation is idempotent and non-interactive: it skips the install when both the canonical copy and the Claude Code link exist, and a failed download only warns so the rebuild still completes. Trigger it in an agent with "security audit this codebase".
Sandbox: the skill's README requires an OS-enforced sandbox (no external network, sanitized environment, resource limits, scratch-only writes) before it may run target-controlled builds, tests, browser automation, emulators, fuzzers, or fixtures. `security-audit-sandbox` below provides that sandbox. Run target code only through it; otherwise the workflow keeps such leads as `needs_validation` rather than executing target code.
## Security audit sandbox
`security-audit-sandbox` (installed as `~/.local/bin/security-audit-sandbox`) runs untrusted target code in a Docker container. It is for target code only: do not run the audit agent or your own tools inside it.
```bash
security-audit-sandbox start ~/code/myapp [--image node:22-bookworm] [--exclude dist]...
security-audit-sandbox exec ~/code/myapp [--timeout 600] -- npm test
security-audit-sandbox stop ~/code/myapp [--keep]
security-audit-sandbox status ~/code/myapp
```
`start` canonicalizes the app path, copies the app to `~/security-audit-runs/<slug>.XXXXXX`, and starts a detached container. The original app directory is never mounted into the container, so the copy is the only thing the target code can see.
Image resolution order:
1. `--image`
2. `IMAGE=` in the app's `security-audit.conf`
3. Inference: `package.json` gives `node:22-bookworm`, `pyproject.toml` or `requirements.txt` gives `python:3.12-slim`, `go.mod` gives `golang:1.24-bookworm`, `Cargo.toml` gives `rust:1-bookworm`, and `Gemfile` gives `ruby:3.3-bookworm`.
`start` stops with an error when nothing resolves an image. To support another runtime, add a marker file mapping or pass `--image`.
The optional `security-audit.conf` in the app root holds simple `KEY=value` lines. It is parsed, never sourced:
```ini
IMAGE=node:22-bookworm
EXCLUDE="node_modules dist coverage"
```
`EXCLUDE=` is a whitespace-separated list, and the key may be repeated: every `EXCLUDE=` line applies. CLI `--exclude` patterns are added on top of it. The copy always excludes `.git`, `.env*`, and the top-level `/data` directory, so secrets and live data stay on the host.
Container controls:
- `--network none`: no external network, only loopback for local tests.
- `--read-only` root with writes limited to the bind-mounted scratch directory at `/scratch`, plus a 512 MiB tmpfs at `/tmp`.
- `HOME=/scratch/home`, `TMPDIR=/scratch/tmp`, and `XDG_CACHE_HOME=/scratch/cache`.
- Runs as your host UID:GID, with `--cap-drop ALL`, `no-new-privileges`, and `--init`.
- `--memory 4g`, `--cpus 2`, `--pids-limit 256`, and `nofile=1024:1024`.
- `fsize=104857600` (100 MiB) when the Docker host accepts it. Docker Desktop on macOS may refuse `fsize`; the wrapper then starts without only that cap and prints a warning.
`exec` runs the command from `/scratch/app` under `timeout --signal=KILL`, default 600 seconds. It passes no host environment variables. If the image has no `timeout` binary, or its `timeout` does not enforce the `--signal=KILL` wall-clock limit, `exec` refuses to run rather than dropping the limit.
`stop` removes the container, the state file, and the run directory. Pass `--keep` to keep the run directory for inspection. State lives under `${XDG_STATE_HOME:-~/.local/state}/security-audit-sandbox` and is keyed by the canonical app path, so `exec`, `stop`, and `status` find the same run.
Use dummy data only. The exclusions cover common secrets and the top-level `data` directory, not every possible secret path. Review the copied tree, or add `--exclude` patterns, before you run a target that reads credentials from unexpected places. Audit findings do not belong in this repo or in the run directory.
## OpenSuperWhisper (local voice input)
Hold a shortcut, speak, release, and the transcript pastes into the focused app. Everything runs on the Mac: no audio or transcript leaves the machine.
First run:
1. The `opensuperwhisper` cask is installed and `home.activation.openSuperWhisper` pre-downloads the model to `~/Library/Application Support/ru.starmel.OpenSuperWhisper/whisper-models/ggml-large-v3-turbo.bin`. It selects "Whisper V3 Large" only when no model is selected or the selected file is gone, so a model you pick in the app stays selected.
2. Open the app. Onboarding should already show "Whisper V3 Large" as downloaded.
3. Grant **Microphone**, **Accessibility**, and **Input Monitoring** when macOS asks. Input Monitoring is needed because the trigger is Right Option, a single modifier key.
4. Keep the Right Option trigger (or change it in the app's settings). Hold it, speak, release. Auto-paste puts the text into the focused terminal or editor.
Notes:
- A fresh install starts with Option plus backtick instead of Right Option, and that combination needs no Input Monitoring. The activation never writes the trigger, the language, or the paste settings, so whatever you choose in the app survives the next rebuild.
- The model is local-only (about 1.6 GB). If the download failed during the rebuild, rerun `./rebuild.sh` or download the large Turbo V3 model ("Turbo V3 large" in the app's Settings) by hand.
- Voice is for prompts and prose. Type URLs, file paths, and exact identifiers yourself.
- The first-run steps above are manual on purpose: macOS TCC permissions cannot be granted declaratively.
+31 -1
View File
@@ -1,10 +1,36 @@
#!/usr/bin/env bash
# Rebuild nix-darwin + home-manager. Rotates stale home-manager *.backup files
# so a second switch never fails with "would be clobbered".
# Also upgrades grok-build and installs OpenCode 1.x (stable CLI for free-tier).
set -euo pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
ln -sfn "$DIR" ~/.dotfiles
# Upgrade grok-build to latest (Homebrew cask).
# Skip if Homebrew API is unreachable (DNS/network issues).
echo "==> Upgrading grok-build..."
if brew upgrade grok-build 2>&1; then
echo "==> grok-build upgrade complete"
else
echo "==> WARNING: grok-build upgrade failed (network issue). Skipping."
fi
# Install OpenCode 1.x (stable CLI, binary "opencode") if absent.
# Required for free-tier models; opencode2 beta returns HTTP 426 on those endpoints.
# Uses Homebrew's npm (not Nix's npm) to avoid EACCES on the store.
# Skip if npm is unavailable (e.g., network issues preventing fetch).
OPENCODE_BIN=/opt/homebrew/bin/opencode
if [ ! -x "$OPENCODE_BIN" ]; then
echo "==> Installing OpenCode 1.x (stable) via Homebrew npm..."
if /opt/homebrew/bin/npm install -g --allow-scripts=opencode-ai opencode-ai@1.18 2>&1; then
echo "==> OpenCode 1.x installed successfully"
else
echo "==> WARNING: OpenCode 1.x installation failed (network issue). Skipping."
fi
else
echo "==> OpenCode 1.x already installed: $(${OPENCODE_BIN} --version)"
fi
stamp="$(date +%Y%m%d-%H%M%S)"
# Paths home-manager manages via home.file (regular files become out-of-store symlinks).
managed=(
@@ -13,10 +39,14 @@ managed=(
"$HOME/.claude/settings.json"
"$HOME/.claude/CLAUDE.md"
"$HOME/.codex/AGENTS.md"
"$HOME/.codex/luna.config.toml"
"$HOME/.config/herdr/config.toml"
"$HOME/.config/opencode/AGENTS.md"
"$HOME/.config/opencode/opencode.json"
"$HOME/.config/opencode2/opencode.json"
"$HOME/.config/opencode2/AGENTS.md"
"$HOME/.local/bin/oc2"
"$HOME/.local/bin/opencode-go-token"
"$HOME/.pi/agent/settings.json"
"$HOME/.pi/agent/models.json"
"$HOME/.pi/agent/AGENTS.md"
@@ -33,7 +63,7 @@ done
for path in \
"$HOME/.config/wezterm" \
"$HOME/.config/nvim" \
"$HOME/.config/herdr" \
"$HOME/.config/opencode/skills" \
"$HOME/.pi/agent/themes" \
"$HOME/.pi/agent/extensions/calm"
do