Skip to content

Latest commit

 

History

54 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grok-build-prompts

Tooling that extracts prompt components from a pinned Grok Build CLI binary.

Grok Build is distributed by xAI through the official installer at https://x.ai/cli/install.sh. The installer supports explicit versions, so this repo pins a known artifact instead of installing latest.

The binary is a native Mach-O executable. The extractor dynamically reads its Mach-O section table, finds __TEXT,__const and __DATA_CONST,__const, and reconstructs Rust string-slice records (ptr, len) that point to embedded prompt components.

Quick Start

bun install
bun run download:grok
bun run extract

The scripts write:

  • vendor/grok/<version>/grok - pinned local Grok Build binary, ignored by git.
  • prompts/<name>.md - extracted prompt components.
  • skills/<name>.md - extracted skill prompt components.
  • subagents/<name>.md - extracted subagent prompt components, when present.
  • raw/ - command outputs and extraction metadata.
  • the generated catalog below - an index linking to every generated file.

Catalog

Source binary: vendor/grok/1.0.24/grok Grok Build: grok 1.0.24 (68e414c661e3) Previous generated version: grok 1.0.13 (5e9a58528b76)

Change summary:

  • Added: 0
  • Changed: 0
  • Removed: 0
  • Unchanged: 5

Added

  • (none)

Changed

  • (none)

Removed

  • (none)

Notes:

  • The extractor dynamically parses Mach-O sections and uses Rust string-slice records for native prompt components.
  • Short prompt fragments are intentionally excluded so generated folders are not polluted with one-line strings.
  • Treat extracted files as embedded prompt components, not guaranteed fully composed runtime prompts.

Prompts

Subagents

  • (none)

Skills

  • (none)

Raw Artifacts

Bumping Grok Build

package.json stores the pinned Grok Build version under grokBuild.version. The workflow at .github/workflows/update-grok.yml checks https://x.ai/cli/stable, updates the exact pin, downloads the binary, runs extraction, opens a grok-bump PR, and requests auto-merge.

Layout

scripts/download-grok.mjs       # downloads the pinned Grok binary
scripts/extract-grok-prompts.mjs # extractor
package.json                    # command manifest and pinned Grok version
.github/workflows/update-grok.yml
.github/workflows/regenerate-prompts.yml
prompts/                        # generated prompt components
skills/                         # generated skill prompt components
subagents/                      # generated subagent prompt components
raw/                            # generated metadata and raw CLI output
README.md                       # includes the generated catalog

Caveats

  • Extracted prompt files are embedded prompt components, not guaranteed fully composed runtime system prompts.
  • Runtime prompts can be assembled from fragments and dynamic context; the extractor avoids publishing short one-line fragments as standalone prompts.
  • grok inspect --json is useful for local debugging, but it includes user-local skills, plugins, hooks, and paths, so this repo does not commit it by default.

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages