← Browse

@mohitagw15856/git-troubleshooter

A

Diagnose a tangled git situation and give the exact, safe commands to fix it. Use when asked to undo a commit, recover lost work, fix a bad merge or rebase, resolve a detached HEAD, unstage files, or get out of a git mess. Produces the diagnosis, the precise commands to run in order, what each does, and a recovery note if something goes wrong.

skillclaude

Install

agr install @mohitagw15856/git-troubleshooter --target claude

Writes 1 file into .claude/skills/, pinned to git-1b95108d.

  • .claude/skills/git-troubleshooter/SKILL.md

Document


name: git-troubleshooter description: "Diagnose a tangled git situation and give the exact, safe commands to fix it. Use when asked to undo a commit, recover lost work, fix a bad merge or rebase, resolve a detached HEAD, unstage files, or get out of a git mess. Produces the diagnosis, the precise commands to run in order, what each does, and a recovery note if something goes wrong." homepage: https://mohitagw15856.github.io/pm-claude-skills/skill/git-troubleshooter.html metadata: { "openclaw": { "emoji": "⚙️" } }

Git Troubleshooter Skill

Get the user un-stuck from git — calmly, safely, and without destroying work.

Working from a brief

Infer the current state from what the user describes (and typical git output); label assumptions (assumed — confirm). Always give a concrete command sequence. If a step is destructive, say so loudly before it.

Input

What happened / what they want (e.g. "committed to main instead of a branch", "rebase went wrong", "deleted a branch with unpushed work"), plus any git status/error output. Infer the rest.

Output Structure

Diagnosis

One or two lines: what state the repo is in and why the user is stuck.

Fix — run these in order

A numbered list of exact commands, each with a one-line note of what it does:

1. git reflog                # find the lost commit's SHA
2. git checkout -b rescue <SHA>   # recover it onto a new branch

Prefer non-destructive routes (branch, reflog, --soft) over destructive ones. Flag any command that rewrites history or discards work with ⚠️ and what it will lose.

Safety net

How to undo if the fix doesn't do what they expected (usually git reflog + reset to the prior HEAD), plus a one-line habit to avoid the situation next time.

Quality Checks

  • The command sequence is exact and ordered (copy-pasteable)
  • Destructive commands are clearly marked with what they destroy
  • A non-destructive option is offered first where one exists
  • A recovery/undo path is included

Anti-Patterns

  • Do not suggest git push --force, reset --hard, or clean -fd without a ⚠️ and a safer alternative first
  • Do not give commands without saying what each one does
  • Do not assume the remote state — ask or label it if it changes the safe path
  • Do not skip git reflog when work might be recoverable — it usually is

Trustgrade A

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • passLicense

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-1b95108d7e672026-07-31