Self-review quality gate for OpenClaw agents. Uses Claude CLI (claude --print) as an independent reviewer to catch errors, missed requirements, and quality issues before delivering work to the user.
When an agent finishes a task, it runs review-work on its output. The script sends the work to a separate Claude instance for independent review — the reviewer has no context of the original conversation, so it evaluates purely on merit.
Agent writes code → review-work sends to Claude CLI → gets issues back → fixes → re-reviews → delivers
The reviewer returns issues rated by severity (critical / major / minor) and a clear PASS/FAIL verdict.
- Claude CLI installed and configured (
npm install -g @anthropic-ai/claude-code) - Valid Anthropic API key
mkdir -p ~/.openclaw/workspace/skills/claude-review
cp skill/SKILL.md ~/.openclaw/workspace/skills/claude-review/
cp skill/review-work.sh /usr/local/bin/review-work
chmod +x /usr/local/bin/review-workEnable in your openclaw.json:
{
"skills": {
"entries": {
"claude-review": { "enabled": true }
}
}
}cp skill/review-work.sh /usr/local/bin/review-work
chmod +x /usr/local/bin/review-workreview-work "<task_summary>" --context <file_or_folder> [--skill <file_or_folder>]| Argument | Required | Description |
|---|---|---|
task_summary |
Yes | What the work was supposed to accomplish |
--context <path> |
Yes | File or folder to review (work output, reference material, test logs — anything relevant) |
--skill <path> |
No | SKILL.md or skill folder used for the task — reviewer checks against its requirements |
All paths accept files or folders. Claude reads all files itself using its built-in tools — including images, PDFs, and text files. Common junk directories (node_modules, .git, pycache, dist, build, etc.) are automatically skipped.
# Basic review
review-work "Write a Python email validator" --context /tmp/email.py
# Review with skill — reviewer verifies against skill's specific requirements
review-work "Write an SEO blog" --context /tmp/blog.md --skill ~/skills/seo-content-writer/SKILL.md
# Review an entire project folder
review-work "Build a todo app" --context /tmp/todo-app/ --skill ~/skills/fullstack/
# Review without task description
review-work "general review" --context /tmp/output.csvWhen --skill is passed, the reviewer reads the skill's full requirements and generates a verification checklist. For example, with the seo-content-writer skill, the reviewer checks:
- Is the primary keyword in the title, H1, first 100 words?
- Is the meta description 150-160 chars?
- Are there 5+ FAQ questions with 40-80 word answers?
- Does it follow CORE-EEAT standards?
Without --skill, the review is generic (accuracy, completeness, quality).
## Review: blog.md
### Verification Checklist (from seo-content-writer skill)
- [x] Primary keyword in title
- [x] Meta description 150-160 chars
- [ ] FAQ section with 5+ questions — only 3 found
- [x] Table of contents with anchor links
### Major Issues
1. **FAQ section incomplete** — Only 3 questions, skill requires minimum 5.
### Minor Issues
2. **Meta description is 148 chars** — Slightly under the 150 minimum.
VERDICT: FAIL — 0 critical, 1 major, 1 minor
- File & folder support — review a single file or an entire project directory
- Images & PDFs — Claude reads all file types natively (images, PDFs, text, code)
- Skill-aware review — pass
--skillto review against a skill's specific requirements and definition of done - Auto-learnings — failed reviews are automatically logged to
LESSONS.md - Repeat mistake detection — auto-includes
LESSONS.mdin every review so the reviewer checks for past mistakes
Failed reviews are auto-logged to LESSONS.md (default: ~/.openclaw/workspace/LESSONS.md). This file is also auto-read on every future review, so the reviewer checks for repeat mistakes — no extra flags needed.
Override the path with:
LESSONS_FILE=/path/to/LESSONS.md review-work "task" --context /tmp/outputExample auto-logged entry:
### [2026-03-10] REVIEW-FAIL: email.py
TASK: Write a Python email validator
CONTEXT: /tmp/email.py
VERDICT: FAIL — 1 critical, 1 major, 1 minor
ISSUES:
1. **critical** — validate_email() accepts None without raising an error
2. **major** — Regex doesn't handle consecutive dots in local part
---When used as an OpenClaw skill, the agent automatically:
- Identifies every file it created or modified
- Runs
review-workwith the task summary,--contextpointing to output, and--skillif a skill was used - Fixes any critical or major issues
- Re-reviews after fixing (up to 3 cycles)
- Reports the review summary in its final output
The user just needs to say "review your work" or "use review-work" — the agent determines all arguments on its own.
MIT