captain

Coordinate multiple coding agent lanes through merge trains, version stamps, and approval gates.

139k|20.6k|Updated Mar 11, 2026
Ready to run
npx skills add https://github.com/garrytan/gstack --skill captain-garrytan
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: captain
Source: https://github.com/garrytan/gstack/tree/main/captain
Command: npx skills add https://github.com/garrytan/gstack --skill captain-garrytan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Managing multiple parallel development threads without collision, red bases, or manual merge conflicts is complex. The Captain Skill automates the coordination: lanes send READY blocks, the controller merges through trains, approvals flow through one path, and flaky tests are fixed daily instead of retried. ## Core Features & Use Cases - Merge Train Orchestration: Build multi-PR trains, run unified gates, merge in slot order with version stamps. - READY Contract Validation: Enforce proof of CI green, pregate pass, and paid evidence before any merge. - Approval Routing: Record owner decisions in their exact words, route all asks through the controller, track approvals in a ledger. - Flaky Test Ledger: Daily pass reads gate artifacts, groups flakes by cause, and opens fix PRs with regression tests. - Digest & Reporting: Keep one living digest of what landed, what is READY, what is in-flight, and what needs the owner. - Use Case: A crew of 4 engineers working on overlapping subsystems. Each lane opens a PR and sends a READY block with CI green and gate evidence. The controller builds a train of 3 PRs, the gate runs once on the train head, each PR lands with its own version stamp, and the next train takes the remaining PR. Owner approvals are logged once and cited in future similar decisions. ## Quick Start Run the captain skill, read the digest to see what needs you, read the crew rules file to understand the crew's parameters and standing approvals, then handle the open item at the top of the digest.

Frequently Asked Questions about captain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a merge train for my repository?▼

Fill the CREW.md template with your repo name, base branch, required checks, gate workflow, and train size. Each lane sends a READY block after /ship; the controller runs `gstack-ship-queue train build --prs <pins>` to build the train, waits for the gate verdict, then merges each PR in slot order with `verify` and `gh pr merge`.

What goes in a READY block?▼

The block includes the PR number, full 40-character head SHA, green required checks at the pin, pregate pass, paid gate evidence (focused cases or screen result), /ship receipt, and any flaky cases already logged in the ledger. Validation refuses a short SHA, pending checks, or a receipt that does not match the pin.

How do version stamps work in a train?▼

The controller calls each lane with its slot number and base SHA. The lane merges the base (slots 2+), runs `gstack-restamp --next` to allocate a version and stamp only the files in `STAMP_FILES`, commits the merge and stamp, waits for CI, then answers with the stamped SHA and version. The verification step refuses any edit beyond the merge and stamp files.

What happens when a train goes red?▼

The gate verdict prints `RED` with case names that failed twice in-run. The controller runs `gstack-ship-queue train bisect` to identify which PR caused the failure. That lane is sent back to fix and READY again; the rest join the next train.

How do flaky test reruns work?▼

The daily flaky-fix lane reads gate and free-suite artifacts, logs each flake with both runs, groups by case, and opens one fix PR per root cause with a regression test red on base and green with the fix. Weakened assertions, raised thresholds, or added trials are not fixes and need owner approval.

Can lanes merge their own PRs or skip the train?▼

No. A lane's job ends at an unstamped READY block. The controller merges; a PR outside a train costs a backstop gate and a red result freezes the queue. Single urgent PRs take a one-PR train with `--urgent`.