skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
laurigates/claude-plugins50 installs

workflow-preflight

Pre-work validation before starting implementation. Use when beginning work on an issue, feature, or fix to verify remote state, check for existing PRs, detect branch conflicts, and prevent redundant work. Catches problems that cause wasted effort: already-merged fixes, stale branches, unclean diffs.

How do I install this agent skill?

npx skills add https://github.com/laurigates/claude-plugins --skill workflow-preflight
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill is a development workflow utility designed to validate the state of a Git repository and check for existing GitHub issues or pull requests before starting work. It uses standard Git and GitHub CLI commands to provide context and prevent redundant efforts. No security issues were detected.

  • Socketpass

    No alerts

  • Snykwarn

    Risk: MEDIUM · 1 issue

  • Runlayerpass

    1/1 file flagged

What does this agent skill do?

/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 get-url origin
  • 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

Step 1: Fetch Latest Remote State

git fetch origin --prune 2>/dev/null

Step 2: Check for Existing Work

If an issue number was provided, check if it's already addressed:

# Check if issue exists and its state
gh issue view $ISSUE --json number,title,state,labels 2>/dev/null

# Check for PRs that reference this issue
gh pr list --search "fixes #$ISSUE OR closes #$ISSUE OR resolves #$ISSUE" --json number,title,state,headRefName 2>/dev/null

# Check for branches that reference this issue
git branch -a --list "*issue-$ISSUE*" --list "*fix/$ISSUE*" --list "*feat/$ISSUE*" 2>/dev/null

If a merged PR exists: Report that the issue is already addressed. Stop. If an open PR exists: Report the PR and ask if the user wants to continue on that branch or start fresh.

Step 3: Verify Branch State

# Check divergence from main/master
git log --oneline origin/main..HEAD 2>/dev/null || git log --oneline origin/master..HEAD 2>/dev/null

# Check if main has moved ahead
git log --oneline HEAD..origin/main -5 2>/dev/null || git log --oneline HEAD..origin/master -5 2>/dev/null

# Check for uncommitted changes
git status --porcelain=v2 --branch 2>/dev/null

Report:

  • Commits ahead/behind remote
  • Uncommitted changes that might interfere
  • Whether a rebase is needed

Step 4: Check for Conflicts

# Dry-run merge to detect conflicts (without actually merging)
git merge-tree $(git merge-base HEAD origin/main) HEAD origin/main 2>/dev/null | head -20

Step 5: Summary Report

Output a structured summary:

CheckStatusDetail
Remote statefresh/staleLast fetch time
Existing PRsnone/open/mergedPR numbers if any
Branch stateclean/dirty/divergedAhead/behind counts
Conflictsnone/detectedConflicting files
Stashempty/N itemsStash contents

Recommendations:

  • If behind remote: "Rebase recommended before starting work"
  • If existing PR found: "PR #N already addresses this - review before duplicating"
  • If dirty state: "Commit or stash changes before branching"
  • If conflicts detected: "Resolve conflicts with main before proceeding"
  • If clean: "Ready to proceed"

Agentic Optimizations

ContextCommand
Quick remote syncgit fetch origin --prune 2>/dev/null
Check existing PRsgh pr list --search "fixes #N" --json number,state,headRefName
Branch divergencegit log --oneline origin/main..HEAD
Conflict detectiongit merge-tree $(git merge-base HEAD origin/main) HEAD origin/main
Compact statusgit status --porcelain=v2 --branch
Remote trackinggit branch -vv --format='%(refname:short) %(upstream:track)'

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

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/laurigates/claude-plugins/workflow-preflight">View workflow-preflight on skillZs</a>