← 返回 Skills 市场
robshabbir

Agent Self-Care

作者 robshabbir · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
326
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install agent-self-care
功能描述
Autonomous agent health, optimization, and cleanup. Use when: (1) running scheduled cron jobs for agent maintenance, (2) responding to "optimize", "cleanup",...
使用说明 (SKILL.md)

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 \x3C30 seconds
安全使用建议
This skill appears to do what it says, but it grants broad control over agent sub-processes and can write/rotate logs and create retrospective files without clear safety boundaries. Before installing or enabling automated runs: 1) Confirm what the platform commands (subagents/process/session_status/cron) actually control and whether the skill will be allowed to terminate user-owned processes. 2) Require a dry-run or confirmation mode for destructive steps (killing processes, clearing cron artifacts). 3) Limit scope (e.g., only manage processes owned by the agent, restrict process age/criteria) and lower schedule frequency while testing. 4) Provide or request explicit config paths for where retrospectives/logs are written, and ensure audit logging is enabled. 5) Test in a staging environment first. If you cannot get answers about scope and safeguards, treat this skill as risky and avoid enabling autonomous frequent scheduling.
功能分析
Type: OpenClaw Skill Name: agent-self-care Version: 1.0.0 The skill bundle provides a framework for autonomous agent maintenance, including process cleanup, sub-agent monitoring, and health reporting. While the instructions in SKILL.md grant the agent authority to terminate processes and sub-agents, these actions are strictly aligned with the stated purpose of 'self-care' and optimization. The accompanying shell script (scripts/optimize.sh) is a harmless status reporter, and no evidence of data exfiltration, backdoors, or malicious prompt injection was found.
能力评估
Purpose & Capability
Name and description match the behavior: the skill is explicitly for agent maintenance and its instructions call platform tools to list/kill sub-agents and processes, compact context, rotate logs, and record retrospectives. No unrelated capabilities or unexpected external services are requested.
Instruction Scope
SKILL.md instructs the agent to kill sub-agents and background processes, rotate logs >50MB, clear cron artifacts, and write retrospective files to memory/daily/YYYY-MM-DD.md. Those are powerful actions and the skill does not specify scope boundaries (which processes/sub-agents are safe to kill), opt-in/dry-run behavior, or exact file paths/permissions. It also recommends running every 5 minutes and being 'proactive', which grants broad discretion to act without user prompts.
Install Mechanism
No install spec and only a small included shell script (optimize.sh) — nothing is downloaded or extracted. Low installation risk. The script itself contains only echo/placeholder commands and a harmless cron action=list call with fallback text.
Credentials
No environment variables, credentials, or external endpoints are requested. However, the skill implies access to agent internals (subagents, process management, memory paths) without declaring required config paths or permissions, which should be clarified before use.
Persistence & Privilege
always:false (good) but the SKILL.md recommends a 5-minute cron schedule and the principle 'Don't wait for user to ask'. Enabling automated scheduling would give the skill ongoing authority to act frequently; this is potentially high-impact, so consider limiting schedule frequency and requiring explicit consent for destructive actions.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agent-self-care
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agent-self-care 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release - autonomous health monitoring for OpenClaw agents
元数据
Slug agent-self-care
版本 1.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Agent Self-Care 是什么?

Autonomous agent health, optimization, and cleanup. Use when: (1) running scheduled cron jobs for agent maintenance, (2) responding to "optimize", "cleanup",... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 326 次。

如何安装 Agent Self-Care?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-self-care」即可一键安装,无需额外配置。

Agent Self-Care 是免费的吗?

是的,Agent Self-Care 完全免费(开源免费),可自由下载、安装和使用。

Agent Self-Care 支持哪些平台?

Agent Self-Care 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Agent Self-Care?

由 robshabbir(@robshabbir)开发并维护,当前版本 v1.0.0。

💬 留言讨论