async-post-commit-hook-commit-orphaned-by-squash-merge

Rescues orphaned async post-commit hook commits lost after squash-merging a branch.

3|Updated May 8, 2026
One-click install
npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill async-post-commit-hook-commit-orphaned-by-squash-merge-wan-huiyan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: async-post-commit-hook-commit-orphaned-by-squash-merge
Source: https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/async-post-commit-hook-commit-orphaned-by-squash-merge
Command: npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill async-post-commit-hook-commit-orphaned-by-squash-merge-wan-huiyan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a repo has an async post-commit hook that creates its own follow-up commit (auto-docs, site regen, changelog updates), that commit often lands locally after your push completes, so it never reaches the PR and is silently lost when the squash-merged branch is deleted. ## Core Features & Use Cases - Orphan Detection: Identifies the tell-tale sign of a local branch showing [ahead 1] of its origin ref after a supposedly complete squash-merge. - Content Judgment: Guides inspection of the orphaned commit with git show to decide whether it carries real content worth keeping or is disposable noise. - Rescue Workflow: Cherry-picks the orphaned commit onto a fresh branch off origin/main and folds it into the next PR, such as a session-handoff PR. - Use Case: You squash-merged a fix PR, then notice your branch is ahead of origin with an [auto-docs] commit correcting a design doc. Use this Skill to cherry-pick that commit into your handoff PR before deleting the branch. ## Quick Start Ask the AI to check whether my just-merged branch is ahead of origin and rescue any orphaned post-commit hook commits before I delete the branch.

Frequently Asked Questions about async-post-commit-hook-commit-orphaned-by-squash-merge

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

FAQPage Schema
Why is my branch ahead of origin after a squash merge?▼

A branch showing `[ahead 1]` after a squash merge usually means a local commit never reached the remote. With an async post-commit hook, the hook's commit lands after your push completes, so it exists only locally and was never part of the PR.

How do I recover a commit lost to a squash merge?▼

Inspect the orphaned commit with `git show <sha>` to confirm it has valuable content, then create a fresh branch off origin/main and run `git cherry-pick <sha>`. Fold the cherry-picked commit into your next PR so the content lands on main.

What is an async post-commit hook in Git?▼

An async post-commit hook runs in the background after each commit and creates its own follow-up commit, such as auto-generated docs or a site regen. Because it runs asynchronously, `git push` does not wait for it, so the hook's commit often misses the push.

Should I delete a merged branch that is ahead of origin?▼

No. Inspect the ahead commits first with `git log --oneline` and `git show` before deleting. If a commit carries real content like a corrected design doc, cherry-pick it onto a fresh branch off origin/main before removing the merged branch.

When should I discard an orphaned hook commit instead of rescuing it?▼

Discard the orphan when it is noise, such as a no-op regeneration or content that is already correct on main. Rescue it only when it carries real, load-bearing content like a design doc corrected to match your merged change.