agentleFS
AlizHarbAlizHarb/agent-skills/skills/create-console-command/SKILL.md

create-console-command

Skill1 starsChanged 5 months agoMITView on GitHub

Use when creating or changing a Laravel console command and its prompts, output, signature, or supporting tests.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for Laravel Artisan commands, especially when the command should be discoverable, generator-backed, and friendly to …

    line 13
  2. Distinctive:

    Check whether an Artisan generator already exists before creating the file manually.

    line 21
  3. Very specific:

    Use the appropriate php artisan make:* command when one exists.

    line 22
  4. Distinctive:

    Put reusable behavior in Actions, Services, Jobs, or Support classes.

    line 23
  5. Very specific:

    Use laravel/prompts for interactive input, choice, and confirmation instead of ad hoc console IO.

    line 24
  6. Distinctive:

    Keep the command thin and typed.

    line 25
  7. Distinctive:

    Add tests for signature, output, and behavior.

    line 26
  8. Very specific:

    Prefer dependency injection over app() in commands.

    line 40
  9. Distinctive:

    Use Laravel Prompts for user interaction.

    line 41
  10. Distinctive:

    Test command behavior, prompts, output, and side effects.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Console Command

When To Use

Use this skill for Laravel Artisan commands, especially when the command should be discoverable, generator-backed, and friendly to interactive users.

Inputs Needed

  • Command purpose, signature, options, prompts, output, side effects, and tests.

Workflow

  1. Check whether an Artisan generator already exists before creating the file manually.
  2. Use the appropriate php artisan make:* command when one exists.
  3. Put reusable behavior in Actions, Services, Jobs, or Support classes.
  4. Use laravel/prompts for interactive input, choice, and confirmation instead of ad hoc console IO.
  5. Keep the command thin and typed.
  6. Add tests for signature, output, and behavior.

Files That May Be Created

  • app/Console/Commands/*
  • Supporting Actions, Services, DTOs, and tests.

Files That May Be Modified

  • Console commands, providers, support classes, config, translation files, and tests.

Architecture Rules

  • Commands orchestrate; reusable classes own business logic.
  • Prefer dependency injection over app() in commands.
  • Use Laravel Prompts for user interaction.
  • Localize command output when it is user-facing and reusable.

Testing Requirements

  • Test command behavior, prompts, output, and side effects.

Security Requirements

  • Validate interactive input and avoid leaking secrets into output.

Review Checklist

  • Was a generator used if available?
  • Is laravel/prompts used for interactive input?
  • Is business logic extracted?
  • Are outputs localized where appropriate?

Common Mistakes

  • Writing everything directly inside the command class.
  • Using plain ask()/choice() patterns when Laravel Prompts gives better UX.
  • Creating commands manually when an Artisan generator exists.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.