ls-unfuck-my-git-state

Diagnose broken Git state and generate guided repair plans.

3|2|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/CruxExperts/localsetup --skill ls-unfuck-my-git-state
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ls-unfuck-my-git-state
Source: https://github.com/CruxExperts/localsetup/tree/main/_localsetup/skills/ls-unfuck-my-git-state
Command: npx skills add https://github.com/CruxExperts/localsetup --skill ls-unfuck-my-git-state

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Diagnose and recover broken Git state and worktree metadata with a staged, low-risk recovery flow. Use when Git reports detached HEAD state, orphaned worktrees, phantom branch locks, missing refs, or zero-hash worktree entries.

Core Features & Use Cases

  • Non-destructive diagnostics: Snapshot repository state and detect exact failure modes without altering refs.
  • Guided repair plans: Generate plan content by symptom or snapshot to apply the smallest safe fix.
  • Verification gates: Use preflight and recovery checklist to ensure the repository remains healthy after remediation.
  • Regression harness support: Validate repair logic against synthetic scenarios before applying in production.

Quick Start

Run the diagnostic snapshot on your repo, then invoke the guided repair planner by symptom or repository.

Frequently Asked Questions about ls-unfuck-my-git-state

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

FAQPage Schema
How do I fix a detached HEAD state in Git without losing commits?

To fix a detached HEAD state safely, you need a non-destructive diagnostic workflow that snapshots repository metadata and generates a guided repair plan. This applies the smallest safe fix to recover refs without altering your commit history.

What is the best way to recover orphaned Git worktrees and missing refs?

Recovering orphaned Git worktrees and missing refs requires diagnosing worktree metadata from a repository snapshot. A staged recovery flow detects exact failure modes like phantom branch locks and enforces verification gates before modifying refs.

Why does Git show phantom branch locks and how can I resolve them?

Git shows phantom branch locks due to corrupted worktree metadata or zero-hash worktree entries. You can resolve them by running non-destructive diagnostics to snapshot the state, then applying a guided repair plan with preflight verification gates.

Can I validate Git state recovery logic before applying it to a live repository?

Yes, you can validate Git state recovery logic using a regression harness support feature. This tests repair plans against synthetic scenarios to ensure the remediation workflow is safe before applying any modifications to your live repository refs.

How do I safely remove zero-hash worktree entries from my Git repository?

To safely remove zero-hash worktree entries, use a non-destructive diagnostic snapshot to detect the exact failure mode. Then follow an escalation path that enforces verification gates before modifying the corrupted worktree metadata.

Does Git state recovery work on live repositories or only on snapshots?

Git state recovery works on both live repositories and repository snapshots. The workflow diagnoses broken state and worktree metadata from either source, enforcing non-destructive plans and verification gates before modifying any refs.