The first mate drives these; interactive entrypoints work by hand too, while *-lib.sh files are sourced helpers.
Each file also starts with a short header comment.
| Script | Description |
|---|---|
fm-bootstrap.sh |
Detect required toolchain problems, optional capability facts, and primary-checkout TANGLE: problems; locally sync live secondmate homes; refresh clones best-effort; install tools only after consent |
fm-fleet-sync.sh |
Fetch clones, clean-fast-forward their checked-out default branches, and safely prune branches whose remote is gone |
fm-update.sh |
Self-update the running firstmate repo and registered secondmate homes with fast-forward-only pulls from origin |
fm-backlog-handoff.sh |
Move already-judged in-scope queued backlog items from the main home into a seeded secondmate home |
fm-brief.sh |
Scaffold a ship brief with a worktree-isolation assertion, a report-only scout brief with --scout, or a secondmate charter with --secondmate |
fm-ensure-agents-md.sh |
Ensure project AGENTS.md is the real memory file and CLAUDE.md symlinks to it |
fm-guard.sh |
Warn when the primary checkout is tangled, when queued wakes are pending, or when a stale or missing watcher needs a prominent banner |
fm-home-seed.sh |
Lease/provision a secondmate home transactionally, clone projects, initialize gates, and maintain data/secondmates.md |
fm-spawn.sh |
Spawn one task, several id=repo pairs, or a persistent secondmate with --secondmate; ship/scout spawns require an isolated treehouse worktree; secondmate spawns locally sync the home before launch |
fm-project-mode.sh |
Resolve a project's delivery mode and +yolo flag from data/projects.md |
fm-merge-local.sh |
Fast-forward a local-only project's local default branch after approval |
fm-review-diff.sh |
Review a crewmate branch against the authoritative base, with optional --stat output |
fm-marker-lib.sh |
Shared from-firstmate request marker and detector sourced by fm-send.sh, fm-brief.sh, and tests |
fm-watch-arm.sh |
Verified per-home watcher re-arm; reports started, healthy, or FAILED; --restart relaunches only this home's watcher |
fm-watch.sh |
Singleton-safe one-shot watcher; blocks until supervision work is due, queues it durably, then exits with one reason line |
fm-supervise-daemon.sh |
Presence-gated sub-supervisor for walk-away (/afk) supervision: wraps fm-watch.sh, self-handles routine wakes in bash, and escalates only captain-relevant events as one verified, batched, single-line digest prefixed with a sentinel marker |
fm-tangle-lib.sh |
Shared default-branch resolution and primary-checkout tangle classification sourced by bootstrap and guard |
fm-ff-lib.sh |
Shared guarded fast-forward helper for /updatefirstmate origin pulls and no-fetch local secondmate syncs |
fm-tasks-axi-lib.sh |
Shared tasks-axi compatibility probe sourced by bootstrap and teardown |
fm-wake-drain.sh |
Atomically drain queued watcher wakes before handling supervision work |
fm-wake-lib.sh |
Shared durable wake queue and portable lock helpers sourced by the watcher, drain, arm, guard, and daemon |
fm-send.sh |
Send one verified literal line (or --key Escape) to a direct-report window; exits non-zero on confirmed swallowed Enter; bare kind=secondmate targets are marked as from-firstmate; text sends pause FM_SEND_SETTLE seconds after success |
fm-tmux-lib.sh |
Shared tmux pane primitives for busy detection, dim-ghost-aware and border-aware composer detection, and verified submit retry |
fm-peek.sh |
Print a bounded tail of a crewmate pane |
fm-pr-check.sh |
Record a PR-ready task and arm the watcher's merge poll |
fm-promote.sh |
Promote a scout task in place so it becomes a protected ship task |
fm-teardown.sh |
Return the worktree or retire/release a secondmate home; protects ship work, requires scout reports, checks child work, and prints the backlog reminder |
fm-harness.sh |
Detect the running harness; resolve the effective crewmate harness |
fm-lock.sh |
Per-home firstmate session lock |