AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
100/100
Scores the file, not the repository.Length
1,182 words
16 headings · 6 code blocksRepository
28k
— · pushed 3 days agoLast changed
3 days ago
First indexed 3 days ago.1# AGENTS.md — Cross-Agent Instructions for Bagisto 2.4.x23## Do Not Edit45- `vendor/`, `node_modules/`, `composer.lock`, `package-lock.json`6- `public/themes/*/build/` — Vite build output7- `storage/` — runtime caches, logs, compiled views8- `*.hot` files — Vite HMR markers9- `packages/Webkul/*/src/Resources/assets/` — only edit if working on frontend; always run `npm run build` from the respective package directory after1011## Repository Map1213```14├── app/ # Thin Laravel app shell (middleware, providers)15├── bootstrap/16│ ├── app.php # Middleware, exceptions, routing17│ └── providers.php # All service provider registrations18├── config/19│ ├── concord.php # Concord module (model proxy) registrations20│ ├── themes.php # Shop + Admin theme config (Vite paths)21│ ├── elasticsearch.php # Elasticsearch connection22│ └── ... # Standard Laravel configs23├── database/24│ ├── migrations/ # App-level migrations25│ └── seeders/26├── packages/Webkul/ # ★ All Bagisto packages live here (40 packages)27│ ├── Admin/ # Admin panel (controllers, views, DataGrids, reporting, e2e-pw tests)28│ ├── Shop/ # Customer storefront (controllers, views, e2e-pw tests)29│ ├── Core/ # Helpers, models, jobs, listeners, exchange rates30│ ├── Product/ # Product models, types, indexers, repositories31│ ├── Sales/ # Orders, invoices, shipments, refunds32│ ├── Checkout/ # Cart, checkout flow33│ ├── Customer/ # Customer models, auth34│ ├── Category/ # Category tree (nested set)35│ ├── Attribute/ # EAV attribute system36│ ├── Payment/ # Base payment classes (CashOnDelivery, MoneyTransfer)37│ ├── Paypal/ # PayPal integration38│ ├── Stripe/ # Stripe integration39│ ├── Razorpay/ # Razorpay integration40│ ├── PayU/ # PayU integration41│ ├── Shipping/ # Base shipping carriers42│ ├── Inventory/ # Stock management43│ ├── CartRule/ # Cart promotion rules44│ ├── CatalogRule/ # Catalog price rules45│ ├── Tax/ # Tax calculation46│ ├── DataGrid/ # Admin data table component47│ ├── DataTransfer/ # Import/export48│ ├── CMS/ # CMS pages49│ ├── Marketing/ # SEO, URL rewrites, search terms, campaigns50│ ├── Theme/ # Theme management51│ ├── MagicAI/ # AI features (Laravel AI SDK)52│ ├── Notification/ # Notifications53│ ├── BookingProduct/ # Booking product type54│ ├── Rule/ # Shared rule engine base55│ ├── User/ # Admin user management56│ ├── Installer/ # Installation wizard57│ ├── SocialLogin/ # OAuth social login58│ ├── SocialShare/ # Social sharing59│ ├── Sitemap/ # XML sitemap generation60│ ├── GDPR/ # GDPR compliance61│ ├── RMA/ # Return merchandise authorization62│ ├── FPC/ # Full page cache63│ ├── ImageCache/ # Image caching/resizing64│ ├── DebugBar/ # Debug toolbar65│ ├── BreezeFront/ # Breeze frontend theme66│ └── NewTheme/ # New theme scaffold67├── routes/68│ ├── web.php # Minimal — packages define their own routes69│ └── console.php70├── tests/71│ └── Pest.php # Pest configuration binding test cases to packages72├── phpunit.xml # Test suites per package73├── pint.json # Pint config (preset: laravel)74├── vite.config.js # Root Vite config75└── docker-compose.yml # Sail: MySQL 8, Redis, Elasticsearch 7.17, Kibana, Mailpit76```7778## Package Internal Structure7980Every package in `packages/Webkul/{Name}/src/` follows:8182```83├── Config/ # admin-menu.php, system.php, acl.php, carriers.php, etc.84├── Contracts/ # Interfaces for each model85├── Database/86│ ├── Migrations/87│ ├── Factories/88│ └── Seeders/89├── DataGrids/ # DataGrid classes (extends Webkul\DataGrid\DataGrid)90├── Http/91│ ├── Controllers/92│ ├── Middleware/93│ └── Requests/ # Form Request validation classes94├── Jobs/95├── Listeners/96├── Models/ # Eloquent models + Proxy classes97├── Observers/98├── Providers/99│ ├── {Name}ServiceProvider.php100│ └── ModuleServiceProvider.php # Concord model registration101├── Repositories/ # Prettus L5 repositories102├── Resources/103│ ├── assets/ # JS, CSS, images (Vite-compiled)104│ ├── lang/{locale}/ # 21 locales105│ └── views/106├── Routes/107│ ├── admin-routes.php108│ └── shop-routes.php109└── Type/ # (Product package) Product type classes110```111112## Key Architecture Patterns113114- **Concord Module System**: Models registered in each package's `ModuleServiceProvider`, wired via `config/concord.php`. Every data entity has a Contract (interface), Model, and Proxy (three-component system).115- **Repository Pattern**: All DB access through repositories extending `Webkul\Core\Eloquent\Repository` (Prettus L5). Repository `model()` returns the Contract class, not the Model.116- **Path Repositories**: `composer.json` uses `"type": "path"` for `packages/*/*`, packages are symlinked — no `composer update` needed for package code changes. Run `composer dump-autoload` after adding new packages.117- **Service Providers**: Each package has a main ServiceProvider (routes, views, translations, migrations, config) registered in `bootstrap/providers.php`.118- **Dual Route Files**: Admin routes (`['web', 'admin']` middleware, `config('app.admin_url')` prefix) and Shop routes (`['web', 'locale', 'theme', 'currency']` middleware).119- **21 Locales**: ar, bn, ca, de, en, es, fa, fr, he, hi_IN, id, it, ja, nl, pl, pt_BR, ru, sin, tr, uk, zh_CN. Translation changes must be applied to ALL locale files. Verify with `php artisan bagisto:translations:check`.120121## Commands122123### Testing124```bash125# Pest (PHP)126php artisan test --compact # Run all tests127php artisan test --compact --filter=testName # Run specific test128php artisan test --compact packages/Webkul/Admin/tests # Run package tests129130# Playwright (E2E) — Admin (run from packages/Webkul/Admin)131cd packages/Webkul/Admin && npm install && npx playwright install --with-deps chromium132cd packages/Webkul/Admin && npx playwright test --config=tests/e2e-pw/playwright.config.ts133134# Playwright (E2E) — Shop (run from packages/Webkul/Shop)135cd packages/Webkul/Shop && npm install && npx playwright install --with-deps chromium136cd packages/Webkul/Shop && npx playwright test --config=tests/e2e-pw/playwright.config.ts137```138139### Code Style140```bash141vendor/bin/pint --dirty # Fix changed files only142vendor/bin/pint # Fix all files143vendor/bin/pint --test # Check only (CI uses this)144```145146### Frontend (run from within each package: Admin, Shop, or Installer)147```bash148cd packages/Webkul/Admin && npm install && npm run build # Admin production build149cd packages/Webkul/Shop && npm install && npm run build # Shop production build150cd packages/Webkul/Admin && npm run dev # Admin dev server with HMR151cd packages/Webkul/Shop && npm run dev # Shop dev server with HMR152```153154### Database155```bash156php artisan migrate # Run migrations157php artisan db:seed # Seed database158```159160## CI Workflows (.github/workflows/)161162| Workflow | Trigger | What it does |163|----------|---------|--------------|164| `pest_tests.yml` | push, PR | Installs Bagisto, runs `vendor/bin/pest` |165| `pint_tests.yml` | push, PR | Runs `pint --test` (style check) |166| `admin_playwright_tests.yml` | push, PR | Admin E2E tests |167| `shop_playwright_tests.yml` | push, PR | Shop E2E tests |168| `translation_tests.yml` | push, PR | Translation key consistency |169170## Safety Rails171172- **Never modify `bootstrap/providers.php` or `config/concord.php`** without understanding the full provider chain — removing a provider breaks the entire module.173- **Translations are 21 files per key.** Missing a locale will fail CI. When adding/removing translation keys, hit all 21 files.174- **Pint must pass.** Run `vendor/bin/pint --dirty` before finalizing any PHP change.175- **Tests must pass.** Run affected package tests after changes. Do not delete tests without approval.176- **Do not add/remove composer dependencies without approval.**177- **Do not create documentation files unless explicitly requested.**178179## Validation Checklist (Before Marking Complete)1801811. `vendor/bin/pint --dirty` — no style violations1822. `php artisan test --compact` — affected tests pass1833. `php artisan bagisto:translations:check` — translation keys exist in all 21 locale files (if changed)1844. No `env()` calls outside `config/` files1855. New models have Contract + Model + Proxy + Repository1866. New packages registered in `bootstrap/providers.php` and `config/concord.php`187
Also in bagisto/bagisto
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| unoplat/unoplat-code-confluenceunoplat-code-confluence-frontend/AGENTS.md · 95 | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago | |
| unoplat/unoplat-code-confluenceunoplat-code-confluence-query-engine/AGENTS.md · 95 | AGENTS.md | setupbuildtestlint-format+5 | 98/100 | 2 days ago | |
| ruvnet/RuViewAGENTS.md · 88k | AGENTS.md | teststylegitsecurity+3 | 97/100 | 3 days ago | |
| halo-dev/haloui/AGENTS.md · 39k | AGENTS.md | setuptestlint-formatstyle+4 | 97/100 | 3 days ago | |
| alibaba/opc-starterAGENTS.md · 87 | AGENTS.md | setupbuildtestlint-format+5 | 97/100 | 3 days ago |
