03-custom-skills/examples/git-sync-branches/SKILL.md
Merges all feature branches into develop, syncs master/main with develop, commits any uncommitted changes, and deletes all feature branches (local and remote). Handles git submodules automatically. Use when you want to clean up branches and leave only develop and master/main in sync.
npx skillsauth add escapeboy/ai-prompts git-sync-branchesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Commit everything, merge all feature branches into develop, sync master/main, delete feature branches. Handles submodules.
git status
If there are untracked files or modifications, commit them:
git add <specific files or dirs>
git commit -m "chore: commit pending changes before branch sync"
master vs main — use whichever existsdevelop — this is the integration branchgit branch | grep -E "^\*? *(master|main|develop)$"
For each git submodule, run the full sync workflow inside the submodule first:
git submodule status
For each submodule that has feature branches:
cd <submodule-path>cd .. back to parentgit branch | grep "feat/"
For each feature branch, check how many commits it's ahead of develop:
git log --oneline develop..<branch> | wc -l
Only merge branches that are actually ahead (non-zero).
Before merging, classify every feature branch and state the recommendation with a reason. Blanket "merge everything ahead" buries dead experiments and stale spikes into develop.
For each branch ahead of develop:
git log --oneline develop..<branch> # what work is on it
git log --oneline <branch>..develop | wc -l # how far behind develop it is (drift)
git log -1 --format='%cr' <branch> # how stale (last commit age)
Recommend one of:
git rebase develop <branch> (or recommend the author do it) before merging.Print the verdict list (one line per branch: branch — verdict — reason) and proceed. Only branches marked Merge/Rebase flow into Steps 5–7; Close branches skip straight to deletion.
git checkout develop
git pull origin develop
For each branch that has commits ahead of develop:
git merge <branch> --no-ff -m "feat: merge <branch> into develop"
Submodule conflict resolution: If a merge fails with add_cacheinfo failed to refresh for path '<submodule>':
git merge --abortgit add <submodule> && git commit -m "chore: update submodule pointer"Other conflicts: Resolve manually, then git add . && git commit.
After submodule sync, update the parent's pointer to the latest submodule commit:
git add <submodule-path>
git commit -m "chore: update <submodule> submodule to latest develop/main"
git checkout master # or: git checkout main
git merge develop --ff-only 2>/dev/null || git merge develop --no-ff -m "chore: merge develop into master — branch sync"
git branch | grep "feat/" | while read branch; do git branch -D "$branch"; done
git push origin develop master # or: git push origin develop main
git branch -r | grep "origin/feat/" | sed 's|origin/||' | while read branch; do
git push origin --delete "$branch" 2>&1 || true
done
If you get "remote ref does not exist" errors, the branches are already gone — prune stale refs:
git fetch --prune
git branch -a
git log --oneline -3 master # or main
git log --oneline -3 develop
Both master/main and develop should point to the same commit (or master should be ≥ develop).
develop first, never directly into master/mainmain rejects force-push, use git pull origin main --rebase firstgit branch -D force-deletes; verify with git log develop..<branch> firstParent repo branches: master (prod) + develop (default work branch)
Submodule (base/) branches: main (prod) + develop
Order of operations:
base/ submodule: merge features → develop → mainbase pointerdevelopdevelop → masterfeat/* branches in both reposdevelopment
Audit or install maximum-depth 1Password integration in the current project — fetches fresh 1Password developer docs first, detects existing integration, and either reviews/improves it or greenfield-installs (Service Account secret resolution + site-compat autocomplete/well-known). Stack-aware (Laravel, Node/Next, Python, Ruby/Rails, Go). Use when the user says "integrate 1Password", "make this site 1Password-friendly", "audit our 1P integration", or invokes /onepassword-integrate.
development
Optimize PNG and JPEG images locally using pngquant and mozjpeg/jpegtran — TinyPNG-level compression without API keys.
testing
Three-phase autonomous bug fix — investigate all occurrences, fix with full coverage, validate with regression test. Prevents partial fixes (the
development
This skill should be used when performing legal and regulatory compliance audits on software projects. It covers GDPR, CCPA/CPRA, ePrivacy Directive, HIPAA, PCI DSS, SOC 2, and WCAG 2.2 accessibility. The skill generates a full compliance package: audit report with severity ratings, automatic code fixes, legal document templates (Privacy Policy, Cookie Policy, DPA, DPIA), and data flow diagrams. This skill should be triggered when the user asks to check compliance, audit privacy, generate legal documents, review data handling, or ensure regulatory readiness for any project type (web, mobile, API, desktop).