| name | workflow-preflight |
| description | Pre-work validation before implementation. Use when starting an issue or fix to verify remote state, check for existing PRs, and detect branch conflicts before coding. |
| args | [issue-number|branch-name] |
| allowed-tools | Bash(bash *), Bash(git fetch *), Bash(git status *), Bash(git diff *), Bash(git log *), Bash(git branch *), Bash(git remote *), Bash(git stash *), Bash(gh pr *), Bash(gh issue *), Read, Grep, Glob, TodoWrite |
| argument-hint | optional issue number or branch name to check |
| created | "2026-02-08T00:00:00.000Z" |
| modified | "2026-06-18T00:00:00.000Z" |
| reviewed | "2026-06-10T00:00:00.000Z" |
/workflow:preflight
Pre-work validation to prevent wasted effort from stale state, redundant work, or branch conflicts.
When to Use This Skill
| Use this skill when... | Skip when... |
|---|
| Starting work on a new issue or feature | Quick single-file edit |
| Resuming work after a break | Already verified state this session |
| Before spawning parallel agents | Working in an isolated worktree |
| Before creating a branch for a PR | Branch already created and verified |
Context
- Repo: !
git remote -v
- Current branch: !
git branch --show-current
- Remote tracking: !
git branch -vv --format='%(refname:short) %(upstream:short) %(upstream:track)'
- Uncommitted changes: !
git status --porcelain
- Stash count: !
git stash list
Execution
Run the preflight check, then apply judgment to its results.
Step 1: Gather preflight state
Invoke the gatherer. Pass --issue <n> or --branch <name> when the argument
is a GitHub issue number or branch:
bash "${CLAUDE_SKILL_DIR}/scripts/preflight.sh" --project-dir "$(pwd)" [--issue N] [--branch NAME]
The script fetches origin --prune, resolves the base ref (origin/main →
origin/master → main → master), and emits a structured KEY=VALUE block:
AHEAD / BEHIND divergence, UNCOMMITTED / STASH_COUNT, CONFLICTS
(+ CONFLICT_FILES), existing-work lookups (ISSUE_STATE, EXISTING_PRS,
BRANCH_MATCHES), and a fixed RECOMMENDATION. It degrades gracefully when
gh is unavailable (GH_AVAILABLE=false) and never fails on network errors.
Pass to override the comparison ref, to skip the
network round-trip.