Agent Skillsmohitagw15856/pm-claude-skills › git-troubleshooter

git-troubleshooter

GitHub

诊断复杂的 Git 状态并提供精确、安全的修复命令。适用于撤销提交、恢复丢失工作、修复合并或变基错误、处理分离 HEAD 等场景。输出包含诊断、分步命令及回退方案,优先非破坏性操作并标记风险。

skills/git-troubleshooter/SKILL.md mohitagw15856/pm-claude-skills

Trigger Scenarios

用户询问如何撤销提交 用户需要恢复丢失的工作 合并或变基出现错误 遇到分离 HEAD 状态 需要从 Git 混乱中恢复

Install

npx skills add mohitagw15856/pm-claude-skills --skill git-troubleshooter -g -y
More Options

Use without installing

npx skills use mohitagw15856/pm-claude-skills@git-troubleshooter

指定 Agent (Claude Code)

npx skills add mohitagw15856/pm-claude-skills --skill git-troubleshooter -a claude-code -g -y

安装 repo 全部 skill

npx skills add mohitagw15856/pm-claude-skills --all -g -y

预览 repo 内 skill

npx skills add mohitagw15856/pm-claude-skills --list

SKILL.md

Frontmatter
{
    "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."
}

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

Version History

  • a38bc30 Current 2026-07-05 11:36

Same Skill Collection

exports/openclaw/360-feedback-template/SKILL.md
exports/openclaw/401k-plan-decoder/SKILL.md
exports/openclaw/ab-test-planner/SKILL.md
exports/openclaw/ab-test-readout/SKILL.md
exports/openclaw/accessibility-audit/SKILL.md
exports/openclaw/account-plan/SKILL.md
exports/openclaw/acquirer-red-team/SKILL.md
exports/openclaw/ad-copy/SKILL.md
exports/openclaw/aeo-optimizer/SKILL.md
exports/openclaw/agenda-or-cancel/SKILL.md
exports/openclaw/agent-design-review/SKILL.md
exports/openclaw/agent-hiring-panel/SKILL.md
exports/openclaw/agent-observability-spec/SKILL.md
exports/openclaw/agent-severance/SKILL.md
exports/openclaw/agent-spec/SKILL.md
exports/openclaw/agm-in-a-box/SKILL.md
exports/openclaw/ai-ethics-review/SKILL.md
exports/openclaw/ai-eval-plan/SKILL.md
exports/openclaw/ai-feature-prd/SKILL.md
exports/openclaw/ai-product-canvas/SKILL.md
exports/openclaw/air-quality/SKILL.md
exports/openclaw/altitude-shifter/SKILL.md
exports/openclaw/ambiguity-resolver/SKILL.md
exports/openclaw/analyst-relations-brief/SKILL.md
exports/openclaw/announcement-card/SKILL.md
exports/openclaw/api-docs-writer/SKILL.md
exports/openclaw/api-test-plan/SKILL.md
exports/openclaw/api-versioning-strategy/SKILL.md
exports/openclaw/apology-letter/SKILL.md
exports/openclaw/architecture-decision-record/SKILL.md
exports/openclaw/architecture-diagram/SKILL.md
exports/openclaw/archive-strategy/SKILL.md
exports/openclaw/assumption-bounty/SKILL.md
exports/openclaw/assumption-mapper/SKILL.md
exports/openclaw/async-update-format/SKILL.md
exports/openclaw/auto-repair-estimate-decoder/SKILL.md
exports/openclaw/autopilot-charter/SKILL.md
exports/openclaw/behavior-intervention-plan/SKILL.md
exports/openclaw/benefits-decoder/SKILL.md
exports/openclaw/bennett-time-audit/SKILL.md
exports/openclaw/bid-tender-review/SKILL.md
exports/openclaw/board-deck-narrative/SKILL.md
exports/openclaw/board-game-designer/SKILL.md
exports/openclaw/board-minutes/SKILL.md
exports/openclaw/board-pre-read/SKILL.md
exports/openclaw/bom-cost-review/SKILL.md
exports/openclaw/bookkeeping-categorization/SKILL.md
exports/openclaw/boolean-search-builder/SKILL.md
exports/openclaw/brag-doc/SKILL.md
exports/openclaw/brainstorming/SKILL.md

Metadata

Files
0
Version
e4def4c
Hash
e1c1e93d
Indexed
2026-07-05 11:36

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-31 07:49
浙ICP备14020137号-1 $방문자$