GitPro
Git workflow automation using scripts for atomic, efficient operations.
Supports: Node.js (package.json) and Python (pyproject.toml)
Architecture
┌─────────────────────────────────────────┐
│ Claude Code PreToolUse hook (Skill) │
│ - Validates TS, TODOs before gitpro │
│ - Checkpoint operations skip validation │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ GitPro Skill (this file) │
│ - AI analyzes changes │
│ - AI determines parameters │
│ - AI calls script with parameters │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Bash Scripts (atomic execution) │
│ - Handle beads sync │
│ - Use --no-verify (validation done) │
│ - Single script = single operation │
└─────────────────────────────────────────┘
Quick Start
| User Says | Operation | Script |
|---|---|---|
| "checkpoint" | Quick timestamped commit | gitpro-checkpoint.sh |
| "commit" | Full conventional commit | gitpro-commit.sh |
| "merge to main" | Merge + version bump + cleanup | gitpro-merge.sh |
| "sync" / "pull" / "get updates" | Safe fast-forward from remote | gitpro-sync.sh |
| "merge from X" | Pull changes from branch | Manual (simple) |
| "rename branch" | Rename current branch | Via commit script |
| "new branch" | Create working branch | Manual (simple) |
Core Operations
Checkpoint
Fast timestamped commit without full analysis.
AI Steps:
- •Determine if user provided a custom message prefix
- •Call script
Script Call:
~/.claude/skills/gitpro/scripts/gitpro-checkpoint.sh [optional-message]
Examples:
- •User: "checkpoint" →
gitpro-checkpoint.sh - •User: "checkpoint with message Phase 1 complete" →
gitpro-checkpoint.sh "Phase 1 complete" - •AI completing work: →
gitpro-checkpoint.sh "Refactored auth module"
Commit
Full conventional commit with changelog and optional branch rename.
AI Steps:
- •Run
git statusto see all changed/untracked files - •Run
git diff --statto see actual changes per file (insertions/deletions) - •Categorize changes by feature/purpose:
- •Group related files (e.g., all files for "image processing" vs "AI descriptions")
- •Identify distinct features/fixes being committed
- •Note: Changes may span multiple sessions - analyze ALL diffs, not just session memory
- •Load reference files:
- •
~/.claude/skills/gitpro/references/commit-types.md- emoji/type mapping - •
~/.claude/skills/gitpro/references/changelog-rules.md- what goes in changelog
- •
- •Build commit message:
- •If single feature:
<emoji> <type>: <description> - •If multiple features: Multi-line with primary type, then bullet list
- •If single feature:
- •Build changelog entry:
- •List ALL user-facing features/fixes (see changelog-rules.md)
- •Exclude refactors, tests, docs, style changes
- •Determine branch rename if current is
wt-* - •Call script with parameters
Script Call:
~/.claude/skills/gitpro/scripts/gitpro-commit.sh \ --message "✨ feat: add user authentication" \ --old-branch "wt-petehalsted" \ --new-branch "add-user-auth" \ --changelog "- **✨ Add User Authentication** - JWT-based auth with refresh tokens"
Parameters:
| Parameter | Required | Description |
|---|---|---|
--message | Yes | Full commit message with emoji and type |
--old-branch | No | Current wt-* branch name (for rename) |
--new-branch | No | New descriptive branch name |
--changelog | No | Changelog entry text (if changelog.md exists) |
What Script Does:
- •Beads sync (pre-commit)
- •Stage all changes
- •Rename branch (if --old-branch/--new-branch provided)
- •Update changelog (if --changelog provided)
- •Commit with --no-verify
- •Beads sync (post-commit)
- •Push to remote (non-main branches)
CRITICAL: Analyze ALL Changes
- •Do NOT rely on what you remember working on in this session
- •Uncommitted changes may include work from previous sessions
- •Always use
git diff --statto see the actual scope of changes - •If you see changes you don't recognize, they still need to be in the commit message/changelog
Merge to Main
Full merge workflow with version bump and cleanup.
AI Steps:
- •Check for uncommitted changes - if any, do Commit workflow first
- •Get current branch name:
git branch --show-current - •Analyze commits to determine version bump type:
bash
git log --oneline main..HEAD
- •major: BREAKING CHANGE, ! after type
- •minor: feat:, ✨
- •patch: everything else
- •Get username via whoami command
- •Call script with parameters
Script Call:
~/.claude/skills/gitpro/scripts/gitpro-merge.sh \ --source-branch "add-user-auth" \ --bump-type "minor" \ --username "petehalsted"
Parameters:
| Parameter | Required | Description |
|---|---|---|
--source-branch | Yes | Branch being merged to main |
--bump-type | No | major, minor, or patch (skip if no manifest) |
--username | Yes | For creating wt-{username} branch |
What Script Does:
- •Push source branch
- •Checkout main, pull
- •Merge source branch
- •Bump version, commit, tag (if package.json or pyproject.toml exists)
- •Push main and tags
- •Delete merged source branch
- •Create fresh wt-{username} branch
Sync
Safe fast-forward from remote. Use when another machine pushed changes and local needs to catch up.
AI Steps:
- •Call script (optionally with --branch if not main)
Script Call:
~/.claude/skills/gitpro/scripts/gitpro-sync.sh [--branch name]
Parameters:
| Parameter | Required | Default | Description |
|---|---|---|---|
--branch | No | main | Branch to sync from remote |
What Script Does:
- •Checks for uncommitted changes → aborts if dirty
- •Warns about untracked files (informational only)
- •Switches to target branch if not current
- •Fetches from origin
- •Checks for unpushed local commits → aborts if diverged
- •Shows incoming commits
- •Fast-forwards with
--ff-only(refuses if not a clean fast-forward) - •Switches back to original branch if it changed
Safety Guarantees:
- •Will NOT overwrite uncommitted changes
- •Will NOT overwrite unpushed local commits
- •Will NOT create merge commits (ff-only)
- •Will NOT modify any branch other than the target
Trigger Words: "sync", "pull", "refresh", "get updates", "get updates from repo"
Merge from Branch
Pull changes from another branch into current.
AI Steps (no script needed):
- •
git fetch origin - •
git merge origin/{branch}orgit merge {branch} - •If conflicts: report and exit
- •If not main/master: ask user about deleting source branch
New Branch
Create new working branch.
AI Steps (no script needed):
- •Check for uncommitted changes - offer to commit/checkpoint
- •
git checkout -b {name}(default:wt-$(whoami)) - •
git push -u origin {name}
Commit Types Reference
| Emoji | Type | Use For |
|---|---|---|
| ✨ | feat | New feature |
| 🐛 | fix | Bug fix |
| 📚 | docs | Documentation |
| 🎨 | style | Formatting |
| ♻️ | refactor | Refactoring |
| ⚡ | perf | Performance |
| 🧪 | test | Testing |
| 🔧 | chore | Maintenance |
| 🔖 | chore | Version bump (auto) |
Validation
Validation happens in Claude Code PreToolUse hook BEFORE this skill runs:
- •TypeScript errors (Node) → blocks gitpro (except checkpoint)
- •Python lint/type errors (Python) → blocks gitpro (except checkpoint)
- •Invalid TODOs → blocks gitpro (except checkpoint)
- •Toast usage → warning only
Scripts use --no-verify because validation already passed.
Scripts Location
All scripts in: ~/.claude/skills/gitpro/scripts/
| Script | Purpose |
|---|---|
gitpro-checkpoint.sh | Quick timestamped commit |
gitpro-commit.sh | Full commit with changelog |
gitpro-merge.sh | Merge to main workflow (Node + Python) |
gitpro-sync.sh | Safe fast-forward from remote |
gitpro-bump-python.py | Python version bump helper |
create-token.sh | Token for git-guard bypass |
get_timestamp.sh | Local timezone timestamp |
Project Type Detection
Merge script auto-detects project type:
- •Node.js:
package.jsonexists → usesnpm version - •Python:
pyproject.tomlexists → usesgitpro-bump-python.py
Version format follows semver: vX.Y.Z