{
  "schemaVersion": "1.0",
  "item": {
    "slug": "safe-update",
    "name": "safe-update",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/HackSing/safe-update",
    "canonicalUrl": "https://clawhub.ai/HackSing/safe-update",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/safe-update",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=safe-update",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/update.sh"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/safe-update"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/safe-update",
    "agentPageUrl": "https://openagent3.xyz/skills/safe-update/agent",
    "manifestUrl": "https://openagent3.xyz/skills/safe-update/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/safe-update/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Safe Update",
        "body": "Update OpenClaw from source to the latest version while preserving local changes."
      },
      {
        "title": "⚠️ Important Warnings",
        "body": "This script performs git rebase and git push --force - may lose local changes if not properly committed\nUses npm i -g . for global installation - may require sudo\nUses systemctl --user restart - will restart the OpenClaw service\nBackup your config before running! (see below)"
      },
      {
        "title": "Requirements",
        "body": "Required binaries (must be installed):\n\ngit\nnpm / node\nsystemctl (for restarting gateway)"
      },
      {
        "title": "Environment Variables (optional)",
        "body": "# Set custom project path\nexport OPENCLAW_PROJECT_DIR=\"/path/to/openclaw\"\n\n# Set custom branch (default: main)\nexport OPENCLAW_BRANCH=\"your-feature-branch\"\n\n# Enable dry-run mode (no actual changes)\nexport DRY_RUN=\"true\""
      },
      {
        "title": "Or Pass as Arguments",
        "body": "./update.sh --dir /path/to/openclaw --branch your-branch"
      },
      {
        "title": "Step 1: Analyze Current State (Must Run First)",
        "body": "Before executing any update, check:\n\nWhether the current branch has uncommitted changes\nWhether the current branch has local modifications\nWhether upstream has new commits\nRecommend the most appropriate update strategy based on the situation\n\nRecommended Strategy:\n\nScenarioRecommended MethodRationaleUncommitted local changesCommit/stash first, then mergeSafe, no lost changesOnly clean local commitsmerge or rebasemerge is safer, rebase keeps history cleanPreparing a PRrebase recommendedKeeps history tidyRoutine dev updatemerge recommendedSimple, less error-prone"
      },
      {
        "title": "Step 2: Ask User for Confirmation",
        "body": "After presenting the recommended options, you must wait for user confirmation before executing."
      },
      {
        "title": "Step 3: Execute Update",
        "body": "# 1. Enter project directory\ncd \"${OPENCLAW_PROJECT_DIR:-$HOME/projects/openclaw}\"\n\n# 2. Backup config files (good practice before update!)\necho \"=== Backing up config files ===\"\nmkdir -p ~/.openclaw/backups\nBACKUP_SUFFIX=$(date +%Y%m%d-%H%M%S)\n\n# Backup main config\ncp ~/.openclaw/openclaw.json ~/.openclaw/backups/openclaw.json.bak.$BACKUP_SUFFIX\necho \"✅ Backed up: openclaw.json\"\n\n# Backup auth profiles (if exists)\nif [ -f ~/.openclaw/agents/main/agent/auth-profiles.json ]; then\n  cp ~/.openclaw/agents/main/agent/auth-profiles.json \\\n     ~/.openclaw/backups/auth-profiles.json.bak.$BACKUP_SUFFIX\n  echo \"✅ Backed up: auth-profiles.json\"\nfi\n\necho \"💡 Backups saved to: ~/.openclaw/backups/\"\necho \"\"\n\n# 3. Add upstream repository (if not added)\ngit remote add upstream https://github.com/openclaw/openclaw.git 2>/dev/null || true\n\n# 4. Fetch upstream changes\ngit fetch upstream\n\n# 5. Update target branch (use merge or rebase based on user's choice)\ngit checkout $BRANCH\n# merge: git merge upstream/$BRANCH\n# rebase: git rebase upstream/$BRANCH\n\n# 6. View changelog\necho \"=== Full Changelog ===\"\nCURRENT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo \"v$(node -e 'console.log(require(\"./package.json\").version)')\")\necho \"Current version: $CURRENT_TAG\"\necho \"\"\n\n# 7. Build and install\nnpm run build\nnpm i -g .\n\n# 8. Reinstall systemd service (to update version number)\necho \"=== Reinstalling Gateway service ===\"\nopenclaw daemon install --force\n\n# 9. Check version\nNEW_VERSION=$(openclaw --version)\necho \"✅ Update complete! New version: $NEW_VERSION\"\necho \"\"\n\n# 10. Ask user whether to restart\necho \"=== Gateway needs restart to apply updates ===\"\necho \"Confirm restart? (y/N)\""
      },
      {
        "title": "Quick Script",
        "body": "Run scripts/update.sh to automatically complete all steps above."
      },
      {
        "title": "Command Line Options",
        "body": "./update.sh [OPTIONS]\n\nOptions:\n  --dir PATH       OpenClaw project directory (default: $HOME/projects/openclaw)\n  --branch NAME    Git branch to update (default: main)\n  --mode MODE      Update mode: merge or rebase (if not specified, will analyze and recommend)\n  --dry-run       Show what would be done without executing\n  --help          Show this help message"
      },
      {
        "title": "Examples",
        "body": "# Update with defaults (will analyze and recommend)\n./update.sh\n\n# Update specific branch\n./update.sh --branch feat/my-branch\n\n# Force merge mode\n./update.sh --mode merge\n\n# Force rebase mode\n./update.sh --mode rebase\n\n# Dry run (preview only)\n./update.sh --dry-run\n\n# Custom project path\n./update.sh --dir /opt/openclaw --branch main"
      },
      {
        "title": "Notes",
        "body": "Rebase may cause conflicts - if conflicts occur, resolve manually and continue\nForce push - after rebase, if pushing to fork, use git push --force\nService reinstall - will update version in systemd unit file\nUser confirms restart - Gateway will not restart until you confirm\nBackup first - always backup before updating!"
      },
      {
        "title": "Git Conflicts During Rebase",
        "body": "# Resolve conflicts manually, then:\ngit add .\ngit rebase --continue\n# Continue with build steps"
      },
      {
        "title": "Build Fails",
        "body": "# Clean and retry:\nrm -rf node_modules dist\nnpm install\nnpm run build"
      },
      {
        "title": "Gateway Won't Start",
        "body": "# Check status:\nsystemctl --user status openclaw-gateway\n\n# View logs:\njournalctl --user -u openclaw-gateway -n 50"
      }
    ],
    "body": "Safe Update\n\nUpdate OpenClaw from source to the latest version while preserving local changes.\n\n⚠️ Important Warnings\nThis script performs git rebase and git push --force - may lose local changes if not properly committed\nUses npm i -g . for global installation - may require sudo\nUses systemctl --user restart - will restart the OpenClaw service\nBackup your config before running! (see below)\nRequirements\n\nRequired binaries (must be installed):\n\ngit\nnpm / node\nsystemctl (for restarting gateway)\nConfiguration\nEnvironment Variables (optional)\n# Set custom project path\nexport OPENCLAW_PROJECT_DIR=\"/path/to/openclaw\"\n\n# Set custom branch (default: main)\nexport OPENCLAW_BRANCH=\"your-feature-branch\"\n\n# Enable dry-run mode (no actual changes)\nexport DRY_RUN=\"true\"\n\nOr Pass as Arguments\n./update.sh --dir /path/to/openclaw --branch your-branch\n\nWorkflow\nStep 1: Analyze Current State (Must Run First)\n\nBefore executing any update, check:\n\nWhether the current branch has uncommitted changes\nWhether the current branch has local modifications\nWhether upstream has new commits\nRecommend the most appropriate update strategy based on the situation\n\nRecommended Strategy:\n\nScenario\tRecommended Method\tRationale\nUncommitted local changes\tCommit/stash first, then merge\tSafe, no lost changes\nOnly clean local commits\tmerge or rebase\tmerge is safer, rebase keeps history clean\nPreparing a PR\trebase recommended\tKeeps history tidy\nRoutine dev update\tmerge recommended\tSimple, less error-prone\nStep 2: Ask User for Confirmation\n\nAfter presenting the recommended options, you must wait for user confirmation before executing.\n\nStep 3: Execute Update\n# 1. Enter project directory\ncd \"${OPENCLAW_PROJECT_DIR:-$HOME/projects/openclaw}\"\n\n# 2. Backup config files (good practice before update!)\necho \"=== Backing up config files ===\"\nmkdir -p ~/.openclaw/backups\nBACKUP_SUFFIX=$(date +%Y%m%d-%H%M%S)\n\n# Backup main config\ncp ~/.openclaw/openclaw.json ~/.openclaw/backups/openclaw.json.bak.$BACKUP_SUFFIX\necho \"✅ Backed up: openclaw.json\"\n\n# Backup auth profiles (if exists)\nif [ -f ~/.openclaw/agents/main/agent/auth-profiles.json ]; then\n  cp ~/.openclaw/agents/main/agent/auth-profiles.json \\\n     ~/.openclaw/backups/auth-profiles.json.bak.$BACKUP_SUFFIX\n  echo \"✅ Backed up: auth-profiles.json\"\nfi\n\necho \"💡 Backups saved to: ~/.openclaw/backups/\"\necho \"\"\n\n# 3. Add upstream repository (if not added)\ngit remote add upstream https://github.com/openclaw/openclaw.git 2>/dev/null || true\n\n# 4. Fetch upstream changes\ngit fetch upstream\n\n# 5. Update target branch (use merge or rebase based on user's choice)\ngit checkout $BRANCH\n# merge: git merge upstream/$BRANCH\n# rebase: git rebase upstream/$BRANCH\n\n# 6. View changelog\necho \"=== Full Changelog ===\"\nCURRENT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo \"v$(node -e 'console.log(require(\"./package.json\").version)')\")\necho \"Current version: $CURRENT_TAG\"\necho \"\"\n\n# 7. Build and install\nnpm run build\nnpm i -g .\n\n# 8. Reinstall systemd service (to update version number)\necho \"=== Reinstalling Gateway service ===\"\nopenclaw daemon install --force\n\n# 9. Check version\nNEW_VERSION=$(openclaw --version)\necho \"✅ Update complete! New version: $NEW_VERSION\"\necho \"\"\n\n# 10. Ask user whether to restart\necho \"=== Gateway needs restart to apply updates ===\"\necho \"Confirm restart? (y/N)\"\n\nQuick Script\n\nRun scripts/update.sh to automatically complete all steps above.\n\nCommand Line Options\n./update.sh [OPTIONS]\n\nOptions:\n  --dir PATH       OpenClaw project directory (default: $HOME/projects/openclaw)\n  --branch NAME    Git branch to update (default: main)\n  --mode MODE      Update mode: merge or rebase (if not specified, will analyze and recommend)\n  --dry-run       Show what would be done without executing\n  --help          Show this help message\n\nExamples\n# Update with defaults (will analyze and recommend)\n./update.sh\n\n# Update specific branch\n./update.sh --branch feat/my-branch\n\n# Force merge mode\n./update.sh --mode merge\n\n# Force rebase mode\n./update.sh --mode rebase\n\n# Dry run (preview only)\n./update.sh --dry-run\n\n# Custom project path\n./update.sh --dir /opt/openclaw --branch main\n\nNotes\nRebase may cause conflicts - if conflicts occur, resolve manually and continue\nForce push - after rebase, if pushing to fork, use git push --force\nService reinstall - will update version in systemd unit file\nUser confirms restart - Gateway will not restart until you confirm\nBackup first - always backup before updating!\nTroubleshooting\nGit Conflicts During Rebase\n# Resolve conflicts manually, then:\ngit add .\ngit rebase --continue\n# Continue with build steps\n\nBuild Fails\n# Clean and retry:\nrm -rf node_modules dist\nnpm install\nnpm run build\n\nGateway Won't Start\n# Check status:\nsystemctl --user status openclaw-gateway\n\n# View logs:\njournalctl --user -u openclaw-gateway -n 50"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/HackSing/safe-update",
    "publisherUrl": "https://clawhub.ai/HackSing/safe-update",
    "owner": "HackSing",
    "version": "1.0.6",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/safe-update",
    "downloadUrl": "https://openagent3.xyz/downloads/safe-update",
    "agentUrl": "https://openagent3.xyz/skills/safe-update/agent",
    "manifestUrl": "https://openagent3.xyz/skills/safe-update/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/safe-update/agent.md"
  }
}