mirror of https://github.com/garrytan/gstack.git
chore: regenerate SKILL.md across all hosts (gen:skill-docs)
Mechanical regeneration after preamble + setup-gbrain template + new sync-gbrain skill. Run via: bun run gen:skill-docs --host all. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7414f45e22
commit
a351fb5677
29
SKILL.md
29
SKILL.md
|
|
@ -278,6 +278,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -346,6 +346,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -280,6 +280,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -280,6 +280,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -279,6 +279,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -338,6 +338,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -340,6 +340,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -342,6 +342,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -342,6 +342,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
29
cso/SKILL.md
29
cso/SKILL.md
|
|
@ -343,6 +343,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -366,6 +366,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -345,6 +345,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -343,6 +343,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -360,6 +360,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -343,6 +343,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -340,6 +340,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -340,6 +340,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -379,6 +379,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -337,6 +337,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -338,6 +338,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -340,6 +340,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -279,6 +279,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -375,6 +375,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -337,6 +337,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -338,6 +338,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -369,6 +369,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -342,6 +342,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -346,6 +346,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -344,6 +344,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -351,6 +351,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -339,6 +339,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
29
qa/SKILL.md
29
qa/SKILL.md
|
|
@ -345,6 +345,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -357,6 +357,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -342,6 +342,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -338,6 +338,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -276,6 +276,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -341,6 +341,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -343,6 +343,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
|
|
@ -339,6 +339,35 @@ _BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
|||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Mutually exclusive variants per /plan-eng-review §4. Empty string when gbrain
|
||||
# is not configured (zero context cost for non-gbrain users).
|
||||
_GBRAIN_CONFIG="$HOME/.gbrain/config.json"
|
||||
if [ -f "$_GBRAIN_CONFIG" ] && command -v gbrain >/dev/null 2>&1; then
|
||||
_GBRAIN_VERSION_OK=$(gbrain --version 2>/dev/null | grep -c '^gbrain ' || echo 0)
|
||||
if [ "$_GBRAIN_VERSION_OK" -gt 0 ] 2>/dev/null; then
|
||||
_SYNC_STATE="$_GSTACK_HOME/.gbrain-sync-state.json"
|
||||
_CWD_PAGES=0
|
||||
if [ -f "$_SYNC_STATE" ]; then
|
||||
# Flatten newlines so the regex works against pretty-printed JSON too.
|
||||
_CWD_PAGES=$(tr -d '\n' < "$_SYNC_STATE" 2>/dev/null \
|
||||
| grep -o '"name": *"code"[^}]*"detail": *{[^}]*"page_count": *[0-9]*' \
|
||||
| grep -o '"page_count": *[0-9]*' | grep -o '[0-9]\+' | head -1)
|
||||
_CWD_PAGES=${_CWD_PAGES:-0}
|
||||
fi
|
||||
if [ "$_CWD_PAGES" -gt 0 ] 2>/dev/null; then
|
||||
echo "GBrain configured. Prefer \`gbrain search\`/\`gbrain query\` over Grep for"
|
||||
echo "semantic questions; use \`gbrain code-def\`/\`code-refs\`/\`code-callers\` for"
|
||||
echo "symbol-aware code lookup. See \"## GBrain Search Guidance\" in CLAUDE.md."
|
||||
echo "Run /sync-gbrain to refresh."
|
||||
else
|
||||
echo "GBrain configured but this repo isn't indexed yet. Run \`/sync-gbrain --full\`"
|
||||
echo "before relying on \`gbrain search\` for code questions in this repo."
|
||||
echo "Falls back to Grep until indexed."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
_BRAIN_SYNC_MODE=$("$_BRAIN_CONFIG_BIN" get gbrain_sync_mode 2>/dev/null || echo off)
|
||||
|
||||
if [ -f "$_BRAIN_REMOTE_FILE" ] && [ ! -d "$_GSTACK_HOME/.git" ] && [ "$_BRAIN_SYNC_MODE" = "off" ]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue