autopilot — intake & setup
You configure and install the autopilot daily autonomous project-driver. This skill is
self-contained: the per-run prompt is PROMPT.md and all scripts are under scripts/, both bundled
beside this file (so the live copy under ~/.claude/skills/autopilot/ runs without the source repo).
Full design + every sub-tool spec: docs/autopilot/README.md in the agent-harness repo.
Modes (how the user invokes you)
/autopilot setup <proj> (or "用 autopilot 跑 …") — the intake below: ask, confirm, install timers,
record THIS session as the project's home session, then arm the daily in-session cron and offer to
run once now. This is the default when no project is configured yet.
/autopilot run <proj> — run the directive right now, in this session (visible, in context):
read PROMPT.md + the plan docs and execute until the ≥30-min floor. No new session, no claude -p.
/autopilot status <proj> — read ~/.claude/autopilot/<proj>/cron_state.json + the newest
runs/ log + the latest daily-runs/<date>.md, and report plainly, with clickable links, what
the last run did and whether the daily cron is armed/healthy.
/autopilot skip <proj> (or "跳过今晚 / 暂停 X 的定时任务") — skip the scheduled run without unarming
anything. Run bash ~/.claude/autopilot/bin/skip.sh <proj> today (skip today, resume tomorrow),
... until <YYYY-MM-DD> (skip until a date), ... resume (un-skip now), or ... status. It writes
paused_until into cron_state.json; cycle_status.py then reports the covered cycles as
complete+skipped, so a fired run self-skips at PROMPT step 0, the idempotent guard skips, and the
watchdog does NOT try to recover them — the cron can stay armed, and it auto-resumes on the date.
The daily run is an in-session cron (you arm it with CronCreate), NOT a hidden headless claude -p.
It lives in the user's always-open, phone-remote-controlled session so they can watch it.
Intake flow (do this in order)
- Ask the user for:
- Long-term work / requirements — what should autopilot drive (the
[ROLE & SCOPE] block of PROMPT.md)?
- Daily auto-run time (e.g.
03:00).
- Minimum duration per run (default 30 min, no upper cap).
- Project path (repo root) and model (default the session model).
- Summarize the inputs back and ask for explicit confirmation — restate everything you captured
so there is no misreading. Wait for a clear "yes" before installing.
- Offer optimization suggestions — based on the project + the design doc, propose improvements
(e.g. better run time to avoid peak hours, scoping the first MVP, enabling the STRICT review layer,
watchdog interval) and ask whether to accept each.
- On confirm, install:
- Write config:
~/.claude/autopilot/<proj>/config.yaml (role/scope, time, floor, model, repo).
- Seed the plan root under the project's
docs/<plan-root>/ (per the neobanker structure) if absent.
- Install support timers:
bash scripts/install.sh <proj> → systemd --user units autopilot-watch
(failed/empty-run detector), autopilot-summary, and the global autopilot-resurrect (every 30 min,
relaunches the home session in tmux after a crash/reboot — needs tmux).
- Arm the daily in-session cron + record the home session. With
CronCreate, create a recurring
durable cron (schedule from the run time, e.g. 0 22 * * *). Cron prompt: "autopilot daily run
for []: FIRST run python3 ~/.claude/skills/autopilot/scripts/update_check.py <proj> (cheap,
code-only) — if it prints UPDATED, re-run scripts/install.sh <proj> and re-arm this cron with the
latest config (refreshing configured_with_version) BEFORE working; then read
/.claude/skills/autopilot/PROMPT.md and execute the directive for now." Write
`/.claude/autopilot//cron_state.jsonwithhome_session_id= THIS session's id,cron_id, last_armed= today,schedule, and **configured_with_version** = the contents of ~/.claude/skills/autopilot/VERSION(soupdate_check.pycan detect a later autopilot update cheaply). (The SessionStart hook re-arms it after restarts; you self-renew before day 6 to dodge the 7-dayCronCreatecap — see` in PROMPT.md.)
- Confirm with
systemctl --user list-timers 'autopilot-*' and CronList.
- Review-gate scope (ask — review-gate gates git, see
hooks/review-gate/):
- (once, only if
~/.claude/hooks/review-gate/review-gate.conf is absent) — "Also block git commit? Default no: commits stay free (the AI review at Stop still runs and surfaces findings, it just won't block committing); yes denies commits the same NON-FATAL way as push." Write block_commit=0|1 to that conf.
- (this project) — "Add this project to the push-whitelist?
git push / gh pr create|merge are blocked by default (the autopilot red-line is never push anyway); whitelist only a code project you actually intend to push from. Pure-docs / low-impact → recommend leaving it blocked." If yes, append the repo root path to ~/.claude/hooks/review-gate/push-whitelist.txt. A block is non-fatal — the agent keeps working, it just can't push.
- Offer the first planning pass NOW (ask y/n). The first timer fire may be hours away, so ask:
"Do the first planning pass now?" If yes, do it in this session — run the
<startup_sequence>
Perceive step (read the project's docs + code + recent git log), CREATE the long-term plan under
the plan root (docs/<plan-root>/planning/), then present the first-run contract output: a
markdown-table overview of the plan (one row per phase/MVP — goal · effort estimate · status) and a
clickable link to the full plan doc, so the user can approve the whole plan at a glance. If no,
the first timer fire produces the same table + link unattended.
What it then does (autonomously, no human input)
The daily run happens IN the user's always-open session (not a hidden claude -p). The in-session
cron you armed fires daily and runs the PROMPT.md directive until the ≥30-min floor (floor.py),
committing each increment (review-gate-passed), re-planning, updating time estimates, writing the per-run
doc, and posting a plain-language, fully-linked summary — all visible to the user (and on their phone
via remote-control). Resilience is three layers: (1) the in-session cron = the run; (2) the SessionStart
hook (session_check.sh) re-arms the cron after any restart and surfaces an unshown failed run, plus
your >5-day self-renew dodges the 7-day cron cap; (3) the global resurrector (resurrect.sh,
every 30 min) relaunches the home session in tmux if the machine rebooted or the session crashed. The
watchdog (watch.py) flags any run that ended without meeting the floor (last-error newer than
last-done), so a silent empty run never passes as success. (The headless run.sh stays in scripts/
as an optional fallback for users with no always-open session.)
Manage
- Pause:
systemctl --user disable --now autopilot-daily.timer
- Status:
systemctl --user list-timers 'autopilot-*' · run-state under ~/.claude/autopilot/<proj>/
- Run once now (test):
bash ~/.claude/autopilot/bin/run.sh <proj>
Guarantees it relies on
review-gate (mandatory on every code turn) · code discipline (minimal module/change/impact, modular,
tests + commits + docs, git per increment) · agent-harness skills + Chrome/visual tools as needed ·
system-level crash-proofing (systemd Persistent + watchdog).
1---2name: autopilot-23description: autopilot — intake & setup4---56# autopilot — intake & setup78You configure and install the **autopilot** daily autonomous project-driver. This skill is9self-contained: the per-run prompt is `PROMPT.md` and all scripts are under `scripts/`, both bundled10beside this file (so the live copy under `~/.claude/skills/autopilot/` runs without the source repo).11Full design + every sub-tool spec: `docs/autopilot/README.md` in the agent-harness repo.1213## Modes (how the user invokes you)1415- **`/autopilot setup <proj>`** (or "用 autopilot 跑 …") — the intake below: ask, confirm, install timers,16 **record THIS session as the project's home session**, then arm the daily in-session cron and offer to17 run once now. This is the default when no project is configured yet.18- **`/autopilot run <proj>`** — run the directive **right now, in this session** (visible, in context):19 read `PROMPT.md` + the plan docs and execute until the ≥30-min floor. No new session, no `claude -p`.20- **`/autopilot status <proj>`** — read `~/.claude/autopilot/<proj>/cron_state.json` + the newest21 `runs/` log + the latest `daily-runs/<date>.md`, and report **plainly, with clickable links**, what22 the last run did and whether the daily cron is armed/healthy.23- **`/autopilot skip <proj>`** (or "跳过今晚 / 暂停 X 的定时任务") — skip the scheduled run without unarming24 anything. Run `bash ~/.claude/autopilot/bin/skip.sh <proj> today` (skip today, resume tomorrow),25 `... until <YYYY-MM-DD>` (skip until a date), `... resume` (un-skip now), or `... status`. It writes26 `paused_until` into `cron_state.json`; `cycle_status.py` then reports the covered cycles as27 complete+skipped, so a fired run self-skips at PROMPT step 0, the idempotent guard skips, and the28 watchdog does NOT try to recover them — the cron can stay armed, and it auto-resumes on the date.2930The daily run is an **in-session cron** (you arm it with CronCreate), NOT a hidden headless `claude -p`.31It lives in the user's always-open, phone-remote-controlled session so they can watch it.3233## Intake flow (do this in order)34351. **Ask** the user for:36 - **Long-term work / requirements** — what should autopilot drive (the `[ROLE & SCOPE]` block of `PROMPT.md`)?37 - **Daily auto-run time** (e.g. `03:00`).38 - **Minimum duration per run** (default **30 min**, no upper cap).39 - Project path (repo root) and model (default the session model).402. **Summarize the inputs back and ask for explicit confirmation** — restate everything you captured41 so there is no misreading. Wait for a clear "yes" before installing.423. **Offer optimization suggestions** — based on the project + the design doc, propose improvements43 (e.g. better run time to avoid peak hours, scoping the first MVP, enabling the STRICT review layer,44 watchdog interval) and ask whether to accept each.454. **On confirm, install:**46 - Write config: `~/.claude/autopilot/<proj>/config.yaml` (role/scope, time, floor, model, repo).47 - Seed the plan root under the project's `docs/<plan-root>/` (per the neobanker structure) if absent.48 - Install support timers: `bash scripts/install.sh <proj>` → systemd `--user` units `autopilot-watch`49 (failed/empty-run detector), `autopilot-summary`, and the global `autopilot-resurrect` (every 30 min,50 relaunches the home session in tmux after a crash/reboot — needs `tmux`).51 - **Arm the daily in-session cron + record the home session.** With `CronCreate`, create a recurring52 durable cron (schedule from the run time, e.g. `0 22 * * *`). Cron **prompt**: "autopilot daily run53 for [<proj>]: FIRST run `python3 ~/.claude/skills/autopilot/scripts/update_check.py <proj>` (cheap,54 code-only) — if it prints `UPDATED`, re-run `scripts/install.sh <proj>` and re-arm this cron with the55 latest config (refreshing `configured_with_version`) BEFORE working; then read56 ~/.claude/skills/autopilot/PROMPT.md and execute the directive for <proj> now." Write57 `~/.claude/autopilot/<proj>/cron_state.json` with `home_session_id` = THIS session's id, `cron_id`,58 `last_armed` = today, `schedule`, and **`configured_with_version`** = the contents of59 `~/.claude/skills/autopilot/VERSION` (so `update_check.py` can detect a later autopilot update cheaply).60 (The SessionStart hook re-arms it after restarts; you self-renew before day 6 to dodge the 7-day61 `CronCreate` cap — see `<resilience>` in PROMPT.md.)62 - Confirm with `systemctl --user list-timers 'autopilot-*'` and `CronList`.63 - **Review-gate scope (ask — review-gate gates git, see `hooks/review-gate/`):**64 - **(once, only if `~/.claude/hooks/review-gate/review-gate.conf` is absent)** — "Also block `git commit`? Default **no**: commits stay free (the AI review at Stop still runs and surfaces findings, it just won't block committing); **yes** denies commits the same NON-FATAL way as push." Write `block_commit=0|1` to that conf.65 - **(this project)** — "Add this project to the **push-whitelist**? `git push` / `gh pr create|merge` are blocked by default (the autopilot red-line is *never push* anyway); whitelist only a code project you actually intend to push from. Pure-docs / low-impact → recommend leaving it blocked." If yes, append the repo root path to `~/.claude/hooks/review-gate/push-whitelist.txt`. A block is non-fatal — the agent keeps working, it just can't push.665. **Offer the first planning pass NOW (ask y/n).** The first timer fire may be hours away, so ask:67 "Do the first planning pass now?" If **yes**, do it in this session — run the `<startup_sequence>`68 *Perceive* step (read the project's docs + code + recent `git log`), CREATE the long-term plan under69 the plan root (`docs/<plan-root>/planning/`), then present the **first-run contract** output: a70 markdown-table overview of the plan (one row per phase/MVP — goal · effort estimate · status) **and a71 clickable link to the full plan doc**, so the user can approve the whole plan at a glance. If **no**,72 the first timer fire produces the same table + link unattended.7374## What it then does (autonomously, no human input)7576**The daily run happens IN the user's always-open session** (not a hidden `claude -p`). The in-session77cron you armed fires daily and runs the `PROMPT.md` directive until the **≥30-min floor** (`floor.py`),78committing each increment (review-gate-passed), re-planning, updating time estimates, writing the per-run79doc, and posting a **plain-language, fully-linked** summary — all visible to the user (and on their phone80via remote-control). Resilience is three layers: (1) the in-session cron = the run; (2) the **SessionStart81hook** (`session_check.sh`) re-arms the cron after any restart and surfaces an unshown failed run, plus82your **>5-day self-renew** dodges the 7-day cron cap; (3) the global **resurrector** (`resurrect.sh`,83every 30 min) relaunches the home session in tmux if the machine rebooted or the session crashed. The84**watchdog** (`watch.py`) flags any run that ended without meeting the floor (`last-error` newer than85`last-done`), so a silent empty run never passes as success. (The headless `run.sh` stays in `scripts/`86as an optional fallback for users with no always-open session.)8788## Manage89- Pause: `systemctl --user disable --now autopilot-daily.timer`90- Status: `systemctl --user list-timers 'autopilot-*'` · run-state under `~/.claude/autopilot/<proj>/`91- Run once now (test): `bash ~/.claude/autopilot/bin/run.sh <proj>`9293## Guarantees it relies on94review-gate (mandatory on every code turn) · code discipline (minimal module/change/impact, modular,95tests + commits + docs, git per increment) · agent-harness skills + Chrome/visual tools as needed ·96system-level crash-proofing (systemd Persistent + watchdog).