← 返回
AI智能 中文

Agent Self-Care

Autonomous agent health, optimization, and cleanup. Use when: (1) running scheduled cron jobs for agent maintenance, (2) responding to "optimize", "cleanup",...
使用时机:(1) 运行定时 cron 任务进行代理维护;(2) 响应“优化”“清理”等指令。
robshabbir
AI智能 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 595
下载
💾 17
安装
1
版本
#latest

概述

Agent Self-Care

Autonomous health monitoring and optimization for OpenClaw agents. Runs on cron or triggers manually.

Workflow

1. Check Sub-Agents

subagents action=list

Kill any stale sub-agents:

  • Running >30 min without progress
  • In "waiting" state
  • Failed/errored

2. Check Processes

process action=list

Kill hanging processes:

  • Running >10 min in background
  • No output in 5 min

3. Check Session Health

session_status

Metrics to watch:

  • Context usage >80% → trigger compaction
  • Tokens growing unbounded
  • Session age >2 hours → suggest refresh

4. Run Optimization Script

Execute scripts/optimize.sh which:

  • Clears completed cron job artifacts
  • Rotates logs if >50MB
  • Reports health metrics

5. BMAD Retrospective (every 10 runs)

After 10 executions, run:

  • Score last task 1-10
  • Identify gaps
  • Document improvements in memory/daily/YYYY-MM-DD.md
  • Feed learnings into next run

Cron Schedule

Recommended: Every 5 minutes for active agents.

{
  "name": "agent-self-care",
  "schedule": {"kind": "every", "everyMs": 300000},
  "payload": {"kind": "agentTurn", "message": "Run agent-self-care skill"},
  "sessionTarget": "isolated",
  "enabled": true
}

Output Format

Report after each run:

🔧 Self-Care Report
- Sub-agents: X active, Y killed
- Processes: X running, Y cleared
- Context: X% used
- Health: ✅ GOOD / ⚠️ WARNING
- Retrospective: SKIP / COMPLETE

Key Principles

  1. Always clean - Never leave stalled sub-agents or processes
  2. Proactive - Don't wait for user to ask
  3. Document - Log issues and improvements
  4. BMAD - Continuous self-evaluation every 10 runs
  5. Fast - Complete in <30 seconds

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 19:18 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,376
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,836
ai-intelligence

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 418 📥 115,219