Skip to content

feat(dev): reverse cron — natural language → cron expression - #162

Merged
slaveofcode merged 1 commit into
developfrom
feat/cron-natural-language
Aug 7, 2026
Merged

feat(dev): reverse cron — natural language → cron expression#162
slaveofcode merged 1 commit into
developfrom
feat/cron-natural-language

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

Summary

  • Adds a "Describe your schedule" input at the top of the Cron Expression tool
  • Pure rule-based NL parser (no LLM, no server calls, fully client-side)
  • Press Enter or the Convert button to fill the expression field

Patterns supported

  • Intervals: "every minute", "every 15 minutes", "every 6 hours"
  • Daily: "every day at 9am", "midnight daily", "at 14:30"
  • Weekdays/ends: "every weekday at 9am", "weekends at midnight"
  • Named days: "every Monday at noon", "every Monday and Wednesday at 8am"
  • Monthly: "monthly", "on the 15th at noon"
  • Yearly: "every January 1st", "annually"

Test plan

  • Type "every 15 minutes" → Convert → expression becomes */15 * * * *
  • Type "every weekday at 9am" → 0 9 * * 1-5
  • Type "monthly on the 1st" → 0 0 1 * *
  • Enter key triggers convert
  • Invalid input shows inline error
  • Expression field gets focus after successful convert
  • Existing expression editor + presets + next-runs unaffected

Adds a "describe your schedule" input above the cron editor. Type plain
English like "every weekday at 9am" or "midnight on the 1st" and press
Convert to instantly get the cron expression.

- cron-natural.lib.ts: pure rule-based NL parser (no LLM, no server):
  interval shortcuts (every N min/hr), time extraction (midnight/noon/
  HH:MM/am-pm), DOW (weekdays/weekends/named days/lists), DOM (ordinals),
  month names, yearly/monthly/weekly/daily patterns.
- 86 unit tests across naturalToCron + 4 sub-extractors.
- CronExplainer.tsx: "Describe your schedule" input + Convert button on
  top; Enter key submits; on success fills expression field + focuses it;
  error shown inline. Divider separates NL section from expression section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
goodwebtools 231841c Aug 07 2026, 08:35 AM

@slaveofcode
slaveofcode merged commit 80ca23c into develop Aug 7, 2026
1 of 2 checks passed
@slaveofcode
slaveofcode deleted the feat/cron-natural-language branch August 7, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant