https://github.com/dubsopenhub/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.
https://github.com/dubsopenhub/groundhog-day
automation backup copilot-cli github-copilot skills
Last synced: 2 days ago
JSON representation
๐ฟ๏ธ 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.
- Host: GitHub
- URL: https://github.com/dubsopenhub/groundhog-day
- Owner: DUBSOpenHub
- License: mit
- Created: 2026-03-06T05:14:51.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-06-24T04:23:22.000Z (about 1 month ago)
- Last Synced: 2026-07-07T22:21:29.382Z (23 days ago)
- Topics: automation, backup, copilot-cli, github-copilot, skills
- Language: Shell
- Homepage: https://github.com/DUBSOpenHub/copilot-skills
- Size: 118 KB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# ๐ฟ๏ธ 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:**
> ```bash
> curl -fsSL https://raw.githubusercontent.com/DUBSOpenHub/groundhog-day/main/install.sh | bash
> ```
> Or with Homebrew:
> ```bash
> brew install DUBSOpenHub/tap/groundhog-day
> ```

---
Did you know that every [Copilot CLI](https://docs.github.com/copilot/concepts/agents/about-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:**
> ```bash
> 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.
```
```bash
# 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

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
```bash
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](https://github.com/DUBSOpenHub/agent-xray)** 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](https://github.com/DUBSOpenHub/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

Groundhog Day runs an automated health check every morning at 6:00 AM. It checks 13 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 last 7 days?
- Log file size (reported for awareness)
- When was the last successful sync?
- Is fswatch installed?
- Is Copilot CLI up to date?
- Is a stale sync lock blocking syncs?
- Is `.zshrc` syntax valid?
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:
```bash
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:
```bash
# 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](https://github.com/DUBSOpenHub) with the [GitHub Copilot CLI](https://docs.github.com/copilot/concepts/agents/about-copilot-cli).
Let's build! ๐โจ