Heleni Maintenance
by @netanel-abergel
Unified workspace maintenance skill. Covers: (1) backing up the workspace to GitHub git repo, and (2) updating OpenClaw and skills. Use when: asked to backup...
clawhub install heleni-maintenanceπ About This Skill
name: workspace-maintenance description: "Unified workspace maintenance skill. Covers: (1) backing up the workspace to GitHub git repo, and (2) updating OpenClaw and skills. Use when: asked to backup, push to git, update openclaw, update skills, or run maintenance."
Maintenance Skill
Minimum Model
Any model. Both sections are scripted operations.Trigger Phrases
Section 1 β Workspace Backup
Back up the entire workspace to GitHub on a regular schedule or on demand.
When to Run
Step 1 β Find the GitHub Token
Priority order: 1. Git remote URL β check if token is embedded:
git -C /opt/ocana/openclaw/workspace remote get-url origin
2. Environment variable:
echo $GITHUB_TOKEN
echo $GH_TOKEN
3. Credentials file:
cat ~/.credentials/github-token.txt 2>/dev/null
cat ~/.credentials/github-pat.txt 2>/dev/null
If no token found β report BLOCKED to owner.
Step 2 β Commit and Push
cd /opt/ocana/openclaw/workspaceStage all changes
git add -ACommit with timestamp
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M UTC")
git commit -m "Auto-backup: $TIMESTAMP" 2>/dev/null || echo "Nothing to commit"Push
git push origin main
Step 3 β Report (On-Demand Only)
If triggered manually (not by cron):
β
Workspace backed up to GitHub β [timestamp]
[X] files changed
If triggered by cron β silent (no message to owner).
Cron Schedule
openclaw cron add \
--name "workspace-backup" \
--every 6h \
--session isolated \
--message "Run the maintenance skill, Section 1 (Workspace Backup). cd /opt/ocana/openclaw/workspace && git add -A && git commit -m 'Auto-backup: $(date -u +\"%Y-%m-%d %H:%M UTC\")' && git push origin main. Silent β do not message owner unless push fails." \
--timeout-seconds 60
Troubleshooting
| Issue | Fix |
|---|---|
| git push auth error | Token expired β update in remote URL or credentials file |
| nothing to commit | Normal β workspace unchanged since last backup |
| rejected (non-fast-forward) | Run git pull --rebase origin main first, then push |
| No token found | Ask owner for a GitHub PAT with repo scope |
Section 2 β OpenClaw Updates
Keep OpenClaw and installed skills up to date.
When to Run
Step 1 β Update OpenClaw
# Update the OpenClaw platform
openclaw updateCheck the new version
openclaw --version
Step 2 β Update Skills via ClawHub
# Update all installed skills to latest
clawhub updateOr update a specific skill
clawhub update
Step 3 β Report What Changed
After updates, report to owner:
π Maintenance complete (Sunday update):OpenClaw: v1.2.3 β v1.2.4
- [changelog item if available]
Skills updated:
- skill-master: v1.1 β v1.2
- whatsapp: v2.0 β v2.1
- [others]
No action needed. Everything is up to date.
If nothing changed:
β
No updates available β everything is current.
Step 4 β Verify After Update
# Check gateway is still running
openclaw gateway statusCheck agent is responding (send a test message or check logs)
openclaw logs --last 10
If gateway is down after update β run openclaw gateway restart.
Cron Schedule
openclaw cron add \
--name "weekly-update" \
--cron "0 3 * * 0" \
--session isolated \
--message "Run maintenance skill Section 2 (OpenClaw Updates): run 'openclaw update' and 'clawhub update', then report what changed to owner via WhatsApp." \
--to "OWNER_PHONE" \
--channel whatsapp \
--timeout-seconds 300
Troubleshooting
| Issue | Fix |
|---|---|
| openclaw update fails | Check internet connectivity; retry in 30 min |
| clawhub update not found | Install: npm install -g clawhub |
| Gateway down after update | Run openclaw gateway restart |
| Skills missing after update | Re-install: clawhub install |
Section 3 β Session Store Cleanup
Prevent sessions.json from bloating (observed growing to 67MB+ with 600+ stale cron run entries).
When to Run
sessions.json exceeds 10MBStep 1 β Check Size
ls -lh /opt/ocana/openclaw/agents/main/sessions/sessions.json
If under 10MB β skip cleanup.
Step 2 β Clean Stale Cron Run Entries
cd /opt/ocana/openclaw/agents/main/sessionsBackup first
cp sessions.json sessions.json.bak.$(date +%Y%m%d-%H%M%S)Remove all :run: entries (completed cron run histories)
python3 -c "
import json
with open('sessions.json') as f:
d = json.load(f)
before = len(d)
cleaned = {k:v for k,v in d.items() if ':run:' not in k}
after = len(cleaned)
with open('sessions.json', 'w') as f:
json.dump(cleaned, f)
print(f'Removed {before-after} entries. {after} remaining.')
"
Step 3 β Restart Gateway
openclaw gateway restart
Step 4 β Report
π§Ή Session cleanup: [X]MB β [Y]MB, removed [N] stale cron run entries.
Cost Tips
π Tips & Best Practices
| Issue | Fix |
|---|---|
| git push auth error | Token expired β update in remote URL or credentials file |
| nothing to commit | Normal β workspace unchanged since last backup |
| rejected (non-fast-forward) | Run git pull --rebase origin main first, then push |
| No token found | Ask owner for a GitHub PAT with repo scope |