/anchor:ship [base branch, default main]from anchor
一条龙发车 —— done check + Conventional Commit + gh PR create。Use to ship a finished change as a PR in one command (assumes /done has passed or you're confident).
Ships in anchor. Installing the plugin adds it to Claude Code.
按这个流程发车,每步成功才走下一步:
/done 流程(如果还没跑)如果用户最近没跑过 /done,先调用 /done 跑完所有 done-gates。如果 /done 没全过(lint 挂、未做 E2E、未回写 CLAUDE.md),停在这里报告 + 不发车。
如果用户在前 5 turn 内已经跑过 /done 且通过,可以跳过这步。
$ARGUMENTS 为空 → base = main。否则 base = $ARGUMENTS。
确认当前在一个非 base的 branch 上(不能从 main 直接 PR 到 main):
current=$(git branch --show-current)
test "$current" != "<base>" || { echo "ERROR: 在 base branch 上,先切到 feature branch"; exit 1; }
没在 feature branch → 报告 + 停。
跑:
git log --oneline <base>..HEAD
feat: / fix: / docs: / refactor: / test: / ci: / chore:判断 prefix:
feat:fix:docs:refactor:test:ci: / build:模板:
## Summary
<1-3 bullets:这个 PR 改了什么 / 为什么>
## How tested
<本会话做过的 E2E 步骤;如果只跑了单测,明说>
## Risk / 二阶问题
<改动有没有这些隐患?(每项打勾或写 N/A)>
- [ ] Empty state 安全
- [ ] Retry 幂等
- [ ] Stale state 处理
- [ ] Rollback 路径
## Related
<linked issue/discussion 链接,或 N/A>
填的时候只填本会话里你确定的信息,没做的诚实写 N/A 或留空,不要编。
# Ensure branch is pushed
git push -u origin "$current" 2>&1
# Create PR via gh CLI
gh pr create --base <base> --head "$current" \
--title "<conventional commit title>" \
--body-file /tmp/pr-body-$(date +%s).md
--body-file 用临时文件传 body,避免 PR body 里如果含敏感字面量被 PreToolUse hook 误拦。
PR 成功创建 → 拿到 URL,告诉用户:
✅ PR opened: <url>
Title: <title>
Base: <base>
Head: <branch>
如果用户在 $ARGUMENTS 里加 --skip-done,跳过第 1 步的 /done 自动调用(信任用户已经检查过)。但在 PR description 里加一行 "⚠️ /done was skipped at user request"。
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
23 commands in this plugin
/cleanup1. 拿改动文件清单扫本会话改动的文件,找 dead code / debug print / 未用 import / 过期 TODO 等收尾杂物。Use right before /done or /ship to ship clean code./decide/decide — architectural decision record (ADR)ADR-style 架构决策记录 — 写到 ~/.anchor/memory/decisions/<project>/。Use when you make a non-trivial design / tech / process decision worth remembering./diff1. 决定 diff 范围分析 git diff 的风险面 —— 改动规模、命中敏感关键词、可能引入的回归类别。Use before /done or before committing to spot trouble early./done1. 检查 task list一键收尾——按 ec skill 的"完成清单"系统化跑完所有 done-gates,不要再含糊说"应该可以了"/ec/ec — alias for /anchorBackward-compat alias for /anchor (formerly the primary skill trigger before v1.5.0)./init-claude-md步骤在当前工作目录创建 CLAUDE.md 骨架(项目无 CLAUDE.md 时用)。Use when entering a new project that has no project-level CLAUDE.md / AGENTS.md.npx claudepluginhub biefan/anchor --plugin anchorOther plugins' commands for the same job