返回顶部
m

message-injector

OpenClaw plugin that prepends custom text to every user message before it reaches the agent. Use for: enforcing memory_search before replies, injecting system-level instructions, adding persistent reminders to every conversation turn. Install as a workspace extension — works on all channels including WebChat, Telegram, Slack, etc.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
581
下载量
0
收藏
概述
安装方式
版本历史

message-injector

# Message Injector A lightweight OpenClaw workspace extension that uses the `before_agent_start` hook to inject custom text into every user message via `prependContext`. ## Installation ### 1. Create the extension directory ```bash mkdir -p ~/.openclaw/workspace/.openclaw/extensions/message-injector ``` ### 2. Copy the plugin files Copy `scripts/index.ts` and `scripts/openclaw.plugin.json` to the extension directory: ```bash cp scripts/index.ts ~/.openclaw/workspace/.openclaw/extensions/message-injector/ cp scripts/openclaw.plugin.json ~/.openclaw/workspace/.openclaw/extensions/message-injector/ ``` ### 3. Add configuration Add the following to `~/.openclaw/openclaw.json` under `plugins.entries`: ```json "message-injector": { "enabled": true, "config": { "enabled": true, "prependText": "Your custom text here" } } ``` ### 4. Restart Gateway ```bash openclaw gateway restart ``` ## Configuration | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | boolean | `true` | Enable or disable the injector | | `prependText` | string | `""` | Text to prepend before every user message | ## Example Use Cases **Force memory search:** ```json "prependText": "[⚠️ 回答前必须先 memory_search 检索相关记忆,禁止凭印象回答]" ``` **Add persistent context:** ```json "prependText": "[当前项目:my-app | 技术栈:React + Node.js | 部署环境:AWS]" ``` **Inject safety rules:** ```json "prependText": "[RULE: Always verify file paths before deletion. Never run rm -rf without confirmation.]" ``` ## How It Works The plugin registers a `before_agent_start` hook. When triggered, it returns `{ prependContext: prependText }` which OpenClaw prepends to the user's message before the agent processes it. This is a hard injection at the Gateway level — the agent cannot skip or ignore it. ## Source Code GitHub: https://github.com/Harukaon/openclaw-message-injector

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 message-injector-1776318259 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 message-injector-1776318259 技能

通过命令行安装

skillhub install message-injector-1776318259

下载 Zip 包

⬇ 下载 message-injector v1.0.0

文件大小: 2.61 KB | 发布时间: 2026-4-16 18:36

v1.0.0 最新 2026-4-16 18:36
Initial release: prepend custom text to every user message via before_agent_start hook

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部