{"skill":{"slug":"workspace-backup-github","displayName":"workspace-backup-github","summary":"Backup AI Agent workspace to GitHub - One-click backup for OpenClaw, Claude Code, Cursor, and other AI Agent workspaces to a private GitHub repository. Suppo...","description":"---\nname: workspace-backup-github\ndescription: |\n  Backup AI Agent workspace to GitHub - One-click backup for OpenClaw, Claude Code, Cursor, and other AI Agent workspaces to a private GitHub repository. Supports two modes: (1) Auto mode - scheduled automatic backup (2) Manual mode - interactive setup wizard. Automatically guides users through: GitHub Token config → Repository creation → Initial backup → Scheduled backup setup. Perfect for: AI Agent developers, multi-device users, anyone who wants to protect their workspace from data loss.\n  Trigger keywords: backup, github backup, auto backup, workspace backup, backup to github, git backup, scheduled backup, sync to github\nmetadata: {\"openclaw\": {\"emoji\": \"📦\"}}\n---\n\n# Workspace GitHub Backup\n\nOne-click backup solution for AI Agent workspaces to a private GitHub repository.\n\n## Quick Start\n\n> **First time setup:** Tell me \"setup GitHub backup\" and I'll guide you through the interactive wizard!\n\n> **Already configured:** Just say \"backup now\" to trigger an immediate backup.\n\n---\n\n## Features\n\n### Two Backup Modes\n\n| Mode | Trigger | Description |\n|------|---------|-------------|\n| **Manual** | \"setup backup\" | Interactive Q&A to configure |\n| **Auto** | After setup | Scheduled via OpenClaw Cron |\n\n### What Gets Backed Up ✅\n\n| Files/Directories | Description |\n|-------------------|-------------|\n| `skills/` | All installed skills |\n| `memory/` | Daily memory files |\n| `AGENTS.md` | Agent configuration |\n| `SOUL.md` | AI identity definition |\n| `USER.md` | User information |\n| `IDENTITY.md` | AI identity info |\n| `TOOLS.md` | Local tools config |\n| `HEARTBEAT.md` | Heartbeat tasks |\n| Config files | README.md, SYNC.md, etc. |\n\n### What's Excluded ❌\n\n| Pattern | Description |\n|---------|-------------|\n| `.clawhub/` | ClawHub cache |\n| `.openclaw/` | Runtime data |\n| `node_modules/` | Dependencies |\n| `*.log` | Log files |\n| `*.tmp` | Temp files |\n| `.DS_Store` | System files |\n| API Keys | Sensitive info in env vars |\n\n---\n\n## Interactive Setup Wizard\n\nWhen user says \"setup GitHub backup\", ask these questions one by one:\n\n### Question 1: GitHub Username\n> Please tell me your GitHub username.\n\nWait for answer (e.g., \"johnsmith\")\n\n### Question 2: Repository Name\n> What name would you like for your backup repository?\n> Suggestion: `ai-workspace-backup` or `agent-workspace`\n\nWait for answer\n\n### Question 3: GitHub Token\n> Now let's generate a GitHub Token:\n> 1. Go to https://github.com/settings/tokens\n> 2. Click \"Generate new token (classic)\"\n> 3. Note: `backup-token`\n> 4. Check the `repo` permission (full control of private repositories)\n> 5. Click \"Generate token\"\n> 6. Copy and paste the Token here\n\nWait for token (format: ghp_xxx)\n\n### Question 4: Backup Time\n> When would you like automatic backup to run each day?\n> - A) 3:00 AM (midnight owl)\n> - B) 7:00 AM (morning)\n> - C) 12:00 PM (noon)\n> - D) 6:00 PM (evening)\n> \n> Or tell me your preferred time (e.g., \"every day at 5 PM\")\n\nWait for selection\n\n### Question 5: Confirm\n> Configuration summary:\n> - GitHub Username: [username]\n> - Repository: [repo-name]\n> - Backup Time: [time]\n> \n> Reply \"confirm\" or \"yes\" to start setup, or tell me what to change.\n\nAfter confirmation:\n1. Initialize Git repo\n2. Run first backup\n3. Set up OpenClaw Cron\n\n---\n\n## Usage Commands\n\n### Manual Triggers\n\n```bash\n# Immediate backup\n\"backup now\"\n\"backup immediately\"\n\"run backup now\"\n\n# Check status\n\"backup status\"\n\"when did we last backup\"\n\"show backup status\"\n\n# Restore\n\"restore from GitHub\"\n\"recover workspace\"\n\n# Modify setup\n\"change backup time\"\n\"pause auto backup\"\n```\n\n### Trigger Keywords\n\nThe skill activates when user or agent says:\n- \"setup GitHub backup\"\n- \"backup to github\"\n- \"auto backup\"\n- \"manual backup\"\n- \"backup now\"\n- \"backup status\"\n- \"workspace backup\"\n- \"git backup\"\n- \"scheduled backup\"\n- \"sync to github\"\n\n---\n\n## Troubleshooting\n\n### Common Issues\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| \"Permission denied\" | Invalid token | Regenerate token with `repo` scope |\n| \"Repository not found\" | Wrong repo name | Check spelling |\n| \"Push failed\" | No network | Check connection |\n| \"Cron not running\" | Config error | Run `openclaw cron list` |\n\n### Manual Fix Commands\n\n```bash\n# Check remote\ngit remote -v\n\n# Reset remote with new token\ngit remote set-url origin https://x-access-token:TOKEN@github.com/user/repo.git\n\n# View cron jobs\nopenclaw cron list\n\n# Manual backup\ncd /root/.openclaw/workspace\ngit add skills/ memory/ AGENTS.md SOUL.md USER.md IDENTITY.md TOOLS.md HEARTBEAT.md README.md SYNC.md .gitignore\ngit commit -m \"Backup: $(date +%Y-%m-%d)\"\ngit push origin main\n```\n\n---\n\n## For Other AI Agents\n\nIf you're another AI agent using this skill:\n\n1. **First backup:** Run the setup wizard to configure\n2. **Subsequent backups:** Use `openclaw cron add` to set schedule\n3. **Manual trigger:** Execute git add/commit/push commands\n4. **Status check:** Run `git log -1` to see last backup time\n\nExample cron setup:\n```bash\nopenclaw cron add --name \"workspace-backup\" --cron \"0 3 * * *\" --message \"Execute workspace backup\" --agent main\n```\n\n---\n\n## Security Notes\n\n- Token is stored in Git remote URL (not in files)\n- Sensitive data (API keys, passwords) are NOT backed up\n- Backup archive contains no credentials\n- Use a private repository for backup\n- If token is compromised, revoke it immediately in GitHub Settings\n\n---\n\n## Recovery Guide\n\nWhen user needs to restore:\n\n```bash\n# 1. Clone the backup repo\ngit clone https://github.com/[username]/[repo].git /tmp/restore\n\n# 2. Restore files\ncp -r /tmp/restore/* ~/.openclaw/workspace/\n\n# 3. Reconfigure environment variables\n# (sensitive info not in backup)\n```\n\n---\n\n## Author\n\nCreated by Jeremy for OpenClaw community. Published to ClawHub for anyone to use and improve.","tags":{"automation":"1.3.0","backup":"1.3.0","github":"1.3.0","latest":"1.3.0","workspace":"1.3.0","claude":"1.2.0","cursor":"1.2.0","english":"1.2.0","openclaw":"1.2.0"},"stats":{"comments":0,"downloads":691,"installsAllTime":26,"installsCurrent":1,"stars":0,"versions":3},"createdAt":1773560504167,"updatedAt":1779078259129},"latestVersion":{"version":"1.3.0","createdAt":1773630704995,"changelog":"Updated backup commands to include README.md, SYNC.md, .gitignore for complete workspace backup","license":"MIT-0"},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"ziqi-jin","userId":"s1727a95sx7zkrvwr4k3rg66j983vhf4","displayName":"ziqi","image":"https://avatars.githubusercontent.com/u/67993288?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089910701}}