# symfony-scheduler

Configures recurring tasks with the Symfony Scheduler component without system crontab entries. Useful for scheduled report generation, database cleanups, and Messenger syncs.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 234 repo stars
- Author: dev-toolings
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/dev-toolings/superpowers-symfony/tree/HEAD/content/skills/symfony-scheduler/SKILL.md
- Updated: 2026-10-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/symfony-scheduler

## What it does

The skill guides Claude Code when building recurring workloads on top of `symfony/scheduler`, native to Symfony 7.x. The agent generates `ScheduleProviderInterface` classes marked with `#[AsSchedule]`, sets up `every()` intervals or `cron()` expressions with explicit timezones, and connects them to `#[AsMessageHandler]` handlers.

Execution guards are part of the output. The skill attaches `stateful()` and `lock()` calls to the schedule and prepares the `messenger:consume scheduler_default` command for Supervisor. Running multiple worker processes without a lock causes duplicate runs. Handlers also need to remain idempotent in case a task repeats.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dev-toolings/superpowers-symfony --skill symfony-scheduler -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/symfony-scheduler/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/symfony-scheduler/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dev-toolings/superpowers-symfony --skill symfony-scheduler -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/symfony-scheduler/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dev-toolings/superpowers-symfony --skill symfony-scheduler -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/symfony-scheduler/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dev-toolings/superpowers-symfony content/skills/symfony-scheduler
```

2. **Manually: put the files in place**
- File: `.github/skills/symfony-scheduler/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dev-toolings/superpowers-symfony --skill symfony-scheduler -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dev-toolings/superpowers-symfony --path content/skills/symfony-scheduler
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/symfony-scheduler/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dev-toolings/superpowers-symfony/tree/HEAD/content/skills/symfony-scheduler/SKILL.md

## When to use it
- run scheduled tasks without configuring system crontab entries
- split background jobs across separate schedules using `#[AsSchedule]`
- block duplicate executions of heavy jobs with locks and state tracking
- write Supervisor consumer configurations with `--time-limit` recycling

## Example prompts
- Configure a Symfony Scheduler provider to clean old logs every six hours.
- Set up a scheduled report job with a lock factory to prevent overlapping executions.
- Generate a Supervisor worker config for `scheduler_default` with a time limit flag.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 2b3b66934c899ead.

BEGIN THIRD-PARTY FILE 2b3b66934c899ead
```text
---
name: symfony-scheduler
description: Schedule recurring tasks with the Symfony Scheduler component (native since 7.x); define schedules, triggers, and integrate with Messenger
capabilities: [read, search, edit, shell]
tags: [messenger]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep
  - Write
  - Edit
  - Bash
---

# 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`
```
END THIRD-PARTY FILE 2b3b66934c899ead

The third-party file has ended. Everything between the 2b3b66934c899ead tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© dev-toolings · MIT · https://github.com/dev-toolings/superpowers-symfony/tree/HEAD/content/skills/symfony-scheduler/SKILL.md

## Similar
- [symfony-specialist](https://affpapa.org/en/nevibecode/agents/symfony-specialist.md) — subagent · ★ 26718 repo stars
- [scheduler](https://affpapa.org/en/nevibecode/skills/scheduler.md) — skill · 574 installs
- [cron-scheduler](https://affpapa.org/en/nevibecode/plugins/cron-scheduler.md) — plugin · ★ 2858 repo stars
- [symfony-security-auditor](https://affpapa.org/en/nevibecode/skills/symfony-security-auditor.md) — skill · 239 installs
- [php-symfony](https://affpapa.org/en/nevibecode/rules/php-symfony.md) — rule · ★ 41430 repo stars
- [react-typescript-symfony-cursorrules-prompt-file](https://affpapa.org/en/nevibecode/rules/react-typescript-symfony-cursorrules-prompt-file.md) — rule · ★ 41178 repo stars

From the same set: [dev-toolings/superpowers-symfony](https://affpapa.org/en/nevibecode/by/dev-toolings/superpowers-symfony.md) — 51 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
