git-workflow-designer
Expert guide for designing Git branching strategies including Git Flow, GitHub Flow, trunk-based development, and release management. Use when establishing team workflows or improving version control practices.
What this skill does
# Git Workflow Designer Skill
## Overview
This skill helps you design and implement effective Git branching strategies for teams of any size. Covers Git Flow, GitHub Flow, trunk-based development, release management, and branch protection policies.
## Workflow Selection Philosophy
### Key Factors
1. **Team size**: Solo vs. small team vs. large organization
2. **Release frequency**: Continuous vs. scheduled releases
3. **Environment complexity**: Single vs. multiple deployment targets
4. **Risk tolerance**: Move fast vs. stability first
### Workflow Comparison
| Workflow | Best For | Release Frequency | Complexity |
|----------|----------|-------------------|------------|
| Trunk-Based | Small teams, CI/CD | Continuous | Low |
| GitHub Flow | Most web apps | On-demand | Low |
| Git Flow | Versioned software | Scheduled | High |
| GitLab Flow | Environment-based | Mixed | Medium |
## GitHub Flow (Recommended for Most)
### Overview
Simple, effective workflow for continuous deployment.
```
main ─────●─────●─────●─────●─────●─────●
\ / \ /
feature/x ●─────● ●─────●
```
### Process
1. **Branch from main**
```bash
git checkout main
git pull origin main
git checkout -b feature/user-authentication
```
2. **Commit regularly**
```bash
git add .
git commit -m "feat: add login form component"
```
3. **Push and create PR**
```bash
git push -u origin feature/user-authentication
gh pr create --title "Add user authentication" --body "..."
```
4. **Review and merge**
- CI runs tests
- Peer review
- Squash merge to main
5. **Deploy**
- Automatic deploy on merge to main
### Branch Naming Convention
```
feature/ - New features
fix/ - Bug fixes
docs/ - Documentation
refactor/ - Code refactoring
test/ - Test additions
chore/ - Maintenance tasks
```
### Configuration
```yaml
# .github/branch-protection.yml (pseudo-config)
main:
required_status_checks:
strict: true
contexts:
- "ci/tests"
- "ci/lint"
- "ci/build"
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: true
enforce_admins: false
restrictions: null
```
## Git Flow (For Versioned Releases)
### Overview
Structured workflow for scheduled release cycles.
```
main ─────●─────────────────●─────────────●
\ / \
release ●─────●─────●─ ●───
\ \ / /
develop ●─────●─●─────●─●─────●─────●─────●─●
\ / \ / \ /
feature ●─● ●─────● ●─────●
```
### Branches
| Branch | Purpose | Merges To |
|--------|---------|-----------|
| `main` | Production-ready code | - |
| `develop` | Integration branch | `main` |
| `feature/*` | New features | `develop` |
| `release/*` | Release preparation | `main`, `develop` |
| `hotfix/*` | Emergency fixes | `main`, `develop` |
### Feature Development
```bash
# Start feature
git checkout develop
git pull origin develop
git checkout -b feature/new-dashboard
# Work on feature
git commit -m "feat: add dashboard layout"
git commit -m "feat: add dashboard charts"
# Complete feature
git checkout develop
git merge --no-ff feature/new-dashboard
git branch -d feature/new-dashboard
git push origin develop
```
### Release Process
```bash
# Start release
git checkout develop
git checkout -b release/1.2.0
# Bump version
npm version 1.2.0 --no-git-tag-version
git commit -am "chore: bump version to 1.2.0"
# Fix release issues
git commit -m "fix: correct typo in release notes"
# Complete release
git checkout main
git merge --no-ff release/1.2.0
git tag -a v1.2.0 -m "Release 1.2.0"
git push origin main --tags
git checkout develop
git merge --no-ff release/1.2.0
git push origin develop
git branch -d release/1.2.0
```
### Hotfix Process
```bash
# Start hotfix
git checkout main
git checkout -b hotfix/1.2.1
# Fix the issue
git commit -m "fix: critical security vulnerability"
# Complete hotfix
git checkout main
git merge --no-ff hotfix/1.2.1
git tag -a v1.2.1 -m "Hotfix 1.2.1"
git push origin main --tags
git checkout develop
git merge --no-ff hotfix/1.2.1
git push origin develop
git branch -d hotfix/1.2.1
```
## Trunk-Based Development
### Overview
Everyone commits to main with short-lived branches.
```
main ─●─●─●─●─●─●─●─●─●─●─●─●─●─●─●─●
\─/ \─/ \─/
PR PR PR
```
### Principles
1. **Short-lived branches** (< 1 day)
2. **Small, frequent commits**
3. **Feature flags for incomplete work**
4. **Comprehensive CI/CD**
### Feature Flags Integration
```typescript
// src/lib/features.ts
export const features = {
newCheckout: process.env.FEATURE_NEW_CHECKOUT === 'true',
darkMode: process.env.FEATURE_DARK_MODE === 'true',
};
// Usage
if (features.newCheckout) {
return <NewCheckout />;
}
return <OldCheckout />;
```
### Branch Rules
```bash
# Quick feature (< 4 hours)
git checkout main
git pull
git checkout -b quick/fix-typo
# ... work ...
git push -u origin quick/fix-typo
gh pr create --title "Fix typo" --body ""
# Merge immediately after CI passes
```
## Release Management
### Semantic Versioning
```
MAJOR.MINOR.PATCH
1.0.0 - Initial release
1.1.0 - New feature (backwards compatible)
1.1.1 - Bug fix
2.0.0 - Breaking change
```
### Automated Version Bumping
```json
// package.json
{
"scripts": {
"release:patch": "npm version patch && git push --follow-tags",
"release:minor": "npm version minor && git push --follow-tags",
"release:major": "npm version major && git push --follow-tags"
}
}
```
### Changelog Generation
```yaml
# .github/workflows/release.yml
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v4
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changelog.outputs.changelog }}
```
### Conventional Commits
```bash
# Format
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
# Types
feat: New feature
fix: Bug fix
docs: Documentation
style: Formatting, no code change
refactor: Refactoring
test: Tests
chore: Maintenance
# Examples
feat(auth): add password reset flow
fix(api): handle null user gracefully
docs: update README with new API endpoints
chore(deps): update dependencies
```
### Commitlint Configuration
```javascript
// commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat',
'fix',
'docs',
'style',
'refactor',
'test',
'chore',
'perf',
'ci',
'build',
'revert',
],
],
'subject-case': [2, 'always', 'lower-case'],
'header-max-length': [2, 'always', 72],
},
};
```
## Branch Protection
### GitHub Branch Protection Rules
```yaml
# Recommended settings for main branch
Required status checks:
- ci/test
- ci/lint
- ci/build
- ci/typecheck
Required reviews: 1
Dismiss stale reviews: true
Require review from code owners: true
Require signed commits: false # Optional
Require linear history: true # Encourages squash/rebase
Include administrators: false # Allow admins to bypass
Restrict who can push:
- Maintainers only
```
### CODEOWNERS
```
# .github/CODEOWNERS
# Default owners
* @team-lead
# Frontend
/src/components/ @frontend-team
/src/app/ @frontend-team
# Backend
/src/api/ @backend-team
/src/lib/db/ @backend-team
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.