grok-build-delegate

Delegate bounded coding tasks to the local Grok Build CLI with scoped permissions.

3|Updated Apr 8, 2025
One-click install
npx skills add https://github.com/ZanzyTHEbar/dragonarchy --skill grok-build-delegate-zanzythebar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grok-build-delegate
Source: https://github.com/ZanzyTHEbar/dragonarchy/tree/main/packages/opencode/.config/opencode/skills/grok-build-delegate
Command: npx skills add https://github.com/ZanzyTHEbar/dragonarchy --skill grok-build-delegate-zanzythebar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When you want a second opinion or parallel implementation from Grok Build, manually crafting safe CLI invocations with correct permission flags, worktree isolation, and prompt scoping is error-prone and risks unintended file changes or unauthorized git operations. ## Core Features & Use Cases - Read-Only Delegation: Run Grok in review or diagnosis mode with Edit, Write, and Bash denied by default for safe second opinions. - Isolated Implementation: Delegate code changes inside a dedicated git worktree with allow-listed commands so OpenCode can inspect diffs before adopting them. - Advanced Controls: Use best-of-n tournaments, self-check verification, effort tuning, sandboxing, and session export or trace for auditability. - Use Case: Ask for a Grok second opinion on a tricky bug fix, then compare its proposed diff in an isolated worktree against your own implementation before merging. ## Quick Start Ask Grok Build for a read-only second opinion on the current bug and summarize its findings.

Frequently Asked Questions about grok-build-delegate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I delegate a coding task to Grok Build from OpenCode?

Write a bounded prompt to a temp file under /tmp/opencode, then invoke the grok CLI with --model grok-build, --prompt-file, --output-format json, and explicit --allow and --deny permission flags. Default to read-only unless implementation is approved.

How do I let Grok edit files safely?

Use the --worktree flag to isolate Grok's changes in a separate git worktree, allow only Edit, Write, and specific Bash commands like git or npm test, and add --check for self-verification. Inspect the worktree diff before adopting any changes.

What should I do if the grok CLI reports unauthenticated?

Stop before delegating and run grok login or configure the XAI_API_KEY environment variable. Do not retry with broader permissions; report the exact authentication blocker to the user.

When should I use Grok delegation instead of native OpenCode tools?

Only when the user explicitly asks for Grok, a Grok second opinion, or Grok-specific features like best-of-n, worktrees, or effort tuning. Routine coding tasks should use native OpenCode tools and subagents.

How can I audit what Grok did during a delegated session?

Parse the JSON output for the sessionId, then run grok export <SESSION_ID> to save the transcript or grok trace <SESSION_ID> --local --json for a detailed archive. You can also list past runs with grok sessions list.