captain-release
Captain-only. Quality-check, commit, push, create PR, and cut a release in one flow. The "code is ready" command for captain-owned branches. Every PR is a release. Formerly `/release` — v2 rename to captain-actor-verb.
适合你,如果你需要快速将代码从分支发布为正式版本
npx oh-my-skill add the-agency-ai/the-agency/captain-releasecurl -fsSL https://oh-my-skill.com/install.sh | bash -s -- the-agency-ai/the-agency/captain-releasenpx oh-my-skill verify the-agency-ai/the-agency/captain-release怎么用
商店整理自技能原文 · 版本 dd2430b · 表述以原文为准装上后,当你对 captain 所属分支执行命令时,Claude 会依次进行代码质量检查、提交、推送、创建 PR 并更新版本号,最终生成一份发布摘要。
当你使用 /captain-release 命令并给出提交描述时触发。前提是你当前在 captain-* 分支、不在 master、有未提交的变更且已完成质量门禁检查。
技能原文 SKILL.md
<!-- allowed-tools omitted — inherits Bash(). This skill composes many tools (commit-precheck, git-safe-commit, git-push, pr-create, Edit, Read for manifest.json) plus Skill invocations (/pr-prep, /git-safe-commit). Inherit Bash() rather than enumerate at subcommand level (flag #62/#63 / devex dispatch #171). -->
captain-release
Captain's one-flow release command for captain-owned branches (captain-*). Runs quality-check → commit → push → create PR → version-bump → summary. Every PR is a release.
Name pattern: captain- actor prefix (captain-only), release verb. Grouped with captain-log, captain-review in the captain family.
Why this exists
When captain has staged coordination work (a framework fix, a refactor, a doc update) on a captain-* branch, that work needs to land as a PR with proper QG + release tagging + version bump. Without one cohesive command, each step gets skipped or done out of order. captain-release bundles the full flow.
Agents use a different path: /pr-submit → captain's /pr-captain-land. That's the agent-owned-work flow. captain-release is for captain-owned work (framework fixes, REFERENCE doc updates, captain-* coord artifacts).
Required reading
Before proceeding, Read the files listed in required_reading: frontmatter.
Usage
/captain-release <commit description> /captain-release --no-push <description> /captain-release --no-pr <description>
Preconditions
- Captain NOT on master. Running on master aborts — never push directly to master; always PR.
- Working tree has staged or uncommitted changes relevant to this release.
- A QGR receipt exists for the current state (via prior
/pr-prepor/quality-gate).
Flow / Steps
Step 1: Pre-flight
- Check current branch. If master, abort.
- Show
git status+git diff --stat HEAD. - If no changes, inform user and stop.
- Check for pending post-merge (C#372 Fix B). Run
./agency/tools/post-merge-state check. If exit 1, STOP — a prior PR is in pending-post-merge state (merged but release not yet cut). Run/pr-captain-post-merge <pending-PR>first, then re-invoke this skill. A release cannot start while the last release is incomplete. Exit 0 → continue.
Step 2: Quality gate
Run ./agency/tools/commit-precheck. Verify formatting, linting, tests pass. If fails, stop and report.
Step 3: Commit
Invoke /git-safe-commit with the commit description from <arguments>. Produces a commit on the captain-* branch.
Step 4: Push (unless --no-push)
- Show commits that will be pushed.
- Ask for confirmation.
./agency/tools/git-push --force-with-lease <branch>.
Step 5: PR (unless --no-pr and push happened)
- Check if PR exists:
gh pr view <branch>. - If exists: report URL.
- If not:
./agency/tools/pr-create --title "..." --body "...".
Never raw gh pr create. The pr-create tool validates a QGR receipt before allowing PR creation.
Step 6: Version bump
- Parse PR title for release version (D#-R# → version #.# OR
agency_versionincrement). - Update
agency/config/manifest.json: bump appropriate version field +updated_at. - Commit the bump via
/git-safe-commit --no-work-item. - Push:
./agency/tools/git-push <branch>.
Step 7: Summary
Release complete: Committed: <commit-hash> <message> Version: <old> → <new> Pushed: origin/<branch> PR: <url> (or skipped) Post-merge: run /pr-captain-post-merge after PR merges on GitHub
Failure modes
- On master: abort (never push directly to master).
- commit-precheck fails: stop, report which check failed; captain fixes + retries.
- push rejected: probably branch protection or force-with-lease race; captain investigates.
- pr-create rejected (no QGR): run
/pr-prepto produce a receipt, retry. - version bump already done on branch: skill detects (manifest diff), skips Step 6 bump.
What this does NOT do
- Does not merge the PR — that's
/pr-captain-merge. - Does not run post-merge — that's
/pr-captain-post-mergeafter GitHub merges the PR. - Does not push master — master is pushed only via merged PRs.
- Does not land agent-owned work — for that, agent uses
/pr-submit→ captain uses/pr-captain-land.
Captain-only — three-layer defense
paths: []— no file-path auto-activation; universally discoverable for the captain but scoped out of worktree contexts.- Name contains
captain-— scope visible in listing. - Step 1 precondition — captain must be on a captain-* branch, not master or agent branch.
(Historically disable-model-invocation: true was a fourth layer. That flag was removed 2026-04-20 because the captain session IS the principal's session — DMI was blocking the captain from invoking captain-* skills. See REFERENCE-SKILL-CONVENTIONS.md §1.)
Status
active (v2, refactored from legacy release 2026-04-19).
Related
/pr-captain-merge— merge step after PR is reviewed/pr-captain-post-merge— release step after merge/pr-captain-land— alternative flow when landing agent-owned work/pr-prep— QG before this skill runs/git-safe-commit— underlying commit toolagency/tools/pr-create— underlying PR creation toolagency/tools/commit-precheck— QG precheck- the-agency#296 — PR lifecycle ownership
- the-agency#315 — V1→V2 migration
OFFENDERS WILL BE FED TO THE — CUTE — ATTACK KITTENS!