LaunchKit · 2026
Back to Skills

message-injector

OpenClaw plugin that prepends custom text to every user message before it reaches the agent.

0
401 downloads
by @harukaon

Setup & Installation

openclaw skills install @harukaon/message-injector

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install message-injector

What This Skill Does

A workspace extension for OpenClaw that prepends custom text to every user message before the agent processes it. Uses the `before_agent_start` hook to inject text at the Gateway level, making it impossible for the agent to bypass. Works across all channels.

Unlike system prompt edits that vary per session or client, this injects at the Gateway level so the instruction applies universally regardless of which channel or client is used.

When to use it

  • Force memory search before every agent reply
  • Inject current project context into each conversation turn
  • Enforce safety rules like confirming before file deletion
  • Add persistent reminders without modifying each prompt manually
  • Maintain consistent persona or language instructions across sessions

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: 'Delete the old logs folder'

AGENT
  1. 1before_agent_start hook fires on incoming message
  2. 2Plugin reads prependText from config: '[RULE: Always verify file paths before deletion. Never run rm -rf without confirmation.]'
  3. 3prependContext prepends the rule to the user message
  4. 4Agent receives combined message: rule + original user request
  5. 5Agent processes message with injected constraint in context
OUTPUT

Agent responds by asking for confirmation before proceeding with deletion

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

OpenClaw Gateway installed and running