← 返回 Skills 市场
wrentheai

Action Guard

作者 wrentheai · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
182
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install action-guard
功能描述
Prevents duplicate external actions (posts, replies, sends, transfers, deploys). Check before acting, record after. Use when: (1) replying to social media po...
使用说明 (SKILL.md)

Action Guard

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 \x3Caction-type> \x3Ctarget-id>

# After acting — record it
node scripts/guard.js record \x3Caction-type> \x3Ctarget-id> [--note "context"] [--parent \x3Cparent-id>]

# 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

  1. Check hashes \x3Caction-type>:\x3Ctarget-id> and searches the log
  2. Also checks --parent matches — catches "different reply to same post" duplicates
  3. Record appends to .action-guard/actions.jsonl
  4. Data persists across sessions — survives context resets

Action Types

Use any string. Common types:

Type Use For
reply Social media replies
post Original posts
send Token/crypto transfers
email Outbound emails
deploy Production deployments
dm Direct messages
webhook Webhook triggers

CLI Reference

node scripts/guard.js \x3Ccommand> [options]

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

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

Integration Pattern

In cron jobs or automation, always wrap actions:

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

DO the action

AFTER success:
  node guard.js record \x3Ctype> \x3Ctarget> --note "what you did" --parent \x3Cparent-if-applicable>

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.

安全使用建议
This skill appears coherent and local-only: it stores action records in .action-guard/actions.jsonl and provides CLI commands to check and record actions. Before installing/using: 1) Ensure you run it from a sensible working directory or set --data-dir to a secure path; the notes and targets are stored in plaintext, so avoid recording secrets or private keys. 2) If you plan to use it in parallel or distributed automation (multiple processes/machines), be aware there is no file-locking or centralized store — race conditions could still allow duplicate actions. 3) If you need stronger guarantees or shared state, consider using a secure central database or add locking/atomic check-and-write logic. Otherwise this local CLI is consistent with its description and does not request unnecessary access or credentials.
功能分析
Type: OpenClaw Skill Name: action-guard Version: 1.0.0 The action-guard skill is a utility designed to prevent AI agents from performing duplicate external actions (e.g., double-posting or double-sending tokens) by maintaining a local state. It uses a Node.js script (scripts/guard.js) to record and check action history in a local JSONL file (.action-guard/actions.jsonl). The code is straightforward, uses only built-in modules (fs, path), and contains no evidence of data exfiltration, malicious execution, or prompt injection.
能力评估
Purpose & Capability
Name/description (prevent duplicate external actions) aligns with the included CLI script and SKILL.md. The script only implements check/record/history/stats/search for action records and requires no external services or credentials.
Instruction Scope
Runtime instructions are limited to invoking the local Node script to check/record actions and to wrap external actions. This stays within the stated purpose. Note: SKILL.md suggests recording notes which could contain sensitive content (messages, transaction details); the skill will store whatever is provided in plaintext in the local data directory.
Install Mechanism
No install spec or external downloads; code is provided in the package and runs locally with Node. No network fetches, package installs, or archive extraction are present.
Credentials
No environment variables, credentials, or config paths are required. The script uses only a data directory (default .action-guard in the current working directory).
Persistence & Privilege
The script persists records to a local file (.action-guard/actions.jsonl). It does not request persistent platform privileges, does not set always:true, and does not modify other skills or system-wide settings. Note: the file is stored in plaintext in the working-directory; consider permissions/backup/rotation and that concurrent agent runs have no built-in file-locking (possible race conditions leading to duplicate external actions).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install action-guard
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /action-guard 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release. Universal dedup for AI agent external actions. Check before acting, record after.
元数据
Slug action-guard
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Action Guard 是什么?

Prevents duplicate external actions (posts, replies, sends, transfers, deploys). Check before acting, record after. Use when: (1) replying to social media po... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 182 次。

如何安装 Action Guard?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install action-guard」即可一键安装,无需额外配置。

Action Guard 是免费的吗?

是的,Action Guard 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Action Guard 支持哪些平台?

Action Guard 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Action Guard?

由 wrentheai(@wrentheai)开发并维护,当前版本 v1.0.0。

💬 留言讨论