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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "message-injector" with this command: npx skills add harukaon/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

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:

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:

"message-injector": {
  "enabled": true,
  "config": {
    "enabled": true,
    "prependText": "Your custom text here"
  }
}

4. Restart Gateway

openclaw gateway restart

Configuration

FieldTypeDefaultDescription
enabledbooleantrueEnable or disable the injector
prependTextstring""Text to prepend before every user message

Example Use Cases

Force memory search:

"prependText": "[⚠️ 回答前必须先 memory_search 检索相关记忆,禁止凭印象回答]"

Add persistent context:

"prependText": "[当前项目:my-app | 技术栈:React + Node.js | 部署环境:AWS]"

Inject safety rules:

"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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Edicts — Ground Truth for AI Agents

Ground truth layer for AI agents — provide verified facts in every prompt and expose read/search tools for edict management. Write tools are opt-in. No more...

Registry Source
1330Profile unavailable
Automation

The Spaced Repetition Systems for Agents

Use when running Spaced Repetition Systems for AI Agents (SRSA) daily review sessions, grading cards with again/hard/good/easy, and proposing explicit memory...

Registry Source
1480Profile unavailable
General

赛博功德箱 (Cyber TipJar)

赛博功德箱/AI打赏罐。记录用户给 AI 奖励的“鸡腿”、“咖啡”等。当用户说“给你加个鸡腿”、“请你喝咖啡”或者查询自己给过多少奖励时触发。这是一个提供高情绪价值的互动技能。

Registry SourceRecently Updated
660Profile unavailable
Research

Memoria

The most advanced memory system for AI agents. 24 cognitive layers, knowledge graph, procedural learning, dialectic queries, AI self-observation, auto skill...

Registry SourceRecently Updated
3092Profile unavailable