Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    PHP Engineering

    1

    Build, debug, and refactor production-ready PHP applications using modern 8.x patterns and strict typing.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    PHP Engineering

    PHP Engineering

    Example session with this skill installed

    Refactor this legacy user registration snippet into a modern PHP 8 service. It currently uses a raw array for user data and handles validation, DB insertion, and email in one function.

    • Read your context and instructions
    • Compiled the php engineering

    I have refactored the registration logic into a dedicated service using PHP 8.3 features. The logic is now decoupled into a DTO for data integrity, a Service for orchestration, and uses constructor promotion for cleaner dependency injection.

    Refactored PHP 8 Engineering Solution

    namespace App\Services;
    
    readonly class UserRegistrationRequest
    {
        public function __construct(
            public string $email,
            public string $password,
            public string $name,
            public array $roles = ['user'],
        ) {}
    }
    
    interface UserService
    {
        public function register(UserRegistrationRequest $data): User;
    }
    
    final class RegistrationService implements UserService
    {
        public function __construct(
            private UserRepository $repository,
            private PasswordHasher $hasher,
            private EventDispatcher $events,
        ) {}
    
        /**
         * Handles the atomic registration process.
         * Throws ValidationException if data is malformed.
         */
        public function register(UserRegistrationRequest $data): User
        {
            $hashedPassword = $this->hasher->hash($data->password);
            
            $user = $this->repository->create([
                'email' => $data->email,
                'password' => $hashedPassword,
                'name' => $data->name,
                'roles' => $data->roles,
            ]);
    
            $this->events->dispatch(new UserRegistered($user));
    
            return $user;
        }
    }
    

    Next steps

    1. Update your controller to type-hint UserService and pass the UserRegistrationRequest DTO.
    2. Run vendor/bin/phpunit to verify the service mock behavior.
    3. Apply static analysis via PHPStan or Psalm to confirm type coverage for the new DTO.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    PHP projects often suffer from bloated controllers, hidden side effects, and weak typing that makes long-term maintenance a nightmare. This skill enforces modern PHP 8.x standards to transform messy scripts into structured, testable, and secure applications.

    What it does

    • Architectural Refactoring translates business logic from controllers into dedicated service layers and domain objects.
    • Type Safety Enforcement replaces vague array-shaped data with DTOs, value objects, and typed collections.
    • Performance Optimization identifies database bottlenecks, eager loading issues, and redundant service resolutions.
    • Modernization upgrades legacy syntax to utilize PHP 8.x features for better readability and performance.
    • Security Hardening implements secure defaults for request validation, persistence, and serialization.

    How it works

    1. Stack Identification analyzes the project to detect if it is Laravel, Symfony, a standalone package, or legacy PHP.
    2. Environment Audit inspects PHP versions, Composer configurations, and existing static analysis tools.
    3. Logic Extraction decouples framework-specific code from core business rules to improve testability.
    4. Verification validates all changes against the existing test suite and static analysis benchmarks.

    Frameworks & tools

    Primary support for PHP 8.x, Laravel, Symfony, and Composer-based packages. It integrates with PHPUnit, static analysis tools, and standard PSR coding conventions.

    Why this beats prompting it yourself

    Generic prompts often produce outdated PHP 5/7 patterns or "array-driven" code that lacks IDE autocompletion. This skill specifically prioritizes strict typing and domain-driven boundaries, ensuring your code is ready for enterprise static analysis.

    Use cases

    • Migrating a legacy PHP 7.4 script to a modern PHP 8.3 service class.
    • Refactoring a 500-line Laravel controller into reusable DTOs and Services.
    • Optimizing Eloquent or Doctrine queries to fix N+1 performance issues.
    • Building a framework-agnostic PHP package with clean PSR compliance.

    Known limitations

    Does not perform automated server-level PHP version upgrades or manage server extensions. Requires an existing Composer setup for optimal dependency analysis.

    Requires existing Composer setup. Does not manage server-side extension installations or OS-level PHP upgrades. Focuses on application-level code and architecture.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Permissions

    No special permissions declared or detected

    Listed1 month ago

    What's inside

    Frequently Asked Questions

    This skill is designed for modern LLMs that support code analysis and generation. It functions best when granted access to your project's file structure via a developer-focused AI agent or IDE integration.

    While it specializes in Laravel and Symfony, the skill is grounded in PSR standards and PHP 8.x syntax, making it highly effective for standalone packages and other modern frameworks like Slim or Laminas.

    It is primarily designed for projects using Composer. The skill relies on analyzing your composer.json and vendor structure to ensure that refactored code remains compatible with your existing dependencies.

    No, this skill focuses on application-level code. While it can optimize database queries and refactor logic, it does not perform server-side tasks like upgrading PHP versions or configuring Nginx/Apache.

    The skill replaces generic 'array-heavy' coding habits with modern PHP 8 features like constructor promotion, union types, and Readonly classes, which standard prompts often overlook.

    The skill is periodically updated to support the latest PHP 8.x point releases and framework updates (such as new Laravel or Symfony versions) to ensure the generated patterns remain industry-standard.

    New in APIs & Backend