fix(install): wire global opencode agents dir; add doc-check anti-pattern rule

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.
This commit is contained in:
Brydon DeWitt 2026-05-22 21:39:41 -04:00
parent f4017abf45
commit 5c1225744a
2 changed files with 25 additions and 1 deletions

View File

@ -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

View File

@ -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"