agentleFS
rakaarwakyrakaarwaky/agents-arwaky/skills/autonomous-ai-agents/grok-build/SKILL.md

grok-build

Skill0 starsChanged 7 days agoMITView on GitHub

Delegates coding and multi-agent orchestration to the local Grok Build CLI over the OmniRoute gateway (model myomniroute, not an xAI subscription) via Orca CLI worktrees. Hermes delegates exclusively through Orca CLI (`orca worktree create ... --agent grok` and `orca terminal send`) — never running grok directly in a headless terminal. Use when a coding task should go to Grok instead of being implemented inline, or when authoring Rhai workflows. Sibling of the orca skill: orca owns the worktrees and terminals; this defines the Grok agent surface inside them.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Verify the gateway first: Before relying on any run, curl -s -o /dev/null -w '%{http_code}\n' "$OMNIROUTE_URL/v1/models" must return 200.

    line 25
  2. Very specific:

    Auth is the gateway key: Never run grok login and never set XAI_API_KEY.

    line 26
  3. Distinctive:

    After each round, measure remaining scope against the brief with a targeted grep of the *feature's key symbols* (the constant names, fn …

    line 68
  4. Distinctive:

    If files remain, write a focused follow-up brief listing exactly the remaining files + the specific edit in each, and re-run the same …

    line 69
  5. Distinctive:

    After the last round, run the repo's full verification gate yourself (fmt, clippy, build, tests) in the worktree, then commit.

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Grok Build

Delegate coding tasks to Grok Build: Grok reads files, writes code, runs shell commands, spawns subagents, and manages git workflows. This skill owns the Grok agent surface inside Orca worktrees; the orca skill owns the worktrees and terminals it runs in. Hermes never launches Grok directly — the delegation path always runs through Orca CLI. Every invocation follows the rules below, then loads only the reference the task names.

Global rules

  • Verify the gateway first. Before relying on any run, curl -s -o /dev/null -w '%{http_code}\n' "$OMNIROUTE_URL/v1/models" must return 200; 401 means the OMNIROUTE_KEY is missing or invalid and no run will work.
  • Auth is the gateway key. Never run grok login and never set XAI_API_KEY; this machine runs Grok against the local OmniRoute gateway, not an xAI subscription.
  • Delegate via Orca — never directly. All coding-task runs go through orca CLI worktrees with the Grok agent slot (--agent grok). Two valid launch paths: interactive TUI driven with orca terminal send, or headless one-shots grok -p <brief> --cwd <workdir> --always-approve --max-turns <n> that Hermes itself launches inside the Orca-managed worktree (cd into the worktree, then run the headless flags; the worktree is the Orca artifact, the launch is the driver). A bare grok -p run with no worktree at all (i.e. in Hermes's own scratch dir) is the forbidden pattern. For large multi-file refactors, headless one-shots inside the Orca worktree are the reliable mode: --max-turns caps each round, and you re-run with a focused follow-up brief per round.
  • One orchestration mode per task. Headless -p for one-shots (PREFERRED); interactive PTY + tmux only for multi-turn TUI work. Both modes run with workdir (or --cwd) set so Grok targets the right project; long tasks run in the background with background=true, notify_on_complete=true and are monitored via the process tool.
  • Re-read ~/.grok/config.toml before relying on any config block. Provider, model, and auth choices change when the gateway is re-pointed; a stale config block is the usual cause of "why is it still trying xAI". The block below is a copy, not the source of truth:
[model_providers.omniroute]
base_url = "http://127.0.0.1:7777/v1"
api_backend = "chat_completions"
env_key = "OMNIROUTE_KEY"

[model.myomniroute]
model = "myomniroute"
name = "myomniroute"
model_provider = "omniroute"
context_window = 262144

[model.myomnivision]
model = "myomnivision"
name = "myomnivision"
model_provider = "omniroute"
context_window = 262144

[models]
default = "myomniroute"
image_description = "myomnivision"

[ui]
permission_mode = "always-approve"

Delegation verification pitfalls — these cost rework when ignored:

  • Confirm accepted: true before considering a brief delivered. orca terminal send can return ok while the brief never reaches the TUI; treat absence of accepted: true as not delivered.
  • After accepted: true, stop driving. Continued orca terminal send calls interleave with Grok's work. Disengage and verify via worktree state instead.
  • tui-idle is not a reliable progress signal. The terminal stream can stay empty (tail: [], 0 returned lines) while Grok actively writes files and commits. Verify progress in the worktree directory: git log --oneline -3, git status --short, git show --stat <head-sha>, and ls <expected-new-file>.
  • Verify the diff, not just the commit SHA. A matching commit message proves the commit exists, not that it contains the briefed changes. Run git diff <base>..HEAD and confirm it matches the brief exactly.
  • Grok can omit pieces it considers incidental. Grok may drop functions or methods it thinks are "legacy" while keeping callers that need them. Always run the full test suite in the worktree before declaring done — not just the subset Grok mentions.
  • Clean up. tmux kill-session -t <name> when a TUI session is done; scratch commit tasks without a repo use mktemp -d && git init.

Multi-round large refactor recipe (headless inside the Orca worktree). For a brief that touches dozens of files, Grok hits --max-turns mid-task and leaves a partially-applied tree. Do not re-send the whole original brief expecting it to "continue" — it re-reads from scratch each round. Instead:

  1. After each round, measure remaining scope against the brief with a targeted grep of the feature's key symbols (the constant names, fn names, CLI variants, MCP tool names — not the generic word), and count matched files.
  2. If files remain, write a focused follow-up brief listing exactly the remaining files + the specific edit in each, and re-run the same headless command. Repeat until the symbol grep returns 0.
  3. A headless grok -p with --max-turns exits cleanly (code 0, "Max turns reached" in stderr) even when the work is incomplete — the exit code is not a progress signal; only the grep count is.
  4. After the last round, run the repo's full verification gate yourself (fmt, clippy, build, tests) in the worktree, then commit. Grok's final round may not have run the gate.

This loop — full brief, then N focused follow-ups keyed on a shrinking grep count — is the standard pattern for 40+ file refactors and is far more reliable than one giant --max-turns 100 run, which burns the whole budget re-reading files instead of editing.

Routing

TaskReference
Full flag tables, sessions, TUI cheatsheet, dashboard commandsreferences/flags-and-tui.md
Delegation recipes: read-only audit notes, PR review (diff-piped, clone-to-temp), parallel issue fixing across worktreesreferences/delegation-scenarios.md
Authoring and editing .rhai workflows: procedure, smoke-check, save, and the complete Rhai language referencereferences/workflow-authoring.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.