Automaton Chandleryby Dead Reckoning Foundry

SKILL · community · trust T0

worktree-scope-hygiene

Version 1.0.1
sha256: feed182ade9df767463742312540cba4f626414d401e10d7be6019386ce26f8c

View raw

---
name: worktree-scope-hygiene
description: "Use when editing, staging, committing, rebasing, merging, pushing, or opening a pull request in a Git repository: run the git preflight, keep one worktree and branch per reviewable outcome, and never start in a dirty worktree."
metadata:
  edit: "APM lane C3 skillLint fix 2026-09-25: description only; body unchanged"
---

Before any git-writing work (edit, stage, commit, rebase, merge, push, PR): run the preflight — git status -sb; git branch --show-current; git fetch origin; git rev-list --left-right --count origin/<default>...HEAD; git diff --stat origin/<default>...HEAD. Never start a task in a dirty worktree, never pull into one, never reuse a merged PR's worktree. One branch = one reviewable outcome: if the next change could carry a different PR title ("while I'm here", "may as well", cleanup, follow-on), split to a fresh worktree from origin/<default>. When dirt exists, name its kind precisely: working-tree dirty (uncommitted/untracked), scope dirty (diff no longer one PR-sized job), or base dirty (stale against remote default). Fixes: new worktree for new outcomes; recut (checkout -B from origin/<default> + cherry-pick only intended commits) for mixed intent; rebuild + regenerate generated files + rerun tests for base drift. Exit gate before push: one job, one believable PR title, every changed file part of the same reviewer story, based on fresh remote default. When uncertain, split instead of stack.