From b65fc98c5c08d79b0a579c58bee73773051b7499 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 20 May 2026 20:58:57 -0700 Subject: [PATCH] chore: regenerate SKILL.md after voyage-code-3 default Mechanical regen via \`bun run gen:skill-docs --host all\` after the template changes in the previous commit. Single-host regen leaves other-host outputs stale and trips gen-skill-docs.test.ts; --host all keeps every adapter (claude, codex, kiro, opencode, slate, cursor, openclaw, hermes, gbrain) in sync. Co-Authored-By: Claude Opus 4.7 (1M context) --- setup-gbrain/SKILL.md | 31 +++++++++++++++++++++++++++---- sync-gbrain/SKILL.md | 7 +++++-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/setup-gbrain/SKILL.md b/setup-gbrain/SKILL.md index a31b7de7a..6a3536d3b 100644 --- a/setup-gbrain/SKILL.md +++ b/setup-gbrain/SKILL.md @@ -845,7 +845,14 @@ with `GSTACK_DETECT_NO_CACHE=1` (busts the 60s cache). If the new ```bash BACKUP="$HOME/.gbrain/config.json.gstack-bak-$(date +%s)" mv "$HOME/.gbrain/config.json" "$BACKUP" -if ! gbrain init --pglite --json; then +# gstack default: voyage-code-3 (1024d) when VOYAGE_API_KEY is set — best for +# code retrieval. Without the key, fall back to gbrain's own auto-selected +# embedding provider chain (OpenAI 1536d when OPENAI_API_KEY is present, etc.). +GBRAIN_EMBED_FLAGS="" +if [ -n "${VOYAGE_API_KEY:-}" ]; then + GBRAIN_EMBED_FLAGS="--embedding-model voyage:voyage-code-3 --embedding-dimensions 1024" +fi +if ! gbrain init --pglite --json $GBRAIN_EMBED_FLAGS; then # Restore on failure mv "$BACKUP" "$HOME/.gbrain/config.json" echo "gbrain init failed. Your previous config was restored at $HOME/.gbrain/config.json." >&2 @@ -1052,10 +1059,18 @@ Then follow the same secret-read + verify + init flow as Path 1. ### Path 3 (PGLite local) ```bash -gbrain init --pglite --json +# gstack default: voyage-code-3 (1024d) when VOYAGE_API_KEY is set — code +# retrieval beats general-purpose embeddings on real code queries (validated +# A/B). Without the key, gbrain auto-selects (OpenAI 1536d when available). +GBRAIN_EMBED_FLAGS="" +if [ -n "${VOYAGE_API_KEY:-}" ]; then + GBRAIN_EMBED_FLAGS="--embedding-model voyage:voyage-code-3 --embedding-dimensions 1024" +fi +gbrain init --pglite --json $GBRAIN_EMBED_FLAGS ``` -Done. No network, no secrets. +Done. No network, no secrets (beyond Voyage embedding API calls during sync, if +`VOYAGE_API_KEY` is set — ~$0.18 per 1M tokens, pennies per repo). ### Path 4 (Remote gbrain MCP — HTTP transport with bearer token) @@ -1135,7 +1150,15 @@ if [ -f "$HOME/.gbrain/config.json" ]; then BACKUP="$HOME/.gbrain/config.json.gstack-bak-$(date +%s)" mv "$HOME/.gbrain/config.json" "$BACKUP" fi -if ! gbrain init --pglite --json; then +# gstack default for local code-search PGLite: voyage-code-3 (1024d) when +# VOYAGE_API_KEY is set. It wins the A/B over voyage-4-large and OpenAI +# text-embedding-3-large on this codebase's symbol queries. Falls back to +# gbrain's auto-selected provider when the key isn't present. +GBRAIN_EMBED_FLAGS="" +if [ -n "${VOYAGE_API_KEY:-}" ]; then + GBRAIN_EMBED_FLAGS="--embedding-model voyage:voyage-code-3 --embedding-dimensions 1024" +fi +if ! gbrain init --pglite --json $GBRAIN_EMBED_FLAGS; then if [ -n "${BACKUP:-}" ] && [ -f "$BACKUP" ]; then mv "$BACKUP" "$HOME/.gbrain/config.json"; fi echo "gbrain init failed. Existing config (if any) was restored. PGLite at ~/.gbrain/pglite/ may be in a partial state — \`rm -rf ~/.gbrain/pglite\` to reset." >&2 echo "Continuing setup without local code search; you can re-run /setup-gbrain to retry." >&2 diff --git a/sync-gbrain/SKILL.md b/sync-gbrain/SKILL.md index f7b9b5230..b6d362fe3 100644 --- a/sync-gbrain/SKILL.md +++ b/sync-gbrain/SKILL.md @@ -821,7 +821,9 @@ BEFORE invoking the orchestrator: "Your brain queries (the `mcp__gbrain__*` tools) work via remote MCP, but symbol code search needs a local PGLite. Run `/setup-gbrain` and pick 'Yes' at the new 'local code index' prompt (Step 4.5), or run - `gbrain init --pglite --json` directly. Continuing without code stage." + `gbrain init --pglite --json --embedding-model voyage:voyage-code-3 --embedding-dimensions 1024` + directly (drop the voyage flags if `VOYAGE_API_KEY` isn't set). Continuing + without code stage." Then proceed to Step 2 — the orchestrator's `runCodeImport()` and `runMemoryIngest()` will return SKIP per plan D12; only `runBrainSyncPush()` will run. Do NOT abort. @@ -834,7 +836,8 @@ BEFORE invoking the orchestrator: 1. Re-run /setup-gbrain — Step 1.5 offers Retry / Switch to PGLite / Switch brain mode / Quit (plan D4). 2. Repair manually: mv ~/.gbrain/config.json ~/.gbrain/config.json.bak - && gbrain init --pglite --json + && gbrain init --pglite --json --embedding-model voyage:voyage-code-3 \ + --embedding-dimensions 1024 (drop voyage flags if VOYAGE_API_KEY unset) Re-run /sync-gbrain after. ``` Do NOT continue — the orchestrator would skip code+memory and only run