ClawedBack git-workflow
Structured git workflow for commits, branches, and PRs. Use when the user says "commit", "create a PR", "new branch", "prepare for review", "ship this", or "push my changes". Safe, conventional git operations with checkpoints.
install
source · Clone the upstream repo
git clone https://github.com/reedmayhew18/ClawedBack
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/reedmayhew18/ClawedBack "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/git-workflow" ~/.claude/skills/reedmayhew18-clawedback-git-workflow && rm -rf "$T"
manifest:
.claude/skills/git-workflow/SKILL.mdsource content
Git Workflow
Safe, structured git operations with user checkpoints before irreversible actions.
Goal
Ensure git operations are safe, conventional, and reviewable.
- Commit done: user-approved commit exists with conventional message and hash returned
- Branch done: correctly named branch created and checked out, confirmed to user
- PR done: branch pushed, PR created via
, PR URL returned to usergh
Dependencies
Tools: Bash (all git operations,
gh CLI for PRs)
CLI required: git (always available), gh (GitHub CLI — required for PR command only; warn user if not installed)
No MCP or external API required
Context
- Read
for project-specific branch naming conventions before creating a branchCLAUDE.md - Check
before drafting a PR body; use it as the template if present.github/pull_request_template.md - Check
or CI config if relevant for reviewer assignment.github/CODEOWNERS
Commands
Commit: /git-workflow commit [message]
/git-workflow commit [message]- Run
andgit status
to understand changesgit diff --staged - Check for sensitive files (.env, credentials, secrets) — WARN and exclude if found
- Determine which files to stage (never
orgit add -A
— stage specific files)git add . - If no message provided, draft one:
- Prefix: feat/fix/refactor/docs/test/chore
- Focus on WHY, not WHAT (the diff shows what)
- Under 72 chars for subject line
CHECKPOINT: Present staged file list and draft commit message. Do NOT commit until user approves.
- Create the commit
Branch: /git-workflow branch [name]
/git-workflow branch [name]- Run
— warn if uncommitted changes exist; ask user to commit or stash before proceedinggit status - Fetch latest from remote (
)git fetch - Derive branch name: use provided name or propose one from context using convention
,feat/description
,fix/descriptionrefactor/description
CHECKPOINT: Show proposed branch name and source branch (e.g.,
main). Do NOT create the branch until user approves.
- Create branch from main/master and switch to it
- Output: "Created and switched to
frombranch-name
."main
PR: /git-workflow pr
/git-workflow pr- Run
— warn if uncommitted changesgit status - Run
to understand all commits on this branchgit log main..HEAD - Run
for the complete diffgit diff main...HEAD - Draft PR with:
- Short title (under 70 chars)
- Summary section with 1-3 bullet points
- Test plan checklist
CHECKPOINT: Show PR title, summary, and test plan. Do NOT push or create PR until user confirms.
- Push branch with
flag if not pushed-u - Create PR via
gh pr create - Return the PR URL
Output
- Commit: confirmation message with hash
- Branch: confirmation with branch name
- PR: the PR URL
Safety Rules
- NEVER force push to main/master
- NEVER commit .env, credentials, API keys, tokens
- NEVER amend published commits without explicit request
- NEVER skip pre-commit hooks (--no-verify)
- Always stage specific files, not everything
- Always verify branch before pushing