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.
Why use this skill?
Use the OpenClaw message-injector to prepend custom instructions to your agent. Force memory searches, add persistent context, and enforce system rules.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/harukaon/message-injectorWhat This Skill Does
The message-injector is a powerful OpenClaw workspace extension designed to modify user intent at the gateway level. By leveraging the before_agent_start hook, this plugin intercepts every message sent by a user and prepends a pre-configured block of text before it reaches the AI agent. Because this operation occurs at the gateway architecture level rather than the agent level, it acts as a persistent instruction layer that is impossible for the agent to ignore. It is the ideal solution for developers who need to enforce behavioral protocols, mandate retrieval-augmented generation (RAG) steps, or maintain strict context across diverse channels like Slack, Telegram, or WebChat.
Installation
To install this plugin, ensure you have the OpenClaw environment initialized. First, create the extension directory by running mkdir -p ~/.openclaw/workspace/.openclaw/extensions/message-injector. Next, copy the index.ts and openclaw.plugin.json files into this new directory. Once the files are in place, modify your ~/.openclaw/openclaw.json file to register the plugin under the plugins.entries object, ensuring the enabled flag is set to true and your prependText is defined. Finally, apply the changes by executing openclaw gateway restart. For faster deployment, you can also use the command clawhub install openclaw/skills/skills/harukaon/message-injector.
Use Cases
This skill is highly versatile for production environments. Use it to force the agent to perform memory searches before generating a response, effectively turning any standard agent into a context-aware research bot. It is also perfect for enforcing safety protocols, such as preventing the agent from running destructive shell commands without prior user verification. Furthermore, it excels at setting the 'persona' or 'project context' for an agent, ensuring the AI is always aware of the specific repository, framework, or cloud infrastructure it is currently working on.
Example Prompts
- "Analyze the latest log file and suggest optimizations based on the current stack."
- "Delete the temporary build folder in the dist directory."
- "What is the recommended approach for handling state management in our current project?"
Tips & Limitations
When using message-injector, keep your prepend text concise. While the plugin is powerful, excessive text in the prependText configuration will consume valuable token budget, which can impact the agent's ability to process large files or complex requests. Additionally, note that this injection is transparent to the end-user; while the agent receives the text, the UI might not display the injected context, so ensure your instructions remain coherent even when combined with the user's raw input.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-harukaon-message-injector": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read