proactive-agent
Proactive task initiation: monitor conditions, trigger actions without user prompting, autonomous ops
What this skill does
# proactive-agent
## Purpose
This skill enables OpenClaw to act as a proactive agent, monitoring system conditions and triggering predefined actions autonomously without user input. It's designed for scenarios requiring continuous oversight, such as resource monitoring or automated responses, leveraging AI to reduce manual intervention.
## When to Use
Use this skill when you need autonomous operations, like monitoring server metrics and reacting to thresholds, or triggering workflows based on events without prompts. Apply it in production environments for error prevention, in IoT setups for real-time responses, or in CI/CD pipelines for automated fixes.
## Key Capabilities
- Monitor conditions using configurable rules, e.g., CPU usage > 80% or file size > 1GB.
- Trigger actions like executing scripts, sending notifications, or calling APIs without user interaction.
- Support for periodic checks (e.g., every 5 minutes) or event-driven triggers.
- Integration with external services via webhooks or APIs for seamless autonomous ops.
- Logging and state tracking to maintain audit trails of triggered actions.
## Usage Patterns
To use this skill, first define a configuration file specifying monitors and actions, then start the agent via CLI or API. Always set up authentication first. For example, run the agent in a loop for continuous monitoring or integrate it into a larger script for conditional starts. Ensure monitors are tested in a staging environment before production deployment.
## Common Commands/API
Use the OpenClaw CLI for quick starts or the REST API for programmatic control. Authentication requires setting the environment variable `$OPENCLAW_API_KEY` before commands.
- **CLI Command**: Start the agent with a config file.
```
openclaw proactive-agent start --config path/to/config.json --interval 300
```
This monitors conditions every 300 seconds; use `--dry-run` to simulate without actions.
- **API Endpoint**: Trigger or query the agent via HTTP.
POST /api/v1/proactive-agent/run with body: {"monitor": "cpu>80", "action": "restart"}
```
curl -H "Authorization: Bearer $OPENCLAW_API_KEY" -X POST -d '{"monitor":"cpu>80","action":"restart"}' https://api.openclaw.com/api/v1/proactive-agent/run
```
Response includes status and any errors.
- **Config Format**: JSON file defining rules.
```
{
"monitors": [{"type": "cpu", "threshold": ">80"}],
"actions": [{"type": "exec", "command": "systemctl restart service"}]
}
```
Load this via CLI or API to define what to monitor and act on.
- **Stop Command**: Halt the agent gracefully.
```
openclaw proactive-agent stop --id agent123
```
Use the `--id` flag from the start command output.
## Integration Notes
Integrate this skill by embedding it into scripts or services. For example, combine with monitoring tools like Prometheus by setting up webhooks: in your config, add `"webhook": "https://your-service.com/hook"` to notify external systems. Use the API in Node.js applications:
```
const fetch = require('node-fetch');
fetch('https://api.openclaw.com/api/v1/proactive-agent/run', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.OPENCLAW_API_KEY}` }, body: JSON.stringify({monitor: 'memory>90', action: 'alert'})});
```
Ensure your environment has `$OPENCLAW_API_KEY` set. For containerized setups, mount config files as volumes and run the agent as a sidecar.
## Error Handling
Handle errors by checking exit codes from CLI commands (e.g., non-zero indicates failure) and parsing API responses for error fields like "error_code: 403". Common issues include invalid configs—validate JSON with `openclaw proactive-agent validate --config path/to/config.json` before running. For runtime errors, set up logging in your config: `"log_level": "debug"` to capture details, and implement retries in scripts, e.g.:
```
try {
await fetch('https://api.openclaw.com/api/v1/proactive-agent/run', options);
} catch (error) {
console.error('Retry in 5s:', error);
setTimeout(() => { /* retry logic */ }, 5000);
}
```
Monitor for authentication failures by verifying `$OPENCLAW_API_KEY` is current.
## Graph Relationships
- Related to: monitoring-agent (shares monitoring capabilities)
- Depends on: autonomous-ops (for action execution frameworks)
- Clusters with: community (as per metadata grouping)
- Tagged with: proactive, autonomous, monitoring, ai (for cross-skill queries)
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.