Compare commits

..
Author SHA1 Message Date
Lap Tran 5bf1e05091 no-mistakes(document): correct stale backpass skip reference in comment 2026-11-11 13:08:13 -05:00
Lap Tran 9598499dcf no-mistakes(review): match real backpass and acpx launch paths 2026-11-11 12:49:41 -05:00
Lap Tran 9addc502fa no-mistakes(review): always install latest backpass and acpx on rebuild 2026-11-11 12:39:56 -05:00
Lap Tran d4e8c24b2f fix(home): converge backpass and acpx to the latest npm release on rebuild
Both npm globals were installed only when the binary was missing, so a
rebuild never moved them and the installed copies drifted behind the
registry. Read the installed version and the registry's latest instead,
and install only when they differ.

The running-process guard skips a package while one of its own processes
is alive, the registry lookup and the install warn and continue on
failure so the switch never aborts, and one shared function serves both
packages.
2026-11-11 12:29:27 -05:00
Lap Tran f21d20e1f7 fix(opencode): drop the dead automaton-guard plugin reference
The global OpenCode config pointed at ~/.automaton/plugins/automaton-guard, which no longer exists, so every OpenCode session logged Plugin failed to load. The automaton guard now ships only for Pi as automaton-guard-pi.
2026-11-08 22:29:47 -05:00
hermes a2c6ef7152 Merge pull request 'Point the fm alias at OpenCode 2 and keep Pi as fm-pi' (#18) from fm/dotfiles-fm-opencode2 into main 2026-11-08 21:19:08 -05:00
Lap Tran cdceb1eb09 Point the fm alias at OpenCode 2 and keep Pi as fm-pi
The primary firstmate session now starts through the isolated-config oc2
wrapper so it loads the tracked .opencode/plugins. fm-pi keeps the old Pi
launch until the new launcher is confirmed on the captain's machine.

Verified with a scratch FM_HOME: oc2 v2.2.6 loads all five firstmate
plugins, and the isolated config already exposes the primary model
opencode-go/deepseek-v4.1-flash.
2026-11-08 20:52:31 -05:00
hermes 5becfd69aa Merge pull request 'Make the linked Homebrew OpenCode build the only OpenCode install' (#17) from fm/opencode-retire-v1 into main 2026-11-08 18:55:45 -05:00
Lap Tran 78f2928132 no-mistakes(document): Correct rebuild.sh npm guard comment 2026-11-08 18:39:19 -05:00
Lap Tran 877ee5d163 Leave OpenCode unpinned so the linked brew build tracks latest
State the upgrade-on-rebuild behavior at the formula and drop version labels from the rebuild comments.
2026-11-08 18:30:32 -05:00
Lap Tran ac7888c9a5 no-mistakes(document): Drop pinned OpenCode version from docs 2026-11-08 18:29:13 -05:00
Lap Tran 2787bcc9ac no-mistakes(review): Remove stale OpenCode npm shims and fix oc2 hint 2026-11-08 18:13:24 -05:00
Lap Tran 3c7d2662a4 Retire OpenCode 1.x so Homebrew OpenCode 2 is the only install
Link the Homebrew opencode formula at /opt/homebrew/bin/opencode, drop the npm 1.x install from rebuild.sh, and remove leftover npm packages. Update the agent notes and home.nix comments to match.
2026-11-08 18:06:38 -05:00
hermes b03d71dc81 Merge pull request 'Run OpenCode 2 from the stable Homebrew formula' (#16) from fm/dotfiles-opencode2-stable-brew into main 2026-11-08 18:03:11 -05:00
Lap Tran d9d0a2e849 no-mistakes(document): Align OpenCode 2 docs with stable brew formula 2026-11-08 12:37:34 -05:00
Lap Tran 2a147c911a no-mistakes(review): Remove retired OpenCode 2 npm beta during rebuild 2026-11-08 12:23:20 -05:00
Lap Tran 1fda5c09b7 Run OpenCode 2 from the stable Homebrew formula
Declare the opencode formula with link = false so it never replaces the
npm-installed OpenCode 1.x CLI at /opt/homebrew/bin/opencode. Drop the npm
beta install from home.activation.opencode2, point home/bin/oc2 at the keg
binary, and correct the related notes.
2026-11-08 12:15:22 -05:00
hermes ec34fc005c Merge pull request 'Route design tasks to Pi GPT-6.1 Sol and set herdr dracula theme' (#15) from fm/dotfiles-design-dispatch-rule into main 2026-11-08 11:03:33 -05:00
Lap Tran f49ba2a84b no-mistakes(document): Document design dispatch rule in agent notes 2026-11-08 10:55:37 -05:00
Lap Tran c84f536c76 no-mistakes(review): Declare codex provider for the Pi design dispatch rule 2026-11-08 10:46:13 -05:00
Lap Tran 2005db22e6 feat(home): route design tasks to Pi GPT-6.1 Sol and set herdr dracula theme 2026-11-08 10:31:34 -05:00
hermes 766b2bbaeb Merge pull request 'Install pinned pstack skills on activation' (#14) from fm/dotfiles-pstack-skills-pin into main 2026-11-07 18:12:43 -05:00
Lap Tran 550c94d58a no-mistakes(document): Correct pinned pstack commit record claim 2026-11-07 18:11:37 -05:00
Lap Tran a58546900f docs(pstack): use neutral third-person wording
Describe the existing tdd skill and the skill tree without
second-person address or a firstmate role name.
2026-11-07 18:03:15 -05:00
Lap Tran 1fb1a23eea no-mistakes(document): Document pinned pstack skill install 2026-11-07 18:00:40 -05:00
Lap Tran d4fd08cabe feat(home): install pinned pstack skills on activation
Add home.activation.pstackSkills plus a pinned cursor/plugins fetch.
It replaces the eleven adopted skill directories in ~/.agents/skills on
every rebuild and leaves all other skills untouched. pstack's tdd copy
stays skipped because the captain's own tdd skill owns that name.
2026-11-07 17:42:21 -05:00
9 changed files with 186 additions and 61 deletions

No files matched your search

+3 -3
View File
@@ -8,9 +8,9 @@ Deliberate decisions in this repo - do NOT silently revert them:
- 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. - 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.
- 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`. - 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. - 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` + `pi` with the two firstmate primary extensions); the primary runs Pi on the OpenCode Go subscription, while crews run on the opencode harness. `oc2` remains the isolated OpenCode 2 fallback. Self-update via `/updatefirstmate`, not rebuild. - 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, coding crewmates and scouts use `opencode` + `opencode-go/deepseek-v4.1-flash` through the OpenCode CLI. Design, architecture, and design-review tasks are the exception: the file's first rule sends them to Pi with `openai-codex/gpt-6.1-sol` at `xhigh`, and implementation tasks re-resolve their profile instead of keeping that model. 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` + the `oc2` wrapper, so the primary runs OpenCode 2 on the OpenCode Go subscription and loads firstmate's `.opencode/plugins` by working directory), while crews run on the opencode harness unless a dispatch rule selects another harness. `oc2` remains the isolated-config OpenCode launcher, and `fm-pi` keeps the old Pi launch as a fallback until the OpenCode 2 launcher is confirmed on the captain's machine. Self-update via `/updatefirstmate`, not rebuild.
- OpenCode 2 is the isolated OpenCode harness behind `oc2`, not 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. - OpenCode is one install: the stable Homebrew `opencode` formula, linked so `/opt/homebrew/bin/opencode` is that build. It is both the firstmate crew harness and the `oc2` binary. `oc2` only isolates the config: `OPENCODE_CONFIG` stays at `home/.config/opencode2/opencode.json` and cannot rewrite `~/.config/opencode`, and `OPENCODE2_BIN` overrides the binary. firstmate harness detection matches `*opencode*`, so it still classifies as OpenCode.
- Shell aliases: `cc` (Claude skip-permissions), `co` (Codex full-auto), `gb` (Grok --yolo), `fm` (firstmate via Pi), `oc2` (OpenCode 2, isolated). They are intentional high-agency shortcuts. - Shell aliases: `cc` (Claude skip-permissions), `co` (Codex full-auto), `gb` (Grok --yolo), `fm` (firstmate via OpenCode 2), `fm-pi` (firstmate via Pi fallback), `oc2` (OpenCode with isolated config). 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. - 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 ## Maintaining this file
+4 -1
View File
@@ -54,7 +54,10 @@
# resolves on the normal PATH. No server, service, database, or # resolves on the normal PATH. No server, service, database, or
# connection is configured. # connection is configured.
{ name = "libpq"; link = true; } { name = "libpq"; link = true; }
"node" # required: opencode2 is an npm global, not a Homebrew formula "node" # required: backpass and acpx are npm globals, not formulae
# Unpinned: onActivation.upgrade refreshes formulae each rebuild, so the
# linked binary tracks the latest opencode release. Crew harness and oc2.
"opencode"
"pi-coding-agent" "pi-coding-agent"
"tea" # Gitea CLI - PRs for firstmate crewmates on unraid.local:3003 "tea" # Gitea CLI - PRs for firstmate crewmates on unraid.local:3003
"tmux" "tmux"
+122 -34
View File
@@ -11,6 +11,28 @@ let
ytTranscribe = pkgs.runCommand "yt-transcribe" { } '' ytTranscribe = pkgs.runCommand "yt-transcribe" { } ''
install -Dm755 ${./home/bin/yt-transcribe} $out/bin/yt-transcribe install -Dm755 ${./home/bin/yt-transcribe} $out/bin/yt-transcribe
''; '';
# Pinned pstack skills tree (cursor/plugins). `tdd` is deliberately absent:
# an existing user-level tdd skill owns that name. See firstmate's
# docs/adopted-skills.md for why these eleven skills exist.
pstackSkillNames = [
"statechart"
"create-verification-skill"
"maintain-verification-skill"
"correct"
"benchmark-checklist"
"architect"
"technical-writing"
"unslop"
"recall"
"ketchup"
"blast-radius"
];
pstackSkills = pkgs.fetchFromGitHub {
owner = "cursor";
repo = "plugins";
rev = "6b0300214a09fd6029cfb7077043125758cd1fd2";
hash = "sha256-TDuZ1v+taPdqyvvCs1VHUjtpSy8zHxhQKJv/kIPTpK8=";
};
in in
{ {
@@ -58,8 +80,12 @@ in
cc = "claude --dangerously-skip-permissions"; cc = "claude --dangerously-skip-permissions";
co = "codex --full-auto"; co = "codex --full-auto";
gb = "grok --yolo"; gb = "grok --yolo";
# firstmate primary session via Pi on the OpenCode Go subscription; crewmates = OpenCode # firstmate primary session in OpenCode 2 on the OpenCode Go subscription,
fm = "cd ${firstmateHome} && exec pi"; # launched through the isolated-config oc2 wrapper; crewmates = OpenCode by
# default. fm-pi keeps the old Pi launch until the OpenCode 2 launcher is
# confirmed on the captain's machine.
fm = "cd ${firstmateHome} && exec ${home}/.local/bin/oc2";
fm-pi = "cd ${firstmateHome} && exec pi";
oc2 = "${home}/.local/bin/oc2"; oc2 = "${home}/.local/bin/oc2";
# Sync ~/Music into the beets library on Unraid (requires NAS mounted). # Sync ~/Music into the beets library on Unraid (requires NAS mounted).
sync-music = "~/.local/bin/sync-music"; sync-music = "~/.local/bin/sync-music";
@@ -197,7 +223,7 @@ in
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/opencode/skills"; source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/opencode/skills";
force = true; force = true;
}; };
# OpenCode 2 isolated config - never share ~/.config/opencode with 1.x # OpenCode isolated config - keep it separate from ~/.config/opencode
home.file.".config/opencode2/opencode.json" = { home.file.".config/opencode2/opencode.json" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/opencode2/opencode.json"; source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/opencode2/opencode.json";
force = true; force = true;
@@ -347,23 +373,9 @@ in
"$HOME/.codex/config.toml" "$HOME/.codex/config.toml"
''; '';
# OpenCode 2 is not on Homebrew (beta). Install via Homebrew's npm, never # OpenCode is the stable Homebrew `opencode` formula, linked in
# Nix's npm (EACCES on the store). Skip when already present so a rebuild # configuration.nix; home/bin/oc2 runs its keg binary with an isolated config.
# does not pull a new beta under a live TUI. Activation blocks are inlined # Nothing to install here.
# 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
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 # backpass (kunchenguid/backpass) - gradient descent for agent memory: reads
# the transcript stores of the harnesses this config already declares # the transcript stores of the harnesses this config already declares
@@ -372,9 +384,15 @@ in
# to a harness you already authenticated, so acpx is a hard runtime dep and # 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 # 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, # (>= 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 # never Nix's npm (EACCES on the store). Both track the registry's latest on
# rebuild never pulls a new version mid-session; refresh manually with # every rebuild: for each package the installed version is compared with the
# /opt/homebrew/bin/npm update -g backpass acpx # published one, and an install runs only when they differ, so a current copy
# is left alone and a stale one converges. The switch therefore always brings
# both packages to the latest published version, whether or not a process of
# that package is running: a running process keeps the code it already loaded
# and picks the new version up at its next start, so the switch prints that as
# a notice and still installs. The registry lookup and the install are optional
# steps - a failure there warns and the switch continues.
home.activation.backpass = lib.hm.dag.entryAfter [ "writeBoundary" ] '' home.activation.backpass = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail set -euo pipefail
# Activation PATH lacks /opt/homebrew/bin, so npm's `#!/usr/bin/env node` # Activation PATH lacks /opt/homebrew/bin, so npm's `#!/usr/bin/env node`
@@ -386,12 +404,45 @@ in
echo "backpass: /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 exit 1
fi fi
if [ ! -x /opt/homebrew/bin/acpx ]; then # Converge one npm global to the registry's latest. $1 is the package name,
"$npm" install -g acpx@latest # $2 is the pgrep pattern matching that package's command line as launched
fi # from the global bin, used only to explain that a live process keeps its
if [ ! -x /opt/homebrew/bin/backpass ]; then # loaded code. Every optional failure returns 0, so `set -e` never aborts the
"$npm" install -g backpass # switch and later blocks still run.
fi converge_npm_global() {
pkg="$1"
live="$2"
# Installed version from npm's own global record; empty means absent. The
# `|| true` keeps `set -e` quiet when npm exits non-zero over extraneous
# packages.
installed="$("$npm" ls -g --depth=0 2>/dev/null | sed -n "s/.*[[:space:]]$pkg@\([^[:space:]]*\).*/\1/p" | head -n 1 || true)"
# Registry lookup is optional: an offline or timed-out lookup warns and
# keeps the installed copy.
latest="$("$npm" view "$pkg" version --fetch-timeout=15000 --fetch-retries=1 2>/dev/null | tr -d "[:space:]" || true)"
if [ -z "$latest" ]; then
echo "$pkg: cannot read the latest version from the npm registry (offline?) - keeping the installed copy, rebuild continues" >&2
return 0
fi
if [ "$installed" = "$latest" ]; then
echo "$pkg: already at $latest"
else
current="$installed"
[ -n "$current" ] || current=none
echo "$pkg: updating $current -> $latest"
# Install failure is optional too: warn and keep the old copy.
if "$npm" install -g "$pkg@$latest"; then
echo "$pkg: installed $latest"
else
echo "$pkg: install of $latest failed - keeping the installed copy, rebuild continues" >&2
return 0
fi
fi
if pgrep -f "$live" >/dev/null 2>&1; then
echo "$pkg: a running process keeps the code it already loaded - $latest takes effect at its next start" >&2
fi
}
converge_npm_global backpass "/opt/homebrew/bin/backpass"
converge_npm_global acpx "/opt/homebrew/bin/acpx"
''; '';
# kunchenguid/no-mistakes gate (git push no-mistakes) - declarative install + daemon + global config # kunchenguid/no-mistakes gate (git push no-mistakes) - declarative install + daemon + global config
@@ -446,11 +497,12 @@ in
# ~/.config/opencode/skills: home-manager owns that path with force = true and # ~/.config/opencode/skills: home-manager owns that path with force = true and
# mkOutOfStoreSymlink into the mutable dotfiles checkout, so a rebuild would # 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 # 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 # when installed, unlike backpass which tracks the latest release, so a
# version mid-session. The skill's own README still requires an OS-enforced # rebuild never pulls a new skill version mid-session. The skill's own README
# sandbox before it may run target-controlled builds, tests, browsers, or # still requires an OS-enforced sandbox before it may run target-controlled
# fuzzers. That sandbox is home/bin/security-audit-sandbox; without it, those # builds, tests, browsers, or fuzzers. That sandbox is
# leads stay `needs_validation`. # home/bin/security-audit-sandbox; without it, those leads stay
# `needs_validation`.
# Install and refresh commands, plus the sandbox docs, are in readme.md. # Install and refresh commands, plus the sandbox docs, are in readme.md.
home.activation.securityAuditSkill = lib.hm.dag.entryAfter [ "writeBoundary" ] '' home.activation.securityAuditSkill = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail set -euo pipefail
@@ -481,6 +533,42 @@ in
fi fi
''; '';
# pstack skills installed from the pinned `pstackSkills` source above (folder
# pstack/skills). The record of why these eleven skills exist is firstmate's
# docs/adopted-skills.md. They live only in ~/.agents/skills, which is outside
# git and Nix, so this block restores them on a fresh machine.
# `tdd` is skipped on purpose: an existing user-level tdd skill owns that
# name, so the pstack copy is never installed.
# Each run replaces only the eleven target directories; every other skill,
# including an existing tdd skill, stays untouched. No `exit 0` here,
# because activation blocks are inlined into one flat script, so an early
# exit would skip the blocks that follow.
home.activation.pstackSkills = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
src="${pstackSkills}/pstack/skills"
dest="$HOME/.agents/skills"
if [ ! -d "$src" ]; then
echo "pstackSkills: pinned source tree missing at $src" >&2
exit 1
fi
mkdir -p "$dest"
for name in ${lib.concatStringsSep " " pstackSkillNames}; do
if [ ! -d "$src/$name" ]; then
echo "pstackSkills: pinned source is missing skill $name" >&2
exit 1
fi
# Remove first so a renamed source file never lingers in the old copy.
rm -rf "$dest/$name"
if ! cp -R "$src/$name" "$dest/$name"; then
echo "pstackSkills: failed to install $name" >&2
exit 1
fi
# Store files are read-only; make the installed copy writable again.
chmod -R u+w "$dest/$name"
done
echo "pstackSkills: installed ${toString (lib.length pstackSkillNames)} pinned skills into $dest"
'';
# OpenSuperWhisper - local voice-first prompting (cask in configuration.nix). # OpenSuperWhisper - local voice-first prompting (cask in configuration.nix).
# The app reads its model from its own Application Support directory, so the # 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. # 1.6 GB Whisper model is downloaded here once and kept outside the Nix store.
+10
View File
@@ -1,5 +1,15 @@
{ {
"rules": [ "rules": [
{
"when": "Design, architecture, architectural review, or design review tasks. This includes product design, UI/UX design, system design, and design investigations. For design tasks with screenshots or other image context, this rule takes precedence over the UI implementation rule. Ordinary implementation and routine code validation do not match this rule. When a task moves from design to implementation, resolve the implementation profile again rather than retaining this model for continuity.",
"use": {
"harness": "pi",
"model": "openai-codex/gpt-6.1-sol",
"effort": "xhigh",
"provider": "codex"
},
"why": "Captain's order: use GPT-6.1 Sol through openai-codex in Pi for design and architectural review tasks. Other task types retain their existing profiles."
},
{ {
"when": "UI work where supplied screenshots or other image context materially affect the implementation or verification.", "when": "UI work where supplied screenshots or other image context materially affect the implementation or verification.",
"use": [ "use": [
+4
View File
@@ -16,3 +16,7 @@ copy_mode = "prefix+y" # herdr's copy-mode entry key; copy-mode's own internal
[ui] [ui]
# Agents panel order: explicit choice of "spaces" (grouped by space, the default) over "priority". # Agents panel order: explicit choice of "spaces" (grouped by space, the default) over "priority".
agent_panel_sort = "spaces" agent_panel_sort = "spaces"
[theme]
name = "dracula"
auto_switch = false
-1
View File
@@ -80,7 +80,6 @@
} }
} }
}, },
"plugin": ["/Users/laptran/.automaton/plugins/automaton-guard"],
"command": { "command": {
"no-mistakes": { "no-mistakes": {
"description": "Validate code changes through the no-mistakes pipeline", "description": "Validate code changes through the no-mistakes pipeline",
+5 -5
View File
@@ -1,14 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Launch OpenCode 2 with an isolated config so it cannot rewrite # Launch OpenCode with an isolated config so it cannot rewrite
# ~/.config/opencode/opencode.json (OpenCode 1 / firstmate). # ~/.config/opencode/opencode.json (firstmate).
set -euo pipefail set -euo pipefail
bin="${OPENCODE2_BIN:-/opt/homebrew/bin/opencode2}" bin="${OPENCODE2_BIN:-/opt/homebrew/opt/opencode/bin/opencode}"
cfg="${OPENCODE_CONFIG:-$HOME/.config/opencode2/opencode.json}" cfg="${OPENCODE_CONFIG:-$HOME/.config/opencode2/opencode.json}"
if [ ! -x "$bin" ]; then if [ ! -x "$bin" ]; then
echo "oc2: opencode2 not installed. Rebuild, or run:" >&2 echo "oc2: stable opencode not installed. Rebuild, or run:" >&2
echo " /opt/homebrew/bin/npm install -g --allow-scripts=@opencode-ai/cli @opencode-ai/cli@beta" >&2 echo " brew install opencode" >&2
exit 1 exit 1
fi fi
if [ ! -e "$cfg" ]; then if [ ! -e "$cfg" ]; then
+9 -1
View File
@@ -13,7 +13,7 @@ The firstmate crew dispatch + Gitea PR helper are wired by `darwin-rebuild`, but
cd ~/Documents/investor-flow cd ~/Documents/investor-flow
git remote set-url origin http://unraid.local:3003/transnet/investor-flow git remote set-url origin http://unraid.local:3003/transnet/investor-flow
Verify: `fm` launches Pi as the first mate (accept project trust once); `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. Verify: `fm` launches OpenCode 2 as the first mate and `fm-pi` is the Pi fallback until that launcher is confirmed; `oc2 --version` prints the Homebrew opencode 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) ## security-audit skill (agent security reviews)
@@ -82,6 +82,14 @@ Container controls:
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. 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.
## pstack skills (pinned on every rebuild)
`home.activation.pstackSkills` restores the eleven adopted pstack skills into `~/.agents/skills`, the shared user-level skill directory that the security-audit section describes. The source is `https://github.com/cursor/plugins` at a fixed commit (folder `pstack/skills`), pinned by the `pstackSkills` `fetchFromGitHub` in `home.nix`. That pin is the only record of the commit in this repo: to move to newer upstream content, change `rev` and `hash` together, then rerun `./rebuild.sh`.
Each run removes and recopies only those eleven directories, so a renamed upstream file never lingers and every other skill in `~/.agents/skills` stays untouched, including an existing tdd skill. `tdd` is skipped on purpose: an existing user-level tdd skill owns that name, so the pstack copy is never installed. The block adds no `~/.claude/skills` link, so Claude Code does not see these eleven skills.
Why these eleven skills exist is recorded in firstmate's `docs/adopted-skills.md`, outside this repo.
## OpenSuperWhisper (local voice input) ## 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. 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.
+29 -16
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Rebuild nix-darwin + home-manager. Rotates stale home-manager *.backup files # Rebuild nix-darwin + home-manager. Rotates stale home-manager *.backup files
# so a second switch never fails with "would be clobbered". # so a second switch never fails with "would be clobbered".
# Also updates flake inputs, upgrades grok-build, installs OpenCode 1.x # Also updates flake inputs, upgrades grok-build, removes retired npm OpenCode
# (stable CLI for free-tier), updates no-mistakes, and updates pi extensions. # packages, updates no-mistakes, and updates pi extensions.
set -euo pipefail set -euo pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
ln -sfn "$DIR" ~/.dotfiles ln -sfn "$DIR" ~/.dotfiles
@@ -16,21 +16,34 @@ else
echo "==> WARNING: grok-build upgrade failed (network issue). Skipping." echo "==> WARNING: grok-build upgrade failed (network issue). Skipping."
fi fi
# Install OpenCode 1.x (stable CLI, binary "opencode") if absent. # Remove retired npm OpenCode installs if an older rebuild installed them:
# Required for free-tier models; opencode2 beta returns HTTP 426 on those endpoints. # the `@opencode-ai/cli` beta and the older `opencode-ai` CLI. The Homebrew
# Uses Homebrew's npm (not Nix's npm) to avoid EACCES on the store. # `opencode` formula declared in configuration.nix is now the only OpenCode
# Skip if npm is unavailable (e.g., network issues preventing fetch). # install, unpinned so it tracks the latest release. The guard is a local check
OPENCODE_BIN=/opt/homebrew/bin/opencode # for npm, so a rebuild without npm skips this instead of failing.
if [ ! -x "$OPENCODE_BIN" ]; then NPM=/opt/homebrew/bin/npm
echo "==> Installing OpenCode 1.x (stable) via Homebrew npm..." if [ -x "$NPM" ] && npm_root="$("$NPM" root -g 2>/dev/null)"; then
if /opt/homebrew/bin/npm install -g --allow-scripts=opencode-ai opencode-ai@1.18 2>&1; then for pkg in @opencode-ai/cli opencode-ai; do
echo "==> OpenCode 1.x installed successfully" if [ -d "$npm_root/$pkg" ]; then
else if "$NPM" uninstall -g "$pkg" >/dev/null 2>&1; then
echo "==> WARNING: OpenCode 1.x installation failed (network issue). Skipping." echo "==> Removed retired npm package $pkg"
fi else
else echo "==> WARNING: $pkg removal failed. Remove it manually: $NPM uninstall -g $pkg"
echo "==> OpenCode 1.x already installed: $(${OPENCODE_BIN} --version)" fi
fi
done
fi fi
# `opencode` links without --overwrite, so any npm shim left in the Homebrew
# prefix aborts the switch's brew bundle link step. Drop the retired packages'
# shims directly, which also covers a failed uninstall and a missing npm.
for link in /opt/homebrew/bin/*; do
case "$(readlink "$link" 2>/dev/null || true)" in
*/node_modules/@opencode-ai/cli/* | */node_modules/opencode-ai/*)
rm -f "$link"
echo "==> Removed stale OpenCode npm shim $link"
;;
esac
done
echo "==> Updating no-mistakes..." echo "==> Updating no-mistakes..."
NO_MISTAKES_BIN="$HOME/.no-mistakes/bin/no-mistakes" NO_MISTAKES_BIN="$HOME/.no-mistakes/bin/no-mistakes"