Skip to content

v1.59.1.0 feat: add /grok skill for xAI second opinion from Claude Code#2016

Closed
ljodea wants to merge 5 commits into
garrytan:mainfrom
ljodea:feat/grok-outside-voice-skill
Closed

v1.59.1.0 feat: add /grok skill for xAI second opinion from Claude Code#2016
ljodea wants to merge 5 commits into
garrytan:mainfrom
ljodea:feat/grok-outside-voice-skill

Conversation

@ljodea

@ljodea ljodea commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Adds /grok — the symmetric counterpart to /codex for getting an independent second opinion from Grok Build CLI while working in Claude Code.

Three modes, same contract as /codex:

  • review — diff-scoped review with [P1]/[P2] findings and pass/fail gate
  • challenge — adversarial failure-mode review
  • consult — open Q&A with session resume via -r / -c

Relationship to #1631

#1631 (stale, open since 2025-05-21) tackles a different but related problem: when Codex is broken/unavailable during automatic outside-voice steps in /plan-*-review and /office-hours, the chain today falls through to a Claude subagent — losing cross-model independence.

#1631 proposed Codex → llm CLI (datasette/llm, e.g. llm-xai) → Claude subagent.

This PR does not supersede #1631 entirely. It adds an explicit /grok skill (like /codex) but does not wire Grok into the plan-review fallback chain. After merge, a natural follow-up is to revive #1631's intent using Grok Build CLI (grok --prompt-file, gstack-grok-probe) instead of datasette llm, reusing the probe/auth patterns from this PR.

Implementation

  • grok/SKILL.md.tmpl — skill workflow (read-only via --permission-mode plan, --prompt-file, --max-turns, --effort)
  • bin/gstack-grok-probe — auth (~/.grok/auth.json, $XAI_API_KEY), timeout wrapper, telemetry
  • test/grok-hardening.test.ts — probe unit tests + shell invocation invariants (no --reasoning-effort)
  • scripts/resolvers/review.tsgrok-review row in ## GSTACK REVIEW REPORT
  • Docs: README power tools, docs/skills.md, CLAUDE.md

Usage (after merge + ./setup)

/grok review
/grok challenge security
/grok Is this migration ordering safe?

Requires grok on PATH and auth via grok login or $XAI_API_KEY.

Test plan

  • bun test test/grok-hardening.test.ts (10/10 pass)
  • bun run gen:skill-docs + bun run gen:skill-docs --host all
  • Manual smoke: grok --prompt-file ... --permission-mode plan diff review in temp repo

@trunk-io

trunk-io Bot commented Jun 15, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@ljodea

ljodea commented Jun 16, 2026

Copy link
Copy Markdown
Author

Follow-up: CONTRIBUTING.md compliance pass

I opened this before reading CONTRIBUTING.md and circled back to close the gaps. Pushed one corrective commit (c1fada2) — no history rewrite, branch was already up to date with main:

  • AGENTS.md — registered /grok in the skill table (the skill-validation doc-inventory cross-check requires every skill with a SKILL.md.tmpl to appear in both AGENTS.md and docs/skills.md; docs/skills.md already had it, AGENTS.md didn't).
  • Golden snapshots — refreshed test/fixtures/golden/{claude,codex,factory}-ship-SKILL.md. The grok-review dashboard line added to the shared ship source regenerated ship/SKILL.md, so the host-config golden-file regression tests needed the snapshots updated (a clean 2-line change per host).
  • VERSION + CHANGELOG — bumped VERSION to 1.59.1.0 (next free slot per gstack-next-version; v1.59.0.0 feat: /land skill + trunk.io merge-queue integration #1815 holds 1.59.0.0) and added a CHANGELOG entry, to match the per-PR version convention. Happy to re-bump if the queue moves before merge, or to drop it if you'd rather assign at merge.

Verification (local):

  • bun run gen:skill-docs --host all → clean git diff across Claude / Codex / Factory hosts, so skill-docs.yml should pass.
  • bun test → green except 5 pre-existing gstack-gbrain-detect failures that fail identically on origin/main (my local box has no gbrain binary; status 127). They're unrelated to this PR.

No checks have run yet on the branch — looks like it's waiting on a first-time-contributor "Approve and run workflows." Could you kick that off when you get a chance? Thanks, and sorry for the process miss on the first pass.

@github-actions github-actions Bot changed the title feat: add /grok skill for xAI second opinion from Claude Code v1.59.1.0 feat: add /grok skill for xAI second opinion from Claude Code Jun 16, 2026
ljodea and others added 3 commits June 22, 2026 10:19
Mirror the /codex outside-voice contract for Grok Build CLI: review
(pass/fail on [P1]), adversarial challenge, and consult with session
resume. Runs read-only via --permission-mode plan with gstack-grok-probe
for auth, timeout, and telemetry.

Includes grok-review rows in the GSTACK REVIEW REPORT resolver, docs,
and grok-hardening unit tests.
…ERSION/CHANGELOG

The original PR was hand-opened before reading CONTRIBUTING.md and missed
three CI-gating requirements:

- Register /grok in AGENTS.md (skill-validation doc-inventory cross-check).
- Refresh the three ship golden snapshots (claude/codex/factory) that the
  grok-review dashboard line in ship/SKILL.md regenerated — host-config
  golden-file regression tests.
- Bump VERSION to the next free queue slot (1.59.1.0, via gstack-next-version)
  and add a CHANGELOG entry, matching every merged gstack PR.

Verified: `bun run gen:skill-docs --host all` is clean across all hosts, and
`bun test` is green except 5 pre-existing gstack-gbrain-detect failures that
fail identically on origin/main (local gbrain tooling absent).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ljodea ljodea force-pushed the feat/grok-outside-voice-skill branch from bfae6ff to e0eedb0 Compare June 22, 2026 15:26
ljodea and others added 2 commits June 25, 2026 15:08
Resolve PR garrytan#2016 conflicts against current main:
- VERSION / package.json: keep 1.59.1.0 (ahead of main's 1.58.5.0)
- CHANGELOG.md: keep both 1.59.1.0 and 1.58.5.0 entries in order
- gstack/llms.txt + rendered SKILL.md: regenerated via `bun run gen:skill-docs --host all`

Pulls in main's first-run activation scaffold + gstack router front door.

Known pre-existing issue (unchanged by this merge): the grok skill is not
excluded from external (Codex) host output, so `gen-skill-docs.test.ts`
"no ~/.claude/ paths in Codex output" fails. Tracked tree is unaffected
(host outputs are gitignored); fix deferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pin every /grok headless invocation to -m grok-4.5 (still overridable via user -m).
Update invocation contract, Model & Effort docs, and harden tests for the default.
@ljodea

ljodea commented Jul 11, 2026

Copy link
Copy Markdown
Author

Superseded by #2241

Closing this PR in favor of a clean re-land.

Why: The original was useful product-wise (and I've been using the fork skill daily), but it was opened before reading CONTRIBUTING fully, then drifted — VERSION/title behind the release queue, merge conflicts against main, deferred host-exclusion issues. Not a rejection of Grok support; maintainers already noted on #2028 that a /grok skill (this PR) is orthogonal to Grok-as-host.

What #2241 keeps: /grok three-mode skill, gstack-grok-probe, hardening tests, review-report row, docs inventory, non-Claude host skip parity with /codex, VERSION 1.62.0.0 on current main.

What stays out of both PRs: plan-review fallback chain (#1631), host registration (#2028).

Thanks for any time spent looking at this one — the better packaging is in #2241.

@ljodea

ljodea commented Jul 11, 2026

Copy link
Copy Markdown
Author

Superseded by #2241 (clean re-land on current main).

@ljodea ljodea closed this Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant