Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
laurigates avatar

Workflow Preflight

  • 50 installs
  • 49 repo stars
  • Updated August 4, 2026
  • laurigates/claude-plugins

Helps with automation & workflows tasks.

About

workflow-preflight is a Claude Code skill for automation & workflows. It helps solo builders move faster with AI-assisted development.

  • workflow-preflight
  • Automation & Workflows
  • AI-coding skill

Workflow Preflight by the numbers

  • 50 all-time installs (skills.sh)
  • Ranked #1,082 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/laurigates/claude-plugins --skill workflow-preflight

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs50
repo stars49
Last updatedAugust 4, 2026
Repositorylaurigates/claude-plugins

What it does

Helps with automation & workflows tasks.

Files

SKILL.mdMarkdownGitHub ↗

/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 featureQuick single-file edit
Resuming work after a breakAlready verified state this session
Before spawning parallel agentsWorking in an isolated worktree
Before creating a branch for a PRBranch 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/mainorigin/mastermainmaster), 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 --base <ref> to override the comparison ref, --no-fetch to skip the network round-trip.

Step 2: Act on existing work (judgment)

Read EXISTING_PRS (#N:STATE:headRef entries) and RECOMMENDATION:

  • `RECOMMENDATION=already-addressed` (a :MERGED: PR exists): report that

the issue is already addressed and stop — do not duplicate the work.

  • `RECOMMENDATION=existing-pr` (an :OPEN: PR exists): report the PR and

ask the user whether to continue on that branch or start fresh (AskUserQuestion). Do not pick for them.

  • Otherwise continue to the summary.

Step 3: Summary report

Translate the KEY=VALUE block into a summary the user can act on:

CheckSource keyDetail
Remote stateFETCHok / skipped / no-remote
Existing PRsEXISTING_PRSPR numbers + state, if any
Branch stateAHEAD / BEHIND / UNCOMMITTEDahead/behind counts, dirty tree
ConflictsCONFLICTS / CONFLICT_FILESconflicting files
StashSTASH_COUNTnumber of stash entries

Lead with the headline RECOMMENDATION, then surface every relevant note — the recommendation is a single first-match headline, but multiple conditions can be worth mentioning:

RECOMMENDATIONTell the user
resolve-conflictsResolve conflicts with the base ref before proceeding
commit-or-stashCommit or stash changes before branching
rebaseRebase on the base ref before starting work
existing-prA PR already addresses this — review before duplicating
already-addressedA merged PR already addresses this — stop
readyReady to proceed

Agentic Optimizations

ContextCommand
Full preflight (default)bash "${CLAUDE_SKILL_DIR}/scripts/preflight.sh" --project-dir "$(pwd)"
Preflight for an issuebash "${CLAUDE_SKILL_DIR}/scripts/preflight.sh" --issue N
Offline / no networkbash "${CLAUDE_SKILL_DIR}/scripts/preflight.sh" --no-fetch
Override base refbash "${CLAUDE_SKILL_DIR}/scripts/preflight.sh" --base origin/develop

The script wraps git fetch --prune, git rev-list --left-right --count, git merge-tree --write-tree, git stash list, and the gh existing-work lookups behind one structured-output call. See `scripts/preflight.sh`.

Quick Reference

FlagDescription
git fetch --pruneFetch and remove stale remote refs
git status --porcelain=v2Machine-parseable status
gh pr list --searchSearch PRs by content
gh issue view --jsonStructured issue data
git merge-treeDry-run merge conflict detection
git log A..BCommits in B but not A

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.