/git-workflow - Git Operations with Standards
Orchestrate git operations with safety checks, branch naming enforcement, and PR creation.
Usage
/git-workflow branch feature/my-feature # Create a properly named branch
/git-workflow commit # Commit with conventional format
/git-workflow pr # Create PR with standards
/git-workflow help # Show this help
Arguments
$ARGUMENTS - Subcommand and options
Subcommands
branch <name> - Create Branch
Creates a new branch with naming validation.
Valid prefixes: feature/, bugfix/, hotfix/, chore/, docs/, refactor/
Steps:
- Validate branch name follows convention
- Check for uncommitted changes
- Create and switch to new branch
- Push with upstream tracking (optional)
Example:
/git-workflow branch feature/123-voice-pipeline
commit - Commit with Standards
Creates a commit following conventional commit format.
Pre-commit checks (automatic):
- Run
/verify-clean- linters, tests, sensitive files - Run
/docs-audit- documentation accuracy - Stage changes if needed
- Prompt for commit message in format:
{type}({scope}): {description}
Commit types: feat, fix, docs, refactor, chore, test
Example output:
feat(vps): Add WordPress deployment automation
- Configure nginx reverse proxy
- Set up automated backups
- Add health check endpoint
Closes #123
pr - Create Pull Request
Creates a PR with proper title format and linked issues.
Steps:
- Verify branch is pushed to remote
- Extract issue number from branch name (if present)
- Generate PR title from commits:
{type}: {description} - Create PR with summary and test plan
- Link to issue if found
PR body format:
## Summary
- Brief description of changes
## Test Plan
- [ ] Tests pass locally
- [ ] Documentation updated
- [ ] No linting errors
Closes #123
Branch Naming Enforcement
| Prefix | Purpose | Example |
|--------|---------|---------|
| feature/ | New functionality | feature/voice-pipeline |
| bugfix/ | Bug fixes | bugfix/auth-401-error |
| hotfix/ | Urgent production fixes | hotfix/db-connection-leak |
| chore/ | Maintenance, dependencies | chore/upgrade-node-22 |
| docs/ | Documentation only | docs/api-examples |
| refactor/ | Code restructuring | refactor/auth-module |
Workflow Integration
1. /git-workflow branch feature/123-desc # Start feature
2. [Development work]
3. /verify-clean # Check quality
4. /docs-audit # Check docs
5. /git-workflow commit # Commit changes
6. /git-workflow pr # Create PR
Output
Provide clear feedback at each step:
- Branch creation confirmation
- Pre-commit check results
- Commit hash and message
- PR URL when created
- Any validation warnings or errors
微信扫一扫