mcpField
L
laravel:task-scheduling

laravel:task-scheduling

github.com/jpcaparasDevelopment157125 installsUpdated 17w ago
Repository

About laravel:task-scheduling

A Laravel skill for defining scheduled tasks with controls for overlap, multi-node execution, and lifecycle handling. It is intended for developers configuring reliable schedules across environments.

Key features

  1. 01Schedule commands at defined times
  2. 02Prevent overlapping task runs
  3. 03Coordinate execution across servers
  4. 04Run jobs in the background
  5. 05Group callbacks and release locks on signals

Use cases

  1. 01Schedule a daily report command
  2. 02Avoid duplicate runs of long tasks
  3. 03Run schedules on multiple nodes

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jpcaparas/superpowers-laravel --skill laravel:task-scheduling

After installing, type/laravel:task-schedulingin Claude Code to confirm it loaded.

Details

From the project README

Task Scheduling

Run scheduled tasks predictably across environments.

Commands

// app/Console/Kernel.php
protected function schedule(Schedule $schedule): void
{
    $schedule->command('reports:daily')
        ->dailyAt('01:00')
        ->withoutOverlapping()
        ->onOneServer()
        ->runInBackground()
        ->evenInMaintenanceMode();
}

# Run the scheduler from cron
* * * * * cd /var/www/app && php artisan schedule:run >> /dev/null 2>&1

Patterns

  • Guard long-running commands with withoutOverlapping()
  • Use onOneServer() when running on multiple nodes
  • Emit logs/metrics for visibility; consider notifications on failure
  • Feature-flag risky jobs via config/env

Laravel 13+

# Group lifecycle callbacks
Schedule::group([
    Command::command('reports:generate'),
    Command::command('emails:send'),
])->before(fn () => /* setup */)->after(fn () => /* teardown */);

# Release overlap locks on SIGTERM/SIGINT for fast redeploys
$schedule->command('reports:generate')->withoutOverlapping(releaseOnSignal: true);

# Inspect what runs per environment
sail artisan schedule:list --environment=production   # or: php artisan schedule:list --environment=production

Comments

Markdown supported