/install cronlint
\r \r
CronLint -- Scheduled Task & Cron Job Anti-Pattern Analyzer\r
\r CronLint scans codebases for scheduled task and cron job anti-patterns: overlapping execution risks, timezone scheduling errors, missing error recovery, resource contention, lifecycle management issues, and observability gaps. It uses regex-based pattern matching against 90 scheduling-specific patterns across 6 categories, lefthook for git hook integration, and produces markdown reports with actionable remediation guidance. 100% local. Zero telemetry.\r \r Note: CronLint focuses on cron jobs, schedulers (node-cron, APScheduler, Quartz, Celery beat, Bull/BullMQ), setInterval/setTimeout scheduling, Kubernetes CronJobs, and periodic task code. It detects anti-patterns in scheduling logic, not HTTP cron endpoints.\r \r
Commands\r
\r
Free Tier (No license required)\r
\r
cronlint scan [file|directory]\r
One-shot scheduling quality scan of files or directories.\r \r How to execute:\r
bash "\x3CSKILL_DIR>/scripts/dispatcher.sh" --path [target]\r
```\r
\r
**What it does:**\r
1. Accepts a file path or directory (defaults to current directory)\r
2. Discovers all source files (skips .git, node_modules, binaries, images, .min.js)\r
3. Runs 30 scheduling patterns against each file (free tier limit)\r
4. Calculates a scheduling quality score (0-100) per file and overall\r
5. Grades: A (90-100), B (80-89), C (70-79), D (60-69), F (\x3C60)\r
6. Outputs findings with: file, line number, check ID, severity, description, recommendation\r
7. Exit code 0 if score >= 70, exit code 1 if scheduling quality is poor\r
8. Free tier limited to first 30 patterns (OE + TZ categories)\r
\r
**Example usage scenarios:**\r
- "Scan my code for cron job issues" -> runs `cronlint scan .`\r
- "Check this file for scheduling anti-patterns" -> runs `cronlint scan src/scheduler.ts`\r
- "Find overlapping cron execution risks" -> runs `cronlint scan src/`\r
- "Audit timezone handling in scheduled tasks" -> runs `cronlint scan .`\r
- "Check for missing error handling in cron jobs" -> runs `cronlint scan .`\r
\r
### Pro Tier ($19/user/month -- requires CRONLINT_LICENSE_KEY)\r
\r
#### `cronlint scan --tier pro [file|directory]`\r
Extended scan with 60 patterns covering overlap, timezone, error recovery, and resource contention.\r
\r
**How to execute:**\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/dispatcher.sh" --path [target] --tier pro\r
```\r
\r
**What it does:**\r
1. Validates Pro+ license\r
2. Runs 60 scheduling patterns (OE, TZ, ER, RC categories)\r
3. Detects missing error recovery and retry logic in scheduled jobs\r
4. Identifies resource contention: every-minute crons, unbounded queries, no rate limiting\r
5. Full category breakdown reporting\r
\r
#### `cronlint scan --format json [directory]`\r
Generate JSON output for CI/CD integration.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/dispatcher.sh" --path [directory] --format json\r
```\r
\r
#### `cronlint scan --format html [directory]`\r
Generate HTML report for browser viewing.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/dispatcher.sh" --path [directory] --format html\r
```\r
\r
#### `cronlint scan --category OE [directory]`\r
Filter scan to a specific check category (OE, TZ, ER, RC, LM, OB).\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/dispatcher.sh" --path [directory] --category OE\r
```\r
\r
### Team Tier ($39/user/month -- requires CRONLINT_LICENSE_KEY with team tier)\r
\r
#### `cronlint scan --tier team [directory]`\r
Full scan with all 90 patterns across all 6 categories including lifecycle and observability.\r
\r
**How to execute:**\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/dispatcher.sh" --path [directory] --tier team\r
```\r
\r
**What it does:**\r
1. Validates Team+ license\r
2. Runs all 90 patterns across 6 categories\r
3. Includes lifecycle management checks (graceful shutdown, orphaned tasks, stale entries)\r
4. Includes observability checks (missing metrics, no duration logging, no alerting)\r
5. Full category breakdown with per-file results\r
\r
#### `cronlint scan --verbose [directory]`\r
Verbose output showing every matched line and pattern details.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/dispatcher.sh" --path [directory] --verbose\r
```\r
\r
#### `cronlint status`\r
Show license and configuration information.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/dispatcher.sh" status\r
```\r
\r
#### `cronlint patterns`\r
List all detection patterns with their IDs, severities, and descriptions.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/dispatcher.sh" patterns\r
```\r
\r
## Check Categories\r
\r
CronLint detects 90 scheduled task anti-patterns across 6 categories:\r
\r
| Category | Code | Patterns | Description | Severity Range |\r
|----------|------|----------|-------------|----------------|\r
| **Overlapping Execution** | OE | 15 | Missing locks, concurrent runs, no mutex, no pid file check | low -- critical |\r
| **Timezone & Scheduling** | TZ | 15 | Hardcoded TZ, DST risks, UTC confusion, midnight pitfalls | low -- high |\r
| **Error & Recovery** | ER | 15 | No try/catch, missing retry, silent failure, no dead letter queue | low -- critical |\r
| **Resource Contention** | RC | 15 | Every-minute cron, no rate limit, unbounded queries, memory risk | low -- critical |\r
| **Lifecycle Management** | LM | 15 | No graceful shutdown, orphaned tasks, stale entries, no health check | low -- high |\r
| **Observability** | OB | 15 | No duration logging, no metrics, no alerting, no execution history | low -- high |\r
\r
## Tier-Based Pattern Access\r
\r
| Tier | Patterns | Categories |\r
|------|----------|------------|\r
| **Free** | 30 | OE, TZ |\r
| **Pro** | 60 | OE, TZ, ER, RC |\r
| **Team** | 90 | OE, TZ, ER, RC, LM, OB |\r
| **Enterprise** | 90 | OE, TZ, ER, RC, LM, OB + priority support |\r
\r
## Scoring\r
\r
CronLint uses a deductive scoring system starting at 100 (perfect):\r
\r
| Severity | Point Deduction | Description |\r
|----------|-----------------|-------------|\r
| **Critical** | -25 per finding | Severe risk (overlapping execution, silent failure, resource abuse) |\r
| **High** | -15 per finding | Significant problem (missing locks, DST scheduling, no error handling) |\r
| **Medium** | -8 per finding | Moderate concern (hardcoded TZ, missing retry, no rate limiting) |\r
| **Low** | -3 per finding | Informational / best practice suggestion |\r
\r
### Grading Scale\r
\r
| Grade | Score Range | Meaning |\r
|-------|-------------|---------|\r
| **A** | 90-100 | Excellent scheduling quality |\r
| **B** | 80-89 | Good scheduling with minor issues |\r
| **C** | 70-79 | Acceptable but needs improvement |\r
| **D** | 60-69 | Poor scheduling quality |\r
| **F** | Below 60 | Critical scheduling problems |\r
\r
- **Pass threshold:** 70 (Grade C or better)\r
- Exit code 0 = pass (score >= 70)\r
- Exit code 1 = fail (score \x3C 70)\r
\r
## Configuration\r
\r
Users can configure CronLint in `~/.openclaw/openclaw.json`:\r
\r
```json\r
{\r
"skills": {\r
"entries": {\r
"cronlint": {\r
"enabled": true,\r
"apiKey": "YOUR_LICENSE_KEY_HERE",\r
"config": {\r
"severityThreshold": "medium",\r
"ignorePatterns": ["**/test/**", "**/fixtures/**", "**/*.test.*"],\r
"ignoreChecks": [],\r
"reportFormat": "text"\r
}\r
}\r
}\r
}\r
}\r
```\r
\r
## Important Notes\r
\r
- **Free tier** works immediately with no configuration\r
- **All scanning happens locally** -- no code is sent to external servers\r
- **License validation is offline** -- no phone-home or network calls\r
- Pattern matching only -- no AST parsing, no external dependencies beyond bash\r
- Supports scanning all file types in a single pass\r
- Git hooks use **lefthook** which must be installed (see install metadata above)\r
- Exit codes: 0 = pass (score >= 70), 1 = fail (for CI/CD integration)\r
- Output formats: text (default), json, html\r
\r
## Error Handling\r
\r
- If lefthook is not installed and user tries hooks, prompt to install it\r
- If license key is invalid or expired, show clear message with link to https://cronlint.pages.dev/renew\r
- If a file is binary, skip it automatically with no warning\r
- If no scannable files found in target, report clean scan with info message\r
- If an invalid category is specified with --category, show available categories\r
\r
## When to Use CronLint\r
\r
The user might say things like:\r
- "Scan my code for cron job issues"\r
- "Check my scheduled task logic"\r
- "Find overlapping execution risks"\r
- "Detect timezone problems in schedulers"\r
- "Are there any cron anti-patterns?"\r
- "Check for missing error handling in cron jobs"\r
- "Audit my scheduling architecture"\r
- "Find resource contention in batch jobs"\r
- "Check for missing job observability"\r
- "Scan for graceful shutdown issues"\r
- "Run a scheduling quality audit"\r
- "Generate a cron health report"\r
- "Check if my jobs have overlap protection"\r
- "Find silent failure patterns in scheduled tasks"\r
- "Check my code for DST scheduling vulnerabilities"\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cronlint - 安装完成后,直接呼叫该 Skill 的名称或使用
/cronlint触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
cronlint 是什么?
Scheduled task & cron job anti-pattern analyzer -- detects overlapping execution risks, timezone scheduling errors, missing error recovery, resource contenti... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 81 次。
如何安装 cronlint?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cronlint」即可一键安装,无需额外配置。
cronlint 是免费的吗?
是的,cronlint 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
cronlint 支持哪些平台?
cronlint 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(darwin, linux, win32)。
谁开发了 cronlint?
由 suhteevah(@suhteevah)开发并维护,当前版本 v1.0.1。