Use when turning verified Codewhale work into commits, branches, or a merge: choosing direct-main vs. worktree vs. integration branch, preserving contributor cr
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-cw-land-41a93d1abe3f ,按照其中的说明把「cw-land」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Verified work still has to land without stepping on other writers, losing
contributor credit, or merging past a gate that has not actually passed. This
stage is about the boundary between "it works" and "it is in main" — and about
which of those steps you are allowed to take.
Stage 5 of the loop: cw-orient → cw-slice → cw-gates → cw-dogfood → land → cw-handoff.
main moving.Choose the landing shape.
main is permitted for a small coherent change when this
checkout is current, clean, and owns the affected files. Local commit
permission never implies push, merge, tag, release, or deploy permission.integration/<topic>-<pr>-<date> — is the
normal path for anything with conflicts or several moving PRs. It is
cheaper than rebasing onto a main that keeps moving, and it leaves the
contributor's branch untouched.Commit narrow and build-green. One coherent change per commit; the tree builds at every commit. Put the real verification in the message — actual pass/fail counts, not "tests pass".
Preserve credit mechanically, not just politely. Commit authorship and
Co-authored-by: trailers must use the contributor's own GitHub-linked
address — GitHub reads neither .github/AUTHOR_MAP nor .mailmap for the
contribution graph; those are project conventions on top. When a
contributor's work lands as our commit, it carries both:
Harvested from PR #N by @handle
Co-authored-by: Name <github-linked-email>
That trailer is what lets auto-close-harvested.yml close their PR with
credit. Canonical human identities live in .github/AUTHOR_MAP.
Whether a bot or agent also appears in a trailer no longer matters — the CI check that policed trailer identities was removed because it rejected ordinary agent commits. Give humans their credit; don't spend time scrubbing tool trailers.
Landing someone else's work: their time is more expensive than ours.
main moved, a maintainer resolves it.git diff $(git merge-base main <pr-head>)..<pr-head>
maintainerCanModify does not guarantee push access to the fork. When the
push is refused, land the resolved merge on an integration branch here.action_required and never start,
so the PR looks abandoned when nobody has actually looked at it. Approve
the runs, then fix the cause: add them to .github/APPROVED_CONTRIBUTORS
(all:username), or comment /lgtm (PR scope) or /lgtmi (issue scope).Verify mergeability against the real head. A PR that is clean against
main can still conflict with a release branch:
git merge-tree $(git merge-base <base> <pr-head>) <base> <pr-head>
Merging under a gate. AGENTS.md ("Merging under a gate") owns this:
the artifact must literally say PASS, the review thread outranks the check
rollup, and ambiguity blocks the merge — never the reverse.
Clean up your own lane. When a worktree's branch lands on main, remove
the worktree (git worktree remove <path>). scripts/worktree-gc.sh
lists lanes by merged/dirty state; --remove-merged --yes prunes the
merged-and-clean ones. Worktree sprawl was a 560 GB problem here once.
AGENTS.md / CLAUDE.md operator controls that live outside the
product repository into a public repo.