Automate Git workflows with ease using GitFlow plugin for Claude.
- GitHub stars
- 11
Install
/plugin install git-flow@oh-my-claude-code-pluginsRun it inside Claude Code after adding the marketplace with /plugin marketplace add huangdijia/oh-my-claude-code-plugins.
Contents
Discovered from sourceCommands 6
Context
- Current git status: !
git status - Current git diff (staged and unstaged changes): !
git diff HEAD - Current branch: !
git branch --show-current - Recent commits: !
git log --oneline -10
Your task
Based on the above changes, create a single git commit.
Context
- Current branch: !
git branch --show-current - Recent commits: !
git log --oneline -10 - Current git status: !
git status - Current git diff (staged and unstaged changes): !
git diff HEAD - Existing Merge Requests: !
glab mr list
Your task
You are a senior engineer. Please create a branch, generate commits, and create a Merge Request (MR) using glab based on code changes.
Required description document structure:
Title
Concisely describe the core content of this MR (e.g., "Fix parameter validation error in user registration API")
Background
Explain why this change is needed, which may include:
- Issues / bugs encountered
- New requirements / business scenarios
- Existing limitations in the current code
Changes
List the main modifications in this MR using bullet points:
- βοΈ Which modules or files were modified
- π§ New logic or optimization points introduced
- β Content deleted or refactored
Test Plan
Describe what tests you performed to verify the correctness of the changes:
- β Unit tests (covering which functionalities)
- π Manual verification (which pages or interfaces)
- π§ͺ Whether CI/CD pipeline passes
Risk & Impact
List potential risk points and whether additional attention is needed:
- Which users or functionalities will be affected
- Whether database migration / cache clearing / configuration changes are needed
- Rollback strategy (if applicable)
Additional Notes (Optional)
- Whether this MR depends on other PRs / MRs
- Whether documentation changes are included
Context
- Current MR status: !
glab mr view $ARGUMENTS --output json | jq -r '.state' - Current MR diff: !
glab mr diff $ARGUMENTS - Current branch: !
git branch --show-current - Recent commits: !
git log --oneline -10
Your task
You are an experienced code review expert. Please use glab to help me review the code changes submitted in the following Merge Request (MR) #$ARGUMENTS, and output the following structure:
- Change Summary: Briefly describe the main changes in this MR.
- Potential Risks: Point out possible issues that may be introduced, such as performance, maintainability, security, etc.
- Optimization Suggestions: Provide reasonable improvement directions, skip if none.
- Compliance Check: Whether it conforms to the current project's code style, naming conventions, module boundary division, etc.
Please output using chinese in structured Markdown format and use bullet lists as much as possible, then ask me if you need pushing the review comments.
Optional Parameter Description
$LANGUAGE: Code language (e.g., Python, PHP, TypeScript)$SCOPE: Review scope (e.g., focus only on performance, security, default is all)
Please adjust the focus based on parameters:
- When
$SCOPE=performance, please pay special attention to loops, I/O, database calls, etc. - When
$SCOPE=security, please pay special attention to input validation, permission boundaries, SQL injection, etc.
Context
- Current branch: !
git branch --show-current - Recent commits: !
git log --oneline -10 - Current git status: !
git status - Current git diff (staged and unstaged changes): !
git diff HEAD - Existing Pull Requests: !
gh pr list
Your task
Create a Pull Request based on the code changes.
- Create a new branch based on the code changes
- Generate commit information
- Push the code to the remote repository
- Create a Pull Request. If an upstream branch exists, create the Pull Request based on the upstream branch; otherwise, create it based on the origin branch
Context
- Current PR status: !
gh pr view $ARGUMENTS --json state -q '.state' - Current PR diff: !
gh pr diff $ARGUMENTS - Current PR files changed: !
gh pr view $ARGUMENTS --json files -q '.files[].path' - Current branch: !
git branch --show-current - Recent commits: !
git log --oneline -10
Your task
You are an experienced code review expert. Please use gh to help me review the code changes submitted in the following Pull Request (PR) #$ARGUMENTS, and output the following structure:
- Change Summary: Briefly describe the main changes in this PR.
- Potential Risks: Point out possible issues that may be introduced, such as performance, maintainability, security, etc.
- Optimization Suggestions: Provide reasonable improvement directions, skip if none.
- Compliance Check: Whether it conforms to the current project's code style, naming conventions, module boundary division, etc.
Please output using chinese in structured Markdown format and use bullet lists as much as possible, then ask me if you need pushing the review comments.
Optional Parameter Description
$LANGUAGE: Code language (e.g., Python, PHP, TypeScript)$SCOPE: Review scope (e.g., focus only on performance, security, default is all)
Please adjust the focus based on parameters:
- When
$SCOPE=performance, please pay special attention to loops, I/O, database calls, etc. - When
$SCOPE=security, please pay special attention to input validation, permission boundaries, SQL injection, etc. - When
$SCOPE=style, please pay special attention to code style, naming conventions, etc.
Git Flow Status
Display comprehensive Git Flow repository status
Current Repository State
- Current branch: !
git branch --show-current - Git status: !
git status --porcelain - Branch list: !
git branch -a | grep -E '(feature|release|hotfix|develop|main)' | head -20 - Latest tags: !
git tag --sort=-version:refname | head -5 - Recent commits: !
git log --oneline --graph --all -10 - Remote status: !
git remote -v
Task
Provide a comprehensive Git Flow status report:
1. Branch Analysis
Determine current branch type and state:
CURRENT_BRANCH=$(git branch --show-current)
# Detect branch type
if [[ $CURRENT_BRANCH == "main" ]]; then
BRANCH_TYPE="π Production"
ICON="π "
STATUS_COLOR="red"
elif [[ $CURRENT_BRANCH == "develop" ]]; then
BRANCH_TYPE="π Integration"
ICON="π"
STATUS_COLOR="blue"
elif [[ $CURRENT_BRANCH == feature/* ]]; then
BRANCH_TYPE="πΏ Feature"
ICON="πΏ"
STATUS_COLOR="green"
elif [[ $CURRENT_BRANCH == release/* ]]; then
BRANCH_TYPE="π Release"
ICON="π"
STATUS_COLOR="yellow"
elif [[ $CURRENT_BRANCH == hotfix/* ]]; then
BRANCH_TYPE="π₯ Hotfix"
ICON="π₯"
STATUS_COLOR="red"
else
BRANCH_TYPE="π Other"
ICON="π"
STATUS_COLOR="gray"
fi
2. Comprehensive Status Display
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
πΏ GIT FLOW STATUS
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π CURRENT BRANCH
$ICON $CURRENT_BRANCH
Type: $BRANCH_TYPE
Base: [origin branch]
Target: [merge destination]
π REPOSITORY INFO
Remote: origin ($REMOTE_URL)
Latest tag: v1.2.0
Total branches: 12
Active features: 3
Active releases: 0
Active hotfixes: 0
π SYNC STATUS
Commits ahead: β 2
Commits behind: β 1
Status: β οΈ Branch diverged from remote
Recommendations:
- Pull latest changes: git pull
- Push your commits: git push
π WORKING DIRECTORY
Modified: β 3 files
Added: β 5 files
Deleted: β 1 file
Untracked: ? 2 files
Total changes: 11 files
Status: β οΈ Uncommitted changes
π COMMIT HISTORY
Commits on branch: 5
Commits since base: 7
Last commit: 2 hours ago
Author: John Doe <john@example.com>
π― MERGE TARGET
Will merge to: develop
Merge status: β Ready (no conflicts)
Estimated files affected: 12
Estimated lines changed: +245 -87
π·οΈ VERSION INFO
Current production: v1.2.0 (on main)
Last release: 3 days ago
Next suggested: v1.3.0 (based on commits)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3. Branch-Specific Information
For Feature Branches:
πΏ FEATURE BRANCH: feature/user-authentication
Branch info:
Created: 2 days ago
Base branch: develop
Merge target: develop
Progress:
Commits: 5
Files changed: 12
Lines added: 245
Lines removed: 87
Status:
β No merge conflicts with develop
β Branch is up to date with remote
β οΈ 3 uncommitted changes
β οΈ Tests not run recently
Next steps:
1. Commit your changes
2. Run tests: npm test
3. Push to remote: git push
4. When ready: /finish
For Release Branches:
π RELEASE BRANCH: release/v1.3.0
Release info:
Version: v1.3.0
Created: 1 day ago
Base branch: develop
Merge targets: main, develop
Release contents:
Features: 5
Bug fixes: 3
Performance: 1
Total commits: 15
Version analysis:
Current: v1.2.0
Proposed: v1.3.0
Increment: MINOR (new features)
Checklist:
β CHANGELOG.md updated
β Version in package.json
β οΈ Tests not run
β No tag created yet
Next steps:
1. Run final tests: npm test
2. Review CHANGELOG.md
3. Create PR: gh pr create
4. Get approvals
5. Finish release: /finish
For Hotfix Branches:
π₯ HOTFIX BRANCH: hotfix/critical-security-patch
Hotfix info:
Issue: critical-security-patch
Created: 2 hours ago
Base branch: main
Merge targets: main, develop
Severity: CRITICAL
Version info:
Current production: v1.2.0
Hotfix version: v1.2.1
Increment: PATCH
Status:
β Fix implemented
β Tests passing
β οΈ Not yet deployed
β οΈ 2 uncommitted changes
β οΈ URGENT: This is a critical production hotfix!
Next steps:
1. Commit remaining changes
2. Final testing
3. Create emergency PR
4. Get fast-track approval
5. Finish and deploy: /finish
6. Monitor production
For Main Branch:
π MAIN BRANCH (Production)
Production info:
Latest tag: v1.2.0
Released: 3 days ago
Last commit: 3 days ago
Status: β Clean and stable
Active work:
Feature branches: 3
Release branches: 0
Hotfix branches: 0
Recent releases:
v1.2.0 - 3 days ago
v1.1.5 - 1 week ago
v1.1.4 - 2 weeks ago
β οΈ WARNING: You are on the production branch!
Avoid committing directly to main.
Use feature/release/hotfix branches instead.
To start new work:
/feature <name> - New feature
/release <version> - New release
/hotfix <name> - Emergency fix
For Develop Branch:
π DEVELOP BRANCH (Integration)
Integration info:
Ahead of main: 12 commits
Last merge: 1 day ago
Status: β Stable
Merged features:
feature/user-authentication (2 days ago)
feature/payment-gateway (1 week ago)
feature/dashboard-redesign (2 weeks ago)
Active features:
feature/notifications (in progress)
feature/api-v2 (in progress)
feature/mobile-app (in progress)
Next release:
Suggested version: v1.3.0
Estimated features: 5
Estimated timeline: 1 week
To start new work:
/feature <name> - Create new feature
4. All Git Flow Branches
List all active Git Flow branches:
π ACTIVE BRANCHES
πΏ Features (3):
feature/notifications (2 commits, 1 day old)
feature/api-v2 (8 commits, 1 week old)
feature/mobile-app (15 commits, 2 weeks old)
π Releases (0):
No active releases
π₯ Hotfixes (0):
No active hotfixes
π Main branches:
main (production, v1.2.0)
develop (integration, +12 commits ahead)
π¦ Stale branches (older than 30 days):
feature/old-experiment (45 days old)
feature/deprecated-feature (60 days old)
Cleanup suggestion: /clean-branches
5. Recommendations
Provide actionable recommendations based on status:
π‘ RECOMMENDATIONS
Priority Actions:
1. β οΈ Commit your 3 uncommitted changes
2. β οΈ Push 2 unpushed commits to remote
3. β οΈ Pull 1 commit from remote (behind)
4. βΉοΈ Run tests before finishing
Branch Hygiene:
- 2 stale branches can be deleted
- feature/mobile-app is 2 weeks old (consider splitting)
- No merge conflicts detected β
Next Steps:
1. Commit changes: git add . && git commit
2. Pull updates: git pull
3. Push commits: git push
4. Run tests: npm test
5. Finish when ready: /finish
6. Error States
Not in Git Repository:
β Not in a git repository
Initialize git repository:
git init
git remote add origin <url>
Or navigate to a git repository.
No Git Flow Structure:
β οΈ Git Flow structure not detected
Missing branches:
- develop (integration branch)
- main (production branch)
Initialize Git Flow:
git flow init
Or create branches manually:
git checkout -b develop
git checkout -b main
Remote Not Configured:
β οΈ No remote repository configured
Add remote:
git remote add origin <repository-url>
Verify remote:
git remote -v
7. Quick Stats
π QUICK STATS
Commits:
Today: 3
This week: 12
This month: 45
Branches:
Features: 3 active
Releases: 0 active
Hotfixes: 0 active
Other: 5
Contributors:
Active this week: 4
Total: 8
Repository:
Total commits: 1,234
Total tags: 25
Latest: v1.2.0
Age: 6 months
8. Workflow Suggestions
Based on current state, suggest next commands:
π― SUGGESTED NEXT COMMANDS
For current branch (feature/user-authentication):
/finish - Complete and merge feature
/flow-status - Refresh this status
To start new work:
/feature <name> - New feature branch
/release <version> - New release
/hotfix <name> - Emergency fix
Repository maintenance:
/clean-branches - Clean up old branches
git fetch --prune - Remove stale remote refs
Related Commands
/feature <name>- Create feature branch/release <version>- Create release branch/hotfix <name>- Create hotfix branch/finish- Complete current branch
Best Practices
Regular Status Checks:
- β Run /flow-status daily
- β Check before starting new work
- β Verify before finishing branches
- β Monitor for stale branches
Status Indicators:
- β Green: Good to proceed
- β οΈ Yellow: Attention needed
- β Red: Action required
- βΉοΈ Blue: Informational
Sponsors
Details
- Marketplace
- huangdijia/oh-my-claude-code-plugins
- Source
- plugins/git-flow
- Category
- Development
