Skip to content
Back to skills

Openclaw Reflect

ASecurity

Self-improvement layer with evaluation separation, rollback, and tiered operator gates. Observes outcomes across sessions, detects recurring patterns, proposes improvements, validates proposals through a separate evaluator invocation, and applies changes safely with snapshot/rollback capability.

  • 14 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 7, 2026
ai-agentsbashnodedebuggingapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 19 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill openclaw-reflect --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Openclaw Reflect?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Openclaw Reflect
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-openclaw-reflect/badge)](https://www.skillsdirectory.com/skills/modbender-openclaw-reflect)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: openclaw-reflect
version: 1.0.2
description: >
  Self-improvement layer with evaluation separation, rollback, and tiered operator gates.
  Observes outcomes across sessions, detects recurring patterns, proposes improvements,
  validates proposals through a separate evaluator invocation, and applies changes
  safely with snapshot/rollback capability.
author: AtlasPA
tags: [self-improvement, reflection, memory, safety, hooks, evaluation]
hooks:
  - event: PostToolUse
    path: hooks/post-tool-use.js
  - event: SessionEnd
    path: hooks/session-end.js
  - event: UserPromptSubmit
    path: hooks/user-prompt-submit.js
permissions:
  - read: workspace
  - write: .reflect/
  - write: MEMORY.md
  - write: CLAUDE.md
  - propose: SOUL.md
env:
  optional:
    - ANTHROPIC_API_KEY     # Enables Anthropic evaluator backend (claude-haiku-4-5-20251001)
    - OPENAI_API_KEY        # Enables OpenAI evaluator backend (gpt-4o-mini)
    - OLLAMA_HOST           # Ollama server hostname (default: localhost)
    - OLLAMA_PORT           # Ollama server port (default: 11434)
    - REFLECT_EVAL_MODEL    # Force a specific Ollama model name
    - REFLECT_EVALUATOR     # Force evaluator backend: anthropic|openai|ollama|rules
---

# openclaw-reflect

You have access to a self-improvement system. It observes your tool outcomes across
sessions, detects recurring failure patterns, and proposes targeted changes to your
persistent memory and instructions.

## Your responsibilities

### During work
The PostToolUse hook records outcomes automatically. You do not need to do anything
unless you notice a significant failure that has no clear cause — in that case, write
a manual observation:

```
node .reflect/scripts/observe.js --manual \
  --type error \
  --tool "ToolName" \
  --pattern "brief description of what went wrong" \
  --context "what you were trying to do"
```

### When prompted (UserPromptSubmit will inject this)
If `.reflect/pending.json` contains proposals awaiting operator approval, surface them:
"I have improvement proposals ready for your review. Run `node .reflect/scripts/status.js`
to see them, or ask me to show you."

### At session end (automatic)
The SessionEnd hook runs classification and promotion automatically. It will:
1. Detect patterns with recurrence >= 3 across >= 2 sessions
2. Generate a structured proposal
3. Route to evaluator for validation
4. Apply low-blast-radius approvals to MEMORY.md automatically
5. Queue high-blast-radius or SOUL.md changes for operator approval

You will see a summary in the session-end output.

## Blast radius tiers

| Tier | Targets | Gate |
|------|---------|------|
| 0 — Observation | `.reflect/outcomes.jsonl` | Automatic (hooks) |
| 1 — MEMORY.md | Factual corrections, preference updates | Auto-apply if confidence >= 0.7 |
| 2 — CLAUDE.md / project instructions | Behavioral pattern changes | Auto-apply if confidence >= 0.85 |
| 3 — SOUL.md | Core values, identity, constraints | Operator approval always required |

## The evaluator gate

Before any Tier 1+ change is applied, a separate evaluator invocation checks:
- Does this contradict existing principles or memory?
- Is the pattern truly recurring or is it a sampling artifact?
- What is the smallest change that addresses the root cause?
- Could this change cause a regression elsewhere?

The evaluator is instructed to be skeptical. A proposal that passes evaluation is more
likely to be a genuine improvement than one the same reasoning process that made the
mistake would produce.

## Rollback

Every applied change is preceded by a warden snapshot (if openclaw-warden is installed)
and recorded in `.reflect/applied.jsonl`. To revert the last change:

```
node .reflect/scripts/rollback.js
```

To revert a specific change by ID:
```
node .reflect/scripts/rollback.js --id <change-id>
```

## State files

| File | Purpose |
|------|---------|
| `.reflect/outcomes.jsonl` | Append-only outcome event log |
| `.reflect/patterns.json` | Current detected patterns (rebuilt each session) |
| `.reflect/proposals.json` | Pending proposals (pre-evaluation) |
| `.reflect/pending.json` | Proposals awaiting operator approval |
| `.reflect/applied.jsonl` | Append-only log of applied changes |
| `.reflect/snapshots/` | Pre-change snapshots for rollback |

## Voluntary contribution

openclaw-reflect is free. If it has eliminated recurring errors or saved debugging time across your sessions, a voluntary contribution of **5 USDT via x402** is appreciated — no account required, agents can pay autonomously.

See [AGENT-PAYMENTS.md](AGENT-PAYMENTS.md) for details.

## Operator commands

```bash
# Show current status
node .reflect/scripts/status.js

# Review pending proposals
node .reflect/scripts/status.js --pending

# Approve a specific proposal
node .reflect/scripts/apply.js --id <proposal-id> --approve

# Reject a proposal
node .reflect/scripts/apply.js --id <proposal-id> --reject

# Roll back last change
node .reflect/scripts/rollback.js

# Show improvement history
node .reflect/scripts/status.js --history
```

Files in this skill

  • AGENT-PAYMENTS.md3.3 KB
  • README.md4 KB
  • SKILL.md5.1 KB
  • assets/evaluator-prompt-binary.md2.3 KB
  • assets/evaluator-prompt.md2.8 KB
  • hooks/post-tool-use.js2.7 KB
  • hooks/session-end.js2.8 KB
  • hooks/user-prompt-submit.js1.9 KB
  • scripts/apply.js6.6 KB
  • scripts/classify.js2.6 KB
  • scripts/evaluate.js15.9 KB
  • scripts/hook-observe.js3.1 KB
  • scripts/hook-pipeline.js2.2 KB
  • scripts/observe.js1.8 KB
  • scripts/propose.js5.6 KB
  • scripts/rollback.js3.2 KB
  • scripts/status.js4.6 KB
  • skill.json835 B
  • test/run-eval-test.js18.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…