From 5c1225744a2b5bd776ad0df854a54cf661a63539 Mon Sep 17 00:00:00 2001 From: Brydon DeWitt Date: Fri, 22 May 2026 21:39:41 -0400 Subject: [PATCH] fix(install): wire global opencode agents dir; add doc-check anti-pattern rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit install.sh step 3 now symlinks all agent .md files into ~/.config/opencode/agents/ so project repos no longer need per-project .opencode/agents/ symlinks. AGENTS.md: add anti-pattern rule — do not assert a third-party tool lacks a feature without fetching the tool's current docs first. --- .agents/AGENTS.md | 7 +++++++ .agents/install.sh | 19 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md index c1d673c..44d8139 100644 --- a/.agents/AGENTS.md +++ b/.agents/AGENTS.md @@ -237,6 +237,13 @@ Some things cannot be unified and live in tool-specific locations: model may be correct. Applies to: OpenCode tool names (`read`/`edit`/`task`), parameter names (`offset`/`limit` not `startLine`/`endLine`), and plugin guard logic. +- ❌ Asserting that a third-party tool does **not** support a feature (config + mechanism, directory, option) without fetching the tool's current docs first. + Training data is frequently stale. Negative claims ("X doesn't have Y") must + be verified live — fetch the docs page before stating the absence. Cost of a + wrong negative: wasted user time, dead-end architecture, and eroded trust. + Rule: if you're about to say "tool X doesn't support Y," fetch the relevant + docs URL first. - ❌ Adding _"reflect / double-check / are you sure / take another look"_ instructions as a mitigation for any failure mode — these feel productive in transcripts but Huang et al. (arXiv:2310.01798) show that intrinsic diff --git a/.agents/install.sh b/.agents/install.sh index db913bf..65e8a80 100755 --- a/.agents/install.sh +++ b/.agents/install.sh @@ -58,7 +58,24 @@ else log "OpenCode plugin symlink: $OC_PLUGIN_LINK → $OC_PLUGIN_TARGET" fi -# ── 3. OpenCode global AGENTS.md ──────────────────────────────────────────── +# ── 3. OpenCode global agents dir ─────────────────────────────────────────── +OC_AGENTS_DIR="$HOME/.config/opencode/agents" +OC_AGENTS_SOURCE="$DOTFILES_AGENTS/agents" + +mkdir -p "$OC_AGENTS_DIR" +for src in "$OC_AGENTS_SOURCE"/*.md; do + name="$(basename "$src")" + link="$OC_AGENTS_DIR/$name" + if [[ "$name" == "AGENTS.md" ]]; then continue; fi # not a slash-command agent + if [[ -L "$link" && "$(readlink "$link")" == "$src" ]]; then + skip "OpenCode agent symlink already set: $link" + else + ln -sf "$src" "$link" + log "OpenCode agent symlink: $link → $src" + fi +done + +# ── 3a. OpenCode global AGENTS.md ─────────────────────────────────────────── OC_AGENTS_TARGET="$DOTFILES_AGENTS/AGENTS.md" OC_AGENTS_LINK="$HOME/.config/opencode/AGENTS.md"