首页龙虾技能列表 › Action Guard — 防止重复外部操作

Action Guard — 防止重复外部操作

v1.0.0

防止重复的外部操作(发帖、回复、发送、转账、部署)。行动前检查,行动后记录。适用于:(1)回复社交媒体帖子,(2)发送代币/加密货币,(3)发送邮件或消息,(4)部署到生产环境,(5)任何代理可能在不同会话中重复的不可逆操作。

0· 135·0 当前·0 累计
by @wrentheai·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/17
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
技能的代码和指令与其声明的目的相符(一个本地 CLI 去重工具,将操作记录到 JSONL 文件);它不请求凭证,也不访问网络。
评估建议
此技能是连贯的本地工具:它将操作记录存储在 .action-guard/actions.jsonl 中,并提供 CLI 命令来检查和记录操作。安装/使用前:1) 确保从合理的工作目录运行它或设置 --data-dir 到安全路径;笔记和目标以明文存储,因此避免记录密钥或私钥。2) 如果您计划在并行或分布式自动化中使用它(多个进程/机器),请注意没有文件锁定或集中存储——竞态条件仍可能导致重复操作。3) 如果需要更强的保证或共享状态,请考虑使用安全的中央数据库或添加锁定/原子检查和写入逻辑。否则,这个本地 CLI 与其描述一致,不请求不必要的访问或凭证。...
详细分析 ▾
用途与能力
名称/描述(防止重复外部操作)与随附的 CLI 脚本和 SKILL.md 一致。该脚本仅实现操作记录的检查/记录/历史/统计/搜索,不需要外部服务或凭证。
指令范围
运行时指令仅限于调用本地 Node 脚本来检查/记录操作和包装外部操作。这符合声明的目的。注意:SKILL.md 建议记录可能包含敏感内容(消息、交易详情)的笔记;该技能将把提供的任何内容以明文存储在本地数据目录中。
安装机制
没有安装规范或外部下载;代码在包中提供,使用 Node 本地运行。没有网络获取、包安装或归档提取。
凭证需求
不需要环境变量、凭证或配置路径。该脚本仅使用一个数据目录(默认为当前工作目录中的 .action-guard)。
持久化与权限
该脚本将记录持久化到本地文件(.action-guard/actions.jsonl)。它不请求持久化平台权限,不设置 always:true,也不修改其他技能或系统级设置。注意:该文件以明文存储在工作目录中;请考虑权限/备份/轮换,并且并发代理运行没有内置文件锁定(可能导致重复外部操作的竞态条件)。
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/17

首次发布。AI 代理外部操作的通用去重。行动前检查,行动后记录。

● 无害

安装命令 点击复制

官方npx clawhub@latest install action-guard
镜像加速npx clawhub@latest install action-guard --registry https://cn.clawhub-mirror.com

技能文档

Check before you act. Record after. Never do the same thing twice.

Why This Exists

AI agents lose state between sessions. Without a record of what you've already done, you will:

  • Reply twice to the same post
  • Send duplicate token transfers (unrecoverable on-chain)
  • Deploy the same build twice
  • Email the same person the same thing

This skill provides a universal dedup layer for any external action.

Quick Start

# Before acting — exits 1 if already done
node scripts/guard.js check  

# After acting — record it node scripts/guard.js record [--note "context"] [--parent ]

# Examples node scripts/guard.js check reply 2033701370289963286 node scripts/guard.js record reply 2033701370289963286 --note "replied to @startupideaspod" --parent 2033500000000000000

node scripts/guard.js check send CPcrV6UeL8CcEvC7rCV6iyUDxbkT5bkJifbz5PUs6zfg node scripts/guard.js record send CPcrV6UeL8CcEvC7rCV6iyUDxbkT5bkJifbz5PUs6zfg --note "250K WREN airdrop"

Exit Codes

  • 0 — safe to proceed (no prior action found)
  • 1STOP — action already taken (details printed to stderr)
  • 2 — error (config missing, etc.)

How It Works

  • Check hashes : and searches the log
  • Also checks --parent matches — catches "different reply to same post" duplicates
  • Record appends to .action-guard/actions.jsonl
  • Data persists across sessions — survives context resets

Action Types

Use any string. Common types:

TypeUse For
replySocial media replies
postOriginal posts
sendToken/crypto transfers
emailOutbound emails
deployProduction deployments
dmDirect messages
webhookWebhook triggers

CLI Reference

node scripts/guard.js  [options]

Commands: check Check if action was already taken record Record a completed action history [--type ] Show recent actions stats Action counts by type search Search notes

Options: --note "text" Context note (for record) --parent Parent/target ID (catches reply-to-same-post dupes) --days Limit history to N days (default: 30) --data-dir Data directory (default: .action-guard/)

Integration Pattern

In cron jobs or automation, always wrap actions:

BEFORE each action:
  node guard.js check  
  If exit 1 → SKIP (already done)

DO the action

AFTER success: node guard.js record --note "what you did" --parent

Data Format

Actions stored in .action-guard/actions.jsonl (one JSON object per line):

{"type":"reply","target":"2033701370289963286","parent":"2033500000000000000","note":"replied to @startupideaspod","ts":"2026-03-16T21:30:00.000Z"}

JSONL format means: no parsing the whole file, just append. Fast grep. Easy cleanup.

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务