← 返回 Skills 市场
tashfeenahmed

Emotion State

作者 tashfeenahmed · GitHub ↗ · v1.2.0
cross-platform ⚠ suspicious
2718
总下载
6
收藏
3
当前安装
5
版本数
在 OpenClaw 中安装
/install emotion-state
功能描述
NL emotion tracking + prompt injection via OpenClaw hook
使用说明 (SKILL.md)

Emotion State (NL) Skill

This skill describes how to install and configure the Emotion State hook, which adds a compact emotion_state block to the system prompt.

What it does

  • Evaluates user and agent emotions as short natural-language phrases.
  • Stores per-user emotion state across sessions in the agent state directory.
  • Injects the latest entries plus a decayed trend line into the system prompt.

Install & enable (workspace hook)

  1. After installing the skill, copy the bundled hook into your workspace:
cp -R ./skills/emotion-state/hooks/emotion-state ./hooks/
  1. Enable the hook in OpenClaw:
openclaw hooks enable emotion-state
  1. Restart the OpenClaw gateway.

Configuration

Set environment variables for the hook via OpenClaw config, e.g. in ~/.openclaw/openclaw.json:

{
  "hooks": {
    "internal": {
      "enabled": true,
      "entries": {
        "emotion-state": {
          "enabled": true,
          "env": {
            "EMOTION_CLASSIFIER_URL": "",
            "OPENAI_API_KEY": "YOUR_KEY",
            "OPENAI_BASE_URL": "https://api.openai.com/v1",
            "EMOTION_MODEL": "gpt-4o-mini",
            "EMOTION_CONFIDENCE_MIN": "0.35",
            "EMOTION_HISTORY_SIZE": "100",
            "EMOTION_HALF_LIFE_HOURS": "12",
            "EMOTION_TREND_WINDOW_HOURS": "24",
            "EMOTION_MAX_USER_ENTRIES": "3",
            "EMOTION_MAX_AGENT_ENTRIES": "2",
            "EMOTION_MAX_OTHER_AGENTS": "3",
            "EMOTION_TIMEZONE": "America/Los_Angeles"
          }
        }
      }
    }
  }
}

Notes

  • The hook stores state at ~/.openclaw/agents/\x3CagentId>/agent/emotion-state.json.
  • It does not store raw user text; only model-inferred reasons.
  • If the classifier fails, entries fall back to neutral/low/unsure.
安全使用建议
This skill will read session messages, keep a per-agent emotion_state file under ~/.openclaw/agents/<agentId>/agent/emotion-state.json, and may send raw message text to an external classifier or OpenAI if configured. The registry omitted required env vars, and the SKILL.md's claim that it 'does not store raw user text' does not prevent it from transmitting raw text to external services. Before installing: (1) review the handler.ts code yourself or with a trusted developer; (2) do not provide an OPENAI_API_KEY (or any classifier URL) unless you trust the operator of that endpoint; (3) if you must test, run in an isolated agent/workspace with non-sensitive data; (4) inspect the system-prompt content the hook injects to ensure it doesn't contain instructions you don't want the model to follow. If you cannot audit the code or you need to protect sensitive user messages, avoid enabling this hook.
功能分析
Type: OpenClaw Skill Name: Developer: Version: Description: OpenClaw Agent Skill Suspicious High-Entropy/Eval files: 1 The skill is classified as suspicious due to its network capabilities and broader file system access. It makes network calls to user-configurable external endpoints (`EMOTION_CLASSIFIER_URL`) or OpenAI, sending user and agent message content for emotion classification, which is a risky capability if a malicious URL is configured by the user. Additionally, the hook reads state files of other agents from the OpenClaw state directory (`~/.openclaw/agents/<otherAgentId>/agent/emotion-state.json`), which represents a broader scope of file system access than strictly its own agent's state. While the `SKILL.md` mentions 'prompt injection', the code demonstrates this is for functional context injection of classified emotions, not malicious manipulation.
能力评估
Purpose & Capability
The skill's name/description (emotion tracking + injecting an emotion_state block into the system prompt) aligns with the included hook code. However the registry declares no required environment variables while the hook clearly expects and uses many (OPENAI_API_KEY, EMOTION_CLASSIFIER_URL, etc.). That discrepancy is incoherent and surprising to an installer.
Instruction Scope
The SKILL.md and HOOK.md instruct the agent to copy/enable a hook that reads session messages and injects an emotion_state block into the system prompt. The hook will transmit user/agent message text to an external classifier endpoint or OpenAI for classification (network calls). The SKILL.md claims it 'does not store raw user text' but the code sends raw text externally — this is a scope mismatch and a potential data-exfiltration vector. Injecting content into the system prompt is powerful and can change agent behavior.
Install Mechanism
No remote install or downloads are used; this is an instruction-only skill with a bundled hook file you copy into your workspace. That limits installer-level risk (nothing fetched from arbitrary URLs).
Credentials
Registry metadata lists no required env vars, but the hook expects multiple configuration variables (OPENAI_API_KEY, OPENAI_BASE_URL, EMOTION_CLASSIFIER_URL, EMOTION_* settings). Requiring an OpenAI API key (or any classifier endpoint) is a powerful permission because it causes user message text to be sent off-host. The number and sensitivity of env vars is disproportionate to what's declared.
Persistence & Privilege
The hook writes per-agent state to ~/.openclaw/agents/<agentId>/agent/emotion-state.json and injects a block into the system prompt during bootstrap. It does not request permanent 'always' inclusion, but system-prompt modification is an elevated capability — expected for hooks but worth noting because it can influence model behavior.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install emotion-state
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /emotion-state 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
Fix JSONL session file parsing, add fetch timeouts, fix OpenAI classifier role handling, use JSON response mode, add LRU user eviction, add state file locking, add error logging
v1.1.0
Initial public release
v1.0.1
Initial public release with bundled hook files
v1.0.0
- Initial release of the emotion-state skill. - Tracks user and agent emotions as natural language phrases. - Stores per-user emotion state across sessions in the agent state directory. - Injects emotion trends into the system prompt for contextual awareness. - Provides configuration options for emotion model, history, and other parameters.
v0.1.0
Initial release
元数据
Slug emotion-state
版本 1.2.0
许可证
累计安装 3
当前安装数 3
历史版本数 5
常见问题

Emotion State 是什么?

NL emotion tracking + prompt injection via OpenClaw hook. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2718 次。

如何安装 Emotion State?

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

Emotion State 是免费的吗?

是的,Emotion State 完全免费(开源免费),可自由下载、安装和使用。

Emotion State 支持哪些平台?

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

谁开发了 Emotion State?

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

💬 留言讨论