git-branch-worktree-discipline

Enforce safe Git branch and worktree workflows with preflight checks and confirmation for destructive commands.

Updated Jul 17, 2026
One-click install
npx skills add https://github.com/kartikkabadi/skills --skill git-branch-worktree-discipline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-branch-worktree-discipline
Source: https://github.com/kartikkabadi/skills/tree/main/git-branch-worktree-discipline
Command: npx skills add https://github.com/kartikkabadi/skills --skill git-branch-worktree-discipline

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents accidental damage in shared Git repositories by enforcing cautious branch, merge, and worktree habits before any risky change is made.

Core Features & Use Cases

  • Preflight Safety Checks: Verifies repository state before edits so you can avoid overwriting or deleting work unintentionally.
  • Branch and Worktree Discipline: Guides safe workflows for creating isolated worktrees, managing concurrent agents, and preparing PR-ready changes.
  • Risky Command Guardrails: Blocks destructive operations like force-pushes, hard resets, and branch deletion unless explicitly approved.
  • Conflict and Handoff Readiness: Helps inspect diffs, validate status, and confirm only intended changes are present before integration.

Quick Start

Use this skill to safely inspect the repo and plan any branch, merge, or worktree change before you modify Git state.

Frequently Asked Questions about git-branch-worktree-discipline

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

FAQPage Schema
How do I prevent accidental data loss during Git merge and rebase operations?

To prevent Git merge safety issues, you need preflight checks that verify repository state before modifications and constrain destructive operations like hard resets. This requires explicit confirmation before executing high-risk commands to avoid overwriting work unintentionally.

What is the best way to manage parallel Git worktrees for concurrent agents?

Managing parallel Git worktrees requires branch discipline to create isolated working directories for concurrent agents. This workflow safely prepares PR-ready changes by validating status and inspecting diffs before integration into shared repositories.

Why does Git force push fail without explicit confirmation in shared repositories?

Git force pushes fail without confirmation due to risky command guardrails that block destructive operations in shared repositories. These safety constraints require explicit approval for branch deletion and force pushes to prevent accidental remote data loss.

How do I safely resolve Git branch conflicts before preparing a pull request?

To safely resolve Git branch conflicts before a pull request, inspect diffs and validate repository status to confirm only intended changes are present. This conflict resolution process ensures handoff readiness before merging into shared branches.

Can I use worktree isolation for branch creation without affecting the main repository state?

Yes, worktree isolation allows safe branch creation without affecting main repository state. Preflight safety checks verify the current Git state before modifications, ensuring concurrent agents can operate independently without overwriting shared work.