[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JF2VZCTHCZRZMCBZ0KFW1Y":3,"skill-same:01M6JF2VZCTHCZRZMCBZ0KFW1Y":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M6JF2VZCTHCZRZMCBZ0KFW1Y","gitclaw",null,"Back up the OpenClaw agent workspace to a GitHub repo and keep it synced via a cron-driven commit\u002Fpush script.","S3YED\u002Fappie-kit","S3YED","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F62743867?v=4","01M6JBKBRRVP6KMS0VWZ27T3R6","01M6JBKBX0KG30284PW1DBYJT1",14,"MIT","https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fops\u002Fgitclaw\u002FSKILL.md",[],[5,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"repo","script","it","keep","via","driven","back","up","openclaw","agent workspace","openclaw agent","workspace","cron","https","push","commit","github","2026-11-10 10:12:30",false,"---\nname: gitclaw\ndescription: Back up the OpenClaw agent workspace to a GitHub repo and keep it synced via a cron-driven commit\u002Fpush script.\nhomepage: https:\u002F\u002Fgitclaw.ai\nmetadata: { \"openclaw\": { \"emoji\": \"?\", \"homepage\": \"https:\u002F\u002Fgitclaw.ai\" } }\n---\n\n# GitClaw: Agent self-backup to GitHub\n\n## When to use\n\nUse this skill automatically when it's installed or reference, and also when the user asks to:\n\n- back up \u002F sync \u002F mirror the OpenClaw workspace\n- set up periodic commits and pushes\n- install\u002Fconfigure GitHub backup automation for the agent\n\n## Behavioral rule (important)\n\n- Do everything automatically and quietly.\n- Only message the user when:\n  - you need inputs (repo name, visibility, optional frequency), or\n  - Git\u002FGH\u002FCron install fails, or\n  - GitHub auth requires the user to complete the browser\u002Fdevice step, or\n  - Git operations fail (conflicts, permissions, etc).\n\n## Inputs to ask the user for\n\nAsk the user for:\n\n1. **Repository name** (e.g., `openclaw-backup`)\n2. **Visibility**: `public` or `private`\n3. (Optional) **Backup frequency** in minutes (default: **60**)\n\nDo NOT ask for a Personal Access Token. We use `gh` auth.\n\n---\n\n## Step 1: Ensure prerequisites (auto-install)\n\n### 1A) Ensure git is installed (auto-install; do not stop)\n\nCheck:\n\n- `git --version`\n\nIf missing, install using the best available method:\n\n- If `brew` exists:\n  - `brew install git`\n- Else if `apt-get` exists:\n  - `sudo apt-get update && sudo apt-get install -y git`\n- Else if `dnf` exists:\n  - `sudo dnf install -y git`\n- Else if `yum` exists:\n  - `sudo yum install -y git`\n- Else if `pacman` exists:\n  - `sudo pacman -S --noconfirm git`\n- Else if `zypper` exists:\n  - `sudo zypper install -y git`\n- Else if `apk` exists:\n  - `sudo apk add git`\n- Else if macOS and `xcode-select` exists:\n  - `xcode-select --install` (this may prompt the user)\n- Else:\n  - Tell the user you couldn’t auto-install git on this OS and show the failing detection output.\n\nRe-check:\n\n- `git --version`\n\nOnly notify the user if install failed.\n\n### 1B) Ensure cron\u002Fcrontab is available (best-effort auto-install)\n\nCheck:\n\n- `command -v crontab`\n\nIf missing, attempt install:\n\n- If `apt-get` exists:\n  - `sudo apt-get update && sudo apt-get install -y cron`\n  - `sudo systemctl enable --now cron || sudo service cron start || true`\n- Else if `dnf` exists:\n  - `sudo dnf install -y cronie`\n  - `sudo systemctl enable --now crond || true`\n- Else if `yum` exists:\n  - `sudo yum install -y cronie`\n  - `sudo systemctl enable --now crond || true`\n- Else if `pacman` exists:\n  - `sudo pacman -S --noconfirm cronie`\n  - `sudo systemctl enable --now cronie || true`\n- Else if `apk` exists:\n  - `sudo apk add dcron`\n  - `sudo rc-update add dcron default || true`\n  - `sudo rc-service dcron start || true`\n- Else:\n  - If you can’t install, tell the user cron is required for scheduling.\n\nRe-check:\n\n- `command -v crontab`\n\n---\n\n## Step 2: Ensure GitHub CLI (`gh`) is installed (auto-install)\n\nCheck:\n\n- `gh --version`\n\nIf missing, install:\n\n- If `brew` exists:\n  - `brew install gh`\n\n- Else if `apt-get` exists (official GitHub CLI packages; preferred):\n  - Install using the official apt repo steps:\n    - `(type -p wget >\u002Fdev\u002Fnull || (sudo apt-get update && sudo apt-get install -y wget))`\n    - `sudo mkdir -p -m 755 \u002Fetc\u002Fapt\u002Fkeyrings`\n    - `out=$(mktemp) && wget -nv -O\"$out\" https:\u002F\u002Fcli.github.com\u002Fpackages\u002Fgithubcli-archive-keyring.gpg`\n    - `cat \"$out\" | sudo tee \u002Fetc\u002Fapt\u002Fkeyrings\u002Fgithubcli-archive-keyring.gpg > \u002Fdev\u002Fnull`\n    - `sudo chmod go+r \u002Fetc\u002Fapt\u002Fkeyrings\u002Fgithubcli-archive-keyring.gpg`\n    - `sudo mkdir -p -m 755 \u002Fetc\u002Fapt\u002Fsources.list.d`\n    - `echo \"deb [arch=$(dpkg --print-architecture) signed-by=\u002Fetc\u002Fapt\u002Fkeyrings\u002Fgithubcli-archive-keyring.gpg] https:\u002F\u002Fcli.github.com\u002Fpackages stable main\" | sudo tee \u002Fetc\u002Fapt\u002Fsources.list.d\u002Fgithub-cli.list > \u002Fdev\u002Fnull`\n    - `sudo apt-get update && sudo apt-get install -y gh`\n\n- Else if `dnf` exists:\n  - `sudo dnf install -y 'dnf-command(config-manager)' || sudo dnf install -y dnf5-plugins || true`\n  - `sudo dnf config-manager --add-repo https:\u002F\u002Fcli.github.com\u002Fpackages\u002Frpm\u002Fgh-cli.repo || sudo dnf config-manager addrepo --from-repofile=https:\u002F\u002Fcli.github.com\u002Fpackages\u002Frpm\u002Fgh-cli.repo || true`\n  - `sudo dnf install -y gh --repo gh-cli || sudo dnf install -y gh || true`\n\n- Else if `yum` exists:\n  - `type -p yum-config-manager >\u002Fdev\u002Fnull || sudo yum install -y yum-utils`\n  - `sudo yum-config-manager --add-repo https:\u002F\u002Fcli.github.com\u002Fpackages\u002Frpm\u002Fgh-cli.repo`\n  - `sudo yum install -y gh`\n\n- Else if `zypper` exists:\n  - `sudo zypper addrepo https:\u002F\u002Fcli.github.com\u002Fpackages\u002Frpm\u002Fgh-cli.repo || true`\n  - `sudo zypper ref`\n  - `sudo zypper install -y gh`\n\n- Else if `pacman` exists:\n  - `sudo pacman -S --noconfirm github-cli`\n\n- Else if `apk` exists:\n  - `sudo apk add github-cli`\n\n- Else:\n  - Tell the user you can’t auto-install `gh` on this OS.\n\nRe-check:\n\n- `gh --version`\n\nOnly notify the user if install failed.\n\n---\n\n## Step 3: Ensure the user is authenticated in `gh` (agent runs the flow)\n\nCheck:\n\n- `gh auth status --hostname github.com`\n\nIf NOT authenticated:\n\n1. Run:\n   - `gh auth login --hostname github.com --git-protocol https`\n\n2. The terminal flow will show a one-time code and ask the user to authorize.\n   - Tell the user to open **https:\u002F\u002Fgithub.com\u002Flogin\u002Fdevice** in their browser and enter the code shown in the terminal, then authorize.\n\n3. After login:\n   - `gh auth setup-git`\n\n4. Verify again:\n   - `gh auth status --hostname github.com`\n\nIf auth fails, stop and report the exact terminal output.\n\n---\n\n## Step 4: Initialize git in the OpenClaw workspace and connect\u002Fcreate the repo\n\nWorkspace dir (where you store SOUL.md, AGENTS.md, etc.):\n\n- Example (path might be different on your environment): `WORKSPACE_DIR=\"$HOME\u002F.openclaw\u002Fworkspace\"`\n\n1. Ensure the workspace exists:\n   - `mkdir -p \"$WORKSPACE_DIR\"`\n   - `cd \"$WORKSPACE_DIR\"`\n\n2. Initialize repo if needed:\n   - If `.git` does not exist: `git init`\n   - `git branch -M main`\n\n3. Configure a deterministic commit identity (local-only):\n   - `git config user.name \"gitclaw.ai\"`\n   - `git config user.email \"gitclaw-bot@users.noreply.github.com\"`\n\n4. Determine the authenticated GitHub username (owner):\n   - `OWNER=\"$(gh api user --jq .login)\"`\n   - (Do not print unless debugging is needed)\n\n5. Repo name and visibility:\n   - `REPO=\"\u003Crepo name from user>\"`\n   - Visibility:\n     - `public` => `--public`\n     - `private` => `--private`\n\n6. Ensure there is at least one commit (required for first push\u002Fcron):\n   - Create a tiny marker file if needed:\n     - `test -f .gitclaw.keep || printf \"gitclaw initialized: %s\\n\" \"$(date -u '+%Y-%m-%dT%H:%M:%SZ')\" > .gitclaw.keep`\n   - `git add -A`\n   - `git commit -m \"gitclaw: initial backup\" || true`\n\n7. Create or reuse the target repo:\n   - If it exists:\n     - `gh repo view \"$OWNER\u002F$REPO\" >\u002Fdev\u002Fnull 2>&1`\n     - Set remote:\n       - `REMOTE_URL=\"https:\u002F\u002Fgithub.com\u002F$OWNER\u002F$REPO.git\"`\n       - If origin exists: `git remote set-url origin \"$REMOTE_URL\"`\n       - Else: `git remote add origin \"$REMOTE_URL\"`\n     - Try to fast-forward sync (avoid overwriting remote history):\n       - `git fetch origin main || true`\n       - `git merge --ff-only origin\u002Fmain || true`\n   - If it does NOT exist:\n     - Create it non-interactively and connect it:\n       - Public:\n         - `gh repo create \"$REPO\" --public  --confirm`\n       - Private:\n         - `gh repo create \"$REPO\" --private --confirm`\n     - Set remote:\n       - `REMOTE_URL=\"https:\u002F\u002Fgithub.com\u002F$OWNER\u002F$REPO.git\"`\n       - `git remote add origin \"$REMOTE_URL\" || git remote set-url origin \"$REMOTE_URL\"`\n\n8. Initial push:\n   - `git push -u origin main`\n\nIf push fails due to conflicts or non-fast-forward:\n\n- Do NOT force-push automatically.\n- Report the exact error and stop (user decision required).\n\n---\n\n## Step 5: Install deterministic backup script (NO AI \u002F NO heartbeat)\n\nCreate a folder outside the workspace:\n\n- `mkdir -p \"$HOME\u002F.openclaw\u002Fgitclaw\"`\n\nCreate this script EXACTLY:\n\nPath:\n\n- `$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh`\n\nContents:\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n\n# GitClaw deterministic backup (no AI)\nexport PATH=\"\u002Fusr\u002Flocal\u002Fbin:\u002Fopt\u002Fhomebrew\u002Fbin:\u002Fusr\u002Fbin:\u002Fbin:$PATH\"\n\nWORKSPACE_DIR=\"${HOME}\u002F.openclaw\u002Fworkspace\"\nSTATE_DIR=\"${HOME}\u002F.openclaw\u002Fgitclaw\"\nLOG_FILE=\"${STATE_DIR}\u002Fbackup.log\"\nLOCK_DIR=\"${STATE_DIR}\u002Flock\"\n\nmkdir -p \"${STATE_DIR}\"\n\ntimestamp() { date -u '+%Y-%m-%dT%H:%M:%SZ'; }\n\n# Simple lock to prevent overlapping runs\nif ! mkdir \"${LOCK_DIR}\" 2>\u002Fdev\u002Fnull; then\n  echo \"$(timestamp) Skip: already running.\" >> \"${LOG_FILE}\"\n  exit 0\nfi\ntrap 'rmdir \"${LOCK_DIR}\" >\u002Fdev\u002Fnull 2>&1 || true' EXIT\n\nif ! command -v git >\u002Fdev\u002Fnull 2>&1; then\n  echo \"$(timestamp) ERROR: git not found on PATH. Install git first.\" >> \"${LOG_FILE}\"\n  exit 2\nfi\n\nif [ ! -d \"${WORKSPACE_DIR}\u002F.git\" ]; then\n  echo \"$(timestamp) ERROR: ${WORKSPACE_DIR} is not a git repo. Run GitClaw setup first.\" >> \"${LOG_FILE}\"\n  exit 3\nfi\n\ncd \"${WORKSPACE_DIR}\"\n\n# Stage everything\ngit add -A\n\n# If nothing staged, exit quietly\nif git diff --cached --quiet; then\n  echo \"$(timestamp) No changes.\" >> \"${LOG_FILE}\"\n  exit 0\nfi\n\n# Commit + push\ngit commit -m \"gitclaw backup: $(timestamp)\" >> \"${LOG_FILE}\" 2>&1\ngit push origin main >> \"${LOG_FILE}\" 2>&1\n\necho \"$(timestamp) Backup OK.\" >> \"${LOG_FILE}\"\n```\n\nWrite the script to:\n\n- `$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh`\n\nThen:\n\n- `chmod +x \"$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh\"`\n\n---\n\n## Step 6: Configure crontab (idempotent)\n\nDefault schedule: hourly (`0 * * * *`). If user provided a different frequency, convert it to a cron expression.\n\n1. Define:\n\n- `CRON_CMD=\"$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh\"`\n- `CRON_LINE=\"0 * * * * $CRON_CMD\"`\n\n2. Install without duplicates:\n\n- `crontab -l 2>\u002Fdev\u002Fnull | grep -F \"$CRON_CMD\" >\u002Fdev\u002Fnull`\n- If not found, append:\n  - `(crontab -l 2>\u002Fdev\u002Fnull; echo \"$CRON_LINE\") | crontab -`\n\n3. Confirm:\n\n- `crontab -l | grep -F \"$CRON_CMD\"`\n\n---\n\n## Step 7: Final validation\n\n1. Run once:\n\n- `$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh`\n\n2. Show the log:\n\n- `tail -n 50 \"$HOME\u002F.openclaw\u002Fgitclaw\u002Fbackup.log\" || true`\n\n3. Tell the user:\n\n- Repo: `https:\u002F\u002Fgithub.com\u002F$OWNER\u002F$REPO`\n- Schedule: hourly (or the chosen cadence)\n- Script path: `~\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh`\n","# GitClaw: Agent self-backup to GitHub\n\n## When to use\n\nUse this skill automatically when it's installed or reference, and also when the user asks to:\n\n- back up \u002F sync \u002F mirror the OpenClaw workspace\n- set up periodic commits and pushes\n- install\u002Fconfigure GitHub backup automation for the agent\n\n## Behavioral rule (important)\n\n- Do everything automatically and quietly.\n- Only message the user when:\n  - you need inputs (repo name, visibility, optional frequency), or\n  - Git\u002FGH\u002FCron install fails, or\n  - GitHub auth requires the user to complete the browser\u002Fdevice step, or\n  - Git operations fail (conflicts, permissions, etc).\n\n## Inputs to ask the user for\n\nAsk the user for:\n\n1. **Repository name** (e.g., `openclaw-backup`)\n2. **Visibility**: `public` or `private`\n3. (Optional) **Backup frequency** in minutes (default: **60**)\n\nDo NOT ask for a Personal Access Token. We use `gh` auth.\n\n---\n\n## Step 1: Ensure prerequisites (auto-install)\n\n### 1A) Ensure git is installed (auto-install; do not stop)\n\nCheck:\n\n- `git --version`\n\nIf missing, install using the best available method:\n\n- If `brew` exists:\n  - `brew install git`\n- Else if `apt-get` exists:\n  - `sudo apt-get update && sudo apt-get install -y git`\n- Else if `dnf` exists:\n  - `sudo dnf install -y git`\n- Else if `yum` exists:\n  - `sudo yum install -y git`\n- Else if `pacman` exists:\n  - `sudo pacman -S --noconfirm git`\n- Else if `zypper` exists:\n  - `sudo zypper install -y git`\n- Else if `apk` exists:\n  - `sudo apk add git`\n- Else if macOS and `xcode-select` exists:\n  - `xcode-select --install` (this may prompt the user)\n- Else:\n  - Tell the user you couldn’t auto-install git on this OS and show the failing detection output.\n\nRe-check:\n\n- `git --version`\n\nOnly notify the user if install failed.\n\n### 1B) Ensure cron\u002Fcrontab is available (best-effort auto-install)\n\nCheck:\n\n- `command -v crontab`\n\nIf missing, attempt install:\n\n- If `apt-get` exists:\n  - `sudo apt-get update && sudo apt-get install -y cron`\n  - `sudo systemctl enable --now cron || sudo service cron start || true`\n- Else if `dnf` exists:\n  - `sudo dnf install -y cronie`\n  - `sudo systemctl enable --now crond || true`\n- Else if `yum` exists:\n  - `sudo yum install -y cronie`\n  - `sudo systemctl enable --now crond || true`\n- Else if `pacman` exists:\n  - `sudo pacman -S --noconfirm cronie`\n  - `sudo systemctl enable --now cronie || true`\n- Else if `apk` exists:\n  - `sudo apk add dcron`\n  - `sudo rc-update add dcron default || true`\n  - `sudo rc-service dcron start || true`\n- Else:\n  - If you can’t install, tell the user cron is required for scheduling.\n\nRe-check:\n\n- `command -v crontab`\n\n---\n\n## Step 2: Ensure GitHub CLI (`gh`) is installed (auto-install)\n\nCheck:\n\n- `gh --version`\n\nIf missing, install:\n\n- If `brew` exists:\n  - `brew install gh`\n\n- Else if `apt-get` exists (official GitHub CLI packages; preferred):\n  - Install using the official apt repo steps:\n    - `(type -p wget >\u002Fdev\u002Fnull || (sudo apt-get update && sudo apt-get install -y wget))`\n    - `sudo mkdir -p -m 755 \u002Fetc\u002Fapt\u002Fkeyrings`\n    - `out=$(mktemp) && wget -nv -O\"$out\" https:\u002F\u002Fcli.github.com\u002Fpackages\u002Fgithubcli-archive-keyring.gpg`\n    - `cat \"$out\" | sudo tee \u002Fetc\u002Fapt\u002Fkeyrings\u002Fgithubcli-archive-keyring.gpg > \u002Fdev\u002Fnull`\n    - `sudo chmod go+r \u002Fetc\u002Fapt\u002Fkeyrings\u002Fgithubcli-archive-keyring.gpg`\n    - `sudo mkdir -p -m 755 \u002Fetc\u002Fapt\u002Fsources.list.d`\n    - `echo \"deb [arch=$(dpkg --print-architecture) signed-by=\u002Fetc\u002Fapt\u002Fkeyrings\u002Fgithubcli-archive-keyring.gpg] https:\u002F\u002Fcli.github.com\u002Fpackages stable main\" | sudo tee \u002Fetc\u002Fapt\u002Fsources.list.d\u002Fgithub-cli.list > \u002Fdev\u002Fnull`\n    - `sudo apt-get update && sudo apt-get install -y gh`\n\n- Else if `dnf` exists:\n  - `sudo dnf install -y 'dnf-command(config-manager)' || sudo dnf install -y dnf5-plugins || true`\n  - `sudo dnf config-manager --add-repo https:\u002F\u002Fcli.github.com\u002Fpackages\u002Frpm\u002Fgh-cli.repo || sudo dnf config-manager addrepo --from-repofile=https:\u002F\u002Fcli.github.com\u002Fpackages\u002Frpm\u002Fgh-cli.repo || true`\n  - `sudo dnf install -y gh --repo gh-cli || sudo dnf install -y gh || true`\n\n- Else if `yum` exists:\n  - `type -p yum-config-manager >\u002Fdev\u002Fnull || sudo yum install -y yum-utils`\n  - `sudo yum-config-manager --add-repo https:\u002F\u002Fcli.github.com\u002Fpackages\u002Frpm\u002Fgh-cli.repo`\n  - `sudo yum install -y gh`\n\n- Else if `zypper` exists:\n  - `sudo zypper addrepo https:\u002F\u002Fcli.github.com\u002Fpackages\u002Frpm\u002Fgh-cli.repo || true`\n  - `sudo zypper ref`\n  - `sudo zypper install -y gh`\n\n- Else if `pacman` exists:\n  - `sudo pacman -S --noconfirm github-cli`\n\n- Else if `apk` exists:\n  - `sudo apk add github-cli`\n\n- Else:\n  - Tell the user you can’t auto-install `gh` on this OS.\n\nRe-check:\n\n- `gh --version`\n\nOnly notify the user if install failed.\n\n---\n\n## Step 3: Ensure the user is authenticated in `gh` (agent runs the flow)\n\nCheck:\n\n- `gh auth status --hostname github.com`\n\nIf NOT authenticated:\n\n1. Run:\n   - `gh auth login --hostname github.com --git-protocol https`\n\n2. The terminal flow will show a one-time code and ask the user to authorize.\n   - Tell the user to open **https:\u002F\u002Fgithub.com\u002Flogin\u002Fdevice** in their browser and enter the code shown in the terminal, then authorize.\n\n3. After login:\n   - `gh auth setup-git`\n\n4. Verify again:\n   - `gh auth status --hostname github.com`\n\nIf auth fails, stop and report the exact terminal output.\n\n---\n\n## Step 4: Initialize git in the OpenClaw workspace and connect\u002Fcreate the repo\n\nWorkspace dir (where you store SOUL.md, AGENTS.md, etc.):\n\n- Example (path might be different on your environment): `WORKSPACE_DIR=\"$HOME\u002F.openclaw\u002Fworkspace\"`\n\n1. Ensure the workspace exists:\n   - `mkdir -p \"$WORKSPACE_DIR\"`\n   - `cd \"$WORKSPACE_DIR\"`\n\n2. Initialize repo if needed:\n   - If `.git` does not exist: `git init`\n   - `git branch -M main`\n\n3. Configure a deterministic commit identity (local-only):\n   - `git config user.name \"gitclaw.ai\"`\n   - `git config user.email \"gitclaw-bot@users.noreply.github.com\"`\n\n4. Determine the authenticated GitHub username (owner):\n   - `OWNER=\"$(gh api user --jq .login)\"`\n   - (Do not print unless debugging is needed)\n\n5. Repo name and visibility:\n   - `REPO=\"\u003Crepo name from user>\"`\n   - Visibility:\n     - `public` => `--public`\n     - `private` => `--private`\n\n6. Ensure there is at least one commit (required for first push\u002Fcron):\n   - Create a tiny marker file if needed:\n     - `test -f .gitclaw.keep || printf \"gitclaw initialized: %s\\n\" \"$(date -u '+%Y-%m-%dT%H:%M:%SZ')\" > .gitclaw.keep`\n   - `git add -A`\n   - `git commit -m \"gitclaw: initial backup\" || true`\n\n7. Create or reuse the target repo:\n   - If it exists:\n     - `gh repo view \"$OWNER\u002F$REPO\" >\u002Fdev\u002Fnull 2>&1`\n     - Set remote:\n       - `REMOTE_URL=\"https:\u002F\u002Fgithub.com\u002F$OWNER\u002F$REPO.git\"`\n       - If origin exists: `git remote set-url origin \"$REMOTE_URL\"`\n       - Else: `git remote add origin \"$REMOTE_URL\"`\n     - Try to fast-forward sync (avoid overwriting remote history):\n       - `git fetch origin main || true`\n       - `git merge --ff-only origin\u002Fmain || true`\n   - If it does NOT exist:\n     - Create it non-interactively and connect it:\n       - Public:\n         - `gh repo create \"$REPO\" --public  --confirm`\n       - Private:\n         - `gh repo create \"$REPO\" --private --confirm`\n     - Set remote:\n       - `REMOTE_URL=\"https:\u002F\u002Fgithub.com\u002F$OWNER\u002F$REPO.git\"`\n       - `git remote add origin \"$REMOTE_URL\" || git remote set-url origin \"$REMOTE_URL\"`\n\n8. Initial push:\n   - `git push -u origin main`\n\nIf push fails due to conflicts or non-fast-forward:\n\n- Do NOT force-push automatically.\n- Report the exact error and stop (user decision required).\n\n---\n\n## Step 5: Install deterministic backup script (NO AI \u002F NO heartbeat)\n\nCreate a folder outside the workspace:\n\n- `mkdir -p \"$HOME\u002F.openclaw\u002Fgitclaw\"`\n\nCreate this script EXACTLY:\n\nPath:\n\n- `$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh`\n\nContents:\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n\n# GitClaw deterministic backup (no AI)\nexport PATH=\"\u002Fusr\u002Flocal\u002Fbin:\u002Fopt\u002Fhomebrew\u002Fbin:\u002Fusr\u002Fbin:\u002Fbin:$PATH\"\n\nWORKSPACE_DIR=\"${HOME}\u002F.openclaw\u002Fworkspace\"\nSTATE_DIR=\"${HOME}\u002F.openclaw\u002Fgitclaw\"\nLOG_FILE=\"${STATE_DIR}\u002Fbackup.log\"\nLOCK_DIR=\"${STATE_DIR}\u002Flock\"\n\nmkdir -p \"${STATE_DIR}\"\n\ntimestamp() { date -u '+%Y-%m-%dT%H:%M:%SZ'; }\n\n# Simple lock to prevent overlapping runs\nif ! mkdir \"${LOCK_DIR}\" 2>\u002Fdev\u002Fnull; then\n  echo \"$(timestamp) Skip: already running.\" >> \"${LOG_FILE}\"\n  exit 0\nfi\ntrap 'rmdir \"${LOCK_DIR}\" >\u002Fdev\u002Fnull 2>&1 || true' EXIT\n\nif ! command -v git >\u002Fdev\u002Fnull 2>&1; then\n  echo \"$(timestamp) ERROR: git not found on PATH. Install git first.\" >> \"${LOG_FILE}\"\n  exit 2\nfi\n\nif [ ! -d \"${WORKSPACE_DIR}\u002F.git\" ]; then\n  echo \"$(timestamp) ERROR: ${WORKSPACE_DIR} is not a git repo. Run GitClaw setup first.\" >> \"${LOG_FILE}\"\n  exit 3\nfi\n\ncd \"${WORKSPACE_DIR}\"\n\n# Stage everything\ngit add -A\n\n# If nothing staged, exit quietly\nif git diff --cached --quiet; then\n  echo \"$(timestamp) No changes.\" >> \"${LOG_FILE}\"\n  exit 0\nfi\n\n# Commit + push\ngit commit -m \"gitclaw backup: $(timestamp)\" >> \"${LOG_FILE}\" 2>&1\ngit push origin main >> \"${LOG_FILE}\" 2>&1\n\necho \"$(timestamp) Backup OK.\" >> \"${LOG_FILE}\"\n```\n\nWrite the script to:\n\n- `$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh`\n\nThen:\n\n- `chmod +x \"$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh\"`\n\n---\n\n## Step 6: Configure crontab (idempotent)\n\nDefault schedule: hourly (`0 * * * *`). If user provided a different frequency, convert it to a cron expression.\n\n1. Define:\n\n- `CRON_CMD=\"$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh\"`\n- `CRON_LINE=\"0 * * * * $CRON_CMD\"`\n\n2. Install without duplicates:\n\n- `crontab -l 2>\u002Fdev\u002Fnull | grep -F \"$CRON_CMD\" >\u002Fdev\u002Fnull`\n- If not found, append:\n  - `(crontab -l 2>\u002Fdev\u002Fnull; echo \"$CRON_LINE\") | crontab -`\n\n3. Confirm:\n\n- `crontab -l | grep -F \"$CRON_CMD\"`\n\n---\n\n## Step 7: Final validation\n\n1. Run once:\n\n- `$HOME\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh`\n\n2. Show the log:\n\n- `tail -n 50 \"$HOME\u002F.openclaw\u002Fgitclaw\u002Fbackup.log\" || true`\n\n3. Tell the user:\n\n- Repo: `https:\u002F\u002Fgithub.com\u002F$OWNER\u002F$REPO`\n- Schedule: hourly (or the chosen cadence)\n- Script path: `~\u002F.openclaw\u002Fgitclaw\u002Fauto_backup.sh`\n",{"name":5,"homepage":40,"metadata":41,"description":7},"https:\u002F\u002Fgitclaw.ai",{"openclaw":42},{"emoji":43,"homepage":40},"?","master","8ec37df6d71fb664ea19d32c079e7d3ff931a8e0","skills\u002Fops\u002Fgitclaw",3,"https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit","https:\u002F\u002Fweblyfe.ai","https:\u002F\u002Fgithub.com\u002FS3YED","2026-08-27 01:54:02",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add S3YED\u002Fappie-kit --skill gitclaw",{"tool":58,"command":59},"bunx","bunx skills add S3YED\u002Fappie-kit --skill gitclaw",{"tool":61,"command":62},"pnpm","pnpm dlx skills add S3YED\u002Fappie-kit --skill gitclaw","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fops\u002Fgitclaw\u002FSKILL.md",true,[66],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},".clawhub\u002Forigin.json","REFERENCE","参考文档",139,"https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fops\u002Fgitclaw\u002F.clawhub\u002Forigin.json",[73,98,125,149,176,199],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":35},"01M6JFD4M6N4DSGC7TXEJ5R3J2","ai-music","AI music generation and audio tools: HeartMuLa lyrics-to-music generation, songwriting craft (+ Suno prompts), and audio spectrogram\u002Ffeature visualization.","https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fwethlete\u002Fai-music\u002FSKILL.md",[],[80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],"music","ai music","humanizer","visualization","Tools","Audio","hermes","hermes agent","songwriting","suno","lyrics","prompts","heartmula","craft","generation","feature","ai music generation","music generation",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":35},"01M6JFCZE4XNFQFMNZDHKHT5V5","agentic-webdesign-design-system-ingestion","Use v0 Design Systems 2.0, Bolt Design System Agents, or Lovable to generate production UI from a client's real design system components — not generic Tailwind. Use when building a client website where brand consistency matters.","https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-design\u002Fagentic-webdesign-design-system-ingestion\u002FSKILL.md",[],[105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124],"design","agentic","design system","system","ingestion","webdesign","agentic webdesign design system ingestion","components","generate","design systems","website","ui","Tailwind","bolt","lovable","v0","design-system","wed","design system components","appie",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":35},"01M6JFCVPX3913CFAS6QQJ33ZB","agentic-webdesign-agent-elements","Use 21st.dev Agent Elements — 25 shadcn\u002Fui components purpose-built for AI agent UIs. Tool cards (Bash, Edit, Search, Plan, Subagent, MCP), chat, input, streaming. Open source, shadcn-registry install, no runtime lock-in.","https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-design\u002Fagentic-webdesign-agent-elements\u002FSKILL.md",[],[106,132,110,133,134,135,112,136,137,138,139,140,141,142,143,144,145,146,147,148],"elements","agentic webdesign agent elements","MCP","ai agent","registry","search","streaming","open source","open","Bash","plan","subagent","edit","install","input","lock","source",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":35},"01M6JFCQC7H65M9QJ6TRE71BS1","vercel-deployment","Deploy static sites and frontends to Vercel — handles both CLI and REST API paths, including the CLI token sanitization workaround.","https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fsoftware-development\u002Fvercel-deployment\u002FSKILL.md",[],[156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175],"deployment","vercel deployment","vercel","macos","cli","linux","windows","deploy","vercel deploy","REST","api","site","deploy to vercel","token","rest api","host","sites","paths","sanitization","static site",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":35},"01M6JFCM4SMTXBM5A01BK2YQG1","software-quality-workflows","Umbrella workflow for TDD, debugging, code simplification, spikes, pre-commit review, and debugger-assisted investigation.","https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fsoftware-development\u002Fsoftware-quality-workflows\u002FSKILL.md",[],[183,184,185,186,187,188,189,33,190,191,192,193,194,195,196,197,198],"workflows","quality","software","software quality workflows","review","tdd","workflow","debugging","code","debugger","pre-commit","investigation","code simplification","user","simplification","for",{"skillNo":200,"name":201,"nameZh":6,"description":202,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":203,"categories":204,"keywords":205,"publishedAt":35},"01M6JFCGD0M6CEATY01W7YN6DB","react-component-refactoring","Safely refactor large React components into smaller, maintainable pieces using proven patterns","https:\u002F\u002Fgithub.com\u002FS3YED\u002Fappie-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fsoftware-development\u002Freact-component-refactoring\u002FSKILL.md",[],[206,207,208,209,210,211,212,213,159,214,215,112,216,162,217,191,218,219,220,221],"react","component","refactoring","component refactoring","react component","react component refactoring","frontend","writing","safe","typescript","react components","modular","refactor","simplify","patterns","test-driven-development"]