复制安装命令
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
href="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue?style=flat-square"
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
来源文件:README.md
You can run one coding agent easily. But the moment you want three project tasks done in parallel - fixes, investigations, plans, audits - you become a tab-juggler: babysitting sessions, copy-pasting context between repos, forgetting which terminal had the failing test.
firstmate flips the model. You talk to a single agent - the first mate - and it runs the crew for you: spawning autonomous agents in a visible session backend, giving each a clean git worktree, supervising them to completion, and handing you finished PRs, approved local merges, or standalone investigation reports. For larger fleets, you can opt in to persistent secondmates: second mates that are still ordinary direct reports, but run from their own isolated firstmate homes on this machine or another SSH-reachable host.
firstmate is not a model, not a harness, not a skill, not an MCP server, and not a CLI.
firstmate is an agent distro for running a crew of agents.
An agent distro is a portable directory of instructions, skills, tooling, policies, and state conventions that turns a general-purpose agent into a specialized one.
There is no app to install: the cloned repo is the distro - AGENTS.md, bundled firstmate skills, and helper scripts that any terminal coding agent can follow.
Launching a supported harness inside it instantiates your first mate - and makes you the captain.
backend=orca, so parallel work on one repo never collides.no-mistakes, direct-PR, or local-only, with an optional +yolo autonomy flag.FM_HOME, state, projects, and session lock, either locally or as a whole home on an SSH-reachable host, with guarded updates and recovery that never turns an unavailable remote route into a local replacement..env pairing token so firstmate can answer your public mentions on X and Discord alike, act on normal reversible mention requests through the same lifecycle as chat requests, acknowledge spawned work, and post up to three public-safe completion follow-ups within seven days for genuine milestones and the final outcome without changing non-Relay behavior; a final reply promised in a thread becomes durable state that is reconciled from disk, so a restart or a compacted conversation cannot lose it; dry-run preview records would-be replies and dismissals locally before go-live.Full detail on every feature lives in docs/architecture.md.
pi-signed, Codex, OpenCode, or Cursor Agent CLI.gh auth login.The first mate detects and offers to install supported missing tools after you approve. Backend-specific setup is linked in Documentation.
Claude Code, Grok, and Pi are equal co-primary recommendations for running the primary firstmate session, with pi-signed supported as Pi's distinct signed-wrapper identity.
Claude Code uses a tracked Stop hook for tokenless watcher re-arm and rewake, Grok uses background-notify wake cycles, and Pi uses its tracked primary watcher extension.
All three have verified turn-end guard paths when launched with their documented setup.
Pick whichever one matches your subscription and workflow.
Codex and OpenCode are also verified and supported as primary harnesses; Codex uses bounded foreground checkpoints, and OpenCode uses a TUI plugin, so both carry more harness-specific supervision tradeoffs than the three co-primaries.
Cursor Agent CLI is verified as a primary too, using a tracked project-scope .cursor/hooks.json whose stop hook parks on the watcher between turns, closest in shape to Claude Code's.
Launch it with --trust, or none of its project hooks load; it also has no turn-end hook in headless cursor-agent -p, so run the primary session interactively.
gh auth login
git clone https://github.com/kunchenguid/firstmate
cd firstmate
Then launch one of the co-primary harnesses; AGENTS.md takes over from there:
Claude Code
claude
Grok
grok --trust
Pi
pi
# or, when the signed wrapper is installed
FM_PI_HARNESS=pi-signed pi-signed
For Grok, --trust is needed once per clone so project hooks and the turn-end guard load; /hooks-trust inside Grok works too.
For Pi, approve the project trust prompt once per clone on first launch so the tracked .pi/extensions/*.ts files auto-load.
Pi's /calm toggle hides supported transcript chrome, including canonically classified Firstmate operational user rows, and uses a Calm-only animated working boat during active runs while preserving all model context and session data.
The hidden operational inputs remain ordinary user-role messages with unchanged delivery, ordering, authority, persistence, and exports.
The preference persists for the effective Firstmate home, and toggling it off restores ordinary rendering.
Calm's current behavior and supported limits are separate from its version-scoped maintainer evidence.
> ahoy! look at my github project xyz, then fix the flaky login test and add dark mode
# firstmate checks its toolchain (asking your consent before installing anything),
# clones the project under projects/ and spawns two isolated workers in the active backend.
# Minutes later:
PR ready for review, captain: https://github.com/you/xyz/pull/42
(fix flaky login test - risk: low - CI green)
> alright merge it
Setup guides for tmux (the default) and every other supported backend (herdr, zellij, Orca, cmux) are linked in Documentation below.
you (the captain)
│ chat: requests, decisions, "merge it"
▼
┌─────────────────────────────────────┐
│ firstmate (this repo) │
│ reads projects/ + firstmate routes │
│ writes guarded backlog/briefs/state │
└──┬──────────────┬───────────────┬───┘
│ backend sends / status files │
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐
│fm-task1│ │fm-task2│ ... │fm-taskN│ tmux windows, herdr/zellij tabs, cmux workspaces, or Orca terminals
│crewmate│ │crewmate│ │crewmate│ one autonomous agent each
└───┬────┘ └───┬────┘ └───┬────┘
▼ ▼ ▼
treehouse worktree, Orca worktree, or isolated secondmate home
│
├─ ship: project mode ► PR/local merge ► teardown
│
└─ scout: report at data/<id>/report.md ► decision inventory ► relay findings ► teardown
You chat with the first mate.
It routes each request to a crewmate in its own session endpoint and git worktree, supervises the fleet with a zero-token event-driven watcher, and brings you finished PRs, approved local merges, or investigation reports.
Optional secondmates extend this to persistent local or whole-home remote second mates, dispatch profiles let you steer which harness handles which task, and opt-in Relay lets the same fleet answer public mentions.
codex-app is not a runtime backend yet; docs/codex-app-backend.md owns the Codex App boundary.
Full architecture - the supervision engine, worktree isolation, secondmates, dispatch profiles, project modes, optional Relay, fleet sync, and self-update - is in docs/architecture.md.
Firstmate ships these user-invocable built-in skills.
Claude and grok use the slash form shown here; codex uses the same names with $, such as $afk.
| Skill | What it does |
|---|---|
/afk | Enter away-mode supervision: the sub-supervisor self-handles routine notifications in bash, escalates captain-relevant events and bounded declared-external-wait rechecks as batched digests, and actively alerts if delivery gets stuck while you step away |
/ahoy | Recap visible session events since the prior real captain message plus visibly unanswered captain decisions, then guide the captain through any open decisions one at a time in agent-judged impact order; fall back to Bearings when invoked as the session's first real captain message |
/bearings | Generate a concise four-section chat digest from bounded local fleet and registered-secondmate state; use /bearings file to also replace today's dated report in data/, and add include PRs when live PR enrichment is wanted |
/updatefirstmate | Self-update the running firstmate and its secondmates to the latest from origin with fast-forward-only pulls, then re-read instructions and nudge secondmates |
/stow | Sweep the session for uncaptured durable knowledge, curate tiered startup memory with decay and cold archival, enforce each home's budget or surface the required decision, cascade to registered second mates, and report what is safe to reset |
Bearings invocation examples:
/bearings returns the fresh four-section digest in chat only./bearings include PRs keeps chat-only mode and opts into live PR enrichment./bearings file replaces today's data/status-report-<YYYY-MM-DD>.md from scratch and links it from the four-section chat digest./bearings file include PRs combines the dated report with live PR enrichment.Agent-only reference skills live under .agents/skills/ and are loaded by firstmate at the trigger points named in AGENTS.md.
Firstmate's skills live in two separate places with different audiences:
.agents/skills/ - agent-loaded skills (this section's table, plus firstmate's agent-only reference skills). Every one of these assumes a live firstmate home and is meaningless, or actively misleading, installed anywhere else, so each carries metadata.internal: true in its frontmatter. That flag hides them from installer discovery (tools like the skills.sh npx skills add installer) without affecting how firstmate itself loads them - frontmatter metadata is inert to the agent's own skill loader.skills/ - public, installer-facing skills meant to be installed standalone into any project, independent of firstmate.
Each one is a self-contained skill with no dependency on firstmate's paths, tools, or vocabulary.
Today that is skills/stow, a generic session-knowledge-sweep skill that routes findings by explicit instruction first, then existing local conventions, then a private .stow-notes.md fallback, and curates tiered entries through decay, local archival, and user-approved on-demand offload proposals.
It intentionally shares no code with the firstmate-internal .agents/skills/stow it is named after, so the two can evolve independently.FM_HOME, runtime backend selection, optional Relay and its X and Discord setup steps, the files you set, and harness support./calm behavior and supported presentation limits.pi-signed, Grok, Cursor, and unknown harness fallback.bin/ toolbelt reference.AGENTS.md - the distro's always-loaded operating contract and routing index for conditional procedures.Contributions are welcome - see CONTRIBUTING.md for the workflow, repo conventions, and how to run the tests.
MIT - see LICENSE.
name: stow
description: Sweep the current conversation for durable knowledge - user preferences, project facts, operational gotchas, standing decisions, and unfinished next steps - and file each through explicit instructions, existing local conventions, or the private `.stow-notes.md` fallback, curating tiered, decaying destination files as it writes. Use when the user invokes /stow, asks to save or write down what was learned this session, or before a context reset or long break.
user-invocable: trueSweep this conversation for durable knowledge that only exists in chat right now, and file it through the user's explicit instructions, the project's existing local conventions, or the private .stow-notes.md fallback in the current directory.
The goal is to leave the next session a compact, current operating map, not an accumulating journal: every durable finding lands on disk, and every file this skill touches comes out more accurate, not merely longer.
Entries are tiered and decay between passes, and stale material retires to a local archive instead of being deleted.
Everything files to a local destination by default; an external system such as an issue tracker is reached only through the explicit-instruction rule in step 3.
Sweep the conversation for uncaptured durable knowledge. Read back over the session and look for:
Discover the host's existing conventions before deciding where anything goes. Don't assume a destination - look for what's actually there, roughly in this order:
CLAUDE.md, AGENTS.md, or an equivalent at the repo root or nearby.TODO, BACKLOG, NOTES, or similarly named plain file already tracked in the project.
This step is about local files only; do not scan for or infer an issue tracker here - step 3 owns external routing.Route each finding using this fixed priority order, local-first.
.github/.gitlab folder, or any other signal that a tracker probably exists is never by itself grounds to file anything there - never route externally on inference.TODO/BACKLOG/NOTES file for undone next steps; a discovered user-level memory file for user preferences when one happens to be accessible - a bonus if reachable, never an assumption or a requirement.
This is the only tier that writes findings into a tracked, shared file or outside the current directory, and only because the user already established that destination..stow-notes.md in the current directory, for every finding-kind. When no existing convention fits, don't improvise a location or invent an ad hoc filename.
In a git worktree, first verify .stow-notes.md is not already tracked in the index; if it is tracked, do not write private findings there - report that the fallback is blocked until the user chooses a safe destination.
Otherwise create or update .stow-notes.md in the current working directory - never a user-level or home-directory path, so the fallback works even for agents sandboxed to the current directory.
Then keep it out of git: add a .stow-notes.md line to a .gitignore file in the current directory - an ordinary file at that path, not git's internal exclude mechanism, which can resolve outside the working directory in a linked worktree.
Leave staging or committing that .gitignore line to the user, same as everything else this skill writes.
If even the .gitignore write fails, don't block or error - still write .stow-notes.md and tell the user to ignore it manually.When it's genuinely ambiguous between two existing conventions, ask once - then remember the answer. If more than one discovered local convention plausibly fits a finding, ask the user once, plainly, which one they want that kind of note to live in going forward. The same applies when the user gives an explicit instruction to use a tracker or other non-local system going forward rather than just for one item. Once they answer, offer to remember it: with their explicit permission, record a short standing note of that choice in the discovered (or newly agreed) user-level memory file, so the same question doesn't need repeating in this project. Always ask before adding that note - never establish a convention silently. When nothing existing fits at all (not merely ambiguous), that's the step-3 fallback, not a question.
Write only into locations that already exist as a real convention, the step-3 fallback (plus its .gitignore line), or a destination the user just approved in step 4.
Do not invent new shared files, new folders, or new tracker categories the project doesn't already have.
Never store, create, or edit a skill as a destination for a finding: there is no "graduate this to a skill" move, even in a repo whose existing .claude/skills/ or skills/ directory makes one look like a convention.
The offload exit in step 7 does not weaken this: this skill only ever proposes such a move, and the on-demand home is created through the user's own change process, never by this skill's writes.
If the fallback is unwritable and the user doesn't want a new convention, say so plainly and leave that finding unfiled rather than fabricate a destination.
Read the destination before writing: inspect-then-update, never blind-append.
Before writing any finding, read the destination file's current contents in full - and for a TODO/BACKLOG/NOTES entry, the full existing item, not just its title.
Then classify the finding against what is already there: new, duplicate, superseding an existing entry, or evidence that an existing entry is now obsolete.
Write the considered replacement that classification implies - a duplicate folds into the entry that already carries it, a superseding finding rewrites the entry it supersedes, and an obsolete entry is refreshed, archived, or replaced in a way that preserves its fact in the same pass - rather than blindly appending a new entry or overwriting the file wholesale.
Prefer a one-sentence rewrite of an existing entry over a second entry saying nearly the same thing.
A superseded body worth keeping leaves through one of step 7's exits, so it stays recoverable instead of being lost silently in the rewrite.
Mark each entry written into a memory file or .stow-notes.md per the tier contract below, but never add tier markers to an existing TODO/BACKLOG/NOTES file.
File each undone next step with what it is waiting on, when it is genuinely blocked on something.
Curate every memory file this pass has open, not only the one a finding routes to.
Evaluate each dated entry against its tier clock per the tier contract below, refreshing what current evidence re-validates and archiving what stays stale.
Archive what is no longer current, including completed chronology, stale versions and paths, transient task state, resolved alternatives, old metrics, and report-sized procedures; merge or remove only superseded claims and duplicates whose facts are preserved elsewhere.
Prefer one concise current rule, or a pointer to the authoritative source, over duplicate prose.
Never plainly remove a unique current fact: every such exit must archive it with provenance in the recoverable cold tier or relocate it to a live on-demand owner or a consolidation merge that preserves the fact.
This is an accuracy discipline, not a length target - a stale entry misleads the next session; a current one earns its place.
A .stow-notes.md note has exactly five exits: promotion into a shared, tracked file the user approves; folding into a discovered user-level memory file; archiving to the local, never-loaded archive file; a user-approved move into an on-demand-loaded home (a skill or scoped instruction file), executed through the user's own change process rather than by this skill; or deletion of a duplicate already preserved by a stronger owner - do not invent another.
Finish with an honest safe-to-end verdict and a resume pointer for the next session.
Report one action per file this sweep touched or considered: unchanged, added, rewritten, pruned, archived (an entry moved to the local archive), or routed (the finding went to a different owner).
Name any proposed moves into an on-demand home still awaiting the user's approval, so they are not mistaken for finished work.
Then tell the user, in plain language, what was captured and where, what could not be captured (and why), and whether the conversation is now safe to end or reset - that is, whether every durable finding from this sweep now lives on disk or in an explicitly requested tracker rather than only in this chat.
If something could not be captured yet, say so explicitly instead of reporting the session fully safe.
If anything landed in .stow-notes.md, say so - note that it is private and confined to this project, and name its promotion exit from step 7 if the user wants it more widely visible.
In a git repo, report the ignore protection as it actually happened: either the .gitignore line was added and awaits the user's own commit, or the write failed and the user must ignore .stow-notes.md manually before relying on git to hide it.
If the fallback was blocked because .stow-notes.md was already tracked, say that no private fallback was written and the session is not fully safe to reset until the user chooses another destination or accepts that tracked file.
If a user preference landed in .stow-notes.md because no user-level memory file was discovered, add one caveat: it now applies to this project only, and the user must copy it into their own global memory file themselves if they want it to follow them across projects.
The real payoff of stowing is not this session but the next one: close with a short, copy-pasteable RESUME POINTER naming exactly which files a fresh session should load to pick this back up cold, e.g. To pick this back up in a new session, load: CLAUDE.md (project conventions), .stow-notes.md (private notes, not shared).
List only the files this sweep actually wrote or updated; skip the pointer if nothing was written.
Markers are compact trailing HTML comments, deliberately cheap because marker bytes are part of every file this skill keeps lean:
<!--a:YYYY-MM-DD--> - an aging entry; the embedded date is its last-reinforced date.<!--p:YYYY-MM-DD--> - a perishable entry; the embedded date is its last-reinforced date.<!--P--> - an explicitly pinned entry in a file whose default tier is not pinned.<!--g--> - migration-only: an unconfirmed legacy entry that has consumed its one grace cycle, carrying no date because grace is not reinforcement.- The staging deploy needs the VPN profile active or the smoke test hangs. <!--a:2026-08-03-->
- CI is red on the flaky auth test until the pinned runner image updates (tracked in TODO). <!--p:2026-07-20-->
- Always run the schema linter before touching migrations. <!--P-->
The tier names say what this skill does with an entry:
pinned - never decays and is never dropped to shorten a file; it changes only when the user or reality changes it.aging - must re-prove itself: an entry whose age is greater than or equal to 30 days since its last-reinforced date is stale, and a stale entry is re-validated (date refreshed) or archived, never kept by inertia alone.perishable - written to be thrown out: an entry whose age is greater than or equal to 7 days since its last-reinforced date is stale, and its text must name a checkable expiry condition, such as a ticket, a version, or a dated expectation.
An entry that cannot name a checkable condition is aging, not perishable.Rules:
pinned, while a project memory file and .stow-notes.md default to aging.pinned default carries no marker at all; every aging and perishable entry always carries its dated marker, whose letter names the tier, so a clock-carrying entry is never ambiguous with unmarked legacy material.<!-- memory tiers: see the stow skill -->, optionally naming that file's default tier when it deviates.
The tier semantics, marker spellings, and clocks live only in this skill and are never restated in a file header.
During one-time migration, add the pointer even to a default-pinned file that contains only unmarked entries, so every governed file names its scheme owner.perishable entry against its named condition: still open means refresh the date, while resolved, expired, or no longer checkable means archive it now..stow-archive.md in the source file's own directory, never loaded by any session, and its archive record includes the source filename, tier, reinforcement date when present, and a one-line reason.
In a git worktree, verify that this archive path is not already tracked in the index before writing any archived fact there.
If it is tracked, do not write to it and report that archival is blocked until the user chooses a safe destination.
Otherwise add a .stow-archive.md line to a .gitignore file in the archive's directory, and never write archived facts into a git-tracked file.
Recovery is search plus copy back.<!--g-->, which carries no date, to persist one grace cycle without treating presence as reinforcement.
On the next pass, current evidence replaces that marker with the normal dated tier marker; without such evidence, archive the entry with a legacy-unvalidated note.
The same persisted transition applies to an entry a hand edit later leaves unmarked in a file whose default tier carries a clock.It does not invent a new note-taking system, initialize version control, or stage, commit, or push anything on the user's behalf - every write, including the .gitignore line, lands in the working tree for the user to review and commit like any other change.
It never files credentials, secrets, or other sensitive material - only knowledge that's safe to keep in plain text wherever it lands.
It never files anything to an issue tracker, hosted board, or other external or public system on its own inference - that only ever happens on the user's explicit say-so, per the hard rule in step 3.
评论 (0)
暂无评论,成为第一个评论者吧!