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.
npx skills add ggwhite/4x --skill 4x-autopilotgit clone --depth 1 https://github.com/ggwhite/4xWrote 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.
[](https://agentmods.dev/skills/ggwhite/4x/4x-autopilot)<a href="https://agentmods.dev/skills/ggwhite/4x/4x-autopilot"><img src="https://agentmods.dev/badge/skills/ggwhite/4x/4x-autopilot/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ggwhite/4x/4x-autopilot"><img src="https://agentmods.dev/badge/skills/ggwhite/4x/4x-autopilot.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00106 | $0.05200 |
| Opus 5.5 | $0.00042 | $0.02080 |
| Sonnet 5.5 | $0.00021 | $0.01040 |
| Haiku 4.5 | $0.00011 | $0.00520 |
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 1mo 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>/` How it starts
The opening of the file, as written. The whole thing — 416 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 流程
POST_CLEANUP = settings.worktree?.post_cleanup || [] # 清 worktree 後要跑的專案清理指令
POST_CLEANUP 每個元素是一行 shell 指令,字串中的 {feature-id} 會被替換成當前 feature ID。
用途是清掉 worktree 以外的 feature 環境資源(Docker 容器/image/volume、測試資料庫、暫存目錄等)——
這些東西 git worktree remove 不會碰,沒清就會逐輪累積。沒設定就跳過。
取得 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-attention 或 blocked,且累計失敗 < 2 |
→ 執行 AUTO-FIX | 270s |
| 4 | 有 feature phase: needs-attention 或 blocked,且累計失敗 ≥ 2 |
→ log 跳過該 feature | 立即回到判斷 |
| 5 | 有 status: not-started 的 feature |
→ 執行 IDLE-PICK | 270s |
| 6 | 都沒有 | → log 全部完成 | 1800s |
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.
- 1mo ago Changed · +29 lines 519e80854f5a
- 1mo ago First seen · 387 lines · 106 tokens per session scan C ea6fa9b837d7
4x-autopilot is a skill published in the GitHub repository ggwhite/4x (34 stars, last pushed 1mo ago), licensed MIT. It adds 106 tokens to every session and 5,200 once invoked, about $0.0004 per session on Opus 5.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.
Other skills, from other repositories
git-iris
Use this skill when generating commit messages, pull request descriptions, release notes, changelogs, or code reviews in a repository where git-iris is available. Activates on requests like "commit this", "write a commit message", "draft a PR", "generate release notes", "write a changelog", or "review my changes" when…
git
This skill should be used when the user asks to "commit changes", "create a pull request", "rebase safely", or performs any git/GitHub operation.
github-automation
GitHub workflow automation, PR management, issue tracking, and code review coordination. Integrates with GitHub Actions and repository management. Use when: PR creation, code review, issue management, release automation, workflow setup. Skip when: local-only changes, non-GitHub repositories.
github
Skill "github" from Hmbown/Codewhale, covering github, when to use, setup, workflow and non-goals.
github
Drive GitHub via the official gh CLI — repos, issues, pull requests, releases, gists, Actions runs, and raw REST through gh api. Use when the user asks to inspect or manage GitHub.
work
Handle issue/PR work items with worktree isolation. Triggered by "/work [issuelink|description]" to start focused work.