Skip to content

DUBSOpenHub/groundhog-day

Repository files navigation

🐿️ Groundhog Day

Autonomous backup agent for Copilot CLI skills. Your laptop will crash. Your skills won't. Watches, syncs, pushes. Starts on boot, runs forever, zero interaction.

⚑ Install in one line:

curl -fsSL https://raw.githubusercontent.com/DUBSOpenHub/groundhog-day/main/install.sh | bash

Or with Homebrew:

brew install DUBSOpenHub/tap/groundhog-day

Groundhog Day


Did you know that every Copilot CLI skill you've ever built lives in one local folder?

~/.copilot/skills/

That's it. No version history. No sync. No restore path.

Your custom skills. Your workflow automations. The prompts you spent weeks iterating on to get just right. All sitting in a single directory on a single machine. One spilled coffee, one failed drive, one stolen laptop and it's all...

...gone. πŸ’€

🐿️ Groundhog Day is a tiny background agent with one job: make sure that never happens. It watches your skills folder in real time, commits every change, and pushes it to GitHub automatically. You set it up once and never think about it again.

🐿️ Zero effort. Zero maintenance. Zero risk of losing your work.

The installer handles everything: detects your skills, creates a backup repo on your GitHub account, seeds it with your existing skills, and starts the watcher. One command, fully protected.

🐿️ Same thing. Every time. It watches. It syncs. It pushes. It never stops. It never complains. It wakes up tomorrow and does it all again.


🐿️ Quick Install

⚑ Install in one line:

curl -fsSL https://raw.githubusercontent.com/DUBSOpenHub/groundhog-day/main/install.sh | bash

🐿️ See it in action

$ groundhog status
🐿️  Groundhog Day: βœ… Running

$ mkdir -p ~/.copilot/skills/my-new-skill
$ cat > ~/.copilot/skills/my-new-skill/SKILL.md << EOF
---
name: my-new-skill
description: A brand new skill I just created
---
EOF

  ... 5 seconds later ...

$ tail -1 ~/.groundhog.log
🐿️  synced β€” add skill: my-new-skill

$ groundhog checkup
🐿️  Groundhog Day β€” Nightly Checkup
βœ… Watcher process: running
βœ… Skills directory: 10 skills found
βœ… Repo state: clean
βœ… Remote: in sync
βœ… Log: no errors
🐿️  All clear. Groundhog Day is healthy.
# 1. Clone
git clone https://github.com/DUBSOpenHub/groundhog-day.git ~/dev/groundhog-day

# 2. Set up your skills repo (or use an existing one)
gh repo create my-copilot-skills --public
git clone https://github.com/YOUR_USERNAME/my-copilot-skills.git ~/dev/copilot-skills

# 3. Install the agent
cp ~/dev/groundhog-day/groundhog ~/bin/groundhog
chmod +x ~/bin/groundhog

# 4. Configure (edit these two lines in ~/bin/groundhog)
#    REPO="$HOME/dev/copilot-skills"      ← your skills backup repo
#    SKILLS="$HOME/.copilot/skills"        ← default, probably don't change

# 5. Start watching (runs forever, survives reboots)
cp ~/dev/groundhog-day/com.dubsopenhub.groundhog.plist ~/Library/LaunchAgents/
# Edit the plist to match your home directory if not /Users/greggcochran
launchctl load ~/Library/LaunchAgents/com.dubsopenhub.groundhog.plist

That's it. Every skill you create, edit, or delete from this moment forward is automatically committed and pushed. Same thing, every time. 🐿️


🐿️ What It Does

Reporting in

Groundhog Day is a fully autonomous background agent that watches your ~/.copilot/skills/ directory in real time. Once installed, it requires zero interaction. It starts on boot, restarts if it crashes, and syncs every change without you ever touching it. The moment a file changes, it:

  1. Watches β€” detects every create, edit, rename, and delete in real time
  2. Syncs β€” rsyncs your skills to a version-controlled git repo
  3. Commits β€” creates meaningful commits (detects new skills by name)
  4. Pushes β€” sends it to GitHub with automatic retry on failure
  5. Catalogs β€” auto-generates a README with a table of all your skills

No cron. No manual steps. No remembering. It just runs.

🐿️ What It Catches

Scenario Without Groundhog Day With Groundhog Day
Laptop dies πŸ’€ Skills gone forever βœ… git clone on new machine
Accidentally delete a skill πŸ’€ Hope you remember what it said βœ… git restore
Want to share a skill πŸ’€ Manually copy files around βœ… Send a repo link
New machine setup πŸ’€ Rebuild everything from scratch βœ… One clone, done
"Wait, what did that skill look like last week?" πŸ’€ No idea βœ… git log -p

🐿️ Commands

groundhog              # One-shot sync right now
groundhog watch        # Start the real-time watcher
groundhog status       # Health check β€” is it running? Last sync?

🐿️ How It Works

~/.copilot/skills/          ~/dev/copilot-skills           GitHub
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   fswatch   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   git push   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  SKILL.md    β”‚ ──────────▢ β”‚  SKILL.md    β”‚ ──────────▢  β”‚  SKILL.md    β”‚
β”‚  (local)     β”‚   rsync     β”‚  (git repo)  β”‚   auto       β”‚  (backed up) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     you edit                  groundhog                      safe forever
  • fswatch detects file changes in real time (5s debounce)
  • rsync copies changes to the git working tree
  • git commits and pushes with meaningful messages
  • macOS LaunchAgent keeps it alive across reboots

🐿️ Built-In Safety

This isn't a quick script. Groundhog Day was stress-tested by two AI analysis agents before release:

πŸ”¬ Agent X-Ray performed a full security, reliability, and performance audit β€” identified 12 issues across 5 severity levels including a shell injection vector, race conditions, and data loss scenarios.

πŸš‘ Grid-Medic independently diagnosed the same codebase, applied 8 fixes, validated each one, and verified the agent restarted cleanly after patching.

Every finding was fixed. Here's what's built in:

Protection What it prevents
πŸ”’ Sync lock Overlapping syncs corrupting git state
πŸ”„ Push retry (3x) Network failures silently dropping commits
πŸ›‘οΈ Empty source guard rsync --delete wiping your repo if skills dir is empty
πŸ₯ Repo health check Dirty state, rebase conflicts, or missing dirs breaking sync
πŸ“‹ Log rotation Unbounded log growth eating your disk over months
🧹 Graceful shutdown Orphaned processes on SIGTERM
🐍 Injection protection Shell interpolation in Python calls
🧲 Event drain Redundant syncs from batched file events

🐿️ Daily Checkup - 6 AM Automated Health Check

6:00 AM

Groundhog Day runs an automated health check every morning at 6:00 AM. It checks 11 things:

  • Is the watcher process alive?
  • Is the LaunchAgent loaded?
  • Does the skills directory exist and have skills?
  • Is the repo clean?
  • Are all commits pushed?
  • Is the repo stuck in a rebase?
  • Any push failures or errors in the log?
  • Log file size (reported for awareness)
  • When was the last successful sync?
  • Is fswatch installed?
  • Is a stale sync lock blocking syncs?

If anything is wrong, you get a macOS notification. The checkup tells you exactly what to run:

🚨 1 issue(s) found. Run grid-medic:
   β†’ Open Copilot CLI and say:
     "grid-medic diagnose ~/bin/groundhog"

You can also run it manually anytime:

groundhog checkup

Re-run Agent X-Ray after modifying the script to catch new security or reliability issues: Open Copilot CLI and say: "X-ray ~/bin/groundhog for security, reliability, and performance"

🐿️ Restore on a New Machine

Your laptop just died. Here's your 60-second recovery:

# On your new machine
git clone https://github.com/YOUR_USERNAME/my-copilot-skills.git /tmp/skills-restore
cp -R /tmp/skills-restore/*/ ~/.copilot/skills/

All your skills are back. Every single one. Like the crash never happened.

🐿️ FAQ

Q: Does this work on Linux? A: The script works everywhere. The LaunchAgent plist is macOS-specific. On Linux, use a systemd unit or cron instead.

Q: What if I'm offline? A: Changes are committed locally. The next time you're online, the push retry catches up.

Q: Will it push secrets? A: Skills are prompt files (markdown). The sync explicitly excludes .env, .DS_Store, node_modules, and __pycache__. Add a .gitignore to your skills backup repo for anything else you want excluded.

Q: Can multiple people share a skills repo? A: Yes. Groundhog Day runs git pull --rebase before pushing, so it handles concurrent updates.


Why "Groundhog Day"?

Same thing. Every time. It watches. It syncs. It pushes. It never stops. It never complains. It wakes up tomorrow and does it all again. 🐿️


License

MIT

🐿️ Contributing

Found a bug or want to add a feature? PRs welcome. This is a tiny agent with one job β€” keep it simple.


πŸ™ Created with πŸ’œ by @DUBSOpenHub with the GitHub Copilot CLI.

Let's build! πŸš€βœ¨

About

🐿️ Autonomous backup agent for Copilot CLI skills. Your laptop will crash. Your skills won't. Watches, syncs, pushes. Starts on boot, runs forever, zero interaction.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors