Instruction Anchor Guard for Openclaw

A persistence layer for AI agents that ensures critical user constraints and high-priority rules are never lost during context compaction or long sessions.

dalomeve
v1.0.0
Mar 1, 2026
0
918
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install instruction-anchor-guard

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install instruction-anchor-guard using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Instruction Anchor Guard?

Instruction Anchor Guard is a specialized resilience skill designed to solve the problem of context drift in LLM-based agents. In long-running sessions, essential instructions often get buried or purged during context window compaction. This skill provides a structured ledger system to capture, store, and rehydrate user-critical constraints, ensuring the agent remains compliant with your highest-priority rules.

By integrating this into your Openclaw Skills library, you enable more reliable and deterministic agent behavior that respects non-negotiable boundaries throughout the entire task lifecycle. It acts as a permanent memory for constraints, ensuring that once a rule is established, it stays active regardless of how long the conversation becomes.

Instruction Anchor Guard Use Cases

  • Managing complex coding tasks where specific architectural constraints must be followed.
  • Ensuring safety protocols or "never do X" rules are preserved across multi-turn research sessions.
  • Maintaining project-specific style guides or naming conventions during long development sprints.
  • Preventing instruction loss when the AI context window undergoes compaction or reset.
  • Enforcing high-priority constraints across multiple agents in a shared workspace.

How Instruction Anchor Guard Works

  1. Capture: The skill parses user messages for candidate anchor statements marked with keywords like important, must, or critical.
  2. Confirm: For global or high-priority (P0) anchors, the agent requests a quick one-line confirmation before persistence.
  3. Persist: Validated instructions are appended to a structured Markdown ledger located in the memory directory of the workspace.
  4. Rehydrate: Active anchors are loaded into an in-memory set at the start of every turn and immediately after any context compaction event.
  5. Drift Check: The agent compares its current execution plan against the active anchor set to prevent any rule violations before taking action.

Instruction Anchor Guard Setup

To use this within your Openclaw Skills environment, ensure your workspace has a memory directory. The skill automatically looks for the ledger in preferred paths. You can manually initialize the ledger or let the agent create it upon the first anchor capture.

mkdir -p memory
touch memory/anchors.md

Instruction Anchor Guard Data Schema & Taxonomy

The skill maintains an append-only Markdown ledger with specific metadata for every anchor to ensure transparency and auditability:

Field Description
Anchor ID Unique identifier for the specific instruction
Priority P0 (Critical) to P2 (Minor) levels
Scope Defines if the rule is Global, Session, or Task-specific
Status Tracks if the anchor is Active, Paused, Expired, or Superseded
Signature A stable hash of the canonical instruction to track integrity
Expiry ISO-8601 timestamp or "never" for permanent rules

Instruction Anchor Guard Advanced Features

  • Automated drift detection blocks (DRIFT_CHECK) emitted in the response to verify plan alignment.
  • Sophisticated conflict resolution logic that prioritizes safety policies and specific task scopes.
  • Ledger rotation and archiving for high-volume sessions to keep performance optimal.
  • Support for manual control intents such as /anchors list, /anchors pause, and /anchors delete.
  • Native integration with other Openclaw Skills like memory-self-heal for automated error recovery.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*