This file tells any AI agent how to work effectively on the Groundhog Day codebase.
Groundhog Day is a standalone bash daemon that watches ~/.copilot/skills/ and auto-syncs changes to a GitHub repository. It is NOT a Copilot CLI skill β it's infrastructure that protects skills.
~/bin/groundhog β main script (bash)
βββ watch mode (fswatch β rsync β git) β real-time file watcher
βββ sync (rsync + git add/commit/push) β core sync logic
βββ checkup (13-point diagnostic) β daily health check at 6 AM
βββ status (quick health check) β manual status
~/Library/LaunchAgents/
βββ com.dubsopenhub.groundhog.plist β keeps watcher alive
βββ com.dubsopenhub.groundhog.checkup.plist β nightly checkup at 6 AM
| File | Purpose | Change Rules |
|---|---|---|
groundhog |
Main script | All logic lives here. Test with groundhog checkup after changes. |
install.sh |
One-line installer | Must stay idempotent. Re-running should not break existing installs. |
com.dubsopenhub.groundhog.plist |
LaunchAgent (watcher) | KeepAlive=true. Update home dir paths if changing user support. |
com.dubsopenhub.groundhog.checkup.plist |
LaunchAgent (nightly) | Runs at 6 AM. No KeepAlive β runs once and exits. |
README.md |
Documentation | Keep GIFs, keep the tone. Don't remove the Bill Murray energy. |
Groundhog Day uses only: bash, fswatch, rsync, git, python3 (stdlib only). No pip packages. No node modules. This is intentional β it must survive on a fresh machine with just Homebrew basics.
Everything lives in one bash script. No splitting into modules. This keeps installation trivial (cp one file) and debugging simple (cat one file).
/tmp/groundhog.lock is a directory-based lock (atomic on all filesystems). mkdir succeeds or fails atomically. Always release with trap ... RETURN.
The sync target repo's README is regenerated on every sync using a single python3 call that reads all SKILL.md frontmatter. This means the skills repo is always self-documenting.
- Read the full
groundhogscript β it's one file - Run
groundhog checkupto establish baseline health - Make your change
- Run
groundhog checkupagain to verify nothing broke - Test a live sync: touch a file in
~/.copilot/skills/and confirm it commits
π΄ Never remove the empty-source guard. If ~/.copilot/skills/ is empty or missing, rsync --delete would wipe the entire backup repo. The validate_skills() function prevents this.
π΄ Never remove the sync lock. Without it, rapid file changes trigger overlapping git commit / git push cycles that corrupt state.
π΄ Never pass skill file paths via shell interpolation into Python. Use sys.argv to avoid injection. This was a real vulnerability found during the initial X-ray audit.
Groundhog Day was stress-tested by two AI analysis agents:
- Agent X-Ray: Full security, reliability, and performance audit. Found 12 issues across 5 severity levels (3 critical, 2 high, 4 medium, 3 low).
- Grid-Medic: Independent diagnostic pass. Applied 8 fixes, validated each, verified clean restart.
All findings were resolved before v1.0. Run these agents again after any significant changes.