name: scaffold-l1-package description: Scaffolds a new Layer 1 (Pure PHP) package according to Nexus standards.
Scaffold Layer 1 Package (Atomic Package)
This skill automates the creation of a new Layer 1 Atomic Package in the packages/ directory, adhering strictly to the project's Three-Layer Architecture.
Usage
Activate this skill when you need to create a new domain package that contains core business logic, entities, and value objects.
Inputs
- Package Name: The PascalCase name of the package (e.g.,
Accounting,Inventory). - Description: A brief description of the package's responsibility.
Actions
Create Directory Structure:
packages/{PackageName}/packages/{PackageName}/src/Contracts/(Interfaces first!)packages/{PackageName}/src/Exceptions/packages/{PackageName}/src/Models/(Value Objects, Entities)packages/{PackageName}/src/Services/packages/{PackageName}/tests/
Generate
composer.json:- Define namespace:
Atomy\Packages\{PackageName} - CRITICAL: Do NOT include
illuminate/*or any framework dependencies. Onlyphpandext-*. - Require
php: ^8.3. - Autoload
src/andtests/.
- Define namespace:
Create
README.md:- Title:
{PackageName} - Description.
- Architecture Note: "Layer 1 Atomic Package. Pure PHP. No Framework Dependencies."
- Title:
Create
IMPLEMENTATION_SUMMARY.md:- Initialize with "Status: Pending Implementation".
Create Placeholder Test:
tests/ExampleTest.phpextendingPHPUnit\Framework\TestCase.
Register in Root
composer.json:- Add
"Atomy\Packages\{PackageName}": "packages/{PackageName}/src/"to theautoload.psr-4section. - Run
composer dump-autoload.
- Add
Constraints
- Strict Typing: All generated PHP files MUST start with
declare(strict_types=1);. - Immutability: Service classes MUST be
final readonly class. Value Objects MUST havereadonlyproperties. - No Frameworks: Verify no Laravel/Symfony imports are used.
Example Prompt
"Scaffold a new Layer 1 package named 'LoyaltyProgram' for managing customer points."