fix(setup-gbrain): never ask the provider question inside /setup-gbrain

Invoking /setup-gbrain IS the provider choice. Step 1.7 now records
'select gbrain' best-effort and proceeds straight to setup; the offer
ceremony is reserved for entry points where no provider was named. On
machines where the code-intelligence CLI exists, the offer:true path
was hijacking setup into the provider ceremony and the E2E child never
reached MCP registration.
This commit is contained in:
Garry Tan 2026-08-15 00:09:51 -07:00
parent 9889f27491
commit 7494f15541
No known key found for this signature in database
GPG Key ID: C1F69E85C74EFE1D
2 changed files with 20 additions and 8 deletions

View File

@ -921,15 +921,21 @@ Step 1.5 — fall through to Step 2 (where `no-cli` triggers Step 3 install and
## Step 1.7: Code-intelligence provider choice (Step 0 of indexing)
gbrain is one of THREE code-intelligence providers gstack can use; the offer
gate decides whether this repo is even worth indexing:
You are INSIDE /setup-gbrain: the user asked for gbrain by name, so the
provider question is already answered. NEVER ask it here, and never let this
step delay or derail the actual setup. Record the choice best-effort, then
continue immediately with Step 2:
```bash
[ -f ~/.claude/skills/gstack/bin/gstack-code-intelligence ] \
&& bun ~/.claude/skills/gstack/bin/gstack-code-intelligence suggest --json \
|| echo '{"offer": false, "reason": "bin-absent"}'
&& bun ~/.claude/skills/gstack/bin/gstack-code-intelligence select gbrain 2>/dev/null \
|| true
```
The offer ceremony below applies ONLY when this skill is reached from another
entry point where no provider was named (a routing skill exploring indexing
options). Even then:
- `"offer": false` with reason `bin-absent` → the installed gstack predates
the code-intelligence CLI. Skip this step entirely and continue with the
skill — the user asked for gbrain, so set up gbrain. Never block setup on

View File

@ -163,15 +163,21 @@ Step 1.5 — fall through to Step 2 (where `no-cli` triggers Step 3 install and
## Step 1.7: Code-intelligence provider choice (Step 0 of indexing)
gbrain is one of THREE code-intelligence providers gstack can use; the offer
gate decides whether this repo is even worth indexing:
You are INSIDE /setup-gbrain: the user asked for gbrain by name, so the
provider question is already answered. NEVER ask it here, and never let this
step delay or derail the actual setup. Record the choice best-effort, then
continue immediately with Step 2:
```bash
[ -f ~/.claude/skills/gstack/bin/gstack-code-intelligence ] \
&& bun ~/.claude/skills/gstack/bin/gstack-code-intelligence suggest --json \
|| echo '{"offer": false, "reason": "bin-absent"}'
&& bun ~/.claude/skills/gstack/bin/gstack-code-intelligence select gbrain 2>/dev/null \
|| true
```
The offer ceremony below applies ONLY when this skill is reached from another
entry point where no provider was named (a routing skill exploring indexing
options). Even then:
- `"offer": false` with reason `bin-absent` → the installed gstack predates
the code-intelligence CLI. Skip this step entirely and continue with the
skill — the user asked for gbrain, so set up gbrain. Never block setup on