[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DFQW7CBGCCZRY4ANZJ4CH7":3,"skill-same:01M6DFQW7CBGCCZRY4ANZJ4CH7":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":61,"commitSha":62,"skillDirectory":63,"forksCount":64,"repositoryHtmlUrl":65,"repositoryHomepageUrl":6,"ownerHtmlUrl":66,"ownerBlogUrl":6,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6DFQW7CBGCCZRY4ANZJ4CH7","grok",null,"Delegate coding to xAI Grok Build CLI (features, PRs).","zapabob\u002FSkills","zapabob","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F130830376?v=4","01M6DBMYZAGRTFQDSQYW3W764P","峯岸 亮","01M6DBMZ3GKDSJ01NZ9XTZD7JD",2,"MIT","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Farchive\u002Fskill-md-reviewed\u002Fsha256\u002F51\u002F51623f5627eb62c739497f158267f6192c952a2ba73c6ed4591856561f3b207b\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[5,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"coding","claude-code","build","Coding-Agent","build cli","delegate","hermes agent","hermes","xai","macos","refactoring","code-review","code","windows","automation","codex","linux","cli","review","2026-11-10 10:12:30",false,"---\nname: grok\ndescription: \"Delegate coding to xAI Grok Build CLI (features, PRs).\"\nversion: 0.1.1\nauthor: Matt Maximo (MattMaximo), Hermes Agent\nlicense: MIT\nplatforms: [linux, macos, windows]\nmetadata:\n  hermes:\n    tags: [Coding-Agent, Grok, xAI, Code-Review, Refactoring, Automation]\n    related_skills: [codex, claude-code, hermes-agent]\n---\n\n# Grok Build CLI — Hermes Orchestration Guide\n\nDelegate coding tasks to [Grok Build](https:\u002F\u002Fdocs.x.ai\u002Fbuild\u002Foverview) (xAI's\nautonomous coding agent CLI, the `grok` command) via the Hermes terminal. Grok\ncan read files, write code, run shell commands, spawn subagents, and manage git\nworkflows. It runs three ways: an interactive TUI, **headless** (`-p`), and as\nan **ACP agent** over JSON-RPC.\n\nThis is the third sibling to `codex` and `claude-code`. The orchestration\npattern is nearly identical — **prefer headless `-p` for one-shots**, use a PTY\nfor interactive sessions.\n\n## When to use\n\n- Building features\n- Refactoring\n- PR reviews\n- Batch issue fixing\n- Any task where you'd otherwise reach for Codex \u002F Claude Code but want Grok\n\n## Prerequisites\n\n- **Install (preferred):** `npm install -g @xai-official\u002Fgrok`\n  - The official installer `curl -fsSL https:\u002F\u002Fx.ai\u002Fcli\u002Finstall.sh | bash` also\n    works, but the `x.ai` host is Cloudflare-walled in some environments. The\n    npm path avoids that dependency entirely.\n- **Auth — SuperGrok \u002F X Premium+ subscription (primary path):**\n  - Run `grok login` once → opens a browser for OAuth → token cached in\n    `~\u002F.grok\u002Fauth.json`. This uses your **SuperGrok or X Premium+** subscription\n    (no per-token API billing).\n  - Check sign-in state by looking for `~\u002F.grok\u002Fauth.json`, or run a cheap\n    headless smoke test: `grok --no-auto-update -p \"Say ok.\"`\n  - In the TUI, `\u002Flogout` signs out and `\u002Flogin` (or relaunching) signs back in.\n- **No git repo required** — unlike Codex, Grok runs fine outside a git\n  directory (good for scratch\u002Fthrowaway tasks).\n- **Claude Code \u002F AGENTS.md compatible with zero config** — Grok auto-reads\n  `CLAUDE.md`, `.claude\u002F` (skills, agents, MCPs, hooks, rules), and the\n  `AGENTS.md` family. Existing project context just works.\n\n> **API-key fallback (not the default for this user):** Grok also supports\n> setting the `XAI_API_KEY` environment variable for pay-as-you-go billing\n> via `api.x.ai`. Only use\n> this if `grok login` \u002F SuperGrok auth is unavailable. The subscription path\n> (`grok login`) is the intended setup here.\n\n## Two Orchestration Modes\n\n### Mode 1: Headless (`-p`) — Non-Interactive (PREFERRED)\n\nRuns a one-shot task, prints the result, and exits. No PTY, no interactive\ndialogs to navigate. This is the cleanest integration path — the analog of\n`claude -p` and `codex exec`.\n\n```\nterminal(command=\"grok --no-auto-update -p 'Add a dark mode toggle to settings'\", workdir=\"\u002Fpath\u002Fto\u002Fproject\", timeout=180)\n```\n\nAlways pass `--no-auto-update` in automation to skip background update checks.\n\n**When to use headless:**\n- One-shot coding tasks (fix a bug, add a feature, refactor)\n- CI\u002FCD automation and scripting\n- Structured output parsing with `--output-format json`\n- Any task that doesn't need multi-turn conversation\n\n### Mode 2: Interactive PTY — Multi-Turn TUI Sessions\n\nThe TUI is a fullscreen, mouse-interactive app. Drive it with `pty=true`. For\nrobust monitoring\u002Finput use tmux (same pattern as the `claude-code` skill).\n\n```\n# Launch in a tmux session for capture-pane monitoring\nterminal(command=\"tmux new-session -d -s grok-work -x 140 -y 40\")\nterminal(command=\"tmux send-keys -t grok-work 'cd \u002Fpath\u002Fto\u002Fproject && grok' Enter\")\n\n# Wait for startup, then send a task\nterminal(command=\"sleep 5 && tmux send-keys -t grok-work 'Refactor the auth module to use JWT' Enter\")\n\n# Monitor progress\nterminal(command=\"sleep 15 && tmux capture-pane -t grok-work -p -S -50\")\n\n# Exit when done\nterminal(command=\"tmux send-keys -t grok-work '\u002Fquit' Enter && sleep 1 && tmux kill-session -t grok-work\")\n```\n\n**Tip for headless-but-inline output:** if you want TUI-style output without the\nfullscreen alt-screen takeover (e.g. for cleaner logs), add `--no-alt-screen`.\nFor pure automation, headless `-p` is still cleaner than the TUI.\n\n## Headless Deep Dive\n\n### Common Flags\n\n| Flag | Effect |\n|------|--------|\n| `-p, --single \u003CPROMPT>` | Send one prompt, run headless, exit |\n| `-m, --model \u003CMODEL>` | Choose a model |\n| `-s, --session-id \u003CUUID>` | Assign a **NEW** valid UUID to a fresh conversation (must not already exist). Does **not** resume — use `--resume`\u002F`--continue` for that. Only valid with `--resume`\u002F`--continue` when paired with `--fork-session` |\n| `-r, --resume [\u003CUUID>]` | Resume an existing session by its UUID (or the most recent if omitted) |\n| `-c, --continue` | Continue the most recent session in the current directory |\n| `--fork-session` | When resuming, create a new session ID instead of reusing the original |\n| `--max-turns \u003CN>` | Cap the maximum number of agent turns |\n| `--cwd \u003CPATH>` | Set the working directory |\n| `--output-format \u003CFMT>` | `plain` (default), `json`, or `streaming-json` |\n| `--always-approve` | Auto-approve all tool executions (the `--full-auto` \u002F `--yolo` equivalent) |\n| `--no-alt-screen` | Run inline, no fullscreen TUI takeover |\n| `--no-auto-update` | Skip background update checks (use in all automation; hidden from `--help` but still works) |\n\n### Output Formats\n\n- `plain` — human-readable text (default)\n- `json` — one JSON object at the end of the run (parse the result cleanly)\n- `streaming-json` — newline-delimited JSON events as they arrive\n\n```\n# Structured result for parsing\nterminal(command=\"grok --no-auto-update -p 'List all TODO comments in src\u002F' --output-format json\", workdir=\"\u002Fproject\", timeout=120)\n\n# Auto-approve for autonomous building\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the database layer and run the tests'\", workdir=\"\u002Fproject\", timeout=300)\n```\n\n### Background Mode (Long Tasks)\n\n```\n# Start headless in background\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the auth module'\", workdir=\"\u002Fproject\", background=true, notify_on_complete=true)\n# Returns session_id\n\n# Monitor\nprocess(action=\"poll\", session_id=\"\u003Cid>\")\nprocess(action=\"log\", session_id=\"\u003Cid>\")\n\n# Kill if needed\nprocess(action=\"kill\", session_id=\"\u003Cid>\")\n```\n\nFor an interactive (TUI) background session, use `pty=true` + tmux and monitor\nwith `tmux capture-pane`, exactly like the `claude-code` \u002F `codex` skills.\n\n### Session Continuation\n\nSessions are keyed by **UUID**, not by name. `--session-id` assigns a *new* UUID\nto a fresh run (it does **not** resume); `--resume` takes an existing session's\nUUID (or omit the value to resume the most recent).\n\n```\n# Start a session with a self-assigned UUID (must be a valid, unused UUID)\nSID=$(uuidgen)\nterminal(command=\"grok --no-auto-update -s $SID -p 'Start refactoring the database layer' --always-approve\", workdir=\"\u002Fproject\", timeout=240)\n\n# Resume that exact session later by its UUID\nterminal(command=\"grok --no-auto-update -r $SID -p 'Now add connection pooling' --always-approve\", workdir=\"\u002Fproject\", timeout=180)\n\n# Or just continue the most recent session in this directory (no UUID needed)\nterminal(command=\"grok --no-auto-update -c -p 'What did you change last time?'\", workdir=\"\u002Fproject\", timeout=60)\n```\n\n## Read-Only Audit → Markdown Note Pattern\n\nTo have Grok review local artifacts and return a clean markdown note (for\nObsidian or a repo) without mutating anything:\n\n1. Prepare stable input files first with Hermes tools (`read_file`,\n   `write_file`). Snapshot only the relevant context into a temp file rather\n   than dumping raw paths.\n2. Run Grok headless **without** `--always-approve` so it cannot auto-write, and\n   demand `markdown only, no preamble`.\n3. Save Grok's stdout straight into the destination note with `write_file()`.\n\n```\ngrok --no-auto-update -p \"Read ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fcurrent.md and ~\u002F.hermes\u002Fcache\u002Fscratch\u002Finventory.md. Produce markdown only, no preamble. Output a clean note titled 'Cleanup Review'.\" --output-format plain\n```\n\n**Pitfall (same as Claude Code):** for document rewrites, a loose \"rewrite this\"\nprompt may return a change summary instead of the full file. Instead: pipe the\nfile in, and demand `Return ONLY the full revised markdown document. No intro,\nno explanation, no code fences. Start immediately with '# Title'.` Verify the\nfirst lines with `read_file()` before overwriting the destination.\n\n## PR Review Patterns\n\n### Quick Review (Headless)\n\n```\nterminal(command=\"cd \u002Fpath\u002Fto\u002Frepo && git diff main...feature-branch | grok --no-auto-update -p 'Review this diff for bugs, security issues, and style problems. Be thorough.'\", timeout=120)\n```\n\n### Clone-to-temp Review (safe, no repo mutation)\n\n```\nterminal(command=\"REVIEW=$(mktemp -d) && git clone https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && grok --no-auto-update -p 'Review the changes vs origin\u002Fmain. Check bugs, security, race conditions, missing tests.'\", pty=true, timeout=300)\n```\n\n### Post the review\n\n```\nterminal(command=\"gh pr comment 42 --body '\u003Creview text>'\", workdir=\"\u002Fpath\u002Fto\u002Frepo\")\n```\n\n## Parallel Issue Fixing with Worktrees\n\n```\n# Create worktrees\nterminal(command=\"git worktree add -b fix\u002Fissue-78 ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78 main\", workdir=\"~\u002Fproject\")\nterminal(command=\"git worktree add -b fix\u002Fissue-99 ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-99 main\", workdir=\"~\u002Fproject\")\n\n# Launch Grok headless in each (background)\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #78: \u003Cdescription>. Commit when done.'\", workdir=\"~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78\", background=true, notify_on_complete=true)\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #99: \u003Cdescription>. Commit when done.'\", workdir=\"~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-99\", background=true, notify_on_complete=true)\n\n# Monitor\nprocess(action=\"list\")\n\n# After completion: push and open PRs\nterminal(command=\"cd ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78 && git push -u origin fix\u002Fissue-78\")\nterminal(command=\"gh pr create --repo user\u002Frepo --head fix\u002Fissue-78 --title 'fix: ...' --body '...'\")\n\n# Cleanup\nterminal(command=\"git worktree remove ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78\", workdir=\"~\u002Fproject\")\n```\n\n## Useful Subcommands & TUI Commands\n\n| Command | Purpose |\n|---------|---------|\n| `grok` | Start the interactive TUI |\n| `grok -p \"query\"` | Headless one-shot |\n| `grok login` \u002F `grok logout` | Sign in \u002F out (SuperGrok \u002F X Premium+ OAuth) |\n| `grok inspect` | Show what Grok discovered in cwd: config sources, instructions, skills, plugins, hooks, MCP servers |\n| `grok agent stdio` | Run as an ACP agent over JSON-RPC (for IDE\u002Ftool integration) |\n| `grok update` | Update the CLI (needs the `x.ai` host; skip in automation) |\n\nTUI slash commands (interactive only): `\u002Fmodel \u003Cname>`, `\u002Falways-approve`,\n`\u002Fplan`, `\u002Fcontext`, `\u002Fcompact`, `\u002Fresume`, `\u002Fsessions`, `\u002Ffork`, `\u002Fusage`,\n`\u002Fquit`. `Shift+Tab` cycles session modes (including Plan mode, which blocks\nwrite tools except the session plan file).\n\n## Config (`~\u002F.grok\u002Fconfig.toml`)\n\n```toml\n[cli]\nauto_update = false          # skip background update checks persistently\n\n[ui]\npermission_mode = \"ask\"      # or \"always-approve\" to skip tool prompts by default\n\n[models]\ndefault = \"grok-build-0.1\"\n```\n\nPut global preferences in `~\u002F.grok\u002Fconfig.toml` (not project-scoped\n`.grok\u002Fconfig.toml`). `permission_mode` supersedes the legacy `approval_mode` \u002F\n`yolo = true` keys.\n\n## Pitfalls & Gotchas\n\n1. **Auth is subscription-gated.** `grok login` requires a SuperGrok or X\n   Premium+ subscription. If login fails or there's no `~\u002F.grok\u002Fauth.json`,\n   confirm the subscription is active before falling back to `XAI_API_KEY`.\n2. **Don't conflate Hermes' xAI auth with the `grok` CLI's auth.** Hermes'\n   `x_search` runs on its own xAI OAuth; the standalone `grok` CLI has a\n   separate token in `~\u002F.grok\u002Fauth.json`. A working `x_search` does NOT mean\n   `grok` is logged in.\n3. **Always pass `--no-auto-update` in automation** — otherwise Grok phones home\n   for update checks (and `x.ai`\u002F`storage.googleapis.com` may be unreachable).\n4. **Prefer npm install over the curl installer** — `npm install -g\n   @xai-official\u002Fgrok` avoids the Cloudflare-walled `x.ai` host.\n5. **`--always-approve` is the autonomous-build switch.** Without it, headless\n   runs may stall waiting on tool-approval prompts. Omit it deliberately for\n   read-only review\u002Faudit work so Grok can't mutate files.\n6. **Headless `-p` skips TUI dialogs**; the TUI needs `pty=true` (+ tmux for\n   monitoring), just like Claude Code.\n7. **Use `--no-alt-screen`** if you run the TUI inline and the fullscreen\n   alt-screen takeover garbles captured output.\n8. **No git repo needed**, but for PR\u002Fcommit workflows you still want one — use\n   `mktemp -d && git init` for scratch commit tasks.\n9. **Clean up tmux sessions** with `tmux kill-session -t \u003Cname>` when done.\n\n## Rules for Hermes Agents\n\n1. **Prefer headless `-p`** for single tasks — cleanest integration, structured\n   output via `--output-format json`.\n2. **Always set `workdir`** (or `--cwd`) so Grok targets the right project.\n3. **Pass `--no-auto-update`** in every automated invocation.\n4. **Use `--always-approve` only when Grok should write autonomously**; omit it\n   for read-only reviews and audits.\n5. **Background long tasks** with `background=true, notify_on_complete=true` and\n   monitor via the `process` tool.\n6. **Use tmux for multi-turn interactive work** and monitor with\n   `tmux capture-pane -t \u003Csession> -p -S -50`.\n7. **Verify auth before relying on it** — check `~\u002F.grok\u002Fauth.json` or run a\n   cheap `grok -p \"Say ok.\"` smoke test; don't assume Hermes' xAI auth carries\n   over.\n8. **Report results to the user** — summarize what Grok changed and what's left.\n","# Grok Build CLI — Hermes Orchestration Guide\n\nDelegate coding tasks to [Grok Build](https:\u002F\u002Fdocs.x.ai\u002Fbuild\u002Foverview) (xAI's\nautonomous coding agent CLI, the `grok` command) via the Hermes terminal. Grok\ncan read files, write code, run shell commands, spawn subagents, and manage git\nworkflows. It runs three ways: an interactive TUI, **headless** (`-p`), and as\nan **ACP agent** over JSON-RPC.\n\nThis is the third sibling to `codex` and `claude-code`. The orchestration\npattern is nearly identical — **prefer headless `-p` for one-shots**, use a PTY\nfor interactive sessions.\n\n## When to use\n\n- Building features\n- Refactoring\n- PR reviews\n- Batch issue fixing\n- Any task where you'd otherwise reach for Codex \u002F Claude Code but want Grok\n\n## Prerequisites\n\n- **Install (preferred):** `npm install -g @xai-official\u002Fgrok`\n  - The official installer `curl -fsSL https:\u002F\u002Fx.ai\u002Fcli\u002Finstall.sh | bash` also\n    works, but the `x.ai` host is Cloudflare-walled in some environments. The\n    npm path avoids that dependency entirely.\n- **Auth — SuperGrok \u002F X Premium+ subscription (primary path):**\n  - Run `grok login` once → opens a browser for OAuth → token cached in\n    `~\u002F.grok\u002Fauth.json`. This uses your **SuperGrok or X Premium+** subscription\n    (no per-token API billing).\n  - Check sign-in state by looking for `~\u002F.grok\u002Fauth.json`, or run a cheap\n    headless smoke test: `grok --no-auto-update -p \"Say ok.\"`\n  - In the TUI, `\u002Flogout` signs out and `\u002Flogin` (or relaunching) signs back in.\n- **No git repo required** — unlike Codex, Grok runs fine outside a git\n  directory (good for scratch\u002Fthrowaway tasks).\n- **Claude Code \u002F AGENTS.md compatible with zero config** — Grok auto-reads\n  `CLAUDE.md`, `.claude\u002F` (skills, agents, MCPs, hooks, rules), and the\n  `AGENTS.md` family. Existing project context just works.\n\n> **API-key fallback (not the default for this user):** Grok also supports\n> setting the `XAI_API_KEY` environment variable for pay-as-you-go billing\n> via `api.x.ai`. Only use\n> this if `grok login` \u002F SuperGrok auth is unavailable. The subscription path\n> (`grok login`) is the intended setup here.\n\n## Two Orchestration Modes\n\n### Mode 1: Headless (`-p`) — Non-Interactive (PREFERRED)\n\nRuns a one-shot task, prints the result, and exits. No PTY, no interactive\ndialogs to navigate. This is the cleanest integration path — the analog of\n`claude -p` and `codex exec`.\n\n```\nterminal(command=\"grok --no-auto-update -p 'Add a dark mode toggle to settings'\", workdir=\"\u002Fpath\u002Fto\u002Fproject\", timeout=180)\n```\n\nAlways pass `--no-auto-update` in automation to skip background update checks.\n\n**When to use headless:**\n- One-shot coding tasks (fix a bug, add a feature, refactor)\n- CI\u002FCD automation and scripting\n- Structured output parsing with `--output-format json`\n- Any task that doesn't need multi-turn conversation\n\n### Mode 2: Interactive PTY — Multi-Turn TUI Sessions\n\nThe TUI is a fullscreen, mouse-interactive app. Drive it with `pty=true`. For\nrobust monitoring\u002Finput use tmux (same pattern as the `claude-code` skill).\n\n```\n# Launch in a tmux session for capture-pane monitoring\nterminal(command=\"tmux new-session -d -s grok-work -x 140 -y 40\")\nterminal(command=\"tmux send-keys -t grok-work 'cd \u002Fpath\u002Fto\u002Fproject && grok' Enter\")\n\n# Wait for startup, then send a task\nterminal(command=\"sleep 5 && tmux send-keys -t grok-work 'Refactor the auth module to use JWT' Enter\")\n\n# Monitor progress\nterminal(command=\"sleep 15 && tmux capture-pane -t grok-work -p -S -50\")\n\n# Exit when done\nterminal(command=\"tmux send-keys -t grok-work '\u002Fquit' Enter && sleep 1 && tmux kill-session -t grok-work\")\n```\n\n**Tip for headless-but-inline output:** if you want TUI-style output without the\nfullscreen alt-screen takeover (e.g. for cleaner logs), add `--no-alt-screen`.\nFor pure automation, headless `-p` is still cleaner than the TUI.\n\n## Headless Deep Dive\n\n### Common Flags\n\n| Flag | Effect |\n|------|--------|\n| `-p, --single \u003CPROMPT>` | Send one prompt, run headless, exit |\n| `-m, --model \u003CMODEL>` | Choose a model |\n| `-s, --session-id \u003CUUID>` | Assign a **NEW** valid UUID to a fresh conversation (must not already exist). Does **not** resume — use `--resume`\u002F`--continue` for that. Only valid with `--resume`\u002F`--continue` when paired with `--fork-session` |\n| `-r, --resume [\u003CUUID>]` | Resume an existing session by its UUID (or the most recent if omitted) |\n| `-c, --continue` | Continue the most recent session in the current directory |\n| `--fork-session` | When resuming, create a new session ID instead of reusing the original |\n| `--max-turns \u003CN>` | Cap the maximum number of agent turns |\n| `--cwd \u003CPATH>` | Set the working directory |\n| `--output-format \u003CFMT>` | `plain` (default), `json`, or `streaming-json` |\n| `--always-approve` | Auto-approve all tool executions (the `--full-auto` \u002F `--yolo` equivalent) |\n| `--no-alt-screen` | Run inline, no fullscreen TUI takeover |\n| `--no-auto-update` | Skip background update checks (use in all automation; hidden from `--help` but still works) |\n\n### Output Formats\n\n- `plain` — human-readable text (default)\n- `json` — one JSON object at the end of the run (parse the result cleanly)\n- `streaming-json` — newline-delimited JSON events as they arrive\n\n```\n# Structured result for parsing\nterminal(command=\"grok --no-auto-update -p 'List all TODO comments in src\u002F' --output-format json\", workdir=\"\u002Fproject\", timeout=120)\n\n# Auto-approve for autonomous building\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the database layer and run the tests'\", workdir=\"\u002Fproject\", timeout=300)\n```\n\n### Background Mode (Long Tasks)\n\n```\n# Start headless in background\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the auth module'\", workdir=\"\u002Fproject\", background=true, notify_on_complete=true)\n# Returns session_id\n\n# Monitor\nprocess(action=\"poll\", session_id=\"\u003Cid>\")\nprocess(action=\"log\", session_id=\"\u003Cid>\")\n\n# Kill if needed\nprocess(action=\"kill\", session_id=\"\u003Cid>\")\n```\n\nFor an interactive (TUI) background session, use `pty=true` + tmux and monitor\nwith `tmux capture-pane`, exactly like the `claude-code` \u002F `codex` skills.\n\n### Session Continuation\n\nSessions are keyed by **UUID**, not by name. `--session-id` assigns a *new* UUID\nto a fresh run (it does **not** resume); `--resume` takes an existing session's\nUUID (or omit the value to resume the most recent).\n\n```\n# Start a session with a self-assigned UUID (must be a valid, unused UUID)\nSID=$(uuidgen)\nterminal(command=\"grok --no-auto-update -s $SID -p 'Start refactoring the database layer' --always-approve\", workdir=\"\u002Fproject\", timeout=240)\n\n# Resume that exact session later by its UUID\nterminal(command=\"grok --no-auto-update -r $SID -p 'Now add connection pooling' --always-approve\", workdir=\"\u002Fproject\", timeout=180)\n\n# Or just continue the most recent session in this directory (no UUID needed)\nterminal(command=\"grok --no-auto-update -c -p 'What did you change last time?'\", workdir=\"\u002Fproject\", timeout=60)\n```\n\n## Read-Only Audit → Markdown Note Pattern\n\nTo have Grok review local artifacts and return a clean markdown note (for\nObsidian or a repo) without mutating anything:\n\n1. Prepare stable input files first with Hermes tools (`read_file`,\n   `write_file`). Snapshot only the relevant context into a temp file rather\n   than dumping raw paths.\n2. Run Grok headless **without** `--always-approve` so it cannot auto-write, and\n   demand `markdown only, no preamble`.\n3. Save Grok's stdout straight into the destination note with `write_file()`.\n\n```\ngrok --no-auto-update -p \"Read ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fcurrent.md and ~\u002F.hermes\u002Fcache\u002Fscratch\u002Finventory.md. Produce markdown only, no preamble. Output a clean note titled 'Cleanup Review'.\" --output-format plain\n```\n\n**Pitfall (same as Claude Code):** for document rewrites, a loose \"rewrite this\"\nprompt may return a change summary instead of the full file. Instead: pipe the\nfile in, and demand `Return ONLY the full revised markdown document. No intro,\nno explanation, no code fences. Start immediately with '# Title'.` Verify the\nfirst lines with `read_file()` before overwriting the destination.\n\n## PR Review Patterns\n\n### Quick Review (Headless)\n\n```\nterminal(command=\"cd \u002Fpath\u002Fto\u002Frepo && git diff main...feature-branch | grok --no-auto-update -p 'Review this diff for bugs, security issues, and style problems. Be thorough.'\", timeout=120)\n```\n\n### Clone-to-temp Review (safe, no repo mutation)\n\n```\nterminal(command=\"REVIEW=$(mktemp -d) && git clone https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && grok --no-auto-update -p 'Review the changes vs origin\u002Fmain. Check bugs, security, race conditions, missing tests.'\", pty=true, timeout=300)\n```\n\n### Post the review\n\n```\nterminal(command=\"gh pr comment 42 --body '\u003Creview text>'\", workdir=\"\u002Fpath\u002Fto\u002Frepo\")\n```\n\n## Parallel Issue Fixing with Worktrees\n\n```\n# Create worktrees\nterminal(command=\"git worktree add -b fix\u002Fissue-78 ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78 main\", workdir=\"~\u002Fproject\")\nterminal(command=\"git worktree add -b fix\u002Fissue-99 ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-99 main\", workdir=\"~\u002Fproject\")\n\n# Launch Grok headless in each (background)\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #78: \u003Cdescription>. Commit when done.'\", workdir=\"~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78\", background=true, notify_on_complete=true)\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #99: \u003Cdescription>. Commit when done.'\", workdir=\"~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-99\", background=true, notify_on_complete=true)\n\n# Monitor\nprocess(action=\"list\")\n\n# After completion: push and open PRs\nterminal(command=\"cd ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78 && git push -u origin fix\u002Fissue-78\")\nterminal(command=\"gh pr create --repo user\u002Frepo --head fix\u002Fissue-78 --title 'fix: ...' --body '...'\")\n\n# Cleanup\nterminal(command=\"git worktree remove ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78\", workdir=\"~\u002Fproject\")\n```\n\n## Useful Subcommands & TUI Commands\n\n| Command | Purpose |\n|---------|---------|\n| `grok` | Start the interactive TUI |\n| `grok -p \"query\"` | Headless one-shot |\n| `grok login` \u002F `grok logout` | Sign in \u002F out (SuperGrok \u002F X Premium+ OAuth) |\n| `grok inspect` | Show what Grok discovered in cwd: config sources, instructions, skills, plugins, hooks, MCP servers |\n| `grok agent stdio` | Run as an ACP agent over JSON-RPC (for IDE\u002Ftool integration) |\n| `grok update` | Update the CLI (needs the `x.ai` host; skip in automation) |\n\nTUI slash commands (interactive only): `\u002Fmodel \u003Cname>`, `\u002Falways-approve`,\n`\u002Fplan`, `\u002Fcontext`, `\u002Fcompact`, `\u002Fresume`, `\u002Fsessions`, `\u002Ffork`, `\u002Fusage`,\n`\u002Fquit`. `Shift+Tab` cycles session modes (including Plan mode, which blocks\nwrite tools except the session plan file).\n\n## Config (`~\u002F.grok\u002Fconfig.toml`)\n\n```toml\n[cli]\nauto_update = false          # skip background update checks persistently\n\n[ui]\npermission_mode = \"ask\"      # or \"always-approve\" to skip tool prompts by default\n\n[models]\ndefault = \"grok-build-0.1\"\n```\n\nPut global preferences in `~\u002F.grok\u002Fconfig.toml` (not project-scoped\n`.grok\u002Fconfig.toml`). `permission_mode` supersedes the legacy `approval_mode` \u002F\n`yolo = true` keys.\n\n## Pitfalls & Gotchas\n\n1. **Auth is subscription-gated.** `grok login` requires a SuperGrok or X\n   Premium+ subscription. If login fails or there's no `~\u002F.grok\u002Fauth.json`,\n   confirm the subscription is active before falling back to `XAI_API_KEY`.\n2. **Don't conflate Hermes' xAI auth with the `grok` CLI's auth.** Hermes'\n   `x_search` runs on its own xAI OAuth; the standalone `grok` CLI has a\n   separate token in `~\u002F.grok\u002Fauth.json`. A working `x_search` does NOT mean\n   `grok` is logged in.\n3. **Always pass `--no-auto-update` in automation** — otherwise Grok phones home\n   for update checks (and `x.ai`\u002F`storage.googleapis.com` may be unreachable).\n4. **Prefer npm install over the curl installer** — `npm install -g\n   @xai-official\u002Fgrok` avoids the Cloudflare-walled `x.ai` host.\n5. **`--always-approve` is the autonomous-build switch.** Without it, headless\n   runs may stall waiting on tool-approval prompts. Omit it deliberately for\n   read-only review\u002Faudit work so Grok can't mutate files.\n6. **Headless `-p` skips TUI dialogs**; the TUI needs `pty=true` (+ tmux for\n   monitoring), just like Claude Code.\n7. **Use `--no-alt-screen`** if you run the TUI inline and the fullscreen\n   alt-screen takeover garbles captured output.\n8. **No git repo needed**, but for PR\u002Fcommit workflows you still want one — use\n   `mktemp -d && git init` for scratch commit tasks.\n9. **Clean up tmux sessions** with `tmux kill-session -t \u003Cname>` when done.\n\n## Rules for Hermes Agents\n\n1. **Prefer headless `-p`** for single tasks — cleanest integration, structured\n   output via `--output-format json`.\n2. **Always set `workdir`** (or `--cwd`) so Grok targets the right project.\n3. **Pass `--no-auto-update`** in every automated invocation.\n4. **Use `--always-approve` only when Grok should write autonomously**; omit it\n   for read-only reviews and audits.\n5. **Background long tasks** with `background=true, notify_on_complete=true` and\n   monitor via the `process` tool.\n6. **Use tmux for multi-turn interactive work** and monitor with\n   `tmux capture-pane -t \u003Csession> -p -S -50`.\n7. **Verify auth before relying on it** — check `~\u002F.grok\u002Fauth.json` or run a\n   cheap `grok -p \"Say ok.\"` smoke test; don't assume Hermes' xAI auth carries\n   over.\n8. **Report results to the user** — summarize what Grok changed and what's left.\n",{"name":5,"author":48,"license":15,"version":49,"metadata":50,"platforms":60,"description":7},"Matt Maximo (MattMaximo), Hermes Agent","0.1.1",{"hermes":51},{"tags":52,"related_skills":58},[27,53,54,55,56,57],"Grok","xAI","Code-Review","Refactoring","Automation",[39,25,59],"hermes-agent",[40,33,37],"main","0d1434f89f4bc6b07e9d272accd8c1013768820f","archive\u002Fskill-md-reviewed\u002Fsha256\u002F51\u002F51623f5627eb62c739497f158267f6192c952a2ba73c6ed4591856561f3b207b",0,"https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills","https:\u002F\u002Fgithub.com\u002Fzapabob","The Open University of JAPAN　2019-now\r\n\r\nTokyo University of Science　2007-2010","2026-10-26 16:29:01",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add zapabob\u002FSkills --skill grok",{"tool":75,"command":76},"bunx","bunx skills add zapabob\u002FSkills --skill grok",{"tool":78,"command":79},"pnpm","pnpm dlx skills add zapabob\u002FSkills --skill grok","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Farchive\u002Fskill-md-reviewed\u002Fsha256\u002F51\u002F51623f5627eb62c739497f158267f6192c952a2ba73c6ed4591856561f3b207b\u002FSKILL.md",true,[],[84,112,144,171,198,214],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":99,"publishedAt":43},"01M6GJTE1GESGGF9K028Y7753E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fxurl\u002Fvariants\u002Fhermes-agent\u002FSKILL.md",[90,93,94],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[86,100,33,41,101,40,37,102,103,104,105,106,107,31,30,108,61,109,110,111],"openclaw","github","official","search","https","social-media","api","Media","twitter","social","via","post",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":129,"publishedAt":43},"01M6GJT8S1PXQ8WPXT1HSNBWH2","writing-plans","Write implementation plans: bite-sized tasks, paths, code.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fwriting-plans\u002Fvariants\u002Fhermes-agent\u002FSKILL.md",[118,121,124,125,126],{"categoryNo":119,"categoryName":120,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":122,"categoryName":123,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},{"categoryNo":127,"categoryName":128,"taxonomyType":97,"taxonomyTypeDesc":98},"01JBSEEDCAT000000000000036","内容创作者",[130,131,132,133,33,42,40,134,37,135,136,137,36,138,35,139,140,141,142,143],"writing","writing plans","plans","design","workflow","documentation","tasks","development","planning","subagent","write","superpowers","paths","test-driven-development",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":153,"publishedAt":43},"01M6GJST0H5X7WHBJ3BZK0DVKH","whisper","OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fwhisper\u002Fvariants\u002Fhermes-agent-optional\u002FSKILL.md",[150],{"categoryNo":151,"categoryName":152,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",[146,33,40,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],"openai","speech","multimodal","Transformers","ASR","Audio","text","model","speech recognition","use","general","multilingual","translation","english","identification","processing","Audio Processing",{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":180,"publishedAt":43},"01M6GJSMRQ8EETZTYMG72P70EA","weights-and-biases","W&B: log ML experiments, sweeps, model registry, dashboards.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fweights-and-biases\u002Fvariants\u002Fhermes-agent\u002FSKILL.md",[177],{"categoryNo":178,"categoryName":179,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000013","分析与可视化",[181,33,182,183,37,184,185,186,187,188,189,161,190,191,192,193,194,195,196,197],"weights and biases","tensorflow","experiments","pytorch","visualization","registry","real-time","tuning","dashboards","experiment","log","time","Experiment Tracking","Model Registry","Hyperparameter Tuning","WandB","Real-Time Visualization",{"skillNo":199,"name":200,"nameZh":6,"description":201,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":202,"categories":203,"keywords":205,"publishedAt":43},"01M6GJS19KDPRY112JTR326S06","watchers","Poll RSS, JSON APIs, and GitHub with watermark dedup.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fwatchers\u002Fvariants\u002Fhermes-agent-optional\u002FSKILL.md",[204],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[200,33,206,101,40,38,207,208,209,210,211,31,30,212,213],"terminal","http","monitoring","cron","json","rss","devops","with",{"skillNo":215,"name":216,"nameZh":6,"description":217,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":218,"categories":219,"keywords":222,"publishedAt":43},"01M6GJRHJD2A6Q830SWF9W48BC","serving-llms-vllm","vLLM: high-throughput LLM serving, OpenAI API, quantization.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fvllm\u002Fvariants\u002Fhermes-agent\u002FSKILL.md",[220,221],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},[223,224,225,40,226,154,227,228,229,157,230,106,231,232,233,234,235,236,237,238],"llms","vLLM","serving llms vllm","research","openai api","tensor","Inference Serving","Production","llm serving","High Throughput","PagedAttention","Continuous Batching","Quantization","Tensor Parallelism","high-throughput","throughput"]