← Back to Skills Marketplace
zihaofeng2001

Agent Health Optimizer

by Zihao Feng · GitHub ↗ · v1.4.0 · MIT-0
cross-platform ✓ Security Clean
795
Downloads
1
Stars
3
Active Installs
7
Versions
Install in OpenClaw
/install agent-health-optimizer
Description
Audit and improve your OpenClaw setup with one skill. Scores agent health, audits memory hygiene, checks cron reliability, and compares installed skills agai...
README (SKILL.md)

Agent Health Optimizer

Diagnose, score, and steadily improve your OpenClaw setup.

This skill is an audit toolkit, not a magic self-healing system. It is good at surfacing likely problems, weak spots, and opportunities. Its --fix mode is intentionally conservative.

Requirements

  • python3 (3.8+)
  • openclaw CLI

Quick Start

# Full diagnostic suite — one command
python3 scripts/self_optimize.py

# Individual tools
python3 scripts/health_score.py         # Health grade (A+ to F)
python3 scripts/memory_auditor.py       # Memory hygiene check
python3 scripts/cron_optimizer.py       # Cron analysis
python3 scripts/cron_optimizer.py --fix # Conservative auto-repair (backs up first)
python3 scripts/skill_comparator.py     # Adjacent/overlapping ClawHub skills

What It Does

🏥 health_score.py — Agent Health Grade (0-100)

Scores 5 dimensions:

  • 🧠 Memory (25pts): MEMORY.md completeness, daily log activity, working buffer, anti-poisoning hygiene, source tags
  • ⏰ Cron (25pts): job health, schedule diversity, use of isolated sessions, suspicious delivery setups, selective stagger usage
  • 📦 Skills (20pts): count, overlap hints, ClawHub management ratio, metadata completeness
  • 🔒 Security (15pts): safety rules, anti-poisoning policy, WAL protocol, external action controls
  • 🔄 Continuity (15pts): SOUL.md, USER.md, HEARTBEAT.md, IDENTITY.md, git tracking

🔍 memory_auditor.py — Memory Hygiene

Detects:

  • Imperative rules that should be declarative facts
  • Missing source tags on factual entries
  • Stale entries >30 days with pending status
  • External content stored as instructions
  • Oversized files needing archival
  • Daily log gaps

⏰ cron_optimizer.py — Cron Job Doctor

Detects:

  • Error states with job names and error messages
  • Time collisions (multiple jobs on same schedule)
  • Missing stagger on burst-prone recurring schedules
  • Suspicious announce setups (for example explicit channel without explicit to)
  • Timeout mismatches
  • Session target recommendations (isolated vs main)

--fix mode:

  • creates memory/cron-backup.json before changes
  • only auto-adds stagger to recurring top-of-hour stampede-prone jobs
  • does not force delivery on jobs using delivery=none
  • does not modify exact-time jobs just because they lack stagger

📦 skill_comparator.py — Skill Landscape Checker

Via ClawHub API (https://clawhub.ai/api/v1/):

  • Fetches stars, downloads, installs for installed skills
  • Lists top ClawHub skills you're missing
  • Finds adjacent / overlapping skills with stronger community signals
  • Category coverage analysis (what domains are missing?)

Important: these are comparison hints, not authoritative replacements.

🔄 self_optimize.py — Unified Runner

Runs all 4 tools and produces:

  • Combined report with prioritized action items (HIGH/MED/LOW)
  • Trend tracking vs prior run (📈/📉)
  • JSON reports in memory/ for historical review

What It Reads & Writes

Reads (non-destructive):

  • Workspace files: MEMORY.md, AGENTS.md, SOUL.md, USER.md, HEARTBEAT.md, IDENTITY.md
  • Daily logs: memory/*.md
  • Skill metadata: skills/*/SKILL.md
  • Cron config: openclaw cron list --json
  • ClawHub public API: https://clawhub.ai/api/v1/skills/...

Writes (reports only):

  • memory/health-score.json
  • memory/memory-audit.json
  • memory/cron-optimizer.json
  • memory/skill-comparator.json
  • memory/self-optimize-report.json
  • memory/self-optimize-last.json

Modifies (only with --fix):

  • cron_optimizer.py --fix edits cron jobs via openclaw cron edit
  • Always backs up to memory/cron-backup.json first

Periodic Self-Optimization

Set up a weekly cron (read-only, no --fix):

openclaw cron add \
  --name "Agent Self-Optimize" \
  --cron "0 11 * * 0" \
  --tz "America/Los_Angeles" \
  --session isolated \
  --stagger 2m \
  --no-deliver \
  --message "Run agent self-optimization:
python3 ~/.openclaw/workspace/skills/agent-health-optimizer/scripts/self_optimize.py

Report results. List HIGH priority issues first. Keep it brief if everything looks fine."

Positioning

Use this skill when you want:

  • a periodic audit
  • a sanity check before changing agent architecture
  • conservative recommendations
  • a historical trend of agent health

Do not treat it as a substitute for human review on destructive or far-reaching changes.

Credits

Diagnostic patterns informed by:

  • proactive-agent by halthelobster
  • self-improving-agent by pskoett
  • Moltbook openclaw-explorers community — cron jitter pattern (thoth-ix), heartbeat batching (pinchy_mcpinchface)

License

This work is licensed under CC BY-SA 4.0. You are free to share and adapt, with attribution and same-license requirement.

Usage Guidance
This skill appears coherent: it reads your OpenClaw workspace, calls the openclaw CLI, and queries the public ClawHub API to produce audits and suggestions. Before installing or scheduling it: (1) Review the bundled scripts yourself (they are included) and run them once in read-only mode to see outputs; (2) only run with --fix when you understand and approve the specific cron edits—the script backs up cron state first but will call `openclaw cron edit`; (3) be aware the comparator queries https://clawhub.ai — ensure network access to that host is acceptable in your environment; (4) because autonomous invocation is allowed by default, avoid giving the agent blanket autonomy to run --fix without human review or restrict scheduling to read-only runs. Minor notes: the packaged _meta.json version differs from the registry metadata and some files in the manifest are truncated in the provided listing — these are not security issues but worth checking the full package before trusting it.
Capability Analysis
Type: OpenClaw Skill Name: agent-health-optimizer Version: 1.4.0 The agent-health-optimizer is a diagnostic toolkit designed to audit and improve OpenClaw agent configurations. It analyzes memory hygiene, cron job reliability, and skill coverage by reading workspace files and interacting with the openclaw CLI. While it has the capability to modify cron jobs (via cron_optimizer.py) and makes network requests to clawhub.ai (via skill_comparator.py), these actions are transparent, include safety backups, and are strictly aligned with the stated purpose of agent maintenance. No evidence of malicious intent, data exfiltration, or unauthorized persistence was found.
Capability Assessment
Purpose & Capability
Name and description match what the files and SKILL.md implement: health scoring, memory auditing, cron analysis, and skill comparison. Required binaries (openclaw, python3) are appropriate for the implemented behavior. There are no unrelated credentials, binaries, or config paths requested.
Instruction Scope
SKILL.md and the scripts consistently declare and perform the same actions: reading workspace files (MEMORY.md, AGENTS.md, memory/*.md, skills/*/SKILL.md), calling `openclaw cron list` and (in fix mode) `openclaw cron edit`, and fetching ClawHub API endpoints. The scripts produce JSON reports under memory/ and only modify cron when explicitly invoked with --fix (which backups cron state first). No instructions request unrelated system-wide reads/writes or unknown network endpoints.
Install Mechanism
There is no install spec (instruction-only install), and all code is bundled with the skill (scripts/*.py). No external downloads or arbitrary URL extraction occur at install time. Network access is limited to the documented ClawHub API endpoints via standard Python urllib calls.
Credentials
The skill requests no environment variables or credentials. It reads local workspace files and uses the openclaw CLI; that access is proportional to its stated auditing purpose. There are no demands for unrelated secrets or cloud credentials.
Persistence & Privilege
The skill is not marked always:true. It can be invoked autonomously per platform defaults, but that is normal and not combined with broad credential use or hidden persistence. The only write operations are report files under memory/ and conservative cron edits only when --fix is passed; cron edits create a backup first.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agent-health-optimizer
  3. After installation, invoke the skill by name or use /agent-health-optimizer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.4.0
Added CC BY-SA 4.0 license
v1.3.2
Rename for clarity and click-through: emphasize OpenClaw + agent health + audit outcome while keeping the same conservative diagnostics focus.
v1.3.1
Rewrite summary for higher click-through: lead with the user outcome, keep the audit/fix distinction clear, and emphasize conservative fixes over reckless auto-repair.
v1.3.0
Make diagnostics more conservative: only auto-fix burst-prone cron stagger, stop treating delivery=none as a default problem, reduce subjective health scoring, and reframe skill comparisons as adjacent/overlapping hints instead of authoritative upgrades.
v1.2.0
New: Check for missing delivery target ('to' field) in cron jobs. Jobs with announce enabled but no 'to' will silently fail to deliver — no error in logs, no message to user. This was causing reminders and daily digests to vanish without trace. - cron_optimizer.py: Added Check 5 — detects announce jobs missing 'to' field, flags as critical issue - health_score.py: Delivery scoring now checks both delivery=none AND announce-without-to as separate issues
v1.1.0
🐛 Bug Fix: Reversed cron delivery logic The cron optimizer and health scorer had inverted delivery checks that could break all cron job output delivery: • cron_optimizer.py: --fix mode previously detected announce as a problem and disabled it with --no-deliver, causing job output to never reach users. Now correctly detects delivery=none as the issue and enables announce when fixing. • health_score.py: Previously penalized jobs with announce enabled and rewarded delivery=none. Now correctly scores announce positively and flags delivery=none as a problem. Impact: Users running cron_optimizer.py --fix would have all cron job delivery silently disabled — no daily digests, no alerts, no scheduled reports reaching their chat. This fix prevents that and ensures the optimizer recommends proper delivery configuration.
v1.0.0
Initial release of agent-health-optimizer. - Provides automated health scoring (0-100, grades A+ to F) for OpenClaw agents. - Audits memory hygiene, detects cron job issues, and compares installed skills with ClawHub catalog. - Offers individual diagnostic tools plus a unified runner for complete reports and trend tracking. - Supports weekly cron jobs for continuous self-optimization with historical analysis. - Repair mode available for cron optimization (with automatic backup before changes).
Metadata
Slug agent-health-optimizer
Version 1.4.0
License MIT-0
All-time Installs 4
Active Installs 3
Total Versions 7
Frequently Asked Questions

What is Agent Health Optimizer?

Audit and improve your OpenClaw setup with one skill. Scores agent health, audits memory hygiene, checks cron reliability, and compares installed skills agai... It is an AI Agent Skill for Claude Code / OpenClaw, with 795 downloads so far.

How do I install Agent Health Optimizer?

Run "/install agent-health-optimizer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Agent Health Optimizer free?

Yes, Agent Health Optimizer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Agent Health Optimizer support?

Agent Health Optimizer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Agent Health Optimizer?

It is built and maintained by Zihao Feng (@zihaofeng2001); the current version is v1.4.0.

💬 Comments