dvolkering / laravel-magento-guidelines
Laravel Boost guidelines and skill for building Adobe Commerce (Magento 2) integrations with justbetter/laravel-magento-client.
Package info
gitlab.com/dvolkering/laravel-magento-guidelines
pkg:composer/dvolkering/laravel-magento-guidelines
Requires
- php: ^8.2
Requires (Dev)
- justbetter/laravel-magento-client: ^2.0
- laravel/boost: ^2.0
Suggests
- justbetter/laravel-magento-client: The Magento client these guidelines assume. Install it in your Laravel app.
- laravel/boost: Required to auto-discover and load the guidelines and skill shipped by this package.
This package is not auto-updated.
Last update: 2026-04-23 11:51:42 UTC
README
Opinionated Laravel Boost guidelines and an on-demand skill for building Adobe Commerce (Magento 2) integrations on top of justbetter/laravel-magento-client.
When this package is installed alongside Laravel Boost, Boost auto-discovers the contents of resources/boost/ and makes them available to your coding agent. The philosophy:
- Thin upfront guideline (
resources/boost/guidelines/core.blade.php, ~60 lines) — always loaded. Tells the agent what stack to use, the requiredapp/Magento/layout, and the non-negotiable rules. - On-demand skill (
resources/boost/skills/magento-development/) — loaded only when the agent is actually doing Magento work. Contains the detailed conventions: SearchCriteria gotchas, DTO pattern, bulk endpoints, jobs +AvailableMiddleware, error handling, testing. - Reference files under the skill — the full Adobe Commerce 2.4.8 Admin REST OpenAPI spec (
swagger.json, ~2 MB), a grouped paths index (paths-index.md, ~40 KB), and ajqcheatsheet (lookup.md). The agent discovers endpoints via the cheap index andjq's into the spec only for the specific endpoint it needs — no context pollution.
Installation
In a Laravel application that already has Boost installed:
composer require dvolkering/laravel-magento-guidelines --dev
php artisan boost:update --discover
boost:update --discover tells Boost to pick up guidelines and skills from newly installed packages. After this, the Magento guidelines will be part of your project's AI context, and the magento-development skill will load when you ask your agent to work on Magento-facing code.
What the agent gets
Always in context (from core.blade.php)
- Which client to use (
justbetter/laravel-magento-client), and which ones to avoid - The required
app/Magento/folder layout - A handful of non-negotiable rules (inject the client, use
AvailableMiddlewarein jobs, resolve by business key, return DTOs not raw arrays) - A pointer to the
magento-developmentskill for depth
Loaded on demand (from the skill's SKILL.md)
- Decision guide: Controller vs Job, single call vs Action, GraphQL vs REST
SearchCriteriabuilder usage, full filter-condition table, pagination rules, sparse fieldsets- DTO pattern with custom-attribute indexing (Magento's list-of-objects → map pitfall)
- Resource class pattern with correct 404 handling and
rawurlencode()for SKUs - Create / update / delete patterns, idempotent PUT over POST for sync
- Bulk / async API usage and status polling
- Error handling:
RequestException,ConnectionException, and aMagentoNotFoundException - Jobs with
AvailableMiddlewareand retry rules (5xx retry, 4xx fail) - Multi-connection and store-code handling
- Testing with
Http::fake()and the store-code wildcard trap
Loaded only when looking up an endpoint
reference/paths-index.md— grouped flat TOC of all 477 endpointsreference/lookup.md—jqrecipes for request/response shapes and$refresolutionreference/swagger.json— the full 2 MB spec, never read wholesale
Customising
The guideline and skill are opinionated — they reflect one way of structuring a Magento integration in Laravel. To adapt:
- Fork this package and adjust
resources/boost/guidelines/core.blade.phpandresources/boost/skills/magento-development/SKILL.mdto your team's conventions. - Override per project by placing a file with a matching path in your app's
.ai/guidelines/— Boost will use your override instead of the one shipped here. - Swap the swagger in
reference/swagger.jsonfor a spec generated from your specific Magento instance (including third-party modules and extension attributes). The Adobe Commerce docs describe how to generate a local API reference.
Why a package and not just .ai/guidelines/ in the app?
Use this package if:
- You maintain multiple Laravel apps that integrate with Magento and want the same conventions applied to all of them.
- You want to version and changelog the guidelines separately from any individual app.
- You want the swagger reference to be a cached Composer artifact, not a committed file in every app.
For a single project, copying the contents of resources/boost/ into the app's .ai/ directory is simpler.
License
MIT.