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.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- message-injector
- description
- 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.
03 SKILL.md 正文
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
| 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:
"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
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.