git-workflow-freshness

Checks all open pull requests for merge conflicts, lag behind main, and unpushed commits.

1|Updated Jan 14, 2024
One-click install
npx skills add https://github.com/Eyhenij/rt-tools --skill git-workflow-freshness-eyhenij
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-workflow-freshness
Source: https://github.com/Eyhenij/rt-tools/tree/main/.claude/skills/git-workflow-freshness
Command: npx skills add https://github.com/Eyhenij/rt-tools --skill git-workflow-freshness-eyhenij

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Open pull requests silently fall behind main, accumulate merge conflicts, or sit unpushed while you work on other tasks. This Skill enforces a mandatory freshness audit of every open PR before a push, when starting a new task, and after any known merge, so stale branches are caught before they block delivery. ## Core Features & Use Cases - Bulk PR state reading: Queries all your open PRs at once via the GitHub CLI, interpreting mergeable, mergeStateStatus, isDraft, and statusCheckRollup fields to classify each branch. - Conflict vs. lag detection: Uses git merge-tree offline to distinguish a branch that merely lags behind main from one with real file-level disputes, routing each to the correct fix. - Local-vs-remote verification: Compares the local HEAD against the PR's headRefOid on the host to catch work that was merged locally but never pushed. - Use Case: After a teammate merges a neighboring PR, run the freshness check to discover which of your open PRs now lag behind main, merge main into each, rerun checks, and push in the same turn. ## Quick Start Check the freshness of all my open pull requests and fix any that lag behind main or have conflicts.

Frequently Asked Questions about git-workflow-freshness

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

FAQPage Schema
How do I check if my pull request has merge conflicts with GitHub CLI?

Run gh pr list with the --json flag requesting mergeable and mergeStateStatus fields. A mergeable value of CONFLICTING or a mergeStateStatus of DIRTY indicates file-level disputes, while BEHIND means the branch merely lags main.

How to tell branch lag apart from a real merge conflict in git?

Use git merge-tree with the merge base of origin/main and your branch, then count conflict markers in the output. Zero markers means the branch only lags and merging main in fixes it; above zero means a real file dispute requiring resolution.

What does mergeable UNKNOWN mean on a GitHub pull request?

UNKNOWN means GitHub has not finished computing the merge state yet, not that there are no conflicts. Wait a few seconds and query the PR state again rather than treating it as mergeable.

Why does my pull request show outdated state after merging main locally?

Merging main into your branch in the working tree does not update the remote until you push. Compare git rev-parse HEAD against the PR's headRefOid from gh pr view; if they diverge, the push is missing and must be done first.

When should I check the freshness of open pull requests?

Check at three mandatory points: before every push, when taking a new task, and after every merge you learn about. Any merge to main makes all other open PRs lag simultaneously, so a single bulk check covers all of them.