0060-laravel-packages

Extract reusable Laravel code into Composer-ready packages with defined scope.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0060-laravel-packages
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 0060-laravel-packages
Source: https://github.com/MrJmpl3/codex_____data_____configuration/tree/main/skills/0060-laravel-packages
Command: npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0060-laravel-packages

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you identify stable, reusable Laravel patterns and package them for reuse across multiple projects instead of repeatedly copying and maintaining the same code.

Core Features & Use Cases

  • Package-extraction guidance: Decide when the “three project rule” is met, define clear boundaries, and justify maintenance cost.
  • Recommended package structure: Use a conventional Composer-friendly layout (src/, tests/, config/, README/, etc.) and keep a clean public API.
  • Reusable ecosystem starters: Leverage common Laravel package building blocks (Spatie Data, Model States, Query Builder, Saloon, Pest) as composable dependencies.

Quick Start

Tell the AI to generate a complete Composer package plan and skeleton for a reusable Laravel pattern you’ve used in three or more projects, including package structure, versioning approach, and an extraction checklist.

Frequently Asked Questions about 0060-laravel-packages

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

FAQPage Schema
When should I extract reusable Laravel code into a Composer package?

You should extract reusable Laravel code into a Composer package once the "three project rule" is met, meaning you have repeatedly copied the same stable actions, DTOs, or model/state patterns across three or more projects and need to justify the maintenance cost.

How do I structure a Composer package for extracted Laravel code?

To structure a Composer package for Laravel, use a conventional layout with src/, tests/, config/, and README/ directories. This keeps a clean public API and ensures your reusable code is Composer-ready for multiple projects.

Can I use Spatie ecosystem packages and Saloon when building Laravel packages?

Yes, you can leverage common Laravel package building blocks like the Spatie ecosystem (Spatie Data, Model States, Query Builder) and Saloon as composable dependencies for your external service integrations and query filtering.

What is the best way to version a Laravel package extracted from existing projects?

The best way to version a Laravel package is to apply semantic versioning. This requires defining a clear package scope and boundaries to maintain a stable public API for your extracted code across different projects.

Do I need Pest testing for independently extracted Laravel packages?

Yes, you need independent testing guidance, which includes using Pest testing. Establishing independent tests ensures your extracted Laravel package functions correctly outside its original project context before distribution.