- Replace hardcoded /Users/sd9235/ paths with $HOME in all SKILLS docs - Use WORKSPACE_DIR variable in backup-main.sh (auto-resolves from script location) - Genericize 'Forcepoint CertChecker' / 'corporate proxy' to 'SSL-intercepting proxy' - Add scripts/switch-network.sh for toggling npm between corporate proxy and home - No functional code changes — only comments, docs, and paths
3.3 KiB
3.3 KiB
Backup Main Branch Skill
Description: Smart backup of main branches across repositories with duplicate detection.
Script: scripts/backup-main.sh
What It Does
For each of the 3 repositories:
- Switches to
mainand pulls latest - Pushes any unpushed main commits to origin
- Fetches latest remote backup refs
- Skips backup if HEAD matches the latest
backup/main-*branch (smart duplicate detection) - Creates timestamped
backup/main-YYYY-MM-DD-HHMMSSbranch and pushes it - Cleans up old backups (keeps last 7)
- Prints a summary table with: repo name, backup status, total commits, push status, last commit message
Repositories Covered
learning_ai_common_platlearning_voice_ai_agentlearning_multimodal_memory_agents
Quick Start
# From the learning_ai_common_plat root:
bash scripts/backup-main.sh
Or via Windsurf workflow: /backup-main-branch
Example Output
━━━ learning_ai_common_plat ━━━
Pulling latest...
Pushing 2 unpushed commit(s) on main...
✅ Main pushed
Creating: backup/main-2026-02-12-201500
✅ Pushed to remote
━━━ learning_voice_ai_agent ━━━
Pulling latest...
✅ Already backed up → backup/main-2026-02-12-201500
┌─────────────────────────────────────────────────────────────────────────────────┐
│ BACKUP SUMMARY 2026-02-12 20:15 │
├──────────────────────────┬──────────────────┬─────────┬────────────┬────────────┤
│ Repository │ Backup Status │ Commits │ Main Push │ Last Commit│
├──────────────────────────┼──────────────────┼─────────┼────────────┼────────────┤
│ learning_ai_common_plat │ ✅ New backup │ 142 │ ✅ 2 pushed│ feat(docs) │
│ learning_voice_ai_agent │ ✅ Already backed│ 387 │ up to date │ fix(blob) │
│ learning_multimodal_... │ ✅ New backup │ 98 │ ✅ 4 pushed│ feat(azure)│
└──────────────────────────┴──────────────────┴─────────┴────────────┴────────────┘
Restoration
# List available backups
git branch -r | grep "backup/main-"
# Restore from a specific backup
git checkout -b restore-from-backup origin/backup/main-2026-02-12-201500
git switch main
git merge restore-from-backup
Customization
- Add repos: Edit
REPOSarray inscripts/backup-main.sh - Change retention: Modify
tail -n +8(keep last N) in the cleanup section - Cron:
0 18 * * * bash $HOME/code/mygh/learning_ai_common_plat/scripts/backup-main.sh
Related Skills
- Debug Service — Backup before major changes
- Production Readiness — Backup before releases