WHAT: Verifies the working environment at the start of a cast: identity, remote, clean tree, branch divergence. WHY: Operating on wrong assumptions from the first step wastes the entire cast. WHEN: TRIGGER at the start of any cast that will modify the repo. DO NOT TRIGGER mid-cast or before read-only operations.
Run once at the start of your cast. Confirms the environment matches expectations before you start work.
# Verify current state
./scripts/preflight.sh
# Create a branch and verify
./scripts/preflight.sh --branch feature/my-work
On success: JSON environment report on stdout. On failure: error message on stderr, non-zero exit.
These cause the script to exit with an error. Do not proceed.
--branch was requested)The JSON output gives you a complete picture of the environment:
none, already_on_branch, created)main)behind means local main is stale)*-conventions skill)You own the environment from this point forward. There is no need to re-verify state before each git operation. The only verification before a commit is the pre-commit check (see pre-commit skill).