# Git Shipping

> Guides the git workflow for shipping code changes — branch, commit, push, PR. Use whenever asked to `commit` (inspect diff, stage coherent chunks, then commit — not just format a message), `push`, `pr`/`ship`/`open a PR`/`merge this`, or manage branches, and whenever about to make code changes in a git repo (to confirm you're on the right branch before implementation starts) — even if the user only described the change and never said the word "git".

- Skill: `h3y6e/git-shipping` (Agent Skill)
- Install (CLI): `npx skillmds@latest add h3y6e/git-shipping`
- Raw SKILL.md: https://api.skillmd.com/api/skills/h3y6e/git-shipping/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- License: MIT
- Author: h3y6e (https://skillmd.com/u/h3y6e)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/h3y6e/git-shipping

---


# Git Shipping

Code changes flow through: branch → commit → push → PR.

## Intent Expansion

Treat short git requests as workflow shorthand.

| User says | What it means |
|-----------|---------------|
| `commit` | Inspect, stage coherent chunks, commit |
| `push` | Inspect, create commits if needed, push |
| `pr` | Inspect, move off default branch if needed, commit, push, open PR |

Ask only when the intended change scope is unclear enough that you might include unrelated work.

## Language Rule

Check visibility with `gh repo view --json visibility -q '.visibility'`.

- **PUBLIC**: Use English for commit messages, PR titles, and PR bodies.
- **PRIVATE / INTERNAL**: Use the language the user is currently using.

## Branch

Start new feature work in a clean worktree from the remote default branch, not in the default-branch checkout.
Before creating it, check `git wt -h`, then use `git wt <branch> origin/<default-branch> --nocd`.
Never call raw `git worktree`.

Do not move already-started work into a new worktree just to satisfy this workflow. If files are already being edited in the current checkout, keep working there and create or switch to the appropriate branch in place when safe.

## Commit

**REQUIRED SUB-SKILL:** Use `cxg` skill for commit message format.

## Pull Request

- PR titles use Conventional Commit subject format: `type(scope): subject`.
- Prefer a repository PR template when one applies.
- Without a template, use only: `## Summary`, `## Background`, `## Changes`, optional `## Impact`.
- Use `## Impact` only for merge behavior changes. Omit unchanged behavior, non-goals, and work not done.
- Do not add ad hoc `Testing`, `Verification`, `Checklist`, `Related issues`, or `Screenshots`. Never dump local verification commands into the PR body.
- Write the body to a `mktemp` file under `$TMPDIR`, never a fixed path — `gh pr create`/`gh pr edit` can reuse stale content, and plain `mktemp` can fail in a sandboxed shell.
- New PRs default to draft (`gh pr create --draft`); preserve existing PR draft/ready state unless asked.
- After pushing to a branch with an open PR, reread the title and body against the new diff and edit whatever no longer matches (`gh pr edit`).

## Common Mistakes

| Mistake | Fix |
|---------|-----|
| Starting new work on the default branch | Create a clean feature worktree |
| Moving already-started work just to satisfy this workflow | Keep the current checkout; branch in place when safe |
| Copying modified or untracked files into new worktrees by default | Create clean worktrees; transfer in-progress changes only on request |
| Treating `push` / `commit` as one git command | Follow Intent Expansion |
| Using a prose PR title | Use Conventional Commit subject format: `type(scope): subject` |
| Using raw `git worktree` | Use `git wt <branch> origin/<default-branch> --nocd`; check `git wt -h` first |
| Skipping `cxg lint` | Pipe through `cxg lint` before committing |
| Pushing follow-up commits and leaving the PR text stale | Update title and body to describe the PR as it now is |
| Reusing a fixed path for the PR body | `mktemp` a fresh file under `$TMPDIR` for every run |

