# Avenger Initiative

Adopt this skill: https://proskills.md/skills/security/avenger-initiative

Page: https://proskills.md/skills/security/avenger-initiative
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: SKILL.md
size: 4589
upstream: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/SKILL.md

````text
---
name: avenger-initiative
version: 1.0.4
description: Encrypted GitHub backup and restore for any OpenClaw agent system. Creates branch-per-night backups with smart retention (7 daily, 8 weekly, 12 monthly branches). Backs up openclaw.json (AES-256 encrypted), agent memories, SOUL/IDENTITY files, cron jobs, and custom skills to a private GitHub vault. Each backup auto-generates a human-friendly README.md inside the vault with purpose, full contents table, branch structure, step-by-step restore instructions, and Avenger agent commands. Triggers on phrases like "avenger backup", "backup system", "push to vault", "sync vault", "avenger restore", "restore from vault", "setup avenger", "avenger status", "avenger init", "configure backup", "set up backup". Also auto-runs after any critical config change.
license: MIT
---

# 🛡️ Avenger Initiative

Encrypted, branch-based GitHub backup and restore for any OpenClaw system.

## When This Skill Triggers

1. User says "setup avenger" / "configure backup" / "avenger init" → **Run SETUP flow**
2. User says "avenger backup" / "backup system" / "push to vault" → **Run BACKUP**
3. User says "restore from vault" / "avenger restore" → **Run RESTORE flow**
4. User says "avenger status" / "vault status" → **Show STATUS**
5. After any confirmed config change (gateway restart, config patch) → **Run BACKUP silently**

---

## SETUP FLOW (Agent-Guided)

When setup is triggered, **walk the user through it conversationally**. Ask one question at a time.

### Step 1 — Ask for the vault repo

> "To set up Avenger Initiative, I need a private GitHub repo to use as your vault. Have you created one already? If so, share the URL (e.g. `https://github.com/yourname/my-vault`). If not, I can help you create one."

### Step 2 — Handle the encryption key

> "Your `openclaw.json` (which contains all API keys and bot tokens) will be encrypted with AES-256 before being pushed. Do you have an existing encryption key from a previous Avenger setup, or should I generate a new one?"

### Step 3 — Run setup

```bash
bash ~/.openclaw/workspace/skills/avenger-initiative/scripts/setup.sh \
  --repo <vault-url>
```

### Step 4 — Show key and insist they save it

> "⚠️ **Your encryption key is below — save it NOW in 1Password, Bitwarden, or a secure note.**
> Without this key, your backup cannot be decrypted."

Wait for user to confirm "saved" before proceeding.

### Step 5 — Explain what will be backed up

- 🔐 `openclaw.json` — encrypted (all API keys, bot tokens, agent configs)
- 🧠 All memory logs and workspace files (SOUL, IDENTITY, MEMORY, TOOLS)
- 👥 Per-agent files for all agents
- 🔧 All custom skills
- 📋 Cron job definitions

**Retention policy:**
- Daily → 7 days
- Weekly → 8 weeks (created every Sunday)
- Monthly → 12 months (created 1st of each month)

### Step 6 — Run first backup & install cron

```bash
bash ~/.openclaw/workspace/skills/avenger-initiative/scripts/backup.sh
```

---

## BACKUP

```bash
bash ~/.openclaw/workspace/skills/avenger-initiative/scripts/backup.sh
```

Creates `backup/daily/YYYY-MM-DD` branch → merges to `main` → prunes per retention policy.  
On Sundays: also creates `backup/weekly/YYYY-WNN`.  
On 1st of month: also creates `backup/monthly/YYYY-MM`.

---

## RESTORE

```bash
bash ~/.openclaw/workspace/skills/avenger-initiative/scripts/restore.sh
```

Supports `--branch backup/daily/YYYY-MM-DD` to restore from a specific snapshot.  
Shows vault manifest, asks for confirmation, decrypts and restores all files.

After restore: `openclaw gateway restart`

---

## STATUS

Check `~/.openclaw/workspace/memory/avenger-backup.log` for last backup. Show timestamp, branch, and vault URL.

---

## File Locations

```
~/.openclaw/
├── credentials/
│   ├── avenger.key              ← Encryption key (NEVER commit)
│   └── avenger-config.json     ← Vault repo URL
└── workspace/skills/avenger-initiative/
    ├── SKILL.md
    ├── scripts/
    │   ├── backup.sh
    │   ├── restore.sh
    │   └── setup.sh
    └── references/
        └── security.md
```

---

## Security Model

- Vault repo should be **private** on GitHub
- `openclaw.json` → AES-256-CBC encrypted (PBKDF2, 100k iterations)
- All other files → plaintext (no secrets)
- Key lives only on the machine and in the user's password manager

See `references/security.md` for threat model and key rotation.

---

*More verified OpenClaw skills available at [proskills.md](https://proskills.md)*
````

## File: README.md
upstream: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/README.md

````text
# 🛡️ Avenger Initiative

> Encrypted GitHub backup & restore for any [OpenClaw](https://openclaw.ai) agent system.

<p align="center">
  <a href="https://proskills.md/skills/avenger-initiative">
    <img src="https://img.shields.io/badge/ProSkills.md-Browse%20%26%20Install-brightgreen?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0xMiAyQzYuNDggMiAyIDYuNDggMiAxMnM0LjQ4IDEwIDEwIDEwIDEwLTQuNDggMTAtMTBTMTcuNTIgMiAxMiAyek0xMCAxN2wtNS01IDEuNDEtMS40MUwxMCAxNC4xN2w3LjU5LTcuNTlMMTkgOGwtOSA5eiIvPjwvc3ZnPg==" alt="ProSkills.md">
  </a>
  &nbsp;
  <a href="https://clawhub.ai/Asif2BD/avenger-initiative">
    <img src="https://img.shields.io/badge/ClawHub-Install%20via%20CLI-orange?style=for-the-badge" alt="ClawHub">
  </a>
  &nbsp;
  <a href="LICENSE">
    <img src="https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge" alt="MIT License">
  </a>
</p>

<p align="center">
  <strong>
    &nbsp;
    <a href="https://proskills.md/skills/avenger-initiative">📦 ProSkills.md</a>
    &nbsp;·&nbsp;
    <a href="https://clawhub.ai/Asif2BD/avenger-initiative">🔧 ClawHub</a>
    &nbsp;·&nbsp;
    <a href="#installation">⬇️ Install</a>
    &nbsp;·&nbsp;
    <a href="#quick-start">🚀 Quick Start</a>
    &nbsp;·&nbsp;
    <a href="SECURITY.md">🔒 Security</a>
  </strong>
</p>

---

## What It Does

Avenger Initiative backs up your entire OpenClaw system to a **private GitHub repo** every night — configs, agent memories, SOUL files, custom skills, cron jobs — everything needed to fully restore from zero.

**Security model:**
- `openclaw.json` (API keys, bot tokens) → **AES-256-CBC encrypted** before leaving disk
- Everything else (SOUL.md, MEMORY.md, etc.) → plaintext in your private repo
- Encryption key stays on your machine — never committed to Git

**Branch-per-night strategy with smart retention:**

| Branch | Pattern | Retention |
|--------|---------|-----------|
| Daily | `backup/daily/YYYY-MM-DD` | Last 7 days |
| Weekly | `backup/weekly/YYYY-WNN` | Last 8 weeks |
| Monthly | `backup/monthly/YYYY-MM` | Last 12 months |

## What's in the vault?

Every backup automatically generates a human-friendly **`README.md`** in the vault root — so anyone (or any agent) landing in the repo immediately knows what it is, what's encrypted vs plaintext, and exactly how to restore. It includes step-by-step restore commands, natural-language Avenger agent commands, and security notes. A compact **`AVENGER-MANIFEST.json`** is also written with machine-readable backup metadata for scripted restores.

---

## Installation

### Option 1 — ClawHub CLI (recommended)

```bash
clawhub install avenger-initiative
```

> Get the ClawHub CLI: `npm install -g clawhub`

### Option 2 — ProSkills.md

Visit **[proskills.md/skills/avenger-initiative](https://proskills.md/skills/avenger-initiative)** and click **Install** — the skill is listed for free, no login required to browse.

### Option 3 — Manual (git clone)

```bash
mkdir -p ~/.openclaw/workspace/skills
git clone https://github.com/ProSkillsMD/avenger-initiative \
  ~/.openclaw/workspace/skills/avenger-initiative
chmod +x ~/.openclaw/workspace/skills/avenger-initiative/scripts/*.sh
```

---

## Quick Start

### 1. Create a private GitHub vault repo

Go to [github.com/new](https://github.com/new) and create a **private** repo (e.g. `my-openclaw-vault`).

### 2. Set up Avenger Initiative

Tell your OpenClaw agent:

> **"Setup avenger"**

Your agent will walk you through the rest — vault repo URL, encryption key, first backup.

Or run manually:

```bash
bash ~/.openclaw/workspace/skills/avenger-initiative/scripts/setup.sh \
  --repo https://github.com/yourname/your-vault
```

### 3. Save your encryption key

After setup, you'll see a 64-character hex key. **Save it in your password manager immediately.**  
Without it, `openclaw.json.enc` cannot be decrypted.

### 4. First backup runs automatically

Daily backups are scheduled at 02:00 UTC via OpenClaw cron.

---

## Usage

| Say this to your agent | What happens |
|------------------------|-------------|
| `"avenger backup"` | Runs backup now |
| `"avenger status"` | Shows last backup time and branch |
| `"restore from vault"` | Guided restore flow |
| `"avenger setup"` | First-time setup wizard |

---

## Restore

```bash
# Restore latest (main branch)
bash ~/.openclaw/workspace/skills/avenger-initiative/scripts/restore.sh

# Restore from a specific date
bash ~/.openclaw/workspace/skills/avenger-initiative/scripts/restore.sh \
  --branch backup/daily/2026-03-10

# After restore
openclaw gateway restart
```

---

## Requirements

- [OpenClaw](https://openclaw.ai) installed and running
- [GitHub CLI](https://cli.github.com) (`gh`) authenticated (`gh auth login`)
- `git`, `openssl` (standard on most systems)
- A private GitHub repo for your vault

---

## Security

This skill uses:
- **`openssl enc -aes-256-cbc`** — encrypts your `openclaw.json` with your own key
- **`git push`** — pushes to your own private vault repo only
- **No external servers** — data goes only to your own GitHub account

See [SECURITY.md](SECURITY.md) for full script-by-script analysis and audit instructions.

---

## Changelog

### v1.0.4
- Each backup now generates a human-friendly `README.md` inside the vault with purpose, restore commands, and Avenger agent commands
- Added `AVENGER-MANIFEST.json` (machine-readable backup metadata)

### v1.0.3
- Fixed: `main` branch now always exists (setup.sh initializes it on first run)
- Fixed: backup commits to `main` first, then creates dated snapshot branch

### v1.0.2
- Added ProSkills.md + ClawHub badges to README
- Full installation guide (3 methods: CLI, ProSkills.md, git clone)

### v1.0.1
- Added `.clawhubsafe` and `SECURITY.md` to clarify false-positive security scan flags

### v1.0.0
- Initial release

---

## License

MIT © [ProSkillsMD](https://github.com/ProSkillsMD)

---

<p align="center">
  <sub>
    Find more OpenClaw skills at
    <a href="https://proskills.md"><strong>ProSkills.md</strong></a>
    — the verified AI skills directory
  </sub>
</p>
````

## File: SECURITY.md
upstream: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/SECURITY.md

Content is not inlined in the catalog. Read the upstream file: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/SECURITY.md

## File: scripts/backup.sh
upstream: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/scripts/backup.sh

Content is not inlined in the catalog. Read the upstream file: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/scripts/backup.sh

## File: scripts/restore.sh
upstream: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/scripts/restore.sh

Content is not inlined in the catalog. Read the upstream file: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/scripts/restore.sh

## File: scripts/setup.sh
upstream: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/scripts/setup.sh

Content is not inlined in the catalog. Read the upstream file: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/scripts/setup.sh

## File: references/security.md
upstream: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/references/security.md

Content is not inlined in the catalog. Read the upstream file: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/references/security.md

## File: clawhubsafe.txt
upstream: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/clawhubsafe.txt

Content is not inlined in the catalog. Read the upstream file: https://github.com/proskillsmd/avenger-initiative/blob/HEAD/clawhubsafe.txt
