commands

Enforce Laravel Artisan command structure with validation and standard return codes.

3|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/codebar-ag/coding-guidelines --skill commands-codebar-ag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commands
Source: https://github.com/codebar-ag/coding-guidelines/tree/main/resources/boost/skills/commands
Command: npx skills add https://github.com/codebar-ag/coding-guidelines --skill commands-codebar-ag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Artisan console command classes that serve as the CLI entry point for operations. Commands validate input and delegate all business logic to Actions or Services.

Core Features & Use Cases

  • Command classes live in app/Console/Commands/
  • Each command should have a single, clearly defined responsibility
  • Complex logic belongs in Actions or Services, not in the command itself — commands are the entry point only
  • Use descriptive verb-noun names: SendInvoiceReminders, ImportProductCsv, PruneExpiredSessions
  • Command signatures follow the namespace:action pattern: invoices:send-reminders, products:import
  • Every argument and option must have a clear description
  • Validate all input using the Validator class — never trust raw input
  • Use --option flags for optional behaviour; avoid positional ambiguity
  • Implement PromptsForMissingInput so users receive clear prompts instead of silent failures
  • Commands must always return either self::SUCCESS or self::FAILURE — never void or null

Quick Start

Create a new command class in app/Console/Commands and ensure it delegates to an Action or Service for business logic.

Frequently Asked Questions about commands

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Laravel Artisan command to delegate business logic correctly?

To structure a Laravel Artisan command correctly, place the class in app/Console/Commands and use it only as an entry point to delegate business logic to Actions or Services for processing.

What is the correct naming pattern for Laravel Artisan command signatures?

The correct naming pattern for Laravel Artisan command signatures is the namespace:action format, such as invoices:send-reminders, paired with descriptive verb-noun class names like SendInvoiceReminders.

How do I validate user input in a Laravel CLI command?

To validate user input in a Laravel CLI command, use the Validator class to check all arguments and options, ensuring you never trust raw input directly from the command line.

Why does my Laravel console command return null instead of a success status?

Your Laravel console command returns null because it lacks a proper return statement. Commands must always explicitly return either self::SUCCESS or self::FAILURE, never void or null.

Can I use PromptsForMissingInput to avoid silent failures in Laravel commands?

Yes, you can implement the PromptsForMissingInput trait in Laravel commands to automatically prompt users for missing required arguments, preventing silent failures and ensuring clear CLI input.

When should I use optional flags instead of positional arguments in Laravel commands?

You should use optional --option flags instead of positional arguments in Laravel commands to modify behavior and avoid positional ambiguity, ensuring every argument and option has a clear description.