What this prompt does
This prompt makes the AI create a suite of [command_count] custom Artisan commands for a [app_description], handling [command_purposes] and run by [operators] on Laravel [laravel_version]. It builds the primary command [primary_command] with a full signature, [option_count] options, validation, a confirmation prompt for destructive actions, and proper exit codes. Naming the operators and purposes is what steers the AI toward safe, operator-grade tooling rather than throwaway scripts.
The structure works because production CLI tools live or die on the details here. Rich output uses $this->table() with [table_columns] and Laravel Prompts for [interactive_prompts]; long-running support adds a progress bar over [batch_size] records, signal handling, and a --dry-run flag; external-service commands add retries with backoff and [timeout_seconds] timeouts; a parent command orchestrates [sub_command_count] sub-commands; scheduling uses [schedules] with overlap prevention and [notification_method] callbacks; and every command gets Artisan::call() tests. The --verbose levels (-v, -vv, -vvv) on external-service commands surface progressively more detail when an API call misbehaves, and the --quiet flag suppresses non-essential output for scheduled runs. Because you name [operators] and [command_purposes], the AI leans toward operator-grade safeguards — exit codes (0 success, 1 failure, 2 invalid input), input validation, and maintenance-mode awareness — instead of scripts that assume a developer is watching every run.
When to use it
- You write operational commands for billing, data fixes, or reporting
- You need destructive commands with confirmation prompts and a dry-run mode
- You run long batch jobs and want progress bars plus graceful shutdown on SIGINT/SIGTERM
- You call external APIs from a command and need retries with exponential backoff
- You want a parent command that orchestrates sub-commands and reports a summary
- You schedule commands and need overlap prevention and success/failure notifications
Example output
The AI returns Artisan command classes starting with [primary_command]: a defined signature with arguments and [option_count] options, a handle() method with validation, confirmation, and exit codes, table output over [table_columns], Laravel Prompts for [interactive_prompts], progress-bar and signal handling for [batch_size] records with --dry-run, an external-service command with retry and timeout logic, a parent command orchestrating [sub_command_count] sub-commands, scheduling in routes/console.php with overlap prevention, and Artisan::call() tests asserting exit codes and output.
Pro tips
- Always add
--dry-runto anything destructive; previewing changes is the cheapest safety net you can build - Wire signal handling so SIGINT finishes the current item and reports progress instead of corrupting a batch
- Keep
[table_columns]tight and meaningful — readable output is what makes a command safe to hand to[operators] - Set
[retry_count]with backoff for external calls so a transient blip does not fail the whole run - Use
withoutOverlapping()on every scheduled command so a slow run never stacks on the next tick - Cover each command with Artisan::call() and assertExitCode() so a refactor cannot silently break ops