smithery.ai

create-action

Generates a new business logic Action class following the Modular Monolith pattern. Use when implementing a new feature or moving logic out of a controller (e.g., "Create an action to register students").

First seen Apr 16, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsWrite, Read

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,977 B
  • docs SUMMARY.md 225 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Create Business Action

This skill generates a standardized Action class for business logic, ensuring consistent naming and structure.

Instructions

  1. Identify Parameters:

- Module: The domain module (e.g., Identity, Academic). - Entity: The object being acted upon (e.g., Student, Course). - Verb: The operation (e.g., Register, Update, Cancel). - Class Name: {Verb}{Entity}Action (e.g., RegisterStudentAction).

  1. Determine Path:

- app/Modules/{Module}/Actions/{ClassName}.php

  1. Generate Code:

- Namespace: App\Modules\{Module}\Actions - Method: public static function run(...) - Strict typing. - Transaction handling if writing to DB.

Template

<?php

namespace App\Modules\Identity\Actions;

use App\Models\User;
use Illuminate\Support\Facades\DB;
use App\Modules\Identity\DTO\StudentRegistrationData; // Example DTO usage if applicable

class RegisterStudentAction
{
    /**
     * Execute the action.
     *
     * @param array $data Validated data from Request
     * @return User
     */
    public static function run(array $data): User
    {
        return DB::transaction(function () use ($data) {
            // Business logic here
            // 1. Create User
            // 2. Assign Role
            // 3. Dispatch Events

            return $user;
        });
    }
}

Best Practices Reminders

  • No Validation: Validation happens in FormRequests before calling this Action.
  • No HTTP: Do not return response() or redirect() from here. Return data or throw exceptions.
  • Single Responsibility: One action per business use case.