home / skills / aidotnet / moyucode / cron-scheduler

cron-scheduler skill

/skills/tools/cron-scheduler

This skill parses, validates, and explains cron expressions, computes next run times, and helps generate or troubleshoot scheduling.

npx playbooks add skill aidotnet/moyucode --skill cron-scheduler

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
928 B
---
name: cron-scheduler
description: 解析、验证和解释cron表达式,计算下次运行时间。
metadata:
  short-description: Cron表达式助手
source:
  repository: https://github.com/kiorber/croniter
  license: MIT
---

# Cron Scheduler Tool

## Description
Parse, validate, and explain cron expressions. Calculate next run times and generate cron syntax.

## Trigger
- `/cron` command
- User needs cron expression help
- User wants to schedule tasks

## Usage

```bash
# Explain cron expression
python scripts/cron_scheduler.py "0 9 * * 1-5"

# Get next N run times
python scripts/cron_scheduler.py "*/15 * * * *" --next 5

# Generate cron from description
python scripts/cron_scheduler.py --generate "every day at 9am"

# Validate expression
python scripts/cron_scheduler.py "0 0 * * *" --validate
```

## Tags
`cron`, `scheduler`, `automation`, `time`, `jobs`

## Compatibility
- Codex: ✅
- Claude Code: ✅

Overview

This skill parses, validates, and explains cron expressions and calculates next run times. It helps users build correct cron syntax from plain-language schedules and troubleshoot ambiguous or invalid expressions. The tool is focused on practical scheduling tasks for automation and job runners.

How this skill works

The skill accepts cron expressions or plain-language schedule descriptions, then parses the expression into its component fields (minute, hour, day, month, weekday). It validates field ranges and syntax, returns human-readable explanations, and can compute the next N execution timestamps. It also supports generating commonly used cron expressions from concise natural-language inputs.

When to use it

  • When you need to confirm a cron expression is valid and within allowed ranges.
  • When you want a plain-English explanation of what a cron expression does.
  • When you need the next N run times for scheduling or testing.
  • When converting simple schedule descriptions into cron syntax.
  • When diagnosing unexpected schedule behavior in automation systems.

Best practices

  • Provide the full cron expression (all fields) for precise parsing and validation.
  • Specify desired timezone when calculating next run times to avoid ambiguity.
  • Use the generate feature for common schedules, then review the produced expression.
  • Validate expressions before deploying them in production schedulers.

Example use cases

  • Explain '0 9 * * 1-5' as '9:00 AM every weekday' and list the next five run dates.
  • Validate '*/15 * * * *' to confirm a 15-minute interval schedule is correctly formed.
  • Generate a cron expression from 'every day at 9am' to paste into a CI/CD job.
  • Compute the next 10 execution timestamps for a maintenance script to plan windows.
  • Troubleshoot a cron that runs at unexpected times by parsing and inspecting each field.

FAQ

Can the skill handle non-standard cron fields like year or @yearly shortcuts?

It handles standard five-field cron expressions and common shortcuts; support for extended fields may vary—specify the exact format to confirm.

Does it account for daylight saving time?

You should specify the timezone when requesting next run times; DST effects depend on the timezone and are applied if provided.

Can it generate cron expressions from complex natural-language schedules?

It handles common, concise descriptions (daily, hourly, specific time windows). Very complex schedules may need manual refinement after generation.