git-work

Diagnose and resolve git push failures, CI failures, and PR merge conflicts.

2|Updated Jul 18, 2026
One-click install
npx skills add https://github.com/Arasz/ai-badger --skill git-work-arasz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-work
Source: https://github.com/Arasz/ai-badger/tree/main/features/common/skills/git-work
Command: npx skills add https://github.com/Arasz/ai-badger --skill git-work-arasz

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Git operations outside the happy path — rejected pushes, red CI runs, stuck PRs, and merge conflicts — waste hours when handled by trial and error. This Skill provides deterministic recovery procedures for non-fast-forward rejections, CI failure triage, draft-to-squash PR lifecycles, and join-time conflict resolution, plus guards that prevent hand-editing git internals from silently corrupting repository state. ## Core Features & Use Cases - Push failure recovery: Resolve non-fast-forward rejections with fetch, divergence assessment, rebase, and force-with-lease pushes that refuse to overwrite unseen work. - CI failure triage: Read only failed logs, distinguish reproducible failures from infrastructure flakes, and attribute flakes from existing runs instead of re-running suites. - PR lifecycle management: Drive draft PRs through review polling, batched finding triage, thread resolution, and squash-merge with branch deletion. - Git config protection: A SessionStart hook detects lost remote.origin.fetch or branch tracking config, and a PreToolUse guard denies hand edits to .git internals. - Use Case: Your push is rejected after a teammate merged first, and CI later shows one workflow green while another stays queued forever. The Skill walks you through the rebase and force-with-lease push, then identifies the queued run as a CONFLICTING mergeable state requiring conflict resolution before CI will dispatch. ## Quick Start Ask the agent to diagnose why my git push was rejected and recover the branch without losing any remote work.

Frequently Asked Questions about git-work

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

FAQPage Schema
How do I fix a non-fast-forward git push rejection?

Fetch the remote branch first, then assess divergence with git log in both directions. Rebase small differences onto the new base and push with git push --force-with-lease, which refuses the push if someone else pushed between your fetch and push.

How do I triage a failing CI run on GitHub?

Read only the failed jobs with gh run view <id> --log-failed. Failures naming your diff get reproduced locally; infrastructure-shaped failures earn exactly one rerun of the single failing job before investigation, since repeated reruns are not triage.

Why does git fetch succeed but origin branches never update?

This happens when .git/config lost the remote.origin.fetch refspec, usually from a hand edit. Confirm with git config --get remote.origin.fetch, then restore it with git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' and fetch again.

Why is my PR stuck with one CI workflow queued forever?

A branch that conflicts with its base dispatches no merge-ref run, so the queue display looks identical to waiting. Check gh pr view <n> --json mergeable; a CONFLICTING result means you must resolve the conflict before CI will start.

Can I edit .git/config directly to fix tracking problems?

No. Hand edits are what typically truncate the file and drop the fetch refspec in the first place. Use git config, git remote, and git branch --set-upstream-to, which rewrite the file atomically through git's own lock mechanism.

When should I rebuild a branch instead of merging after a squash merge?

When the base was squash-merged, the merge-base predates the flattened commit, so merging replays the entire old branch. Check git diff origin/main..<branch> --stat; a small stat means rebuild from a fresh origin/main worktree instead.