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 |
1---2name: git-shipping3description: 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".4license: MIT5---67# Git Shipping89Code changes flow through: branch → commit → push → PR.1011## Intent Expansion1213Treat short git requests as workflow shorthand.1415| User says | What it means |16|-----------|---------------|17| `commit` | Inspect, stage coherent chunks, commit |18| `push` | Inspect, create commits if needed, push |19| `pr` | Inspect, move off default branch if needed, commit, push, open PR |2021Ask only when the intended change scope is unclear enough that you might include unrelated work.2223## Language Rule2425Check visibility with `gh repo view --json visibility -q '.visibility'`.2627- **PUBLIC**: Use English for commit messages, PR titles, and PR bodies.28- **PRIVATE / INTERNAL**: Use the language the user is currently using.2930## Branch3132Start new feature work in a clean worktree from the remote default branch, not in the default-branch checkout.33Before creating it, check `git wt -h`, then use `git wt <branch> origin/<default-branch> --nocd`.34Never call raw `git worktree`.3536Do 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.3738## Commit3940**REQUIRED SUB-SKILL:** Use `cxg` skill for commit message format.4142## Pull Request4344- PR titles use Conventional Commit subject format: `type(scope): subject`.45- Prefer a repository PR template when one applies.46- Without a template, use only: `## Summary`, `## Background`, `## Changes`, optional `## Impact`.47- Use `## Impact` only for merge behavior changes. Omit unchanged behavior, non-goals, and work not done.48- Do not add ad hoc `Testing`, `Verification`, `Checklist`, `Related issues`, or `Screenshots`. Never dump local verification commands into the PR body.49- 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.50- New PRs default to draft (`gh pr create --draft`); preserve existing PR draft/ready state unless asked.51- 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`).5253## Common Mistakes5455| Mistake | Fix |56|---------|-----|57| Starting new work on the default branch | Create a clean feature worktree |58| Moving already-started work just to satisfy this workflow | Keep the current checkout; branch in place when safe |59| Copying modified or untracked files into new worktrees by default | Create clean worktrees; transfer in-progress changes only on request |60| Treating `push` / `commit` as one git command | Follow Intent Expansion |61| Using a prose PR title | Use Conventional Commit subject format: `type(scope): subject` |62| Using raw `git worktree` | Use `git wt <branch> origin/<default-branch> --nocd`; check `git wt -h` first |63| Skipping `cxg lint` | Pipe through `cxg lint` before committing |64| Pushing follow-up commits and leaving the PR text stale | Update title and body to describe the PR as it now is |65| Reusing a fixed path for the PR body | `mktemp` a fresh file under `$TMPDIR` for every run |