Use at the start of any Codewhale work session, or when unsure which checkout, branch, or worktree is authoritative: establish live repo truth before reading a
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-cw-orient-cfb586ed07dc ,按照其中的说明把「cw-orient」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Open every session on live truth, not on a handoff note, a directory name, or what was true last time. This repo runs many worktrees at once; the cheapest bug to avoid is editing the wrong one. Five commands, then you know where you are.
This is stage 1 of the loop: orient → cw-slice → cw-gates → cw-dogfood → cw-land → cw-handoff.
Locate yourself. Checkout, branch, dirt, and how far you are from the remote:
git rev-parse --show-toplevel && git branch --show-current
git status --short --branch
git log --oneline --decorate -10
A detached HEAD or a branch with no upstream is normal here — note it, don't "fix" it silently.
See the other lanes. Worktree sprawl is the standing hazard: several checkouts of this repo are usually live, each with its own dirty state.
git worktree list
git branch --sort=-committerdate --format='%(committerdate:short) %(refname:short)' | head -20
If the work you were asked to do already has a worktree, use it. Do not start a second copy of the same lane.
Read the dirt before you touch it. Modified files you did not write belong to someone else — another agent, another lane, an in-flight slice:
git status --porcelain
git diff --stat
Preserve them. Leave them unstaged, and do not git checkout -- or stash
another writer's work to get a clean tree. If your change genuinely conflicts
with the dirt, work in a fresh worktree instead.
Fix which guidance applies. The nearest scoped AGENTS.md wins over the
root one, and it is where the per-area rules actually live:
find . -name AGENTS.md -not -path './tmp/*' -not -path '*/node_modules/*' -not -path './target/*'
Today: root AGENTS.md, crates/tui/AGENTS.md,
crates/localization/locales/AGENTS.md, web/AGENTS.md. Read the one that owns the
files you are about to touch.
Establish version truth from source, not memory.
grep -m1 '^version' Cargo.toml
./scripts/release/check-versions.sh
check-versions.sh is the drift gate across the workspace version, npm,
Cargo.lock, the changelog, and the README. If it disagrees with what you
were told, believe the script.
Only if the task is about the community queue — issues, PRs, harvesting,
credit — pull the live queue with the gh-* skills in this directory rather
than assuming from memory. When the task is local-only, stay offline and
record the missing external receipt instead.
.md file's confident prose. All three have been wrong here.git
describes reality.git checkout -- files you did not modify.
Worktree dirt is usually another writer, not garbage.main —
that lane is retirement material, not a base.AGENTS.md "probably covers it". The
scoped files carry the rules that actually get violated.Open with a short status block. Skip fields that are empty or normal — a
clean tree on main with no related worktrees is one line, not five:
check-versions.sh agrees;AGENTS.md files govern this change.