mcpField
S
symfony-scheduler

symfony-scheduler

github.com/dev-toolingsDevelopment22782 installsUpdated 3w ago
Repository

About symfony-scheduler

Symfony Scheduler skill for developers setting up recurring jobs in Symfony. It covers trigger selection, schedule organization, worker operation, and controls for duplicate or overlapping runs.

Key features

  1. 01Recurring and cron triggers
  2. 02Named schedule providers
  3. 03Stateful schedules and locks
  4. 04Worker operation and monitoring

Use cases

  1. 01Scheduling reports, cleanup, and sync jobs
  2. 02Preventing overlap in heavy tasks
  3. 03Testing scheduled messages and run dates

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dev-toolings/superpowers-symfony --skill symfony-scheduler

After installing, type/symfony-schedulerin Claude Code to confirm it loaded.

Bundled filesreference.md

Details

From the project README

Symfony Scheduler (Symfony)

Use when

  • Running recurring work (reports, cleanups, syncs) without system cron entries.
  • Choosing between RecurringMessage::every(), RecurringMessage::cron(), and a custom TriggerInterface.
  • Splitting jobs into several named schedules with #[AsSchedule].
  • Preventing overlap or lost runs of heavy scheduled tasks.

Default workflow

  1. Install symfony/scheduler, then write the message and its #[AsMessageHandler] handler.
  2. Create a #[AsSchedule('default')] class implementing ScheduleProviderInterface and add RecurringMessage entries.
  3. Pick the trigger: every('5 minutes') or cron('0 */6 * * *'), with an explicit timezone for cron.
  4. Add stateful($cache) and lock($lockFactory->createLock('scheduler')) on the Schedule for heavy tasks.
  5. Run it with messenger:consume scheduler_default under Supervisor, one process per schedule.
  6. Log with PreRunEvent and PostRunEvent, and test the provider through getRecurringMessages() and getNextRunDate().

Guardrails

  • Run a single consumer per schedule (numprocs=1) and add a lock, or the same task fires twice.
  • Be explicit about timezones on every cron trigger.
  • Scheduled handlers must be idempotent, since a run can be repeated.
  • Use --time-limit with Supervisor autorestart so the long-lived worker recycles itself.

Progressive disclosure

  • Use this file for execution posture and risk controls.
  • Open references when deep implementation details are needed.

Output contract

  • The schedule provider(s) with their triggers and timezone.
  • The worker command and the Supervisor entry.
  • The overlap policy (stateful, lock) and the monitoring hooks.

References

  • reference.md

Comments

Markdown supported