4x-autopilot

4x-autopilot is a skill for Claude Code, Codex from ggwhite/4x. It costs 106 tokens per session (4,679 once invoked), scanned C, original, MIT.

An owner-only automation mode for the 4x feature pipeline, which manages tracked development tasks from selection through completion and merging. It runs one feature at a time and reads project settings to determine the repositories and workflow.

In plain words
What is it for?
Use it to pick pending features, run them, mark them done, create and merge merge requests when configured, synchronize repositories, clean up, and continue with the next feature.
Why use it?
It removes repeated manual steps from a feature’s lifecycle. Once started, it continues through available work without pausing for routine confirmation, unless there is no runnable feature or the user stops it.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to pick pending features, run them, mark them done, create and merge merge requests when configured, synchronize repositories, clean up, and continue with the next feature.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ggwhite/4x/4x-autopilot
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ggwhite/4x --skill 4x-autopilot
Clone the repo
git clone --depth 1 https://github.com/ggwhite/4x

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 4x-autopilot

README.md
[![agentmods](https://agentmods.dev/badge/skills/ggwhite/4x/4x-autopilot.svg)](https://agentmods.dev/skills/ggwhite/4x/4x-autopilot)
Your own site
<a href="https://agentmods.dev/skills/ggwhite/4x/4x-autopilot"><img src="https://agentmods.dev/badge/skills/ggwhite/4x/4x-autopilot.svg" alt="Measured on agentmods" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,679 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00106 $0.04679
Opus 5 $0.00053 $0.02339
Sonnet 5 $0.00021 $0.00936
Haiku 4.5 $0.00011 $0.00468

Measured 8d ago against content hash ea6fa9b837d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

4x-autopilot scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

2. `rm -rf .worktrees/4x/<feature>/`
skills/4x-autopilot/SKILL.md · 387 lines

How it starts

The opening of the file, as written. The whole thing — 387 lines — stays where its author put it; the contents beside it link to each section on GitHub.

4x Autopilot

WARNING:owner-only,非 owner 請勿安裝或執行。(全自動行為定義見下方「核心原則」)

搭配 /loop 持續輪詢 4x 狀態,驅動 feature 完整生命週期。

核心原則

  • 無狀態:每次 wakeup 從 4x 側重新讀狀態,session 斷線重連即接上
  • 序列執行:一次只跑一個 feature,完成後才 pick 下一個
  • 全自動:不停頓等確認,包括 merge MR
  • 專案無關:所有專案特定值(repo 清單、GitLab 路徑)從 .4x/settings.json 動態讀取
  • 永不停機:除非「沒有 not-started feature 可跑」或「使用者主動說暫停/停止」,否則不可停下來。完成一個 feature 後必須立即 IDLE-PICK 下一個,不可印 session 摘要、不可問「要繼續嗎?」、不可等確認。這是最高優先規則,違反等同 bug。

前置:讀取專案設定

每次 wakeup 開始時,先讀 .4x/settings.json 取得:

REPOS      = Object.keys(settings.workspace.repos)   # 所有 repo 名稱(動態,不硬寫)
HUB_REPOS  = settings.hub_repos || []                 # hub repo(同步時包含,scope 檢查時排除)
USE_GITLAB = settings.issue_tracker?.enabled == true   # 是否啟用 GitLab MR 流程

取得 GitLab group(僅 USE_GITLAB 時需要):

# 從第一個 repo 的 git remote 推導
GITLAB_GROUP=$(git -C <first-repo> remote get-url origin | sed -E 's|.*[:/](.+)/[^/]+\.git$|\1|')
# 例如 [email protected]:server/kairos/kairos-core.git → server/kairos

參數

  • 無參數:自動從 4x status --json --pending 按 priority + id 選下一個
  • 帶 feature-id:優先跑指定 feature

每次 Wakeup 決策樹

每次被 /loop 喚醒時,依序檢查:

1. 讀取狀態

4x status --json --pending

解析 JSON,對每個 feature 取 id, name, status, priority, active 和對應的 state.phase

2. 判斷當前階段

按以下優先順序判斷,命中第一個就執行,不繼續往下

優先 條件 動作 下次 wakeup
1 有 feature active: true → 執行 RUNNING 270s
2 有 feature phase: pending-review → 執行 FINISHING 不排(連續執行)
3 有 feature phase: needs-attentionblocked,且累計失敗 < 2 → 執行 AUTO-FIX 270s
4 有 feature phase: needs-attentionblocked,且累計失敗 ≥ 2 → log 跳過該 feature 立即回到判斷
5 status: not-started 的 feature → 執行 IDLE-PICK 270s
6 都沒有 → log 全部完成 1800s

IDLE-PICK:前置同步 + 選擇 + 啟動

觸發條件:決策樹優先 5(有 not-started feature 可跑)。

Step A: 前置同步(每次 pick 前必做)

REPOS 中每個 repo 依序執行(跳過 path 不存在的):

# 跳過不存在的 repo 目錄
[ -d <repo> ] || continue

git -C <repo> fetch origin main
git -C <repo> merge --ff-only origin/main

Read the full file on GitHub · 387 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 387 lines · 106 tokens per session scan C ea6fa9b837d7

Subscribe to this mod's changes

4x-autopilot is a skill published in the GitHub repository ggwhite/4x (33 stars, last pushed 14d ago), licensed MIT. It adds 106 tokens to every session and 4,679 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

commit-pr

Mandatory Codex/Copilot publication adapter for opencode-swarm. Use for every GitHub issue assignment that results in code changes, commits, pushes, draft PRs, PR body edits, PR readying, release notes, or CI closeout. Must be loaded before git push, gh pr create, gh pr edit, or gh pr ready. Routes to the single…

ZaxbyHub/opencode-swarm · 100 tokens

contributing

Codex adapter for the opencode-swarm contribution checklist. Use when preparing user-visible changes, release note fragments, local validation, branch hygiene, PR checklist items, or contribution-policy compliance before publishing work.

ZaxbyHub/opencode-swarm · 44 tokens

git-ship

An automated Git release workflow that takes code changes through a branch, commit, pull request, review checks, squash merge, and return to the main branch. A pull request is a request to review and merge changes into a shared branch.

oil-oil/git-ship · 273 tokens

mk:ship

Ship workflow with explicit scopes: prepare stages and commits locally; release pushes and creates a PR; publish manages issues and versioning. Use when asked to "ship", "deploy", "push to main", "create a PR", or "merge and push". Proactively suggest when the user says code is ready or asks about deploying. Supports…

ngocsangyem/MeowKit · 92 tokens

ship

Use when changes are ready to ship — takes the working tree to a pull request with code review, Conventional Commit, automatic SemVer bump and a PR template. Part of the cys flow (after cys:check).

bacsystem/parallel-plan-executor · 47 tokens

e2e-delivery

End-to-end software house delivery. Use whenever the user asks to build a feature, fix a non-trivial bug, start a project, or run the full workflow. Orchestrates all roles and executes through Release unless blocked. Skip when WORKMODE is manual unless user/command forces E2E.

rogue-dev-studio/ai-agents-rogue · 67 tokens