Agent skill

Laravel Actions

by coollabsio in coollabsio/coolify

Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions.

Apache-2.0Auto-check passedBackend & APIs

Install Laravel Actions

skills CLI
$ npx skills add coollabsio/coolify --skill laravel-actions -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install coollabsio/coolify laravel-actions --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/coollabsio/coolify.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/laravel-actions .claude/skills/laravel-actions && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
laravel-actions
GitHub stars
63k
Token cost
~2.4k tokens
SKILL.md length
827 words
Files
9 (incl. references)
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions.

  • Works in 6 steps: Confirm the package is installed with… → Create or edit an action class that uses… → Implement handle(...) with the core… → …
  • Implementing reusable action classes (object/controller/job/listener/command)
  • SKILL.md covers Overview, Quick Workflow, Base Action Pattern and Project Conventions, plus 5 more sections
  • Calls composer and php

What it does

Laravel Actions is an agent skill from coollabsio/coolify. Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions. Use when implementing reusable action classes (object/controller/job/listener/command), converting service classes/controllers/jobs into actions, orchestrating workflows via faked actions, or debugging action entrypoints and wiring.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files (for example `references/command.md`, `references/controller.md` and `references/job.md`).

It sits in Backend & APIs, covering Backend development. It works with Laravel and Docker. The repository describes itself as: An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 280+ one-click… The licence is Apache-2.0.

When your agent uses it

  • Implementing reusable action classes (object/controller/job/listener/command)
  • Converting service classes/controllers/jobs into actions
  • Orchestrating workflows via faked actions
  • Debugging action entrypoints and wiring

Example prompts

  • “/laravel-actions”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Confirm the package is installed with composer show lorisleiva/laravel-actions.
  2. Create or edit an action class that uses Lorisleiva\Actions\Concerns\AsAction.
  3. Implement handle(...) with the core business logic first.
  4. Add adapter methods only when needed for the requested entrypoint
  5. Add or update tests for the chosen entrypoint.
  6. When tests need isolation, use action fakes (MyAction::fake()) and assertions (MyAction::assertDispatched()).

What it can do on your machine

Read from SKILL.md and the folder at commit f55efc8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • composer
    • php

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • laravelactions.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Laravel Actions loads about 2.4k tokens when it runs, and up to ~10k if it reads all its reference files. Until then it costs about 83 tokens; SKILL.md has 827 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~83
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~10k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from coollabsio/coolify at commit f55efc8, republished under its Apache-2.0 licence (© coollabsio). 827 words, ~2,440 tokens.

Download SKILL.mdSave it as .claude/skills/laravel-actions/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
laravel-actions
description
Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions. Use when implementing reusable action classes (object/controller/job/listener/command), converting service classes/controllers/jobs into actions, orchestrating workflows via faked actions, or debugging action entrypoints and wiring.

Laravel Actions or lorisleiva/laravel-actions

Overview

Use this skill to implement or update actions based on lorisleiva/laravel-actions with consistent structure and predictable testing patterns.

Quick Workflow

  1. Confirm the package is installed with composer show lorisleiva/laravel-actions.
  2. Create or edit an action class that uses Lorisleiva\Actions\Concerns\AsAction.
  3. Implement handle(...) with the core business logic first.
  4. Add adapter methods only when needed for the requested entrypoint:
    • asController (+ route/invokable controller usage)
    • asJob (+ dispatch)
    • asListener (+ event listener wiring)
    • asCommand (+ command signature/description)
  5. Add or update tests for the chosen entrypoint.
  6. When tests need isolation, use action fakes (MyAction::fake()) and assertions (MyAction::assertDispatched()).

Base Action Pattern

Use this minimal skeleton and expand only what is needed.

php
<?php

namespace App\Actions;

use Lorisleiva\Actions\Concerns\AsAction;

class PublishArticle
{
    use AsAction;

    public function handle(int $articleId): bool
    {
        return true;
    }
}

Project Conventions

  • Place action classes in App\Actions unless an existing domain sub-namespace is already used.
  • Use descriptive VerbNoun naming (e.g. PublishArticle, SyncVehicleTaxStatus).
  • Keep domain/business logic in handle(...); keep transport and framework concerns in adapter methods (asController, asJob, asListener, asCommand).
  • Prefer explicit parameter and return types in all action methods.
  • Prefer PHPDoc for complex data contracts (e.g. array shapes), not inline comments.
When to Use an Action
  • Use an Action when the same use-case needs multiple entrypoints (HTTP, queue, event, CLI) or benefits from first-class orchestration/faking.
  • Keep a plain service class when logic is local, single-entrypoint, and unlikely to be reused as an Action.

Entrypoint Patterns

Run as Object
  • (prefer method) Use static helper from the trait: PublishArticle::run($id).
  • Use make and call handle: PublishArticle::make()->handle($id).
  • Call with dependency injection: app(PublishArticle::class)->handle($id).
Run as Controller
  • Use route to class (invokable style), e.g. Route::post('/articles/{id}/publish', PublishArticle::class).
  • Add asController(...) for HTTP-specific adaptation and return a response.
  • Add request validation (rules() or custom validator hooks) when input comes from HTTP.
Run as Job
  • Dispatch with PublishArticle::dispatch($id).
  • Use asJob(...) only for queue-specific behavior; keep domain logic in handle(...).
  • In this project, job Actions often define additional queue lifecycle methods and job properties for retries, uniqueness, and timing control.
Project Pattern: Job Action with Extra Methods
php
<?php

namespace App\Actions\Demo;

use App\Models\Demo;
use DateTime;
use Lorisleiva\Actions\Concerns\AsAction;
use Lorisleiva\Actions\Decorators\JobDecorator;

class GetDemoData
{
    use AsAction;

    public int $jobTries = 3;

    public int $jobMaxExceptions = 3;

    public function getJobRetryUntil(): DateTime
    {
        return now()->addMinutes(30);
    }

    public function getJobBackoff(): array
    {
        return [60, 120];
    }

    public function getJobUniqueId(Demo $demo): string
    {
        return $demo->id;
    }

    public function handle(Demo $demo): void
    {
        // Core business logic.
    }

    public function asJob(JobDecorator $job, Demo $demo): void
    {
        // Queue-specific orchestration and retry behavior.
        $this->handle($demo);
    }
}

Use these members only when needed:

  • $jobTries: max attempts for the queued execution.
  • $jobMaxExceptions: max unhandled exceptions before failing.
  • getJobRetryUntil(): absolute retry deadline.
  • getJobBackoff(): retry delay strategy per attempt.
  • getJobUniqueId(...): deduplication key for unique jobs.
  • asJob(JobDecorator $job, ...): access attempt metadata and queue-only branching.
Run as Listener
  • Register the action class as listener in EventServiceProvider.
  • Use asListener(EventName $event) and delegate to handle(...).
Run as Command
  • Define $commandSignature and $commandDescription properties.
  • Implement asCommand(Command $command) and keep console IO in this method only.
  • Import Command with use Illuminate\Console\Command;.

Testing Guidance

Use a two-layer strategy:

  1. handle(...) tests for business correctness.
  2. entrypoint tests (asController, asJob, asListener, asCommand) for wiring/orchestration.
Deep Dive: AsFake methods (2.x)

Reference: https://www.laravelactions.com/2.x/as-fake.html

Use these methods intentionally based on what you want to prove.

mock()
  • Replaces the action with a full mock.
  • Best when you need strict expectations and argument assertions.
php
PublishArticle::mock()
    ->shouldReceive('handle')
    ->once()
    ->with(42)
    ->andReturnTrue();
partialMock()
  • Replaces the action with a partial mock.
  • Best when you want to keep most real behavior but stub one expensive/internal method.
php
PublishArticle::partialMock()
    ->shouldReceive('fetchRemoteData')
    ->once()
    ->andReturn(['ok' => true]);
spy()
  • Replaces the action with a spy.
  • Best for post-execution verification ("was called with X") without predefining all expectations.
php
$spy = PublishArticle::spy()->allows('handle')->andReturnTrue();

// execute code that triggers the action...

$spy->shouldHaveReceived('handle')->with(42);
Show full SKILL.md (327 more words)Show less
shouldRun()
  • Shortcut for mock()->shouldReceive('handle').
  • Best for compact orchestration assertions.
php
PublishArticle::shouldRun()->once()->with(42)->andReturnTrue();
shouldNotRun()
  • Shortcut for mock()->shouldNotReceive('handle').
  • Best for guard-clause tests and branch coverage.
php
PublishArticle::shouldNotRun();
allowToRun()
  • Shortcut for spy + allowing handle.
  • Best when you want execution to proceed but still assert interaction.
php
$spy = PublishArticle::allowToRun()->andReturnTrue();
// ...
$spy->shouldHaveReceived('handle')->once();
isFake() and clearFake()
  • isFake() checks whether the class is currently swapped.
  • clearFake() resets the fake and prevents cross-test leakage.
php
expect(PublishArticle::isFake())->toBeFalse();
PublishArticle::mock();
expect(PublishArticle::isFake())->toBeTrue();
PublishArticle::clearFake();
expect(PublishArticle::isFake())->toBeFalse();
  • Business rule test: call handle(...) directly with real dependencies/factories.
  • HTTP wiring test: hit route/controller, fake downstream actions with shouldRun or shouldNotRun.
  • Job wiring test: dispatch action as job, assert expected downstream action calls.
  • Event listener test: dispatch event, assert action interaction via fake/spy.
  • Console test: run artisan command, assert action invocation and output.
Practical defaults
  • Prefer shouldRun() and shouldNotRun() for readability in branch tests.
  • Prefer spy()/allowToRun() when behavior is mostly real and you only need call verification.
  • Prefer mock() when interaction contracts are strict and should fail fast.
  • Use clearFake() in cleanup when a fake might leak into another test.
  • Keep side effects isolated: fake only the action under test boundary, not everything.
Pest style examples
php
it('dispatches the downstream action', function () {
    SendInvoiceEmail::shouldRun()->once()->withArgs(fn (int $invoiceId) => $invoiceId > 0);

    FinalizeInvoice::run(123);
});

it('does not dispatch when invoice is already sent', function () {
    SendInvoiceEmail::shouldNotRun();

    FinalizeInvoice::run(123, alreadySent: true);
});

Run the minimum relevant suite first, e.g. php artisan test --compact --filter=PublishArticle or by specific test file.

Troubleshooting Checklist

  • Ensure the class uses AsAction and namespace matches autoload.
  • Check route registration when used as controller.
  • Check queue config when using dispatch.
  • Verify event-to-listener mapping in EventServiceProvider.
  • Keep transport concerns in adapter methods (asController, asCommand, etc.), not in handle(...).

Common Pitfalls

  • Putting HTTP response/redirect logic inside handle(...) instead of asController(...).
  • Duplicating business rules across as* methods rather than delegating to handle(...).
  • Assuming listener wiring works without explicit registration where required.
  • Testing only entrypoints and skipping direct handle(...) behavior tests.
  • Overusing Actions for one-off, single-context logic with no reuse pressure.

Topic References

Use these references for deep dives by entrypoint/topic. Keep SKILL.md focused on workflow and decision rules.

  • Object entrypoint: references/object.md
  • Controller entrypoint: references/controller.md
  • Job entrypoint: references/job.md
  • Listener entrypoint: references/listener.md
  • Command entrypoint: references/command.md
  • With attributes: references/with-attributes.md
  • Testing and fakes: references/testing-fakes.md
  • Troubleshooting: references/troubleshooting.md

© coollabsio, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in .agents/skills/laravel-actions of coollabsio/coolify.

  • SKILL.md
  • references/command.md
  • references/controller.md
  • references/job.md
  • references/listener.md
  • references/object.md
  • references/testing-fakes.md
  • references/troubleshooting.md
  • references/with-attributes.md

Open the folder on GitHubat commit f55efc8

Compare with similar skills

Laravel Actions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Laravel Actions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Laravel Actions this skillcoollabsio/coolify63k—~2.4kAutomated safety check: PassApache-2.0
Arch Wikiahmedemad3/arch-wiki250—~5.1kAutomated safety check: PassNone
DevopsAratKruglik/claude-laravel155—~596Automated safety check: NotesNone
Laravel Best Practicesanonaddy/anonaddy4.9k13 repos~1.2kAutomated safety check: PassMIT
Infer Conventionsanonaddy/anonaddy4.9k5 repos~3.1kAutomated safety check: PassMIT
Geoflowyaojingang/GEOFlow3.8k—~722Automated safety check: PassAGPL-3.0

Similar skills

  • Arch Wiki

    ahmedemad3/arch-wiki

    Scans any project codebase for new/changed modules, endpoints, middleware, infrastructure, Docker topologies, SQL queries, or permissions and updates docs/architecture/architecture.json.

    250 GitHub stars~5.1k tokensUpdated 22 days ago
    Backend & APIsAuto-check passed
  • Devops

    AratKruglik/claude-laravel

    Generates DevOps configurations and scripts for deploying and managing Laravel applications.

    155 GitHub stars~596 tokensUpdated 5 mo ago
    DevOps & CloudAuto-check: notes
  • Laravel Best Practices

    anonaddy/anonaddy

    Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code.

    4.9k GitHub starsUsed in 13 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Infer Conventions

    anonaddy/anonaddy

    A skill your agent uses to analyze how a Laravel application is actually written and record its conventions as shared rules.

    4.9k GitHub starsUsed in 5 repos~3.1k tokens
    Backend & APIsAuto-check passed
  • Geoflow

    yaojingang/GEOFlow

    Operate/develop GEOFlow CLI/Laravel/admin/API, topics/专题 and topic tasks, theme libraries/replication, sites/leads/Agent, channel sync and legacy yao-geoflow-cli/design/template migration.

    3.8k GitHub stars~722 tokensUpdated today
    Backend & APIsAuto-check passed
  • Laravel Specialist

    Jeffallan/claude-skills

    Builds Laravel 10+ applications with Eloquent models, Sanctum authentication, Horizon queues, API resources and Livewire components, tested with Pest or PHPUnit.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Backend & APIsAuto-check passed

More from coollabsio/coolify

  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Auto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Auto-check passed
  • MCP Development

    coollabsio/coolify

    A skill your agent uses for Laravel MCP development. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 1 repo~949 tokens
    Auto-check passed
  • Livewire Development

    coollabsio/coolify

    A skill your agent uses for any task or question involving Livewire.

    63k GitHub stars~964 tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Laravel Actions

What does Laravel Actions do?

Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions. Laravel Actions is an agent skill from coollabsio/coolify. Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions.

When should I use Laravel Actions?

Laravel Actions fits situations like: implementing reusable action classes (object/controller/job/listener/command); converting service classes/controllers/jobs into actions; orchestrating workflows via faked actions; debugging action entrypoints and wiring.

How do I install Laravel Actions in Claude Code?

Run `npx skills add coollabsio/coolify --skill laravel-actions -a claude-code`. Or copy the skill folder (.agents/skills/laravel-actions in coollabsio/coolify) into .claude/skills/laravel-actions in your project. Claude Code loads it when a task matches its description.

How do I install Laravel Actions in Codex?

Run `npx skills add coollabsio/coolify --skill laravel-actions -a codex`. Or copy the skill folder (.agents/skills/laravel-actions in coollabsio/coolify) into .agents/skills/laravel-actions in your project. Codex loads it when a task matches its description.

Can I use Laravel Actions in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add coollabsio/coolify --skill laravel-actions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/laravel-actions, .gemini/skills/laravel-actions, .github/skills/laravel-actions and .opencode/skills/laravel-actions in your project.

What does Laravel Actions need to run?

Going by SKILL.md and its folder, Laravel Actions needs the command-line tools its instructions call (composer and php).

Does Laravel Actions access the network?

SKILL.md names 1 domain. As links in the text: laravelactions.com. This is read from the text; nothing was executed.

Is Laravel Actions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Laravel Actions use?

Laravel Actions is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Laravel Actions use?

About 2.4k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.5k tokens, read only when the agent opens those files.

What are the alternatives to Laravel Actions?

Skills that share tags, products or a category with Laravel Actions: Arch Wiki (ahmedemad3/arch-wiki, 250 stars), Devops (AratKruglik/claude-laravel, 155 stars), Laravel Best Practices (anonaddy/anonaddy, 4.9k stars) and Infer Conventions (anonaddy/anonaddy, 4.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Laravel Actions?

coollabsio (a GitHub organization) maintains it in coollabsio/coolify, which has 62,800 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 9, 2026.

Source: coollabsio/coolify on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.