From constellation
Use when committing, opening a PR, creating or naming a branch, resolving a merge conflict, setting up a worktree, squashing, rebasing, or wrapping up a finished branch — i.e. any hands-on git operation where the output (commit message, PR body, branch name, conflict resolution) needs to be correct.
How this skill is triggered — by the user, by Claude, or both
Slash command
/constellation:git-workflowThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Active assistant for everyday git operations: produce well-formed conventional commits, complete PR descriptions, valid branch names, and guided conflict resolution. This is a flexible skill — adapt the steps to the repo's conventions; the guardrails below are non-negotiable.
Active assistant for everyday git operations: produce well-formed conventional commits, complete PR descriptions, valid branch names, and guided conflict resolution. This is a flexible skill — adapt the steps to the repo's conventions; the guardrails below are non-negotiable.
Announce at start: "Using git-workflow to [commit | open a PR | create a branch | resolve conflicts | finish this branch]."
These mirror the user's standing git-safety rules. They override convenience.
git branch --show-current. If on main/master/develop, STOP and ask before committing, merging, or pushing.main/master without explicit approval. No force-push to a protected branch, ever..env, credentials, tokens, keys before committing. If found, unstage and warn.git add path/...); avoid git add -A / git add . unless the user asked for it.gh with the token. The bare GITHUB_TOKEN env var is invalid here; run GitHub commands as GITHUB_TOKEN= gh ... so gh falls back to keyring auth.Co-Authored-By: Claude <[email protected]>.Detect the sub-workflow from the request or context; if ambiguous, ask.
| Mode | Trigger | Action |
|---|---|---|
| commit | Staged changes exist, user wants to commit | Generate a conventional commit message |
| pr | User wants to open a PR | Generate PR body, push, create via gh |
| branch | User wants a new branch | Enforce naming, create branch |
| conflict | UU markers in git status | Guide per-file resolution |
| worktree | User wants an isolated workspace | Follow references/using-git-worktrees/ |
| finish | Work done, branch ready to dispose | Follow references/finishing-a-development-branch/ |
Auto-detect: staged files + no conflicts → commit; conflict markers → conflict; clean branch + no argument → ask.
git diff --cached --stat — confirm what is staged. If nothing staged, show git diff --stat and ask which named files to stage (do not blanket-add).git diff --cached.references/conventional-commits.md): new behavior → feat; corrected wrong behavior → fix; restructure, behavior unchanged → refactor; tests only → test; docs only → docs; build/deps → chore; pipeline → ci; measured speedup → perf.<type>(<scope>): <description> — imperative, present tense, first line under 72 chars; explain why in the body, not what.Co-Authored-By trailer.scripts/commit-msg.sh suggests type, scope, and a description hint from the staged diff:
bash scripts/commit-msg.sh
Good/bad messages:
fix(api): return 404 instead of 500 for deleted usersfix: various fixes (no information) / feat: updated stuff (vague, past tense) / WIP (incomplete)main → master → develop).git log --oneline <base>..HEAD and git diff <base>...HEAD --stat..github/PULL_REQUEST_TEMPLATE.md (or pull_request_template.md) first — the repo template overrides assets/pr-template.md.git push -u origin <branch>; else git push. (Re-check the branch-check guardrail before pushing.)GITHUB_TOKEN= gh pr create --title "<title>" --body "<body>". If gh is missing, print the body + remote URL and suggest brew install gh.scripts/pr-body.sh [base-branch] generates a formatted body from commit history.
feature|fix|chore|docs|refactor|test|hotfix|release), optional ticket ID, and a 2–5 word description.<type>/<ticket>-<kebab-desc>, without <type>/<kebab-desc>.bash scripts/branch-check.sh "<name>" (PASS/FAIL + suggestion).git checkout -b <name>.Constraints (full set in references/branch-naming.md): lowercase; hyphens not underscores; only /, -, .; description ≤ 50 chars; total ≤ 100.
feature/PROJ-42-add-oauth-loginfeature/AddOAuthLogin (uppercase) / feature/add_oauth_login (underscores) / PROJ-42-oauth (no type prefix)git diff --name-only --diff-filter=U.git diff <file>, classify the pattern, resolve, then git add <file>.
package-lock.json, go.sum, poetry.lock, …): never hand-edit — delete and regenerate with the package manager.git diff --check.git rebase --continue or git merge --continue.Note: during git rebase, "ours" and "theirs" are swapped (HEAD is the upstream target, "theirs" is your replayed commits). Full patterns in references/merge-conflict-guide.md.
Bundled reference: follow references/using-git-worktrees/ (its SKILL.md). Do not hand-roll worktree creation here. That reference owns directory selection and the safety gates below.
Non-negotiable safety carried from that skill — apply even if you set up a worktree inline:
git check-ignore -q .worktrees || git check-ignore -q worktrees. If NOT ignored: add the line to .gitignore and commit it (auto-fix immediately), then proceed. Skipping this lets worktree contents get tracked and committed.package.json→install, go.mod→go mod download, Cargo.toml→cargo build, requirements.txt/pyproject.toml→install); never hardcode.Bundled reference: follow references/finishing-a-development-branch/ for branch disposition (run tests, then merge / PR / keep / discard, plus worktree cleanup). The "keep as-is" path pairs with constellation:session-handoff. Do not delete a branch or merge to a base without running the test suite first and getting explicit confirmation for destructive options.
references/using-git-worktrees/ — bundled reference for the worktree mode.references/finishing-a-development-branch/ — bundled reference for the finish mode.constellation:code-review / code-review — review a PR this skill opened (no direct coupling; pin reviewers to gh pr diff --name-only scope).constellation:verification-before-completion — run before claiming a commit/PR is done; verify by running, not by reasoning.references/conventional-commits.md — types, scopes, breaking-change format, anti-patterns.references/branch-naming.md — naming rules, ticket formats, pass/fail examples.references/merge-conflict-guide.md — conflict patterns and resolution strategies.scripts/commit-msg.sh — suggest type + scope + description from the staged diff.scripts/pr-body.sh [base] — generate a PR body from commit history and diff stat.scripts/branch-check.sh <name> — validate a branch name, return PASS/FAIL + suggestion.assets/pr-template.md — fallback PR body template (repo PULL_REQUEST_TEMPLATE.md wins when present).npx claudepluginhub trevoredris/constellation --plugin constellationSets up isolated workspaces using native worktree tools or git worktree fallback. Use before starting feature work to protect the current branch.