git-preflight

Validate git repository state before commit, push, pull, merge, rebase, and checkout operations.

5|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/barkleesanders/claude-code-starter --skill git-preflight
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-preflight
Source: https://github.com/barkleesanders/claude-code-starter/tree/main/skills/git-preflight
Command: npx skills add https://github.com/barkleesanders/claude-code-starter --skill git-preflight

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running git commands without first validating repository state leads to merge conflicts, lost uncommitted work, accidental pushes of broken code, and other costly errors that waste developer time. This skill provides mandatory pre-flight checks to catch these issues before they cause problems.

Core Features & Use Cases

  • Mandatory pre-flight validation: Requires checking repository status before all common git operations including commit, push, pull, merge, rebase, and checkout.
  • Command-specific checks: Includes tailored verification steps for each git command to catch operation-specific risks.
  • Safe command patterns: Provides standardized, safe command templates that chain status checks with git operations to reduce errors.
  • Built-in recovery guidance: Includes commands for common git error recovery such as reflog, merge --abort, and restore --staged.
  • Use case: For example, before pushing code to a shared main branch, the pre-flight check will flag uncommitted changes, outdated local branches, or pending merge conflicts so you can resolve them before pushing broken code that disrupts the team.

Quick Start

Use the git-preflight skill to run mandatory pre-flight checks before executing your next git command to prevent errors and avoid losing work.

Frequently Asked Questions about git-preflight

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent git errors before pushing or merging code?

Mandatory git pre-flight checks prevent errors by validating repository status, uncommitted changes, and pending merge conflicts before executing operations like push, merge, or rebase. This stops broken code from reaching shared branches and avoids costly data loss.

What are the best safe command patterns for git pull and rebase?

Safe git command patterns chain status checks with operations like pull and rebase to reduce errors. They provide mandatory pre-flight validation steps that catch operation-specific risks, ensuring commands complete successfully without losing uncommitted work.

How do I recover from a failed git merge or accidental commit?

Git error recovery commands such as reflog, merge --abort, and restore --staged resolve failed merges and accidental commits. These built-in commands undo problematic operations and restore your repository to a stable state without data loss.

Can pre-flight checks stop accidental pushes of broken code to a shared branch?

Pre-flight checks stop accidental pushes of broken code by flagging uncommitted changes, outdated local branches, and pending merge conflicts before you push. This validation ensures your shared main branch remains stable and disruption-free.

Does git error prevention apply to checkout and rebase workflows?

Git error prevention applies to checkout and rebase workflows through command-specific verification steps. Tailored pre-flight checks validate repository state before each operation, catching risks unique to checkout, rebase, commit, and pull commands.