[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FX7HB50ZXH23HF7WTTTPW0":3,"skill-same:01M6FX7HB50ZXH23HF7WTTTPW0":71},{"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":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M6FX7HB50ZXH23HF7WTTTPW0","gitclaw",null,"Back up the OpenClaw agent workspace to a GitHub repo and keep it synced via a cron-driven commit\u002Fpush script.","kbarbel640-del\u002Fskills","kbarbel640-del","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F255315490?v=4","01M6CJPPQGCCESXMG3K7BBGQ5J","01M6CJPPX2PB2BCZERFVM2C2B3",1,"MIT","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmarian2js\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},"?","main","e7e336ac628c3e3bd771aff1aaa469c93778f94a","skills\u002Fmarian2js\u002Fgitclaw",0,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del","2026-08-23 22:39:37",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add kbarbel640-del\u002Fskills --skill gitclaw",{"tool":57,"command":58},"bunx","bunx skills add kbarbel640-del\u002Fskills --skill gitclaw",{"tool":60,"command":61},"pnpm","pnpm dlx skills add kbarbel640-del\u002Fskills --skill gitclaw","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmarian2js\u002Fgitclaw\u002FSKILL.md",true,[65],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"_meta.json","REFERENCE","参考文档",269,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmarian2js\u002Fgitclaw\u002F_meta.json",[72,102,129,149,155,175],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":83,"publishedAt":35},"01M6G8J55967D6281ACMKAKTEQ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[78],{"categoryNo":79,"categoryName":80,"taxonomyType":81,"taxonomyTypeDesc":82},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,31,100,101],"crowd prompting","prompting","api","with","tokens","domain","world","prompts","operations","instructions","text","tool","system","improve","productivity","marketplace","content","ai agents",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":113,"publishedAt":35},"01M6G8J0PKPAYVET6BWE8W4C26","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[108],{"categoryNo":109,"categoryName":110,"taxonomyType":111,"taxonomyTypeDesc":112},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[114,86,115,116,117,28,118,119,120,121,26,122,123,124,125,126,127,91,128],"dilemm ai","arena","analyze","browser","create","automation","browser automation","bot","design","strategy","headless","compete","submit","matchmaking","use",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":138,"publishedAt":35},"01M6G8HWAF3K9SW7NP3Z83CPJ6","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, or submitting paper reviews via API at http:\u002F\u002F150.158.152.82:8000.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Fweak-accept\u002FSKILL.md",[135],{"categoryNo":136,"categoryName":137,"taxonomyType":111,"taxonomyTypeDesc":112},"01JBSEEDCAT000000000000021","资料检索与研究",[139,140,141,142,143,144,145,87,146,126,128,147,86,148,22],"arxiv paper reviews","reviews","arxiv","paper","crawler","papers","comments","fetch","read","http",{"skillNo":150,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":154,"publishedAt":35},"01M6G8HQJ7N7WMY6YV7D7SSJ16","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[153],{"categoryNo":136,"categoryName":137,"taxonomyType":111,"taxonomyTypeDesc":112},[142,141,140,139,22,144,145,87,143,126,128,146,147,86,148],{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":35},"01M6G8HM95Y64JNVFC2HN4E2BG","git-summary","Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzweack\u002Fgit-summary\u002FSKILL.md",[],[162,163,164,165,166,167,168,169,170,171,172,173,174],"git","summary","git summary","commits","repository","win32","status","linux","contributors","true","quick","get","branches",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":185,"publishedAt":35},"01M6G8HGEGF05CNEJCGVYFSC4R","agent-constitution","Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fztsalexey\u002Fagent-constitution\u002FSKILL.md",[181,182],{"categoryNo":109,"categoryName":110,"taxonomyType":111,"taxonomyTypeDesc":112},{"categoryNo":183,"categoryName":184,"taxonomyType":81,"taxonomyTypeDesc":82},"01JBSEEDCAT000000000000037","律师与法务",[186,187,188,189,87,190,191,44,192,147,193,194,195,196,197,31,198,199,34],"agent constitution","constitution","contracts","tree","query","base","log","check","Rules","projects","compliance","actions","state","governance"]