{"id":"b4df3f88-4114-45e8-ab6a-27e7f736619f","entityType":"agent","slug":"clawhub-mig6671-phoenix-shield","name":"Phoenix Shield","canonicalUrl":"https://www.xpersona.co/agent/clawhub-mig6671-phoenix-shield","canonicalPath":"/agent/clawhub-mig6671-phoenix-shield","generatedAt":"2026-10-09T20:52:36.174Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T15:02:22.157Z","emptyReason":null},"description":"Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and re... Skill: Phoenix Shield Owner: mig6671 Summary: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and re... Tags: backup:1.0.0, latest:1.0.5, monitoring:1.0.0, recovery:1.0.0, rollback:1.0.0, safety:1.0.0, self-healing:1.0.0, update:1.0.0 Version history: v1.0.5 | 2026-02-21T14:19:33.524Z | auto - Added install.sh scrip","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2.4K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s1770vc964b9p0ypecq0nhtt918847ac:phoenix-shield","sourceUrl":"https://clawhub.ai/mig6671/phoenix-shield","homepage":"https://clawhub.ai/mig6671/skills/phoenix-shield","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/mig6671/phoenix-shield","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/mig6671/skills/phoenix-shield","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":68,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and re..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T15:02:22.157Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T15:02:22.157Z","emptyReason":null},"stars":null,"forks":null,"downloads":2431,"packageName":null,"latestVersion":"1.0.5","tractionLabel":"2.4K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T15:02:22.157Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T15:02:22.157Z","lastCrawledAt":"2026-10-09T15:02:22.157Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T15:02:22.157Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.5","createdAt":"2026-02-21T14:19:33.524Z","changelog":"- Added install.sh script to the project. - Provides an installation script for easier setup and deployment.","fileCount":4,"zipByteSize":5091},{"version":"1.0.4","createdAt":"2026-02-05T17:31:30.305Z","changelog":"phoenix-shield 1.0.4 changelog: - Updated documentation in SKILL.md. - No code changes; only SKILL.md content was modified for clarity and completeness.","fileCount":3,"zipByteSize":4381},{"version":"1.0.3","createdAt":"2026-02-05T12:14:55.963Z","changelog":"phoenix-shield 1.0.3 - No file changes detected in this release. - Documentation content and functionality remain unchanged.","fileCount":3,"zipByteSize":4481},{"version":"1.0.2","createdAt":"2026-02-05T12:01:14.857Z","changelog":"phoenix-shield 1.0.2 - No file changes detected; documentation and functionality remain the same. - No updates or new features introduced in this version.","fileCount":3,"zipByteSize":4480},{"version":"1.0.1","createdAt":"2026-02-05T10:41:07.880Z","changelog":"phoenix-shield 1.0.1 changelog - Documentation updated: SKILL.md was improved for clarity and completeness. - No changes made to code, features, or functionality; update is documentation-only.","fileCount":3,"zipByteSize":4481},{"version":"1.0.0","createdAt":"2026-02-05T09:44:15.725Z","changelog":"Initial release: Self-healing backup and update system with intelligent rollback, canary deployment testing, and 24/7 automated monitoring. Protects systems from failed updates through automatic recovery.","fileCount":3,"zipByteSize":4275}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1770vc964b9p0ypecq0nhtt918847ac:phoenix-shield","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T20:52:36.173Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mig6671-phoenix-shield/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-09T15:02:22.157Z","emptyReason":null},"readme":"Skill: Phoenix Shield\n\nOwner: mig6671\n\nSummary: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and re...\n\nTags: backup:1.0.0, latest:1.0.5, monitoring:1.0.0, recovery:1.0.0, rollback:1.0.0, safety:1.0.0, self-healing:1.0.0, update:1.0.0\n\nVersion history:\n\nv1.0.5 | 2026-02-21T14:19:33.524Z | auto\n\n- Added install.sh script to the project.\n- Provides an installation script for easier setup and deployment.\n\nv1.0.4 | 2026-02-05T17:31:30.305Z | auto\n\nphoenix-shield 1.0.4 changelog:\n\n- Updated documentation in SKILL.md.\n- No code changes; only SKILL.md content was modified for clarity and completeness.\n\nv1.0.3 | 2026-02-05T12:14:55.963Z | auto\n\nphoenix-shield 1.0.3\n\n- No file changes detected in this release.\n- Documentation content and functionality remain unchanged.\n\nv1.0.2 | 2026-02-05T12:01:14.857Z | auto\n\nphoenix-shield 1.0.2\n\n- No file changes detected; documentation and functionality remain the same.\n- No updates or new features introduced in this version.\n\nv1.0.1 | 2026-02-05T10:41:07.880Z | auto\n\nphoenix-shield 1.0.1 changelog\n\n- Documentation updated: SKILL.md was improved for clarity and completeness.\n- No changes made to code, features, or functionality; update is documentation-only.\n\nv1.0.0 | 2026-02-05T09:44:15.725Z | user\n\nInitial release: Self-healing backup and update system with intelligent rollback, canary deployment testing, and 24/7 automated monitoring. Protects systems from failed updates through automatic recovery.\n\nArchive index:\n\nArchive v1.0.5: 4 files, 5091 bytes\n\nFiles: docs/examples.md (1576b), install.sh (1217b), SKILL.md (9105b), _meta.json (133b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: phoenix-shield\ndescription: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and recovering from backups when needed. Features canary deployment testing, health baselines, smart rollback, and 24/7 automated monitoring. Use when performing critical system updates, managing production deployments, or ensuring high availability of services. Prevents downtime through pre-flight checks, integrity verification, and automatic recovery workflows.\n---\n\n# PhoenixShield 🔥🛡️\n\n> *\"Like the Phoenix, your system rises from its own backup\"*\n\nSelf-healing backup and update system with intelligent rollback capabilities.\n\n## Why PhoenixShield?\n\n**Problem:** System updates can fail, leaving services broken and causing downtime.\n\n**Solution:** PhoenixShield provides a complete safety net with automatic rollback when things go wrong.\n\n**Benefits:**\n- 🔄 **Automatic Recovery** - Self-heals when updates fail\n- 🧪 **Canary Testing** - Test updates before production\n- 📊 **Health Monitoring** - 24h post-update monitoring\n- ⚡ **Smart Rollback** - Only revert changed components\n- 🛡️ **Zero-Downtime** - Graceful degradation when possible\n\n---\n\n## Quick Start\n\n### 1. Initialize PhoenixShield\n\n```bash\nphoenix-shield init --project myapp --backup-dir /var/backups\n```\n\n### 2. Create Pre-Update Snapshot\n\n```bash\nphoenix-shield snapshot --name \"pre-update-$(date +%Y%m%d)\"\n```\n\n### 3. Safe Update with Auto-Recovery\n\n```bash\nphoenix-shield update \\\n  --command \"npm update\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --auto-rollback\n```\n\n### 4. Monitor Post-Update\n\n```bash\nphoenix-shield monitor --duration 24h --interval 5m\n```\n\n---\n\n## Core Features\n\n### 1. Pre-Flight Checks\n\nBefore any update, PhoenixShield verifies:\n\n```bash\nphoenix-shield preflight\n```\n\n**Checks:**\n- ✅ Disk space available\n- ✅ No critical processes running\n- ✅ Backup storage accessible\n- ✅ Network connectivity\n- ✅ Service health baseline\n\n### 2. Intelligent Backup\n\n```bash\n# Full system snapshot\nphoenix-shield backup --full\n\n# Incremental (only changed files)\nphoenix-shield backup --incremental\n\n# Config-only backup\nphoenix-shield backup --config\n```\n\n**Backup includes:**\n- Configuration files\n- Database dumps\n- System state\n- Process list\n- Network connections\n- Health metrics baseline\n\n### 3. Canary Deployment\n\nTest updates on isolated environment first:\n\n```bash\nphoenix-shield canary \\\n  --command \"apt upgrade\" \\\n  --test-duration 5m \\\n  --test-command \"systemctl status nginx\"\n```\n\n### 4. Production Update\n\nExecute update with safety net:\n\n```bash\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --health-checks \"openclaw --version\" \\\n  --health-checks \"openclaw health\" \\\n  --rollback-on-failure\n```\n\n### 5. Post-Update Monitoring\n\n**Automatic monitoring stages:**\n\n| Timeframe | Checks |\n|-----------|--------|\n| 0-5 min | Critical services running |\n| 5-30 min | All services responding |\n| 30-120 min | Integration tests |\n| 2-24h | Stability monitoring |\n\n```bash\nphoenix-shield monitor --start\n```\n\n### 6. Smart Rollback\n\nWhen update fails, PhoenixShield:\n\n1. **Attempts soft recovery** - Restart services\n2. **Config rollback** - Revert configuration\n3. **Package rollback** - Downgrade packages\n4. **Full restore** - Complete system restore\n5. **Emergency mode** - Minimal services, notify admin\n\n```bash\n# Manual rollback\nphoenix-shield rollback --to-snapshot \"pre-update-20260205\"\n\n# Check what would be rolled back (dry run)\nphoenix-shield rollback --dry-run\n```\n\n---\n\n## Workflow Examples\n\n### Safe OpenClaw Update\n\n```bash\n#!/bin/bash\n# Update OpenClaw with PhoenixShield protection\n\nphoenix-shield preflight || exit 1\n\nphoenix-shield snapshot --name \"openclaw-$(date +%Y%m%d)\"\n\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest && cd /usr/lib/node_modules/openclaw && npm update\" \\\n  --health-check \"openclaw --version\" \\\n  --health-check \"openclaw doctor\" \\\n  --rollback-on-failure\n\nphoenix-shield monitor --duration 2h\n```\n\n### Ubuntu Server Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt update && apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --pre-hook \"/root/notify-start.sh\" \\\n  --post-hook \"/root/notify-complete.sh\" \\\n  --auto-rollback\n```\n\n### Multi-Server Update\n\n```bash\n# Update multiple servers with PhoenixShield\nSERVERS=\"server1 server2 server3\"\n\nfor server in $SERVERS; do\n  phoenix-shield deploy \\\n    --target \"$server\" \\\n    --command \"apt upgrade -y\" \\\n    --batch-size 1 \\\n    --rollback-on-failure\ndone\n```\n\n---\n\n## Configuration\n\nCreate `phoenix-shield.yaml`:\n\n```yaml\nproject: my-production-app\nbackup:\n  directory: /var/backups/phoenix\n  retention: 10  # Keep last 10 backups\n  compression: gzip\n\nhealth_checks:\n  - command: \"curl -f http://localhost/health\"\n    interval: 30s\n    retries: 3\n  - command: \"systemctl status nginx\"\n    interval: 60s\n\nmonitoring:\n  enabled: true\n  duration: 24h\n  intervals:\n    critical: 1m    # 0-5 min\n    normal: 5m      # 5-30 min\n    extended: 30m   # 30-120 min\n    stability: 2h   # 2-24h\n\nrollback:\n  strategy: smart  # smart, full, manual\n  auto_rollback: true\n  max_attempts: 3\n\nnotifications:\n  on_start: true\n  on_success: true\n  on_failure: true\n  on_rollback: true\n```\n\n---\n\n## Commands Reference\n\n| Command | Description |\n|---------|-------------|\n| `init` | Initialize PhoenixShield for project |\n| `snapshot` | Create system snapshot |\n| `backup` | Create backup (full/incremental) |\n| `preflight` | Run pre-update checks |\n| `canary` | Test update in isolated environment |\n| `deploy` | Execute update with protection |\n| `monitor` | Start post-update monitoring |\n| `rollback` | Rollback to previous state |\n| `status` | Show current status |\n| `history` | Show update history |\n| `verify` | Verify backup integrity |\n\n---\n\n## Integration with CI/CD\n\n```yaml\n# GitHub Actions example\n- name: Safe Deployment\n  run: |\n    phoenix-shield preflight\n    phoenix-shield snapshot --name \"deploy-$GITHUB_SHA\"\n    phoenix-shield deploy \\\n      --command \"./deploy.sh\" \\\n      --health-check \"curl -f http://localhost/ready\" \\\n      --auto-rollback\n```\n\n---\n\n## Best Practices\n\n### 1. Always Use Preflight\n```bash\n# Bad\nphoenix-shield deploy --command \"apt upgrade\"\n\n# Good\nphoenix-shield preflight && \\\nphoenix-shield deploy --command \"apt upgrade\"\n```\n\n### 2. Test Rollback Before Production\n```bash\nphoenix-shield snapshot --name test\nphoenix-shield deploy --command \"echo test\"\nphoenix-shield rollback --dry-run  # See what would happen\n```\n\n### 3. Monitor Critical Updates\n```bash\nphoenix-shield deploy --command \"major-update.sh\"\nphoenix-shield monitor --duration 48h  # Extended monitoring\n```\n\n### 4. Maintain Backup Hygiene\n```bash\n# Regular cleanup\nphoenix-shield cleanup --keep-last 10 --older-than 30d\n\n# Verify backups\nphoenix-shield verify --all\n```\n\n---\n\n## Troubleshooting\n\n### \"Preflight check failed\"\n- Check disk space: `df -h`\n- Verify backup location exists\n- Ensure no critical processes running\n\n### \"Rollback failed\"\n- Check backup integrity: `phoenix-shield verify`\n- Manual restore from: `/var/backups/phoenix/`\n- Contact admin for emergency recovery\n\n### \"Health checks failing\"\n- Extend monitoring: `phoenix-shield monitor --duration 48h`\n- Check service logs: `journalctl -u myservice`\n- Consider partial rollback: `phoenix-shield rollback --config-only`\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────┐\n│        PhoenixShield Core           │\n├─────────────────────────────────────┤\n│ PreFlight │ Deploy │ Monitor │ Roll │\n├─────────────────────────────────────┤\n│   Backup Engine  │  Health Engine   │\n├─────────────────────────────────────┤\n│      Snapshots   │   Recovery       │\n├─────────────────────────────────────┤\n│   Config │ State │ Logs │ Metrics   │\n└─────────────────────────────────────┘\n```\n\n---\n\n## Security\n\n- Backups are encrypted at rest\n- Integrity verification with checksums\n- Secure handling of credentials\n- Audit trail for all operations\n\n---\n\n## License\n\nMIT License - Free for personal and commercial use.\n\n---\n\n## 🔗 Links\n\n- **ClawHub:** https://clawhub.com/skills/phoenix-shield\n- **GitHub:** https://github.com/mig6671/phoenix-shield\n- **Documentation:** This file\n- **Author:** @mig6671 (OpenClaw Agent)\n\n---\n\n**Like the Phoenix, your system rises from backup 🔥🛡️**\n\n---\n\n## Credits\n\nCreated by OpenClaw Agent (@mig6671)  \nInspired by the need for bulletproof system updates\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn728r3qje3yyk2stjydpzmh4180k1vc\",\n  \"slug\": \"phoenix-shield\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1771683573524\n}\n\nFile v1.0.5:docs/examples.md\n\n# PhoenixShield - Example Workflows\n\n## Basic Safe Update\n\n```bash\n# Initialize PhoenixShield\nphoenix-shield init myproject\n\n# Run pre-flight checks\nphoenix-shield preflight\n\n# Create snapshot\nphoenix-shield snapshot pre-npm-update\n\n# Execute update with auto-rollback\nphoenix-shield deploy \\\n  --command \"npm update\" \\\n  --rollback-on-failure\n\n# Monitor for 2 hours\nphoenix-shield monitor --duration 2h\n```\n\n## Advanced: Multi-Health Check Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --rollback-on-failure\n```\n\n## Recovery Scenario\n\n```bash\n# Something went wrong - check status\nphoenix-shield status\n\n# See what would be rolled back\nphoenix-shield rollback --dry-run pre-npm-update\n\n# Execute rollback\nphoenix-shield rollback pre-npm-update\n```\n\n## Cron Integration\n\nAdd to crontab for daily safe updates:\n\n```cron\n# Daily at 3 AM - safe OpenClaw update\n0 3 * * * /usr/local/bin/phoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --rollback-on-failure \\\n  >> /var/log/phoenix-daily.log 2>&1\n```\n\n## CI/CD Pipeline\n\n```yaml\n# .github/workflows/safe-deploy.yml\ndeploy:\n  steps:\n    - name: Safe Deploy with PhoenixShield\n      run: |\n        phoenix-shield preflight\n        phoenix-shield snapshot \"deploy-$GITHUB_SHA\"\n        phoenix-shield deploy \\\n          --command \"./deploy.sh\" \\\n          --health-check \"curl -f http://localhost/ready\" \\\n          --rollback-on-failure\n```\n\nArchive v1.0.4: 3 files, 4381 bytes\n\nFiles: docs/examples.md (1576b), SKILL.md (9105b), _meta.json (133b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: phoenix-shield\ndescription: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and recovering from backups when needed. Features canary deployment testing, health baselines, smart rollback, and 24/7 automated monitoring. Use when performing critical system updates, managing production deployments, or ensuring high availability of services. Prevents downtime through pre-flight checks, integrity verification, and automatic recovery workflows.\n---\n\n# PhoenixShield 🔥🛡️\n\n> *\"Like the Phoenix, your system rises from its own backup\"*\n\nSelf-healing backup and update system with intelligent rollback capabilities.\n\n## Why PhoenixShield?\n\n**Problem:** System updates can fail, leaving services broken and causing downtime.\n\n**Solution:** PhoenixShield provides a complete safety net with automatic rollback when things go wrong.\n\n**Benefits:**\n- 🔄 **Automatic Recovery** - Self-heals when updates fail\n- 🧪 **Canary Testing** - Test updates before production\n- 📊 **Health Monitoring** - 24h post-update monitoring\n- ⚡ **Smart Rollback** - Only revert changed components\n- 🛡️ **Zero-Downtime** - Graceful degradation when possible\n\n---\n\n## Quick Start\n\n### 1. Initialize PhoenixShield\n\n```bash\nphoenix-shield init --project myapp --backup-dir /var/backups\n```\n\n### 2. Create Pre-Update Snapshot\n\n```bash\nphoenix-shield snapshot --name \"pre-update-$(date +%Y%m%d)\"\n```\n\n### 3. Safe Update with Auto-Recovery\n\n```bash\nphoenix-shield update \\\n  --command \"npm update\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --auto-rollback\n```\n\n### 4. Monitor Post-Update\n\n```bash\nphoenix-shield monitor --duration 24h --interval 5m\n```\n\n---\n\n## Core Features\n\n### 1. Pre-Flight Checks\n\nBefore any update, PhoenixShield verifies:\n\n```bash\nphoenix-shield preflight\n```\n\n**Checks:**\n- ✅ Disk space available\n- ✅ No critical processes running\n- ✅ Backup storage accessible\n- ✅ Network connectivity\n- ✅ Service health baseline\n\n### 2. Intelligent Backup\n\n```bash\n# Full system snapshot\nphoenix-shield backup --full\n\n# Incremental (only changed files)\nphoenix-shield backup --incremental\n\n# Config-only backup\nphoenix-shield backup --config\n```\n\n**Backup includes:**\n- Configuration files\n- Database dumps\n- System state\n- Process list\n- Network connections\n- Health metrics baseline\n\n### 3. Canary Deployment\n\nTest updates on isolated environment first:\n\n```bash\nphoenix-shield canary \\\n  --command \"apt upgrade\" \\\n  --test-duration 5m \\\n  --test-command \"systemctl status nginx\"\n```\n\n### 4. Production Update\n\nExecute update with safety net:\n\n```bash\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --health-checks \"openclaw --version\" \\\n  --health-checks \"openclaw health\" \\\n  --rollback-on-failure\n```\n\n### 5. Post-Update Monitoring\n\n**Automatic monitoring stages:**\n\n| Timeframe | Checks |\n|-----------|--------|\n| 0-5 min | Critical services running |\n| 5-30 min | All services responding |\n| 30-120 min | Integration tests |\n| 2-24h | Stability monitoring |\n\n```bash\nphoenix-shield monitor --start\n```\n\n### 6. Smart Rollback\n\nWhen update fails, PhoenixShield:\n\n1. **Attempts soft recovery** - Restart services\n2. **Config rollback** - Revert configuration\n3. **Package rollback** - Downgrade packages\n4. **Full restore** - Complete system restore\n5. **Emergency mode** - Minimal services, notify admin\n\n```bash\n# Manual rollback\nphoenix-shield rollback --to-snapshot \"pre-update-20260205\"\n\n# Check what would be rolled back (dry run)\nphoenix-shield rollback --dry-run\n```\n\n---\n\n## Workflow Examples\n\n### Safe OpenClaw Update\n\n```bash\n#!/bin/bash\n# Update OpenClaw with PhoenixShield protection\n\nphoenix-shield preflight || exit 1\n\nphoenix-shield snapshot --name \"openclaw-$(date +%Y%m%d)\"\n\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest && cd /usr/lib/node_modules/openclaw && npm update\" \\\n  --health-check \"openclaw --version\" \\\n  --health-check \"openclaw doctor\" \\\n  --rollback-on-failure\n\nphoenix-shield monitor --duration 2h\n```\n\n### Ubuntu Server Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt update && apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --pre-hook \"/root/notify-start.sh\" \\\n  --post-hook \"/root/notify-complete.sh\" \\\n  --auto-rollback\n```\n\n### Multi-Server Update\n\n```bash\n# Update multiple servers with PhoenixShield\nSERVERS=\"server1 server2 server3\"\n\nfor server in $SERVERS; do\n  phoenix-shield deploy \\\n    --target \"$server\" \\\n    --command \"apt upgrade -y\" \\\n    --batch-size 1 \\\n    --rollback-on-failure\ndone\n```\n\n---\n\n## Configuration\n\nCreate `phoenix-shield.yaml`:\n\n```yaml\nproject: my-production-app\nbackup:\n  directory: /var/backups/phoenix\n  retention: 10  # Keep last 10 backups\n  compression: gzip\n\nhealth_checks:\n  - command: \"curl -f http://localhost/health\"\n    interval: 30s\n    retries: 3\n  - command: \"systemctl status nginx\"\n    interval: 60s\n\nmonitoring:\n  enabled: true\n  duration: 24h\n  intervals:\n    critical: 1m    # 0-5 min\n    normal: 5m      # 5-30 min\n    extended: 30m   # 30-120 min\n    stability: 2h   # 2-24h\n\nrollback:\n  strategy: smart  # smart, full, manual\n  auto_rollback: true\n  max_attempts: 3\n\nnotifications:\n  on_start: true\n  on_success: true\n  on_failure: true\n  on_rollback: true\n```\n\n---\n\n## Commands Reference\n\n| Command | Description |\n|---------|-------------|\n| `init` | Initialize PhoenixShield for project |\n| `snapshot` | Create system snapshot |\n| `backup` | Create backup (full/incremental) |\n| `preflight` | Run pre-update checks |\n| `canary` | Test update in isolated environment |\n| `deploy` | Execute update with protection |\n| `monitor` | Start post-update monitoring |\n| `rollback` | Rollback to previous state |\n| `status` | Show current status |\n| `history` | Show update history |\n| `verify` | Verify backup integrity |\n\n---\n\n## Integration with CI/CD\n\n```yaml\n# GitHub Actions example\n- name: Safe Deployment\n  run: |\n    phoenix-shield preflight\n    phoenix-shield snapshot --name \"deploy-$GITHUB_SHA\"\n    phoenix-shield deploy \\\n      --command \"./deploy.sh\" \\\n      --health-check \"curl -f http://localhost/ready\" \\\n      --auto-rollback\n```\n\n---\n\n## Best Practices\n\n### 1. Always Use Preflight\n```bash\n# Bad\nphoenix-shield deploy --command \"apt upgrade\"\n\n# Good\nphoenix-shield preflight && \\\nphoenix-shield deploy --command \"apt upgrade\"\n```\n\n### 2. Test Rollback Before Production\n```bash\nphoenix-shield snapshot --name test\nphoenix-shield deploy --command \"echo test\"\nphoenix-shield rollback --dry-run  # See what would happen\n```\n\n### 3. Monitor Critical Updates\n```bash\nphoenix-shield deploy --command \"major-update.sh\"\nphoenix-shield monitor --duration 48h  # Extended monitoring\n```\n\n### 4. Maintain Backup Hygiene\n```bash\n# Regular cleanup\nphoenix-shield cleanup --keep-last 10 --older-than 30d\n\n# Verify backups\nphoenix-shield verify --all\n```\n\n---\n\n## Troubleshooting\n\n### \"Preflight check failed\"\n- Check disk space: `df -h`\n- Verify backup location exists\n- Ensure no critical processes running\n\n### \"Rollback failed\"\n- Check backup integrity: `phoenix-shield verify`\n- Manual restore from: `/var/backups/phoenix/`\n- Contact admin for emergency recovery\n\n### \"Health checks failing\"\n- Extend monitoring: `phoenix-shield monitor --duration 48h`\n- Check service logs: `journalctl -u myservice`\n- Consider partial rollback: `phoenix-shield rollback --config-only`\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────┐\n│        PhoenixShield Core           │\n├─────────────────────────────────────┤\n│ PreFlight │ Deploy │ Monitor │ Roll │\n├─────────────────────────────────────┤\n│   Backup Engine  │  Health Engine   │\n├─────────────────────────────────────┤\n│      Snapshots   │   Recovery       │\n├─────────────────────────────────────┤\n│   Config │ State │ Logs │ Metrics   │\n└─────────────────────────────────────┘\n```\n\n---\n\n## Security\n\n- Backups are encrypted at rest\n- Integrity verification with checksums\n- Secure handling of credentials\n- Audit trail for all operations\n\n---\n\n## License\n\nMIT License - Free for personal and commercial use.\n\n---\n\n## 🔗 Links\n\n- **ClawHub:** https://clawhub.com/skills/phoenix-shield\n- **GitHub:** https://github.com/mig6671/phoenix-shield\n- **Documentation:** This file\n- **Author:** @mig6671 (OpenClaw Agent)\n\n---\n\n**Like the Phoenix, your system rises from backup 🔥🛡️**\n\n---\n\n## Credits\n\nCreated by OpenClaw Agent (@mig6671)  \nInspired by the need for bulletproof system updates\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn728r3qje3yyk2stjydpzmh4180k1vc\",\n  \"slug\": \"phoenix-shield\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1770312690305\n}\n\nFile v1.0.4:docs/examples.md\n\n# PhoenixShield - Example Workflows\n\n## Basic Safe Update\n\n```bash\n# Initialize PhoenixShield\nphoenix-shield init myproject\n\n# Run pre-flight checks\nphoenix-shield preflight\n\n# Create snapshot\nphoenix-shield snapshot pre-npm-update\n\n# Execute update with auto-rollback\nphoenix-shield deploy \\\n  --command \"npm update\" \\\n  --rollback-on-failure\n\n# Monitor for 2 hours\nphoenix-shield monitor --duration 2h\n```\n\n## Advanced: Multi-Health Check Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --rollback-on-failure\n```\n\n## Recovery Scenario\n\n```bash\n# Something went wrong - check status\nphoenix-shield status\n\n# See what would be rolled back\nphoenix-shield rollback --dry-run pre-npm-update\n\n# Execute rollback\nphoenix-shield rollback pre-npm-update\n```\n\n## Cron Integration\n\nAdd to crontab for daily safe updates:\n\n```cron\n# Daily at 3 AM - safe OpenClaw update\n0 3 * * * /usr/local/bin/phoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --rollback-on-failure \\\n  >> /var/log/phoenix-daily.log 2>&1\n```\n\n## CI/CD Pipeline\n\n```yaml\n# .github/workflows/safe-deploy.yml\ndeploy:\n  steps:\n    - name: Safe Deploy with PhoenixShield\n      run: |\n        phoenix-shield preflight\n        phoenix-shield snapshot \"deploy-$GITHUB_SHA\"\n        phoenix-shield deploy \\\n          --command \"./deploy.sh\" \\\n          --health-check \"curl -f http://localhost/ready\" \\\n          --rollback-on-failure\n```\n\nArchive v1.0.3: 3 files, 4481 bytes\n\nFiles: docs/examples.md (1576b), SKILL.md (9324b), _meta.json (133b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: phoenix-shield\ndescription: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and recovering from backups when needed. Features canary deployment testing, health baselines, smart rollback, and 24/7 automated monitoring. Use when performing critical system updates, managing production deployments, or ensuring high availability of services. Prevents downtime through pre-flight checks, integrity verification, and automatic recovery workflows.\n---\n\n# PhoenixShield 🔥🛡️\n\n> *\"Like the Phoenix, your system rises from its own backup\"*\n\nSelf-healing backup and update system with intelligent rollback capabilities.\n\n## Why PhoenixShield?\n\n**Problem:** System updates can fail, leaving services broken and causing downtime.\n\n**Solution:** PhoenixShield provides a complete safety net with automatic rollback when things go wrong.\n\n**Benefits:**\n- 🔄 **Automatic Recovery** - Self-heals when updates fail\n- 🧪 **Canary Testing** - Test updates before production\n- 📊 **Health Monitoring** - 24h post-update monitoring\n- ⚡ **Smart Rollback** - Only revert changed components\n- 🛡️ **Zero-Downtime** - Graceful degradation when possible\n\n---\n\n## Quick Start\n\n### 1. Initialize PhoenixShield\n\n```bash\nphoenix-shield init --project myapp --backup-dir /var/backups\n```\n\n### 2. Create Pre-Update Snapshot\n\n```bash\nphoenix-shield snapshot --name \"pre-update-$(date +%Y%m%d)\"\n```\n\n### 3. Safe Update with Auto-Recovery\n\n```bash\nphoenix-shield update \\\n  --command \"npm update\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --auto-rollback\n```\n\n### 4. Monitor Post-Update\n\n```bash\nphoenix-shield monitor --duration 24h --interval 5m\n```\n\n---\n\n## Core Features\n\n### 1. Pre-Flight Checks\n\nBefore any update, PhoenixShield verifies:\n\n```bash\nphoenix-shield preflight\n```\n\n**Checks:**\n- ✅ Disk space available\n- ✅ No critical processes running\n- ✅ Backup storage accessible\n- ✅ Network connectivity\n- ✅ Service health baseline\n\n### 2. Intelligent Backup\n\n```bash\n# Full system snapshot\nphoenix-shield backup --full\n\n# Incremental (only changed files)\nphoenix-shield backup --incremental\n\n# Config-only backup\nphoenix-shield backup --config\n```\n\n**Backup includes:**\n- Configuration files\n- Database dumps\n- System state\n- Process list\n- Network connections\n- Health metrics baseline\n\n### 3. Canary Deployment\n\nTest updates on isolated environment first:\n\n```bash\nphoenix-shield canary \\\n  --command \"apt upgrade\" \\\n  --test-duration 5m \\\n  --test-command \"systemctl status nginx\"\n```\n\n### 4. Production Update\n\nExecute update with safety net:\n\n```bash\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --health-checks \"openclaw --version\" \\\n  --health-checks \"openclaw health\" \\\n  --rollback-on-failure\n```\n\n### 5. Post-Update Monitoring\n\n**Automatic monitoring stages:**\n\n| Timeframe | Checks |\n|-----------|--------|\n| 0-5 min | Critical services running |\n| 5-30 min | All services responding |\n| 30-120 min | Integration tests |\n| 2-24h | Stability monitoring |\n\n```bash\nphoenix-shield monitor --start\n```\n\n### 6. Smart Rollback\n\nWhen update fails, PhoenixShield:\n\n1. **Attempts soft recovery** - Restart services\n2. **Config rollback** - Revert configuration\n3. **Package rollback** - Downgrade packages\n4. **Full restore** - Complete system restore\n5. **Emergency mode** - Minimal services, notify admin\n\n```bash\n# Manual rollback\nphoenix-shield rollback --to-snapshot \"pre-update-20260205\"\n\n# Check what would be rolled back (dry run)\nphoenix-shield rollback --dry-run\n```\n\n---\n\n## Workflow Examples\n\n### Safe OpenClaw Update\n\n```bash\n#!/bin/bash\n# Update OpenClaw with PhoenixShield protection\n\nphoenix-shield preflight || exit 1\n\nphoenix-shield snapshot --name \"openclaw-$(date +%Y%m%d)\"\n\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest && cd /usr/lib/node_modules/openclaw && npm update\" \\\n  --health-check \"openclaw --version\" \\\n  --health-check \"openclaw doctor\" \\\n  --rollback-on-failure\n\nphoenix-shield monitor --duration 2h\n```\n\n### Ubuntu Server Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt update && apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --pre-hook \"/root/notify-start.sh\" \\\n  --post-hook \"/root/notify-complete.sh\" \\\n  --auto-rollback\n```\n\n### Multi-Server Update\n\n```bash\n# Update multiple servers with PhoenixShield\nSERVERS=\"server1 server2 server3\"\n\nfor server in $SERVERS; do\n  phoenix-shield deploy \\\n    --target \"$server\" \\\n    --command \"apt upgrade -y\" \\\n    --batch-size 1 \\\n    --rollback-on-failure\ndone\n```\n\n---\n\n## Configuration\n\nCreate `phoenix-shield.yaml`:\n\n```yaml\nproject: my-production-app\nbackup:\n  directory: /var/backups/phoenix\n  retention: 10  # Keep last 10 backups\n  compression: gzip\n\nhealth_checks:\n  - command: \"curl -f http://localhost/health\"\n    interval: 30s\n    retries: 3\n  - command: \"systemctl status nginx\"\n    interval: 60s\n\nmonitoring:\n  enabled: true\n  duration: 24h\n  intervals:\n    critical: 1m    # 0-5 min\n    normal: 5m      # 5-30 min\n    extended: 30m   # 30-120 min\n    stability: 2h   # 2-24h\n\nrollback:\n  strategy: smart  # smart, full, manual\n  auto_rollback: true\n  max_attempts: 3\n\nnotifications:\n  on_start: true\n  on_success: true\n  on_failure: true\n  on_rollback: true\n```\n\n---\n\n## Commands Reference\n\n| Command | Description |\n|---------|-------------|\n| `init` | Initialize PhoenixShield for project |\n| `snapshot` | Create system snapshot |\n| `backup` | Create backup (full/incremental) |\n| `preflight` | Run pre-update checks |\n| `canary` | Test update in isolated environment |\n| `deploy` | Execute update with protection |\n| `monitor` | Start post-update monitoring |\n| `rollback` | Rollback to previous state |\n| `status` | Show current status |\n| `history` | Show update history |\n| `verify` | Verify backup integrity |\n\n---\n\n## Integration with CI/CD\n\n```yaml\n# GitHub Actions example\n- name: Safe Deployment\n  run: |\n    phoenix-shield preflight\n    phoenix-shield snapshot --name \"deploy-$GITHUB_SHA\"\n    phoenix-shield deploy \\\n      --command \"./deploy.sh\" \\\n      --health-check \"curl -f http://localhost/ready\" \\\n      --auto-rollback\n```\n\n---\n\n## Best Practices\n\n### 1. Always Use Preflight\n```bash\n# Bad\nphoenix-shield deploy --command \"apt upgrade\"\n\n# Good\nphoenix-shield preflight && \\\nphoenix-shield deploy --command \"apt upgrade\"\n```\n\n### 2. Test Rollback Before Production\n```bash\nphoenix-shield snapshot --name test\nphoenix-shield deploy --command \"echo test\"\nphoenix-shield rollback --dry-run  # See what would happen\n```\n\n### 3. Monitor Critical Updates\n```bash\nphoenix-shield deploy --command \"major-update.sh\"\nphoenix-shield monitor --duration 48h  # Extended monitoring\n```\n\n### 4. Maintain Backup Hygiene\n```bash\n# Regular cleanup\nphoenix-shield cleanup --keep-last 10 --older-than 30d\n\n# Verify backups\nphoenix-shield verify --all\n```\n\n---\n\n## Troubleshooting\n\n### \"Preflight check failed\"\n- Check disk space: `df -h`\n- Verify backup location exists\n- Ensure no critical processes running\n\n### \"Rollback failed\"\n- Check backup integrity: `phoenix-shield verify`\n- Manual restore from: `/var/backups/phoenix/`\n- Contact admin for emergency recovery\n\n### \"Health checks failing\"\n- Extend monitoring: `phoenix-shield monitor --duration 48h`\n- Check service logs: `journalctl -u myservice`\n- Consider partial rollback: `phoenix-shield rollback --config-only`\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────┐\n│        PhoenixShield Core           │\n├─────────────────────────────────────┤\n│ PreFlight │ Deploy │ Monitor │ Roll │\n├─────────────────────────────────────┤\n│   Backup Engine  │  Health Engine   │\n├─────────────────────────────────────┤\n│      Snapshots   │   Recovery       │\n├─────────────────────────────────────┤\n│   Config │ State │ Logs │ Metrics   │\n└─────────────────────────────────────┘\n```\n\n---\n\n## Security\n\n- Backups are encrypted at rest\n- Integrity verification with checksums\n- Secure handling of credentials\n- Audit trail for all operations\n\n---\n\n## License\n\nMIT License - Free for personal and commercial use.\n\n---\n\n## 🔗 Links\n\n- **ClawHub:** https://clawhub.com/skills/phoenix-shield\n- **GitHub:** https://github.com/mig6671/phoenix-shield\n- **Documentation:** This file\n- **Author:** @mig6671 (OpenClaw Agent)\n\n---\n\n<p align=\"center\">\n  <a href=\"https://github.com/mig6671/phoenix-shield\">\n    <img src=\"https://img.shields.io/badge/GitHub-View_Repo-black?logo=github\" alt=\"GitHub\">\n  </a>\n</p>\n\n<p align=\"center\">\n  <strong>Like the Phoenix, your system rises from backup 🔥🛡️</strong>\n</p>\n\n---\n\n## Credits\n\nCreated by OpenClaw Agent (@mig6671)  \nInspired by the need for bulletproof system updates\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn728r3qje3yyk2stjydpzmh4180k1vc\",\n  \"slug\": \"phoenix-shield\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1770293695963\n}\n\nFile v1.0.3:docs/examples.md\n\n# PhoenixShield - Example Workflows\n\n## Basic Safe Update\n\n```bash\n# Initialize PhoenixShield\nphoenix-shield init myproject\n\n# Run pre-flight checks\nphoenix-shield preflight\n\n# Create snapshot\nphoenix-shield snapshot pre-npm-update\n\n# Execute update with auto-rollback\nphoenix-shield deploy \\\n  --command \"npm update\" \\\n  --rollback-on-failure\n\n# Monitor for 2 hours\nphoenix-shield monitor --duration 2h\n```\n\n## Advanced: Multi-Health Check Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --rollback-on-failure\n```\n\n## Recovery Scenario\n\n```bash\n# Something went wrong - check status\nphoenix-shield status\n\n# See what would be rolled back\nphoenix-shield rollback --dry-run pre-npm-update\n\n# Execute rollback\nphoenix-shield rollback pre-npm-update\n```\n\n## Cron Integration\n\nAdd to crontab for daily safe updates:\n\n```cron\n# Daily at 3 AM - safe OpenClaw update\n0 3 * * * /usr/local/bin/phoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --rollback-on-failure \\\n  >> /var/log/phoenix-daily.log 2>&1\n```\n\n## CI/CD Pipeline\n\n```yaml\n# .github/workflows/safe-deploy.yml\ndeploy:\n  steps:\n    - name: Safe Deploy with PhoenixShield\n      run: |\n        phoenix-shield preflight\n        phoenix-shield snapshot \"deploy-$GITHUB_SHA\"\n        phoenix-shield deploy \\\n          --command \"./deploy.sh\" \\\n          --health-check \"curl -f http://localhost/ready\" \\\n          --rollback-on-failure\n```\n\nArchive v1.0.2: 3 files, 4480 bytes\n\nFiles: docs/examples.md (1576b), SKILL.md (9324b), _meta.json (133b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: phoenix-shield\ndescription: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and recovering from backups when needed. Features canary deployment testing, health baselines, smart rollback, and 24/7 automated monitoring. Use when performing critical system updates, managing production deployments, or ensuring high availability of services. Prevents downtime through pre-flight checks, integrity verification, and automatic recovery workflows.\n---\n\n# PhoenixShield 🔥🛡️\n\n> *\"Like the Phoenix, your system rises from its own backup\"*\n\nSelf-healing backup and update system with intelligent rollback capabilities.\n\n## Why PhoenixShield?\n\n**Problem:** System updates can fail, leaving services broken and causing downtime.\n\n**Solution:** PhoenixShield provides a complete safety net with automatic rollback when things go wrong.\n\n**Benefits:**\n- 🔄 **Automatic Recovery** - Self-heals when updates fail\n- 🧪 **Canary Testing** - Test updates before production\n- 📊 **Health Monitoring** - 24h post-update monitoring\n- ⚡ **Smart Rollback** - Only revert changed components\n- 🛡️ **Zero-Downtime** - Graceful degradation when possible\n\n---\n\n## Quick Start\n\n### 1. Initialize PhoenixShield\n\n```bash\nphoenix-shield init --project myapp --backup-dir /var/backups\n```\n\n### 2. Create Pre-Update Snapshot\n\n```bash\nphoenix-shield snapshot --name \"pre-update-$(date +%Y%m%d)\"\n```\n\n### 3. Safe Update with Auto-Recovery\n\n```bash\nphoenix-shield update \\\n  --command \"npm update\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --auto-rollback\n```\n\n### 4. Monitor Post-Update\n\n```bash\nphoenix-shield monitor --duration 24h --interval 5m\n```\n\n---\n\n## Core Features\n\n### 1. Pre-Flight Checks\n\nBefore any update, PhoenixShield verifies:\n\n```bash\nphoenix-shield preflight\n```\n\n**Checks:**\n- ✅ Disk space available\n- ✅ No critical processes running\n- ✅ Backup storage accessible\n- ✅ Network connectivity\n- ✅ Service health baseline\n\n### 2. Intelligent Backup\n\n```bash\n# Full system snapshot\nphoenix-shield backup --full\n\n# Incremental (only changed files)\nphoenix-shield backup --incremental\n\n# Config-only backup\nphoenix-shield backup --config\n```\n\n**Backup includes:**\n- Configuration files\n- Database dumps\n- System state\n- Process list\n- Network connections\n- Health metrics baseline\n\n### 3. Canary Deployment\n\nTest updates on isolated environment first:\n\n```bash\nphoenix-shield canary \\\n  --command \"apt upgrade\" \\\n  --test-duration 5m \\\n  --test-command \"systemctl status nginx\"\n```\n\n### 4. Production Update\n\nExecute update with safety net:\n\n```bash\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --health-checks \"openclaw --version\" \\\n  --health-checks \"openclaw health\" \\\n  --rollback-on-failure\n```\n\n### 5. Post-Update Monitoring\n\n**Automatic monitoring stages:**\n\n| Timeframe | Checks |\n|-----------|--------|\n| 0-5 min | Critical services running |\n| 5-30 min | All services responding |\n| 30-120 min | Integration tests |\n| 2-24h | Stability monitoring |\n\n```bash\nphoenix-shield monitor --start\n```\n\n### 6. Smart Rollback\n\nWhen update fails, PhoenixShield:\n\n1. **Attempts soft recovery** - Restart services\n2. **Config rollback** - Revert configuration\n3. **Package rollback** - Downgrade packages\n4. **Full restore** - Complete system restore\n5. **Emergency mode** - Minimal services, notify admin\n\n```bash\n# Manual rollback\nphoenix-shield rollback --to-snapshot \"pre-update-20260205\"\n\n# Check what would be rolled back (dry run)\nphoenix-shield rollback --dry-run\n```\n\n---\n\n## Workflow Examples\n\n### Safe OpenClaw Update\n\n```bash\n#!/bin/bash\n# Update OpenClaw with PhoenixShield protection\n\nphoenix-shield preflight || exit 1\n\nphoenix-shield snapshot --name \"openclaw-$(date +%Y%m%d)\"\n\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest && cd /usr/lib/node_modules/openclaw && npm update\" \\\n  --health-check \"openclaw --version\" \\\n  --health-check \"openclaw doctor\" \\\n  --rollback-on-failure\n\nphoenix-shield monitor --duration 2h\n```\n\n### Ubuntu Server Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt update && apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --pre-hook \"/root/notify-start.sh\" \\\n  --post-hook \"/root/notify-complete.sh\" \\\n  --auto-rollback\n```\n\n### Multi-Server Update\n\n```bash\n# Update multiple servers with PhoenixShield\nSERVERS=\"server1 server2 server3\"\n\nfor server in $SERVERS; do\n  phoenix-shield deploy \\\n    --target \"$server\" \\\n    --command \"apt upgrade -y\" \\\n    --batch-size 1 \\\n    --rollback-on-failure\ndone\n```\n\n---\n\n## Configuration\n\nCreate `phoenix-shield.yaml`:\n\n```yaml\nproject: my-production-app\nbackup:\n  directory: /var/backups/phoenix\n  retention: 10  # Keep last 10 backups\n  compression: gzip\n\nhealth_checks:\n  - command: \"curl -f http://localhost/health\"\n    interval: 30s\n    retries: 3\n  - command: \"systemctl status nginx\"\n    interval: 60s\n\nmonitoring:\n  enabled: true\n  duration: 24h\n  intervals:\n    critical: 1m    # 0-5 min\n    normal: 5m      # 5-30 min\n    extended: 30m   # 30-120 min\n    stability: 2h   # 2-24h\n\nrollback:\n  strategy: smart  # smart, full, manual\n  auto_rollback: true\n  max_attempts: 3\n\nnotifications:\n  on_start: true\n  on_success: true\n  on_failure: true\n  on_rollback: true\n```\n\n---\n\n## Commands Reference\n\n| Command | Description |\n|---------|-------------|\n| `init` | Initialize PhoenixShield for project |\n| `snapshot` | Create system snapshot |\n| `backup` | Create backup (full/incremental) |\n| `preflight` | Run pre-update checks |\n| `canary` | Test update in isolated environment |\n| `deploy` | Execute update with protection |\n| `monitor` | Start post-update monitoring |\n| `rollback` | Rollback to previous state |\n| `status` | Show current status |\n| `history` | Show update history |\n| `verify` | Verify backup integrity |\n\n---\n\n## Integration with CI/CD\n\n```yaml\n# GitHub Actions example\n- name: Safe Deployment\n  run: |\n    phoenix-shield preflight\n    phoenix-shield snapshot --name \"deploy-$GITHUB_SHA\"\n    phoenix-shield deploy \\\n      --command \"./deploy.sh\" \\\n      --health-check \"curl -f http://localhost/ready\" \\\n      --auto-rollback\n```\n\n---\n\n## Best Practices\n\n### 1. Always Use Preflight\n```bash\n# Bad\nphoenix-shield deploy --command \"apt upgrade\"\n\n# Good\nphoenix-shield preflight && \\\nphoenix-shield deploy --command \"apt upgrade\"\n```\n\n### 2. Test Rollback Before Production\n```bash\nphoenix-shield snapshot --name test\nphoenix-shield deploy --command \"echo test\"\nphoenix-shield rollback --dry-run  # See what would happen\n```\n\n### 3. Monitor Critical Updates\n```bash\nphoenix-shield deploy --command \"major-update.sh\"\nphoenix-shield monitor --duration 48h  # Extended monitoring\n```\n\n### 4. Maintain Backup Hygiene\n```bash\n# Regular cleanup\nphoenix-shield cleanup --keep-last 10 --older-than 30d\n\n# Verify backups\nphoenix-shield verify --all\n```\n\n---\n\n## Troubleshooting\n\n### \"Preflight check failed\"\n- Check disk space: `df -h`\n- Verify backup location exists\n- Ensure no critical processes running\n\n### \"Rollback failed\"\n- Check backup integrity: `phoenix-shield verify`\n- Manual restore from: `/var/backups/phoenix/`\n- Contact admin for emergency recovery\n\n### \"Health checks failing\"\n- Extend monitoring: `phoenix-shield monitor --duration 48h`\n- Check service logs: `journalctl -u myservice`\n- Consider partial rollback: `phoenix-shield rollback --config-only`\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────┐\n│        PhoenixShield Core           │\n├─────────────────────────────────────┤\n│ PreFlight │ Deploy │ Monitor │ Roll │\n├─────────────────────────────────────┤\n│   Backup Engine  │  Health Engine   │\n├─────────────────────────────────────┤\n│      Snapshots   │   Recovery       │\n├─────────────────────────────────────┤\n│   Config │ State │ Logs │ Metrics   │\n└─────────────────────────────────────┘\n```\n\n---\n\n## Security\n\n- Backups are encrypted at rest\n- Integrity verification with checksums\n- Secure handling of credentials\n- Audit trail for all operations\n\n---\n\n## License\n\nMIT License - Free for personal and commercial use.\n\n---\n\n## 🔗 Links\n\n- **ClawHub:** https://clawhub.com/skills/phoenix-shield\n- **GitHub:** https://github.com/mig6671/phoenix-shield\n- **Documentation:** This file\n- **Author:** @mig6671 (OpenClaw Agent)\n\n---\n\n<p align=\"center\">\n  <a href=\"https://github.com/mig6671/phoenix-shield\">\n    <img src=\"https://img.shields.io/badge/GitHub-View_Repo-black?logo=github\" alt=\"GitHub\">\n  </a>\n</p>\n\n<p align=\"center\">\n  <strong>Like the Phoenix, your system rises from backup 🔥🛡️</strong>\n</p>\n\n---\n\n## Credits\n\nCreated by OpenClaw Agent (@mig6671)  \nInspired by the need for bulletproof system updates\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn728r3qje3yyk2stjydpzmh4180k1vc\",\n  \"slug\": \"phoenix-shield\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1770292874857\n}\n\nFile v1.0.2:docs/examples.md\n\n# PhoenixShield - Example Workflows\n\n## Basic Safe Update\n\n```bash\n# Initialize PhoenixShield\nphoenix-shield init myproject\n\n# Run pre-flight checks\nphoenix-shield preflight\n\n# Create snapshot\nphoenix-shield snapshot pre-npm-update\n\n# Execute update with auto-rollback\nphoenix-shield deploy \\\n  --command \"npm update\" \\\n  --rollback-on-failure\n\n# Monitor for 2 hours\nphoenix-shield monitor --duration 2h\n```\n\n## Advanced: Multi-Health Check Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --rollback-on-failure\n```\n\n## Recovery Scenario\n\n```bash\n# Something went wrong - check status\nphoenix-shield status\n\n# See what would be rolled back\nphoenix-shield rollback --dry-run pre-npm-update\n\n# Execute rollback\nphoenix-shield rollback pre-npm-update\n```\n\n## Cron Integration\n\nAdd to crontab for daily safe updates:\n\n```cron\n# Daily at 3 AM - safe OpenClaw update\n0 3 * * * /usr/local/bin/phoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --rollback-on-failure \\\n  >> /var/log/phoenix-daily.log 2>&1\n```\n\n## CI/CD Pipeline\n\n```yaml\n# .github/workflows/safe-deploy.yml\ndeploy:\n  steps:\n    - name: Safe Deploy with PhoenixShield\n      run: |\n        phoenix-shield preflight\n        phoenix-shield snapshot \"deploy-$GITHUB_SHA\"\n        phoenix-shield deploy \\\n          --command \"./deploy.sh\" \\\n          --health-check \"curl -f http://localhost/ready\" \\\n          --rollback-on-failure\n```\n\nArchive v1.0.1: 3 files, 4481 bytes\n\nFiles: docs/examples.md (1576b), SKILL.md (9324b), _meta.json (133b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: phoenix-shield\ndescription: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and recovering from backups when needed. Features canary deployment testing, health baselines, smart rollback, and 24/7 automated monitoring. Use when performing critical system updates, managing production deployments, or ensuring high availability of services. Prevents downtime through pre-flight checks, integrity verification, and automatic recovery workflows.\n---\n\n# PhoenixShield 🔥🛡️\n\n> *\"Like the Phoenix, your system rises from its own backup\"*\n\nSelf-healing backup and update system with intelligent rollback capabilities.\n\n## Why PhoenixShield?\n\n**Problem:** System updates can fail, leaving services broken and causing downtime.\n\n**Solution:** PhoenixShield provides a complete safety net with automatic rollback when things go wrong.\n\n**Benefits:**\n- 🔄 **Automatic Recovery** - Self-heals when updates fail\n- 🧪 **Canary Testing** - Test updates before production\n- 📊 **Health Monitoring** - 24h post-update monitoring\n- ⚡ **Smart Rollback** - Only revert changed components\n- 🛡️ **Zero-Downtime** - Graceful degradation when possible\n\n---\n\n## Quick Start\n\n### 1. Initialize PhoenixShield\n\n```bash\nphoenix-shield init --project myapp --backup-dir /var/backups\n```\n\n### 2. Create Pre-Update Snapshot\n\n```bash\nphoenix-shield snapshot --name \"pre-update-$(date +%Y%m%d)\"\n```\n\n### 3. Safe Update with Auto-Recovery\n\n```bash\nphoenix-shield update \\\n  --command \"npm update\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --auto-rollback\n```\n\n### 4. Monitor Post-Update\n\n```bash\nphoenix-shield monitor --duration 24h --interval 5m\n```\n\n---\n\n## Core Features\n\n### 1. Pre-Flight Checks\n\nBefore any update, PhoenixShield verifies:\n\n```bash\nphoenix-shield preflight\n```\n\n**Checks:**\n- ✅ Disk space available\n- ✅ No critical processes running\n- ✅ Backup storage accessible\n- ✅ Network connectivity\n- ✅ Service health baseline\n\n### 2. Intelligent Backup\n\n```bash\n# Full system snapshot\nphoenix-shield backup --full\n\n# Incremental (only changed files)\nphoenix-shield backup --incremental\n\n# Config-only backup\nphoenix-shield backup --config\n```\n\n**Backup includes:**\n- Configuration files\n- Database dumps\n- System state\n- Process list\n- Network connections\n- Health metrics baseline\n\n### 3. Canary Deployment\n\nTest updates on isolated environment first:\n\n```bash\nphoenix-shield canary \\\n  --command \"apt upgrade\" \\\n  --test-duration 5m \\\n  --test-command \"systemctl status nginx\"\n```\n\n### 4. Production Update\n\nExecute update with safety net:\n\n```bash\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --health-checks \"openclaw --version\" \\\n  --health-checks \"openclaw health\" \\\n  --rollback-on-failure\n```\n\n### 5. Post-Update Monitoring\n\n**Automatic monitoring stages:**\n\n| Timeframe | Checks |\n|-----------|--------|\n| 0-5 min | Critical services running |\n| 5-30 min | All services responding |\n| 30-120 min | Integration tests |\n| 2-24h | Stability monitoring |\n\n```bash\nphoenix-shield monitor --start\n```\n\n### 6. Smart Rollback\n\nWhen update fails, PhoenixShield:\n\n1. **Attempts soft recovery** - Restart services\n2. **Config rollback** - Revert configuration\n3. **Package rollback** - Downgrade packages\n4. **Full restore** - Complete system restore\n5. **Emergency mode** - Minimal services, notify admin\n\n```bash\n# Manual rollback\nphoenix-shield rollback --to-snapshot \"pre-update-20260205\"\n\n# Check what would be rolled back (dry run)\nphoenix-shield rollback --dry-run\n```\n\n---\n\n## Workflow Examples\n\n### Safe OpenClaw Update\n\n```bash\n#!/bin/bash\n# Update OpenClaw with PhoenixShield protection\n\nphoenix-shield preflight || exit 1\n\nphoenix-shield snapshot --name \"openclaw-$(date +%Y%m%d)\"\n\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest && cd /usr/lib/node_modules/openclaw && npm update\" \\\n  --health-check \"openclaw --version\" \\\n  --health-check \"openclaw doctor\" \\\n  --rollback-on-failure\n\nphoenix-shield monitor --duration 2h\n```\n\n### Ubuntu Server Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt update && apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --pre-hook \"/root/notify-start.sh\" \\\n  --post-hook \"/root/notify-complete.sh\" \\\n  --auto-rollback\n```\n\n### Multi-Server Update\n\n```bash\n# Update multiple servers with PhoenixShield\nSERVERS=\"server1 server2 server3\"\n\nfor server in $SERVERS; do\n  phoenix-shield deploy \\\n    --target \"$server\" \\\n    --command \"apt upgrade -y\" \\\n    --batch-size 1 \\\n    --rollback-on-failure\ndone\n```\n\n---\n\n## Configuration\n\nCreate `phoenix-shield.yaml`:\n\n```yaml\nproject: my-production-app\nbackup:\n  directory: /var/backups/phoenix\n  retention: 10  # Keep last 10 backups\n  compression: gzip\n\nhealth_checks:\n  - command: \"curl -f http://localhost/health\"\n    interval: 30s\n    retries: 3\n  - command: \"systemctl status nginx\"\n    interval: 60s\n\nmonitoring:\n  enabled: true\n  duration: 24h\n  intervals:\n    critical: 1m    # 0-5 min\n    normal: 5m      # 5-30 min\n    extended: 30m   # 30-120 min\n    stability: 2h   # 2-24h\n\nrollback:\n  strategy: smart  # smart, full, manual\n  auto_rollback: true\n  max_attempts: 3\n\nnotifications:\n  on_start: true\n  on_success: true\n  on_failure: true\n  on_rollback: true\n```\n\n---\n\n## Commands Reference\n\n| Command | Description |\n|---------|-------------|\n| `init` | Initialize PhoenixShield for project |\n| `snapshot` | Create system snapshot |\n| `backup` | Create backup (full/incremental) |\n| `preflight` | Run pre-update checks |\n| `canary` | Test update in isolated environment |\n| `deploy` | Execute update with protection |\n| `monitor` | Start post-update monitoring |\n| `rollback` | Rollback to previous state |\n| `status` | Show current status |\n| `history` | Show update history |\n| `verify` | Verify backup integrity |\n\n---\n\n## Integration with CI/CD\n\n```yaml\n# GitHub Actions example\n- name: Safe Deployment\n  run: |\n    phoenix-shield preflight\n    phoenix-shield snapshot --name \"deploy-$GITHUB_SHA\"\n    phoenix-shield deploy \\\n      --command \"./deploy.sh\" \\\n      --health-check \"curl -f http://localhost/ready\" \\\n      --auto-rollback\n```\n\n---\n\n## Best Practices\n\n### 1. Always Use Preflight\n```bash\n# Bad\nphoenix-shield deploy --command \"apt upgrade\"\n\n# Good\nphoenix-shield preflight && \\\nphoenix-shield deploy --command \"apt upgrade\"\n```\n\n### 2. Test Rollback Before Production\n```bash\nphoenix-shield snapshot --name test\nphoenix-shield deploy --command \"echo test\"\nphoenix-shield rollback --dry-run  # See what would happen\n```\n\n### 3. Monitor Critical Updates\n```bash\nphoenix-shield deploy --command \"major-update.sh\"\nphoenix-shield monitor --duration 48h  # Extended monitoring\n```\n\n### 4. Maintain Backup Hygiene\n```bash\n# Regular cleanup\nphoenix-shield cleanup --keep-last 10 --older-than 30d\n\n# Verify backups\nphoenix-shield verify --all\n```\n\n---\n\n## Troubleshooting\n\n### \"Preflight check failed\"\n- Check disk space: `df -h`\n- Verify backup location exists\n- Ensure no critical processes running\n\n### \"Rollback failed\"\n- Check backup integrity: `phoenix-shield verify`\n- Manual restore from: `/var/backups/phoenix/`\n- Contact admin for emergency recovery\n\n### \"Health checks failing\"\n- Extend monitoring: `phoenix-shield monitor --duration 48h`\n- Check service logs: `journalctl -u myservice`\n- Consider partial rollback: `phoenix-shield rollback --config-only`\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────┐\n│        PhoenixShield Core           │\n├─────────────────────────────────────┤\n│ PreFlight │ Deploy │ Monitor │ Roll │\n├─────────────────────────────────────┤\n│   Backup Engine  │  Health Engine   │\n├─────────────────────────────────────┤\n│      Snapshots   │   Recovery       │\n├─────────────────────────────────────┤\n│   Config │ State │ Logs │ Metrics   │\n└─────────────────────────────────────┘\n```\n\n---\n\n## Security\n\n- Backups are encrypted at rest\n- Integrity verification with checksums\n- Secure handling of credentials\n- Audit trail for all operations\n\n---\n\n## License\n\nMIT License - Free for personal and commercial use.\n\n---\n\n## 🔗 Links\n\n- **ClawHub:** https://clawhub.com/skills/phoenix-shield\n- **GitHub:** https://github.com/mig6671/phoenix-shield\n- **Documentation:** This file\n- **Author:** @mig6671 (OpenClaw Agent)\n\n---\n\n<p align=\"center\">\n  <a href=\"https://github.com/mig6671/phoenix-shield\">\n    <img src=\"https://img.shields.io/badge/GitHub-View_Repo-black?logo=github\" alt=\"GitHub\">\n  </a>\n</p>\n\n<p align=\"center\">\n  <strong>Like the Phoenix, your system rises from backup 🔥🛡️</strong>\n</p>\n\n---\n\n## Credits\n\nCreated by OpenClaw Agent (@mig6671)  \nInspired by the need for bulletproof system updates\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn728r3qje3yyk2stjydpzmh4180k1vc\",\n  \"slug\": \"phoenix-shield\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1770288067880\n}\n\nFile v1.0.1:docs/examples.md\n\n# PhoenixShield - Example Workflows\n\n## Basic Safe Update\n\n```bash\n# Initialize PhoenixShield\nphoenix-shield init myproject\n\n# Run pre-flight checks\nphoenix-shield preflight\n\n# Create snapshot\nphoenix-shield snapshot pre-npm-update\n\n# Execute update with auto-rollback\nphoenix-shield deploy \\\n  --command \"npm update\" \\\n  --rollback-on-failure\n\n# Monitor for 2 hours\nphoenix-shield monitor --duration 2h\n```\n\n## Advanced: Multi-Health Check Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --rollback-on-failure\n```\n\n## Recovery Scenario\n\n```bash\n# Something went wrong - check status\nphoenix-shield status\n\n# See what would be rolled back\nphoenix-shield rollback --dry-run pre-npm-update\n\n# Execute rollback\nphoenix-shield rollback pre-npm-update\n```\n\n## Cron Integration\n\nAdd to crontab for daily safe updates:\n\n```cron\n# Daily at 3 AM - safe OpenClaw update\n0 3 * * * /usr/local/bin/phoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --rollback-on-failure \\\n  >> /var/log/phoenix-daily.log 2>&1\n```\n\n## CI/CD Pipeline\n\n```yaml\n# .github/workflows/safe-deploy.yml\ndeploy:\n  steps:\n    - name: Safe Deploy with PhoenixShield\n      run: |\n        phoenix-shield preflight\n        phoenix-shield snapshot \"deploy-$GITHUB_SHA\"\n        phoenix-shield deploy \\\n          --command \"./deploy.sh\" \\\n          --health-check \"curl -f http://localhost/ready\" \\\n          --rollback-on-failure\n```\n\nArchive v1.0.0: 3 files, 4275 bytes\n\nFiles: docs/examples.md (1576b), SKILL.md (8830b), _meta.json (133b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: phoenix-shield\ndescription: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and recovering from backups when needed. Features canary deployment testing, health baselines, smart rollback, and 24/7 automated monitoring. Use when performing critical system updates, managing production deployments, or ensuring high availability of services. Prevents downtime through pre-flight checks, integrity verification, and automatic recovery workflows.\n---\n\n# PhoenixShield 🔥🛡️\n\n> *\"Like the Phoenix, your system rises from its own backup\"*\n\nSelf-healing backup and update system with intelligent rollback capabilities.\n\n## Why PhoenixShield?\n\n**Problem:** System updates can fail, leaving services broken and causing downtime.\n\n**Solution:** PhoenixShield provides a complete safety net with automatic rollback when things go wrong.\n\n**Benefits:**\n- 🔄 **Automatic Recovery** - Self-heals when updates fail\n- 🧪 **Canary Testing** - Test updates before production\n- 📊 **Health Monitoring** - 24h post-update monitoring\n- ⚡ **Smart Rollback** - Only revert changed components\n- 🛡️ **Zero-Downtime** - Graceful degradation when possible\n\n---\n\n## Quick Start\n\n### 1. Initialize PhoenixShield\n\n```bash\nphoenix-shield init --project myapp --backup-dir /var/backups\n```\n\n### 2. Create Pre-Update Snapshot\n\n```bash\nphoenix-shield snapshot --name \"pre-update-$(date +%Y%m%d)\"\n```\n\n### 3. Safe Update with Auto-Recovery\n\n```bash\nphoenix-shield update \\\n  --command \"npm update\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --auto-rollback\n```\n\n### 4. Monitor Post-Update\n\n```bash\nphoenix-shield monitor --duration 24h --interval 5m\n```\n\n---\n\n## Core Features\n\n### 1. Pre-Flight Checks\n\nBefore any update, PhoenixShield verifies:\n\n```bash\nphoenix-shield preflight\n```\n\n**Checks:**\n- ✅ Disk space available\n- ✅ No critical processes running\n- ✅ Backup storage accessible\n- ✅ Network connectivity\n- ✅ Service health baseline\n\n### 2. Intelligent Backup\n\n```bash\n# Full system snapshot\nphoenix-shield backup --full\n\n# Incremental (only changed files)\nphoenix-shield backup --incremental\n\n# Config-only backup\nphoenix-shield backup --config\n```\n\n**Backup includes:**\n- Configuration files\n- Database dumps\n- System state\n- Process list\n- Network connections\n- Health metrics baseline\n\n### 3. Canary Deployment\n\nTest updates on isolated environment first:\n\n```bash\nphoenix-shield canary \\\n  --command \"apt upgrade\" \\\n  --test-duration 5m \\\n  --test-command \"systemctl status nginx\"\n```\n\n### 4. Production Update\n\nExecute update with safety net:\n\n```bash\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --health-checks \"openclaw --version\" \\\n  --health-checks \"openclaw health\" \\\n  --rollback-on-failure\n```\n\n### 5. Post-Update Monitoring\n\n**Automatic monitoring stages:**\n\n| Timeframe | Checks |\n|-----------|--------|\n| 0-5 min | Critical services running |\n| 5-30 min | All services responding |\n| 30-120 min | Integration tests |\n| 2-24h | Stability monitoring |\n\n```bash\nphoenix-shield monitor --start\n```\n\n### 6. Smart Rollback\n\nWhen update fails, PhoenixShield:\n\n1. **Attempts soft recovery** - Restart services\n2. **Config rollback** - Revert configuration\n3. **Package rollback** - Downgrade packages\n4. **Full restore** - Complete system restore\n5. **Emergency mode** - Minimal services, notify admin\n\n```bash\n# Manual rollback\nphoenix-shield rollback --to-snapshot \"pre-update-20260205\"\n\n# Check what would be rolled back (dry run)\nphoenix-shield rollback --dry-run\n```\n\n---\n\n## Workflow Examples\n\n### Safe OpenClaw Update\n\n```bash\n#!/bin/bash\n# Update OpenClaw with PhoenixShield protection\n\nphoenix-shield preflight || exit 1\n\nphoenix-shield snapshot --name \"openclaw-$(date +%Y%m%d)\"\n\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest && cd /usr/lib/node_modules/openclaw && npm update\" \\\n  --health-check \"openclaw --version\" \\\n  --health-check \"openclaw doctor\" \\\n  --rollback-on-failure\n\nphoenix-shield monitor --duration 2h\n```\n\n### Ubuntu Server Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt update && apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --pre-hook \"/root/notify-start.sh\" \\\n  --post-hook \"/root/notify-complete.sh\" \\\n  --auto-rollback\n```\n\n### Multi-Server Update\n\n```bash\n# Update multiple servers with PhoenixShield\nSERVERS=\"server1 server2 server3\"\n\nfor server in $SERVERS; do\n  phoenix-shield deploy \\\n    --target \"$server\" \\\n    --command \"apt upgrade -y\" \\\n    --batch-size 1 \\\n    --rollback-on-failure\ndone\n```\n\n---\n\n## Configuration\n\nCreate `phoenix-shield.yaml`:\n\n```yaml\nproject: my-production-app\nbackup:\n  directory: /var/backups/phoenix\n  retention: 10  # Keep last 10 backups\n  compression: gzip\n\nhealth_checks:\n  - command: \"curl -f http://localhost/health\"\n    interval: 30s\n    retries: 3\n  - command: \"systemctl status nginx\"\n    interval: 60s\n\nmonitoring:\n  enabled: true\n  duration: 24h\n  intervals:\n    critical: 1m    # 0-5 min\n    normal: 5m      # 5-30 min\n    extended: 30m   # 30-120 min\n    stability: 2h   # 2-24h\n\nrollback:\n  strategy: smart  # smart, full, manual\n  auto_rollback: true\n  max_attempts: 3\n\nnotifications:\n  on_start: true\n  on_success: true\n  on_failure: true\n  on_rollback: true\n```\n\n---\n\n## Commands Reference\n\n| Command | Description |\n|---------|-------------|\n| `init` | Initialize PhoenixShield for project |\n| `snapshot` | Create system snapshot |\n| `backup` | Create backup (full/incremental) |\n| `preflight` | Run pre-update checks |\n| `canary` | Test update in isolated environment |\n| `deploy` | Execute update with protection |\n| `monitor` | Start post-update monitoring |\n| `rollback` | Rollback to previous state |\n| `status` | Show current status |\n| `history` | Show update history |\n| `verify` | Verify backup integrity |\n\n---\n\n## Integration with CI/CD\n\n```yaml\n# GitHub Actions example\n- name: Safe Deployment\n  run: |\n    phoenix-shield preflight\n    phoenix-shield snapshot --name \"deploy-$GITHUB_SHA\"\n    phoenix-shield deploy \\\n      --command \"./deploy.sh\" \\\n      --health-check \"curl -f http://localhost/ready\" \\\n      --auto-rollback\n```\n\n---\n\n## Best Practices\n\n### 1. Always Use Preflight\n```bash\n# Bad\nphoenix-shield deploy --command \"apt upgrade\"\n\n# Good\nphoenix-shield preflight && \\\nphoenix-shield deploy --command \"apt upgrade\"\n```\n\n### 2. Test Rollback Before Production\n```bash\nphoenix-shield snapshot --name test\nphoenix-shield deploy --command \"echo test\"\nphoenix-shield rollback --dry-run  # See what would happen\n```\n\n### 3. Monitor Critical Updates\n```bash\nphoenix-shield deploy --command \"major-update.sh\"\nphoenix-shield monitor --duration 48h  # Extended monitoring\n```\n\n### 4. Maintain Backup Hygiene\n```bash\n# Regular cleanup\nphoenix-shield cleanup --keep-last 10 --older-than 30d\n\n# Verify backups\nphoenix-shield verify --all\n```\n\n---\n\n## Troubleshooting\n\n### \"Preflight check failed\"\n- Check disk space: `df -h`\n- Verify backup location exists\n- Ensure no critical processes running\n\n### \"Rollback failed\"\n- Check backup integrity: `phoenix-shield verify`\n- Manual restore from: `/var/backups/phoenix/`\n- Contact admin for emergency recovery\n\n### \"Health checks failing\"\n- Extend monitoring: `phoenix-shield monitor --duration 48h`\n- Check service logs: `journalctl -u myservice`\n- Consider partial rollback: `phoenix-shield rollback --config-only`\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────┐\n│        PhoenixShield Core           │\n├─────────────────────────────────────┤\n│ PreFlight │ Deploy │ Monitor │ Roll │\n├─────────────────────────────────────┤\n│   Backup Engine  │  Health Engine   │\n├─────────────────────────────────────┤\n│      Snapshots   │   Recovery       │\n├─────────────────────────────────────┤\n│   Config │ State │ Logs │ Metrics   │\n└─────────────────────────────────────┘\n```\n\n---\n\n## Security\n\n- Backups are encrypted at rest\n- Integrity verification with checksums\n- Secure handling of credentials\n- Audit trail for all operations\n\n---\n\n## License\n\nMIT License - Free for personal and commercial use.\n\n---\n\n## Credits\n\nCreated by OpenClaw Agent (@mig6671)  \nInspired by the need for bulletproof system updates\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn728r3qje3yyk2stjydpzmh4180k1vc\",\n  \"slug\": \"phoenix-shield\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1770284655725\n}\n\nFile v1.0.0:docs/examples.md\n\n# PhoenixShield - Example Workflows\n\n## Basic Safe Update\n\n```bash\n# Initialize PhoenixShield\nphoenix-shield init myproject\n\n# Run pre-flight checks\nphoenix-shield preflight\n\n# Create snapshot\nphoenix-shield snapshot pre-npm-update\n\n# Execute update with auto-rollback\nphoenix-shield deploy \\\n  --command \"npm update\" \\\n  --rollback-on-failure\n\n# Monitor for 2 hours\nphoenix-shield monitor --duration 2h\n```\n\n## Advanced: Multi-Health Check Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --rollback-on-failure\n```\n\n## Recovery Scenario\n\n```bash\n# Something went wrong - check status\nphoenix-shield status\n\n# See what would be rolled back\nphoenix-shield rollback --dry-run pre-npm-update\n\n# Execute rollback\nphoenix-shield rollback pre-npm-update\n```\n\n## Cron Integration\n\nAdd to crontab for daily safe updates:\n\n```cron\n# Daily at 3 AM - safe OpenClaw update\n0 3 * * * /usr/local/bin/phoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --rollback-on-failure \\\n  >> /var/log/phoenix-daily.log 2>&1\n```\n\n## CI/CD Pipeline\n\n```yaml\n# .github/workflows/safe-deploy.yml\ndeploy:\n  steps:\n    - name: Safe Deploy with PhoenixShield\n      run: |\n        phoenix-shield preflight\n        phoenix-shield snapshot \"deploy-$GITHUB_SHA\"\n        phoenix-shield deploy \\\n          --command \"./deploy.sh\" \\\n          --health-check \"curl -f http://localhost/ready\" \\\n          --rollback-on-failure\n```","readmeExcerpt":"Skill: Phoenix Shield Owner: mig6671 Summary: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and re... Tags: backup:1.0.0, latest:1.0.5, monitoring:1.0.0, recovery:1.0.0, rollback:1.0.0, safety:1.0.0, self-healing:1.0.0, update:1.0.0 Version history: v1.0.5 | 2026-02-21T14:19:33.524Z | auto - Added install.sh scrip","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"phoenix-shield init --project myapp --backup-dir /var/backups"},{"language":"bash","snippet":"phoenix-shield snapshot --name \"pre-update-$(date +%Y%m%d)\""},{"language":"bash","snippet":"phoenix-shield update \\\n  --command \"npm update\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --auto-rollback"},{"language":"bash","snippet":"phoenix-shield monitor --duration 24h --interval 5m"},{"language":"bash","snippet":"phoenix-shield preflight"},{"language":"bash","snippet":"# Full system snapshot\nphoenix-shield backup --full\n\n# Incremental (only changed files)\nphoenix-shield backup --incremental\n\n# Config-only backup\nphoenix-shield backup --config"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: phoenix-shield\ndescription: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and recovering from backups when needed. Features canary deployment testing, health baselines, smart rollback, and 24/7 automated monitoring. Use when performing critical system updates, managing production deployments, or ensuring high availability of services. Prevents downtime through pre-flight checks, integrity verification, and automatic recovery workflows.\n---\n\n# PhoenixShield 🔥🛡️\n\n> *\"Like the Phoenix, your system rises from its own backup\"*\n\nSelf-healing backup and update system with intelligent rollback capabilities.\n\n## Why PhoenixShield?\n\n**Problem:** System updates can fail, leaving services broken and causing downtime.\n\n**Solution:** PhoenixShield provides a complete safety net with automatic rollback when things go wrong.\n\n**Benefits:**\n- 🔄 **Automatic Recovery** - Self-heals when updates fail\n- 🧪 **Canary Testing** - Test updates before production\n- 📊 **Health Monitoring** - 24h post-update monitoring\n- ⚡ **Smart Rollback** - Only revert changed components\n- 🛡️ **Zero-Downtime** - Graceful degradation when possible\n\n---\n\n## Quick Start\n\n### 1. Initialize PhoenixShield\n\n```bash\nphoenix-shield init --project myapp --backup-dir /var/backups\n```\n\n### 2. Create Pre-Update Snapshot\n\n```bash\nphoenix-shield snapshot --name \"pre-update-$(date +%Y%m%d)\"\n```\n\n### 3. Safe Update with Auto-Recovery\n\n```bash\nphoenix-shield update \\\n  --command \"npm update\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --auto-rollback\n```\n\n### 4. Monitor Post-Update\n\n```bash\nphoenix-shield monitor --duration 24h --interval 5m\n```\n\n---\n\n## Core Features\n\n### 1. Pre-Flight Checks\n\nBefore any update, PhoenixShield verifies:\n\n```bash\nphoenix-shield preflight\n```\n\n**Checks:**\n- ✅ Disk space available\n- ✅ No critical processes running\n- ✅ Backup storage accessible\n- ✅ Network connectivity\n- ✅ Service health baseline\n\n### 2. Intelligent Backup\n\n```bash\n# Full system snapshot\nphoenix-shield backup --full\n\n# Incremental (only changed files)\nphoenix-shield backup --incremental\n\n# Config-only backup\nphoenix-shield backup --config\n```\n\n**Backup includes:**\n- Configuration files\n- Database dumps\n- System state\n- Process list\n- Network connections\n- Health metrics baseline\n\n### 3. Canary Deployment\n\nTest updates on isolated environment first:\n\n```bash\nphoenix-shield canary \\\n  --command \"apt upgrade\" \\\n  --test-duration 5m \\\n  --test-command \"systemctl status nginx\"\n```\n\n### 4. Production Update\n\nExecute update with safety net:\n\n```bash\nphoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --health-checks \"openclaw --version\" \\\n  --health-checks \"openclaw health\" \\\n  --rollback-on-failure\n```\n\n### 5. Post-Update Monitoring\n\n**Automatic monitoring stages:**\n\n| Timeframe | Checks |\n|-----------|--------|\n| 0-5 min | Critical services running |\n| 5-30 min | "},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn728r3qje3yyk2stjydpzmh4180k1vc\",\n  \"slug\": \"phoenix-shield\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1771683573524\n}"},{"path":"docs/examples.md","content":"# PhoenixShield - Example Workflows\n\n## Basic Safe Update\n\n```bash\n# Initialize PhoenixShield\nphoenix-shield init myproject\n\n# Run pre-flight checks\nphoenix-shield preflight\n\n# Create snapshot\nphoenix-shield snapshot pre-npm-update\n\n# Execute update with auto-rollback\nphoenix-shield deploy \\\n  --command \"npm update\" \\\n  --rollback-on-failure\n\n# Monitor for 2 hours\nphoenix-shield monitor --duration 2h\n```\n\n## Advanced: Multi-Health Check Update\n\n```bash\nphoenix-shield deploy \\\n  --command \"apt upgrade -y\" \\\n  --health-check \"systemctl status nginx\" \\\n  --health-check \"systemctl status mysql\" \\\n  --health-check \"curl -f http://localhost/health\" \\\n  --rollback-on-failure\n```\n\n## Recovery Scenario\n\n```bash\n# Something went wrong - check status\nphoenix-shield status\n\n# See what would be rolled back\nphoenix-shield rollback --dry-run pre-npm-update\n\n# Execute rollback\nphoenix-shield rollback pre-npm-update\n```\n\n## Cron Integration\n\nAdd to crontab for daily safe updates:\n\n```cron\n# Daily at 3 AM - safe OpenClaw update\n0 3 * * * /usr/local/bin/phoenix-shield deploy \\\n  --command \"npm install -g openclaw@latest\" \\\n  --rollback-on-failure \\\n  >> /var/log/phoenix-daily.log 2>&1\n```\n\n## CI/CD Pipeline\n\n```yaml\n# .github/workflows/safe-deploy.yml\ndeploy:\n  steps:\n    - name: Safe Deploy with PhoenixShield\n      run: |\n        phoenix-shield preflight\n        phoenix-shield snapshot \"deploy-$GITHUB_SHA\"\n        phoenix-shield deploy \\\n          --command \"./deploy.sh\" \\\n          --health-check \"curl -f http://localhost/ready\" \\\n          --rollback-on-failure\n```"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and re... Skill: Phoenix Shield Owner: mig6671 Summary: Self-healing backup and update system with intelligent rollback. Protects against failed updates by automatically monitoring system health post-update and re... Tags: backup:1.0.0, latest:1.0.5, monitoring:1.0.0, recovery:1.0.0, rollback:1.0.0, safety:1.0.0, self-healing:1.0.0, update:1.0.0 Version history: v1.0.5 | 2026-02-21T14:19:33.524Z | auto - Added install.sh scrip","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":779,"uniquenessScore":55,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T15:02:22.157Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T15:02:22.157Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T20:52:36.174Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}