← Back to Skills Marketplace
robshabbir

Agent Self-Care

by robshabbir · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
326
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install agent-self-care
Description
Autonomous agent health, optimization, and cleanup. Use when: (1) running scheduled cron jobs for agent maintenance, (2) responding to "optimize", "cleanup",...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agent-self-care
  3. After installation, invoke the skill by name or use /agent-self-care
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release - autonomous health monitoring for OpenClaw agents
Metadata
Slug agent-self-care
Version 1.0.0
License
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Agent Self-Care?

Autonomous agent health, optimization, and cleanup. Use when: (1) running scheduled cron jobs for agent maintenance, (2) responding to "optimize", "cleanup",... It is an AI Agent Skill for Claude Code / OpenClaw, with 326 downloads so far.

How do I install Agent Self-Care?

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

Is Agent Self-Care free?

Yes, Agent Self-Care is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Agent Self-Care support?

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

Who created Agent Self-Care?

It is built and maintained by robshabbir (@robshabbir); the current version is v1.0.0.

💬 Comments