Agent SkillsHmbown/Codewhale › cw-orient

cw-orient

GitHub

在开始编码或接手任务前,通过Git命令确认当前仓库状态、分支、工作树及版本信息,确保操作基于最新的真实代码环境,避免编辑错误位置。

docs/skills/cw-orient/SKILL.md Hmbown/Codewhale

Trigger Scenarios

开始新的开发会话 接手他人工作 不确定当前工作目录或分支状态时

Install

npx skills add Hmbown/Codewhale --skill cw-orient -g -y
More Options

Non-standard path

npx skills add https://github.com/Hmbown/Codewhale/tree/main/docs/skills/cw-orient -g -y

Use without installing

npx skills use Hmbown/Codewhale@cw-orient

指定 Agent (Claude Code)

npx skills add Hmbown/Codewhale --skill cw-orient -a claude-code -g -y

安装 repo 全部 skill

npx skills add Hmbown/Codewhale --all -g -y

预览 repo 内 skill

npx skills add Hmbown/Codewhale --list

SKILL.md

Frontmatter
{
    "name": "cw-orient",
    "description": "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 plan or editing a file."
}

cw-orient

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-slicecw-gatescw-dogfoodcw-landcw-handoff.

When to use

  • Starting a session, resuming one, or taking over from another agent.
  • A handoff, issue, or plan tells you the state of the repo — verify before trusting it.
  • You are about to edit and are not certain this checkout owns the files.

Workflow

  1. 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.

  2. 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.

  3. 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.

  4. 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/tui/locales/AGENTS.md, web/AGENTS.md. Read the one that owns the files you are about to touch.

  5. 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.

  6. 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.

Red flags / don't

  • Don't infer the active lane from a directory name, a stale handoff, or a .md file's confident prose. All three have been wrong here.
  • Don't treat a plan document as current state. Plans describe intent; git describes reality.
  • Don't clean, stash, reset, or git checkout -- files you did not modify. Worktree dirt is usually another writer, not garbage.
  • Don't start work in a worktree whose branch is already merged to main — that lane is retirement material, not a base.
  • Don't skip step 4 because the root AGENTS.md "probably covers it". The scoped files carry the rules that actually get violated.
  • Don't fetch, browse, or hit GitHub when the task was scoped local-only.

Output

State, in one short block, before doing anything else:

  • checkout path, branch (or detached HEAD), base commit;
  • dirty files and whose they appear to be;
  • other worktrees that own related work;
  • workspace version and whether check-versions.sh agrees;
  • which AGENTS.md files govern this change.

Version History

  • aedb88b Current 2026-09-09 04:22

Same Skill Collection

crates/tui/assets/skills/batch/SKILL.md
crates/tui/assets/skills/best-of-n/SKILL.md
crates/tui/assets/skills/contributor-onboarding/SKILL.md
crates/tui/assets/skills/dataviz/SKILL.md
crates/tui/assets/skills/debug/SKILL.md
crates/tui/assets/skills/delegate/SKILL.md
crates/tui/assets/skills/dependency-update/SKILL.md
crates/tui/assets/skills/docx/SKILL.md
crates/tui/assets/skills/feishu/SKILL.md
crates/tui/assets/skills/fleet-manager/SKILL.md
crates/tui/assets/skills/frontend-design/SKILL.md
crates/tui/assets/skills/handoff/SKILL.md
crates/tui/assets/skills/help/SKILL.md
crates/tui/assets/skills/implement/SKILL.md
crates/tui/assets/skills/interview/SKILL.md
crates/tui/assets/skills/mcp-builder/SKILL.md
crates/tui/assets/skills/mcp-discovery/SKILL.md
crates/tui/assets/skills/pdf/SKILL.md
crates/tui/assets/skills/plan/SKILL.md
crates/tui/assets/skills/plugin-creator/SKILL.md
crates/tui/assets/skills/pptx/SKILL.md
crates/tui/assets/skills/research/SKILL.md
crates/tui/assets/skills/review/SKILL.md
crates/tui/assets/skills/security-review/SKILL.md
crates/tui/assets/skills/simplify/SKILL.md
crates/tui/assets/skills/skill-creator/SKILL.md
crates/tui/assets/skills/skill-installer/SKILL.md
crates/tui/assets/skills/test/SKILL.md
crates/tui/assets/skills/v4-best-practices/SKILL.md
crates/tui/assets/skills/verify/SKILL.md
crates/tui/assets/skills/webapp-testing/SKILL.md
crates/tui/assets/skills/xlsx/SKILL.md
docs/skills/codew-release-qa-sweep/SKILL.md
docs/skills/cw-dogfood/SKILL.md
docs/skills/cw-gates/SKILL.md
docs/skills/cw-handoff/SKILL.md
docs/skills/cw-land/SKILL.md
docs/skills/cw-slice/SKILL.md
docs/skills/gh-assign-issues/SKILL.md
docs/skills/gh-close-issues/SKILL.md
docs/skills/gh-compile-issues/SKILL.md
docs/skills/gh-credit-harvest/SKILL.md
docs/skills/gh-file-issue/SKILL.md
docs/skills/gh-find-prs/SKILL.md
docs/skills/gh-treasure-hunt/SKILL.md
crates/tui/assets/skills/documents/SKILL.md
crates/tui/assets/skills/presentations/SKILL.md
crates/tui/assets/skills/spreadsheets/SKILL.md

Metadata

Files
0
Version
aedb88b
Hash
5ae1554b
Indexed
2026-09-09 04:22

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-16 09:20
浙ICP备14020137号-1 $방문자$