Tools
Cron Enricher
OpenClaw plugin that enriches cron job creation with validation + redirects crontab requests to native Linux crontab
README
# cron-enricher
OpenClaw plugin that intercepts and enriches cron job creation.
## Hooks
### 1. `before_agent_run` — crontab redirect
Intercepts user messages containing "crontab" / "linux crontab" / "native crontab" and redirects to native Linux crontab instead of the OpenClaw `cron` tool.
### 2. `before_tool_call` — cron add enrichment
Intercepts `cron add` tool calls and injects validation + best practices:
| Check | Type | Description |
|-------|------|-------------|
| `schedule.kind` missing | ⚠️ warning | Must be `at`, `every`, or `cron` |
| `schedule.kind=at` without `at` | ⚠️ warning | Needs ISO-8601 timestamp |
| `schedule.kind=every` without `everyMs` | ⚠️ warning | Needs milliseconds |
| `schedule.kind=cron` without `expr` | ⚠️ warning | Needs cron expression |
| `schedule.kind=cron` without `tz` | 💡 suggestion | Use explicit timezone (e.g. Europe/Rome) |
| `gatewayUrl` with http:// | ⚠️ warning | Must use ws:// or wss:// |
| `sessionTarget=main` without `systemEvent` | ⚠️ warning | Invalid combo |
| `sessionTarget=isolated` without `agentTurn` | ⚠️ warning | Invalid combo |
| `isolated` without `timeoutSeconds ≥ 300` | 💡 suggestion | Bootstrap overhead |
| `delivery.mode=announce` without `channel` | ⚠️ warning | Message may not deliver |
| `agentTurn` without `timeoutSeconds` | 💡 suggestion | Set ≥ 300s |
| `payload.kind` missing | ⚠️ warning | Must be `agentTurn` or `systemEvent` |
| Config-touching cron | 💡 suggestion | Reminder to validate schema first |
## Installation
```bash
# Add to openclaw.json plugins.allow and plugins.entries:
# plugins.allow: add "cron-enricher"
# plugins.entries.cron-enricher: { "enabled": true }
```
## Structure
```
cron-enricher/
├── openclaw.plugin.json # Plugin manifest
├── index.ts # Hooks (TypeScript)
└── README.md
```
## Pattern
Based on `safety-guards` plugin. Uses `api.on("before_tool_call")` + `{ inject: "..." }` return pattern.
See also: [OpenClaw hooks docs](https://docs.openclaw.ai/automation/hooks)
tools
Comments
Sign in to leave a comment