SeanTAllen

git-workflow

Use before inspecting a checkout for work, branching, committing, opening a PR, pushing, rebasing, merging, or cleaning up branches and clones.

SeanTAllen 0 Updated 1d ago

Resources

1
GitHub

Install

npx skillscat add seantallen/claude/git-workflow

Install via the SkillsCat registry.

SKILL.md

Git workflow

Use the Git rules in the active profile. If the profile directs you to the Pony workflow, read it before choosing a checkout.

Choose a checkout

Before branch or commit work, run git rev-parse --abbrev-ref HEAD. If the result is neither main nor your own branch, leave the checkout in place. This includes a detached HEAD. Get the GitHub URL with git remote get-url origin, clone from that URL under ~/tmp, and branch from main there. Stop if there is no remote. A clone from GitHub has the correct origin for a push or PR.

Keep follow-up commits on the branch for the work. This includes an investigation, a request to commit and push, and changes after PR review. If the work seems unrelated and needs a new branch, ask Sean.

Commit and open the PR

Commit each logical chunk as you go. When a change affects anything documented in the project instruction file, update that guidance in the same PR. Follow /writing-handoff for commit messages and PR descriptions.

If the project has linting, run it before every push, including review fixes and cleanup. Fix failures before pushing.

Before opening the PR, squash the branch into one commit. Stage all changes with git add -A, then run git reset --soft origin/main. Use git commit --no-gpg-sign and pass the squash commit message explicitly with a heredoc. Verify the committed changes with git diff origin/main..HEAD. For projects with linting, lint the committed files from git show HEAD:<file> so edits in the working tree cannot hide a failure. Push with git push --force-with-lease.

After opening the PR, push each follow-up as a separate commit unless Sean requests another squash.

Rebase, merge and clean up

To bring in main, run git rebase origin/main --no-gpg-sign, resolve conflicts, and push with --force-with-lease. Never merge main into a feature branch. Follow the profile's CI approval rule before merging. If the change includes public API choices, confirm that Sean has explicitly approved each one before you merge or otherwise release it. After the work has merged, check the temporary clone for uncommitted or unpushed changes. If it has neither, delete it.

Categories