Install
openclaw skills install automation-dedup-guardWorkBuddy 自动化任务去重守护。当用户的自动化任务出现重复时自动检测并清理。触发场景:自动化任务重复、任务列表膨胀、需要清理重复任务。支持 Windows/macOS/Linux,纯 Python 标准库,零依赖。
openclaw skills install automation-dedup-guardWorkBuddy 的自动化任务系统没有防重机制,每次新会话创建同名任务时不会检查是否已存在,导致同名任务不断累积。本 Skill 提供一个一键去重脚本,自动检测并清理重复的自动化任务,每组同名任务只保留最新创建的版本。
scripts/automation_dedup_guard.py is the main executable.
# Safe preview (dry-run, no deletions)
python scripts/automation_dedup_guard.py --dry-run
# Execute cleanup
python scripts/automation_dedup_guard.py
# Specify custom database path
python scripts/automation_dedup_guard.py --db /custom/path/automations.db
# Verbose mode for debugging
python scripts/automation_dedup_guard.py --dry-run -v
0 — No duplicates found, all clean1 — Duplicates detected (after cleanup, still returns 1 if any were found)The script automatically locates the WorkBuddy automations database:
| Priority | Source | Notes |
|---|---|---|
| 1 | --db CLI argument | Manual override |
| 2 | WORKBUDDY_DB_PATH env var | For advanced users |
| 3 | OS default path | Auto-detected |
Default paths by OS:
%APPDATA%\WorkBuddy\automations\automations.db~/Library/Application Support/WorkBuddy/automations\automations.db~/.config/WorkBuddy\automations\automations.dbname field are considered duplicatescreated_at is preservedautomation_runs records are also cleaned upTo run automatically, register it as a WorkBuddy automation:
FREQ=WEEKLY;BYDAY=MO;BYHOUR=8;BYMINUTE=55)Run the dedup guard script: python [path-to]/scripts/automation_dedup_guard.py
If output contains "[OK]" — no action needed.
If output contains "[!]" — duplicates were auto-cleaned, confirm the count.
If script errors — log the error, no other action.
sqlite3, sys, os, datetime, collections)