Connect Grok Build as a first-class coding agent - #344
Open
shawnyeager wants to merge 3 commits into
Open
Conversation
Sensitive Change Detection (shadow mode)This PR modifies control-plane files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Grok Build as a first-class coding-agent integration alongside Claude Code and Codex.
Changes:
- Adds Grok detection, skill installation, health checks, refresh, and removal.
- Integrates Grok into setup commands, environment selection, documentation, and installer behavior.
- Expands tests, though binary-only Grok detection remains untested.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
.surface |
Adds the Grok setup command. |
AGENTS.md |
Documents Grok architecture. |
README.md |
Documents Grok setup and selection. |
scripts/install.ps1 |
Documents the Grok selector. |
scripts/install.sh |
Documents the Grok selector. |
tests/e2e/installer.bats |
Extends installer compatibility coverage. |
internal/harness/grok.go |
Implements Grok detection and health checks. |
internal/harness/grok_test.go |
Tests Grok home and skill health. |
internal/harness/agent.go |
Updates agent metadata examples. |
internal/harness/agent_test.go |
Verifies Grok registration. |
internal/cmd/setup_agent.go |
Implements hey setup grok. |
internal/cmd/setup_agents.go |
Adds Grok selection and aggregation. |
internal/cmd/setup_agents_test.go |
Tests Grok setup and removal flows. |
internal/cmd/setup_agents_remove.go |
Removes managed Grok skills. |
internal/cmd/setup_test.go |
Covers Grok command registration. |
internal/cmd/skill_install.go |
Installs skills for detected Grok. |
internal/cmd/skill_install_test.go |
Tests Grok ownership protections. |
internal/cmd/skill_refresh.go |
Refreshes Grok skill copies. |
internal/cmd/skill_refresh_test.go |
Tests Grok refresh behavior. |
internal/cmd/help_topics.go |
Documents Grok environment selection. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jeremy
force-pushed
the
grok-agent-setup
branch
from
September 10, 2026 19:25
b5b1102 to
64f367e
Compare
Register Grok in the agent harness, add hey setup grok, and include Grok in skill install, doctor, setup agents, and --remove. No Grok plugin yet. Grok, like Codex since basecamp#385, discovers the shared ~/.agents/skills/hey skill directly (xAI's docs list ~/.agents/skills/ among the user-level skill locations), so hey setup grok installs the shared skill and confirms it is healthy rather than copying it into $GROK_HOME/skills. Detection uses $GROK_HOME or ~/.grok, or a grok binary on PATH, ~/.local/bin, or $GROK_HOME/bin, where Grok Build's installers put it.
jeremy
force-pushed
the
grok-agent-setup
branch
from
September 10, 2026 19:35
64f367e to
4ec0bd5
Compare
Grok arrived as a copy of Codex: a second harness file and a second block in every command that touches a shared-skill agent (setup handlers, hey skill install, refresh, --remove, the HEY_SETUP_AGENT values), differing only in name, id, home env var, home directory and binary. Two copies of one shape drift — the binary-only detection test existed for Grok but not for Codex, the ~/<home>/bin lookup existed for Grok but not for Codex, and the legacy-copy migration basecamp#385 added existed for Codex but not for Grok. Say it once. harness.SkillAgent carries those five fields; Codex and Grok are two values in a table that init() registers, and Detect, Home, FindBinary, LegacySkillPath and CheckSkill are its methods. The cmd package loops over harness.SkillAgents() wherever it used to name each agent, so a third shared-skill agent is a new row and the prose lists in the help topic, installers and docs — nothing else. AgentInfo gains FindBinary so setup's "binary not found" remediation reads the registry rather than a switch on ids. FindBinary looks on PATH, then ~/.local/bin, then the agent's own home's bin for every row: Grok Build's installers write ~/.grok/bin/grok ($GROK_HOME/bin/grok for the npm package), and a uniform rule costs Codex one stat. Legacy migration is uniform too: a hey-cli-marked copy in any row's own skills directory is a duplicate the agent would list twice, and only hey-cli could have written a marked one, so doctor flags it, and setup, hey skill install and refresh remove it once the shared skill is healthy, for Grok as for Codex. The twin tests fold the same way: one table-driven test per behavior in harness and cmd, run once per row, so a behavior one agent has and the other lacks is a failing test rather than a gap.
jeremy
force-pushed
the
grok-agent-setup
branch
from
September 10, 2026 19:37
4ec0bd5 to
38aed68
Compare
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grok Build can now be connected the same way Codex is.
hey setup grokcopies the HEY skill into$GROK_HOME/skills/hey(default~/.grok/skills/hey).hey skill install, skill refresh,hey doctor,hey setup agents, and--removeall include Grok. There is no Grok plugin. Health is skill presence only, matching Codex.HEY_SETUP_AGENTacceptsgrok.allattempts every registered agent, including Grok. Detection uses$GROK_HOMEor~/.grok, or agrokbinary on PATH, matching Codex.Session-settled decisions carried from planning: Grok matches Codex, not Claude — no
.grok-plugin(user-directed); detect via$GROK_HOME/~/.grokor the grok binary (user-approved);HEY_SETUP_AGENT=alluses AllAgents() so Grok is always attempted (user-approved).Tests
make testpassed locally (go test ./internal/...)What changed since review
Rebased onto main twice. The first pass moved this PR's README paragraphs to where main put them (
docs/agents.md,docs/cli.md; the README keeps ahey setup grokline besidehey setup codex). The second absorbed #385, which changed what "Grok matches Codex" means: Codex no longer gets a copy in~/.codex/skills/hey— it discovers the shared~/.agents/skills/heydirectly,hey setup codexconfirms that skill and migrates a hey-cli-marked legacy copy away, and doctor fails on a managed duplicate. xAI's docs say Grok reads~/.agents/skills/too, so Shawn's first commit is ported to that shape:hey setup grokinstalls the shared skill and confirms it; nothing is written under~/.grok. His authorship and dates are intact; the commit body says how it was ported.One follow-up commit folds the copy: Codex and Grok differ only in name, id, home env var, home directory and binary, so they are two rows of one
harness.SkillAgenttable (internal/harness/skill_agent.go) instead of two files, and everything ininternal/cmdthat touches a shared-skill agent — the setup handlers,hey skill install, refresh,--remove, theHEY_SETUP_AGENTvalues, #385's legacy-copy migration — loops overharness.SkillAgents()rather than naming each.AgentInfogainsFindBinaryso setup's "binary not found" remediation reads the registry instead of a switch on ids. The tests fold the same way: one table-driven test per behavior, run once per agent, so Copilot's binary-only detection case and #385's migration cases now cover both.Facts checked against xAI's sources, since the code models Grok on Codex:
GROK_HOMEoverrides~/.grok— docs.x.ai/build/settings ("To configure the default home directory, you can set$GROK_HOME");xai-org/grok-buildxai-dirs:$GROK_HOMEverbatim when non-empty, else<home>/.grok.~/.agents/skills/— docs.x.ai/build/features/skills-plugins-marketplaces, "Agents.md compatibility": Grok "discovers user-level skills and commands from~/.agents/skills/"; the loader inxai-grok-agent/src/prompt/skills.rsaddshome.join(".agents")alongsidegrok_home. That is why the shared skill is enough and no~/.grok/skills/heycopy is made (Grok dedups skills by name, so a copy would be redundant rather than doubled, but it would still be a second file to keep in sync).~/.grok/skills/<name>/SKILL.mdis also a documented user-level location, which is why a hey-cli-marked copy there is treated as a legacy duplicate the same way~/.codex/skills/heyis.~/.grok/bin/grok(x.ai/cli/install.sh:BIN_DIR="${GROK_BIN_DIR:-$HOME/.grok/bin}"; the@xai-official/groknpm postinstall writes$GROK_HOME/bin), which is whyFindBinarylooks in the agent home'sbinafter PATH and~/.local/bin— for both rows..grok-plugin/plugin.jsonmanifest exists as a fallback behind a rootplugin.json, so "no Grok plugin yet" is a statement about this repo, not about Grok.The five
install_ssh_key.batscases fail locally on macOS (stat -c) on main as well; unrelated to this PR and green on CI's Linux runners.Summary by cubic
Connects Grok Build as a first-class coding agent, the same way Codex works. Codex and Grok now share one
harness.SkillAgenttable, so adding a new skill-only agent is a new row instead of a near-copy of the Codex file.hey setup grokinstalls the shared skill;hey skill install, refresh,hey doctor,hey setup agents, and--removeall include Grok.HEY_SETUP_AGENTacceptsgrok, andallnow attempts every registered agent.$GROK_HOME/~/.grokor agrokbinary on PATH,~/.local/bin, or the agent home'sbin.hey skill install, refresh, and doctor treat a hey-cli-marked copy in either agent's own skills directory as a managed duplicate and migrate it away.Written for commit 38aed68. Summary will update on new commits.