Skip to main content

Scripts plus a Grok Bot named Foreman turn each repo into a ticket-driven agent factory

GitHubGitHubdante-sparras2026-11-26

Code and reposSource read in fullRead first
GitHubGitHubdante-sparras2026-11-26

Open original

Overview

A developer who wants GitHub-issue tickets triaged, decomposed, implemented and reviewed by agents installs two shell scripts, a self-run T3 Code service, and one Grok Bot named Foreman connected through T3's MCP server and the GitHub connector.

Workflow

  1. What it is: a script-built software factory that runs one owner's GitHub repos through a single Grok Bot, on top of Matt Pocock's skill set. machine-setup.sh parks every other global skill and installs Matt's 27 skills for Claude Code, Cursor, Grok Build and Antigravity; factory-init.sh puts one or more repos on the factory (safe to re-run); foreman.md holds the description for the Grok Bot, named Foreman, that runs the factory; templates/ carries the AGENTS.md block and a Node CI workflow used by the init script. The README frames adoption as a staged rollout, one stage per week, and the repo ships no x.ai/bot template link.
  2. Grok Bot parts used: one Bot, one MCP server, one connector and a three-level permission setup. Per the README's Grok Bot section: add T3's MCP server (https://<your T3 address>/mcp), sign in at Auto level, turn on the GitHub connector, create a Bot named Foreman and paste the description from foreman.md, then set its tool permissions. Not part of Grok Bot: T3 Code, a background service the user runs on their own machine; the CLI coding agents it hosts (Claude Code, Cursor, Grok Build, Antigravity); GitHub Actions CI; git hooks; the two shell scripts; the gh CLI.
  3. You need: a machine that runs T3 Code as a background service, signed-in accounts for each coding agent, a Grok Bot account with connectors, and GitHub repos. The scripts run in Git Bash on Windows or any shell on macOS or Linux. The README names the providers to sign in to: Claude Code, Cursor, Grok Build and Antigravity. T3 Code must be reachable from laptop and phone. Paid plans: Not stated in the source.
  4. Install: three setup passes in the README's order (machine, repos, Grok Bot), then a staged rollout.
    • Step 1: Factory machine (once): run t3 up, then t3 connect; sign in to each provider; run ./machine-setup.sh to preview, then ./machine-setup.sh --apply (parked skills go to ~/.skills-parked/<timestamp>/; move them back to undo); optionally schedule the weekly skills refresh with the README's Windows schtasks or Linux cron line.
    • Step 2: Each repo (one command): ./factory-init.sh ~/Projects/app-one ~/Projects/app-two writes docs/agents/ from Matt's latest templates, adds the ## Agent skills and ## Factory blocks to AGENTS.md, creates the triage and wayfinder:* labels, adds a CLAUDE.md that imports AGENTS.md, a Node CI workflow, the factory topic, a ruleset (PRs only, no force-push, ci must pass) and a T3 project; the changes arrive as a PR on chore/factory-setup that the owner merges. Open PR #1 adds a --quality flag (prototype, production or library) written into the repo instructions and kept on re-runs. When run on a folder glob (~/Projects/*/), folders that are not GitHub repos are skipped — watch for repos you do not want on the factory, such as an old skills repo.
    • Step 3: Grok Bot (once): add T3's MCP server, sign in at Auto level, turn on the GitHub connector; create a Bot named Foreman and paste the description from foreman.md; set tool permissions — blocked: merging PRs, pushing code, deleting branches or repos; needs approval: closing issues; always allow: everything else.
    • Step 4: Rollout (one stage per week): run grill-with-docs, to-spec, to-tickets, implement and code-review by hand on 2-3 tickets, with /retro after each; add Review, Rework and Hand-off to Foreman; add Implement (at most 2 tickets at once); add Triage and Weekly health.
  5. After install: label- and merge-triggered tasks, GitHub in, draft PRs out, and every merge still waits for the owner.
    • Triggers: the ready-for-agent label, merges and a weekdays 09:00 schedule (PR #2 task table); no run waits for a human — the owner's label or merge is the next trigger; Implement is capped at 2 in flight and 6 per day.
    • Reads: GitHub issues and PRs through the GitHub connector; reaches the machine's coding agents through T3's MCP server.
    • Produces: a Factory triage: comment on triage, sub-issues from /to-tickets, branches named <type>/<issue>-<slug>, draft PRs with Closes #<issue>, and review verdicts of the form Factory review of <SHA>: PASS|FAIL.
    • Owner gate: closing issues needs approval; merging PRs, pushing code and deleting branches or repos are blocked; Hand-off ends at the owner adding the approved label and merging.
  6. Did the author run it: one local run of the setup script is documented; there are no records of Foreman itself. PR #1 reports a local run of factory-init.sh against throwaway repos (--skip-github --no-t3 --no-pr): before the change, a commit with a failing test script went through; after it, the commit was blocked with pre-commit: 'test' failed. Fix the cause and commit again., a passing commit exited 0, a missing node_modules stops the hook with a message, a tracked .husky/pre-commit keeps core.hooksPath unset, --quality library survives a re-run, and --quality fast exits 2 (author's claim, not reproduced). PR #1 also states the GitHub half of setup (labels, topic, ruleset, PR) was not run. The repository has no run records of Foreman working inside Grok Bot.

Key points and results

  • Maturity: about 1 day old at fetch time. At fetch time on 2026-11-27 06:52 Taipei (2026-11-26 22:52 UTC) the repo was about 1 day old, with 1 commit, 0 stars, 0 forks, 2 open PRs (both from the author, describing pending changes) and no license; created 2026-11-25 17:22 UTC (2026-11-26 01:22 Taipei) and last pushed later the same day. The README frames adoption as one stage per week, and PR #2 is still reshaping the task model.
  • Permissions and boundaries: destructive git actions blocked, issue closing gated. Foreman's tool permissions in the README: blocked — merging PRs, pushing code, deleting branches or repos; needs approval — closing issues; always allow — everything else. The AGENTS.md template block adds: never merge a PR, never push to the default branch, /code-review sub-agents must not run /code-review or start other agents, and never pick up an issue that has sub-issues (a spec, not a ticket); PR #1 adds a no --no-verify commit rule.
  • Known limits: self-run infrastructure and hard caps. T3 Code must run as the user's own background service; the scripts need Git Bash on Windows or any shell on macOS or Linux; running factory-init.sh on a folder glob can sweep in repos the owner does not want on the factory (the README's example: an old skills repo); the GitHub half of setup was not run (PR #1); the quality bar accepts only prototype, production or library; Implement is capped at 2 in flight and 6 per day; fixes never chain and always end at the owner's review (PR #2).
  • Worth borrowing: hand over autonomy one stage per week. Run the workflow by hand on 2-3 tickets with /retro after each, then add Review, Rework and Hand-off, then Implement, then Triage — a staged rollout a coding Bot owner can copy (README rollout section).
  • Worth borrowing: the three-level permission split. Block merging, pushing and deleting outright, gate issue closing on approval, allow the rest — a copyable permission pattern for a coding Bot (README Grok Bot section).
  • Worth borrowing: agents pass the same checks as CI. A pre-commit hook running typecheck, lint and test, a required ci status check on PRs, and a no --no-verify rule keep unattended runs from bypassing quality (PR #1, templates/ci-node.yml).

Source

Platform
GitHub
Author
dante-sparras
Published
Categories
Code and repos

What this evidence label means

Source read in full

We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.

Read the editorial and evidence policy

Other cases in this scenario

This unofficial community project is independent of xAI. xAI has neither approved nor endorsed it. No sign-up. The methods and figures come from the original authors.