Load when planning or about to git commit, branch, push, rebase, resolve a merge conflict, open PR, stack PRs (even when gh-stack drives the stack), or write/update the description of a Pull Request (PR), attach a screenshot or video to a PR, respond to review comments, review a PR, watch/babysit a PR's CI or reviews. Carries the user's git conventions and style you are expected to match. Load as early as possible, the moment git or GitHub work is anywhere in the chat's future.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Git?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sherifabdlnaby-git)
---
name: git
description: >
Load when planning or about to git commit, branch, push, rebase, resolve a merge conflict, open PR, stack PRs (even when gh-stack drives the stack),
or write/update the description of a Pull Request (PR),
attach a screenshot or video to a PR, respond to review comments, review a PR, watch/babysit a PR's CI or reviews.
Carries the user's git conventions and style you are expected to match. Load as early as possible, the moment git or GitHub work is anywhere in the chat's future.
license: MIT
argument-hint: "[commit|branch|pr|attach|rebase|review|watch]"
metadata:
author: sherifabdlnaby
version: "0.6.3"
---
# Git
Route first: each action's actual rules live in a `references/` file. Open the matching one before planning or acting; rules like commit grouping and branch naming shape the plan, so reading them late
means redoing it. Several actions, several references.
Commands and synopses in this skill are the usual call, cached for speed, not the tool's surface.
For anything they do not cover, read `--help` or the current docs, then act.
**Versions.** Checked against gh 2.103.3 and gh-stack 0.3.0 on 2026-10-31.
## Router
**Branches** (create, name, stack) -> [`references/branches.md`](references/branches.md) Switching branches, naming rules, ticket references, switching with a dirty tree, stacked PRs (conventions
here, mechanics via the gh-stack skill), the gh-stack/manual path probe, cascade conflicts and verification, manual restacking fallback (after merge, chain of 3+, mid-stack push), force-pushing.
**Committing** -> [`references/commits.md`](references/commits.md)
Pre-staging walk, file confirmation, message style, hook-failure handling, scoping, editor-free squash, empty commits.
**Pull Requests** (open, update) -> [`references/pull-requests.md`](references/pull-requests.md) Pre-flight survey (coding's `H1` clean first), title format (including the stacked `[n/N]` marker),
`gh pr create` flags, the post-create link, finishing PRs after `gh stack submit`, updating a body without clobbering it.
**PR body** (write or rewrite a description) -> [`references/pr-body.md`](references/pr-body.md) The cold reader and the one-screen limit, the skeleton, what stays open and what folds, human and
agent decisions, visuals on the landing, markers and the structure hook, repo templates, linking.
**Attach a screenshot or video** -> [`references/attach.md`](references/attach.md)
`--attach` on create/edit/comment, body-file placement, screenshot framing guidance.
**Responding to review comments** (on the PR you are working on) -> [`references/review-responses.md`](references/review-responses.md) The mechanics of a round: commits, in-thread replies,
thread resolution, re-requesting review, batching a round into one GraphQL query and one aliased mutation, where a PR stands. What each reply says is the **review** skill's call; load it too.
**Rebasing, merging, pulling, resolving conflicts** -> [`references/rebase.md`](references/rebase.md)
Rebase vs merge, how to pull, who resolves which hunk, conflict guidance, force-with-lease, verification.
Stacked-PR restack live in [`references/branches.md`](references/branches.md); read it too when the branch is in a stack.
**Reviewing a PR, or your own work** -> the **review** skill. It loads this one for posting.
**Watch a PR's CI and reviews** -> [`references/watch.md`](references/watch.md) The verdicts, the modes (green CI / green and quiet / reviews only), the cheap
sub-agent that runs the loop, the stale nudge. Uses the harness's PR-watch tool when it has one, else `scripts/pr-watch.py`, never a sleep loop; its flags are in `references/watch-flags.md`.
**Stuck CI check with no manual retry** -> [`references/commits.md`, Empty commits](references/commits.md#empty-commits)
The last-resort empty commit: when it beats retrying the check, and the zero-file-change guards that keep approvals alive.
## Always
**Disclose AI.** Anything posted on GitHub on the user's behalf (PR body, comment, issue, ticket update) carries an **AI disclosure**, per [AI Disclosure](#ai-disclosure) below. Commit messages carry
no disclosure line; a co-author trailer the harness adds stays.
**Reach for `gh` first.** Every GitHub action goes through the `gh` CLI; the GitHub MCP server is
the fallback for what `gh` cannot do.
**Mutating commands stay sequential** (`commit`, `push`, `rebase`, `gh pr create/edit/merge`). Independent read-only `git`/`gh` calls batch into one tool call.
**Fewer round-trips, smaller payloads.** Your call when a one-off is cheaper:
- **One wide fetch, many narrow reads.** Anything you'll consult more than once in a task (PR JSON, `gh stack view --json`, a review-thread query) goes to a temp file once, and each step reads its
slice with `jq`. Re-fetch after anything you did that changes it (push, edit, reply, resolve); or if time passed and you've been idle, a snapshot is not a live view.
- **Ask for an answer, not a payload.** A count or a single field leaves as `--jq '.x'`; a yes/no leaves as an exit code (`git diff --quiet`, `git merge-base --is-ancestor`). JSON you read with your
own eyes is a payload.
- **Same-shape mutations ride one request.** GraphQL aliases: every reply, resolve, or title edit of a round in one `gh api graphql`. Aliases fail independently, so read the per-alias `errors[].path`,
not the exit code.
- **Bodies travel by file.** PR body or GraphQL query to a file, then `--body-file` / `-F query=@file`. (why: shell quoting eats backticks and `$`, and a file stays editable for the next update.)
Hooks that ship beside this skill check PR bodies deterministically, and they refuse a body they cannot read: pass it as a file or an inline `--body`.
**Resolve once per session, reuse everywhere.** One line for both:
```bash
gh repo view --json nameWithOwner,defaultBranchRef --jq '"repo \(.nameWithOwner)\ntrunk \(.defaultBranchRef.name)"'
```
Carry `<OWNER/REPO>` and `<trunk>` through the session from that.
**Voice** for everything public (commit messages, PR titles and bodies, comments, issues):
- Short sentences, no padding. Light formatting.
- Point first, in plain words: Simplified Technical English, no jargon, no names you made up. Use the project's own terms.
- Emojis mark the one or two pieces the reader must not miss when they glance, or celebrate. If most lines would get one, use none: an emoji on every line draws the eye to nothing.
- NO em dashes in any public-facing text. Use commas, colons, parentheses, or periods. (why: em dashes are a classic AI tell and repel readers.)
- No vague reaffirmations like "for accountability", "for performance", "for resiliency" unless that reason is already in the conversation. (why: invented justification misrepresents the change.)
- Dry, low-key humor.
- A user-supplied Human Note is exempt: it goes in the PR body verbatim.
## AI disclosure
Load the **ai-disclosure** skill before the first post: it owns the disclosure line, its tier, and
where it goes in each kind of post. Without that skill, put this line first in a PR body, issue, or top-level comment, and under the last line of a review comment or thread reply:
```markdown
_<sub>🤖 Agent Decided: <TOOL> · <MODEL> (<EFFORT>)</sub>_
```
`<TOOL>` is the harness you run in (e.g. Claude Code, Cursor); `<MODEL>` is your model's friendly
name (e.g. `Opus 5.5`); `<EFFORT>` is the reasoning effort when the harness exposes it (Claude Code:
`$CLAUDE_EFFORT`), else drop ` (<EFFORT>)`.
## Unattended
No one can answer this turn (a cron, a trigger, an afk run, a background watch), or the user handed over the whole task. Where a rule says ask, confirm or surface, take the reversible option
and continue. The open call goes in the final report.
## Compatibility
Assume everything below is present; do not probe for it. Stop early only on a host listed as unsupported.
Needs: `gh` (authenticated), network, `python3` 3.10 or later for `scripts/pr-watch.py`.
Hosts: Claude Code yes. Cursor yes (a background shell that a sub-agent starts ends with its turn, see `references/watch.md`).
A sandbox without network no (`gh` cannot reach GitHub). Autonomous runs yes, per [Unattended](#unattended).