Install
openclaw skills install @fize/git-workflowGit workflow covering branch management, normalized commits, remote sync, with staged operation flows. Supports git commit, push, pull, branch, smart commit splitting and safe branch operations. Use for git operations such as commit, push, pull, and branch management, or when scenario-standards reaches implementation or DevOps. Triggers include /git-workflow, git 工作流, commit, 提交, push, 推送, pull, 拉取, branch, 分支, 暂存, staged, 拆分, split.
openclaw skills install @fize/git-workflow/git-workflow commit: Smart commit with auto-splitting/git-workflow push: Safe push with auto-sync/git-workflow pull: Safe pull with rebase/git-workflow branch <name>: Create and switch to branch (safe mode)/git-workflow status: Show current Git status with suggestionsAutomatically select appropriate Git operation flow based on development stage:
| Stage | Trigger Condition | Operation Flow |
|---|---|---|
| Initialize | New feature/fix starts | Sync remote → Create branch → Initial commit (if needed) |
| Develop | Has staged changes | Smart split → Generate commit → Verify |
| Complete | Feature development complete | Rebase/Squash commits → Push to remote |
| Maintain | Daily maintenance | Pull --rebase → Resolve conflicts → Continue development |
Auto-split logic (minimize user confirmation):
src/ + docs/) → force splitGIT_FLOW_AUTO_SPLIT=true/falseSplit Logic Example:
Detected 5 file changes:
Group 1 (feature A): src/auth/oauth2.py, tests/test_oauth2.py
Group 2 (feature B): src/utils/token.py, tests/test_token.py
Group 3 (docs): docs/auth.md
Auto-splitting into 3 commits...
[1/3] feat(auth): add OAuth2 login support
[2/3] feat(utils): add token utility functions
[3/3] docs(auth): update auth module documentation
Committing...
✅ All commits created successfully
If uncertain about splitting:
Detected 4 files changed:
Group 1: src/auth/oauth2.py, src/utils/token.py
Group 2: tests/test_oauth2.py, tests/test_token.py
Suggested split (uncertain about grouping):
1. feat(auth): add OAuth2 login and token utils
2. test(auth): add tests for OAuth2 and token utils
Confirm? [Yes/Adjust/Cancel]
Always sync remote first before creating/switching branches:
git fetch originGIT_FLOW_AUTO_STASH=true) or prompt userBranch Naming Convention:
feat/xxx, fix/xxx, refactor/xxx, docs/xxx, test/xxx, chore/xxxExample: Create Branch (Safe Mode):
User: /git-workflow branch feat/user-profile
AI: Syncing with remote...
✅ Remote sync complete
✅ Current branch: main (clean working tree)
Creating branch...
✅ Branch created: feat/user-profile
✅ Switched to new branch
If local has uncommitted changes:
User: /git-workflow branch feat/user-profile
AI: Syncing with remote...
✅ Remote sync complete
⚠️ Uncommitted changes detected:
M src/auth.py
?? new_file.py
Options:
1. Auto-stash changes, apply after switch
2. Cancel and commit changes first
Choose [1/2]:
<type>(<scope>): <subject>| Type | Description | Example |
|---|---|---|
feat | New feature | feat(auth): add OAuth2 login support |
fix | Bug fix | fix(login): fix null password bypass vulnerability |
refactor | Refactoring | refactor(auth): extract auth logic into separate module |
perf | Performance improvement | perf(query): optimize user query SQL index |
docs | Documentation | docs(api): update REST API documentation |
test | Testing | test(auth): add OAuth2 login test cases |
chore | Build/tool changes | chore(deps): upgrade flask to 3.0 |
ci | CI configuration | ci(gitlab): add multi-stage pipeline |
Before pull:
git pull --rebase (keep linear history)Before push:
Example: Push Code to Remote (Safe Mode):
User: /git-workflow push
AI: Checking status...
✅ Current branch: feat/oauth2-login
⚠️ Local is behind remote by 2 commits
Auto-pulling with rebase...
✅ Rebase complete, no conflicts
Pushing...
✅ Push successful: feat/oauth2-login → origin/feat/oauth2-login
GIT_FLOW_AUTO_CLEANUP=true)Example:
Conflict detected during rebase:
Conflict files:
- src/auth/oauth2.py
- tests/test_oauth2.py
Suggestions:
1. src/auth/oauth2.py:
- Incoming changes add OAuth2 support
- Current changes refactor auth logic
- Suggestion: Keep both, OAuth2 should call refactored auth logic
2. tests/test_oauth2.py:
- Incoming changes add OAuth2 tests
- Current changes update test fixtures
- Suggestion: Merge both test cases and update fixtures
Resolve conflicts manually, then run `/git-workflow continue` to continue rebase.
Environment variables (can be set in project's .env file or shell):
| Variable | Values | Default | Description |
|---|---|---|---|
GIT_FLOW_AUTO_SPLIT | true/false | true | Enable/disable auto-split |
GIT_FLOW_PULL_STRATEGY | rebase/merge | rebase | Pull strategy |
GIT_FLOW_AUTO_STASH | true/false | false | Auto-stash uncommitted changes |
GIT_FLOW_AUTO_CLEANUP | true/false | false | Auto-delete merged branches |
GIT_FLOW_CONFIRM_THRESHOLD | high/medium/low | medium | Confirmation threshold |
User: /git-workflow branch feat/user-profile
AI: Syncing with remote...
✅ Remote sync complete
✅ Current branch: main (clean working tree)
Creating branch...
✅ Branch created: feat/user-profile
✅ Switched to new branch
You can now start developing. Use `/git-workflow commit` to commit changes.
User: /git-workflow commit
AI: Analyzing staged changes...
Detected 3 files changed:
Group 1: src/auth/oauth2.py, tests/test_oauth2.py
Group 2: docs/auth.md
Auto-splitting into 2 commits...
[1/2] feat(auth): add OAuth2 login support
[2/2] docs(auth): update auth module documentation
Committing...
[1/2] Creating commit: feat(auth): add OAuth2 login support
✅ Commit created: abc123
[2/2] Creating commit: docs(auth): update auth module documentation
✅ Commit created: def456
✅ All commits created successfully
User: /git-workflow push
AI: Checking status...
✅ Current branch: feat/oauth2-login
⚠️ Local is behind remote by 2 commits
Auto-pulling with rebase...
✅ Rebase complete, no conflicts
Pushing...
✅ Push successful: feat/oauth2-login → origin/feat/oauth2-login
User: /git-workflow pull
AI: Fetching from remote...
✅ Remote sync complete
✅ Local is behind by 3 commits
Rebasing...
✅ Rebase complete, no conflicts
✅ Local branch updated successfully
If conflicts are too complex to resolve with suggestions alone:
git rebase --abortgit merge --abortgit mergetool for visual conflict resolutionIf git operations result in a detached HEAD:
git log --oneline -5 to see where you are.git branch <name> to save it, then git checkout <branch>git stash, then git checkout <branch>, then git stash popgit log --oneline -3 # identify the commit to move
git checkout <correct-branch>
git cherry-pick <commit-hash>
git checkout <wrong-branch>
git reset --hard HEAD~1 # remove from wrong branch
git log --oneline -3 on both branches.