Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Agents
reyhan-commerce/reyhan
claude-code
cursor
strict-types
actions
eloquent
transactions
pest
pint
coding-standards

๐Ÿค– Reyhan Commerce โ€” AI Agent & Engineering Constitution

Install
php artisan boost:add-skill reyhan-commerce/reyhan

Save this content to: AGENTS.md

# ๐Ÿค– Reyhan Commerce โ€” AI Agent & Engineering Constitution

> **For all AI Agents (Antigravity, Claude Code, Cursor, Copilot, Junie, Codex) and Software Engineers**

---

## ๐Ÿ›๏ธ 1. Universal Documentation & Code Contract
1. **100% English Only**: Every `.md` file, commit message, code comment, method docstring, and architectural diagram across this entire repository MUST be written in English.
2. Persian (`fa`) is strictly reserved for:
   - Application localization dictionaries (`lang/fa.json`, `lang/fa/*.php`)
   - Iranian commerce seeders (Provinces, Cities, Persian demo products)

---

## โšก 2. Laravel & PHP Coding Constitution (`farshid-laravel`)

### Strict Typing & Classes
- `declare(strict_types=1);` is **mandatory** at the very top of every PHP file.
- All method parameters, return types, and class properties must have explicit types. Avoid `mixed` unless handling untyped raw third-party payloads.

### Controllers & Business Logic
- **Controllers must remain thin**: Validate with `FormRequest`, delegate domain logic to a single `Action`, and return an `ApiResource` or `JsonResponse`.
- **Business Logic in Actions**: Use `final class [Verb][Noun]Action` with a single public `execute(...)` method.
- **Strictly No Repositories**: Repositories are strictly banned. Use native Eloquent directly (`Model::query()->...`).

### Models & Persistence
- Every Eloquent model must define `protected $guarded = ['id'];`.
- Use modern Laravel `casts()` method (`protected function casts(): array`), never the deprecated `$casts` property.
- Never trigger external HTTP requests or network calls inside model observers or lifecycle hooks.

### Transactions & Boundaries
- Always wrap state mutations inside `DB::transaction(fn () => ...)`.
- **Never wrap external network/HTTP calls inside database transactions** to prevent connection starvation and database lock contention.

---

## ๐Ÿงช 3. Testing & Verification

- Test runner: **Pest 4** (`php artisan test` or `./vendor/bin/pest`).
- Architecture & Coding style: **Laravel Pint** (`./vendor/bin/pint --test`).
- Diagnostics: Run `./reyhan doctor` to verify PHP, PostgreSQL, Redis, and directory write permissions.

---

## ๐Ÿ“‚ 4. Ecosystem Quick Reference

| Component | Repository | Role |
| :--- | :--- | :--- |
| **`reyhan-commerce/core`** | [core](https://github.com/reyhan-commerce/core) | Core domain framework package (Facades, Pipelines, Actions, Models) |
| **`reyhan-commerce/reyhan`** | [reyhan](https://github.com/reyhan-commerce/reyhan) | Application skeleton project (This repo) |
| **`reyhan-commerce/installer`** | [create-reyhan](https://github.com/reyhan-commerce/create-reyhan) | Composer-native CLI installer (`reyhan new`) |
| **`storefront-nuxt`** | [storefront-nuxt](https://github.com/reyhan-commerce/storefront-nuxt) | Decoupled Nuxt 4 Storefront |
| **`docs`** | [docs](https://github.com/reyhan-commerce/docs) | Official VitePress documentation portal |

๐Ÿค– Reyhan Commerce โ€” AI Agent & Engineering Constitution

For all AI Agents (Antigravity, Claude Code, Cursor, Copilot, Junie, Codex) and Software Engineers


๐Ÿ›๏ธ 1. Universal Documentation & Code Contract

  1. 100% English Only: Every .md file, commit message, code comment, method docstring, and architectural diagram across this entire repository MUST be written in English.
  2. Persian (fa) is strictly reserved for:
    • Application localization dictionaries (lang/fa.json, lang/fa/*.php)
    • Iranian commerce seeders (Provinces, Cities, Persian demo products)

โšก 2. Laravel & PHP Coding Constitution (farshid-laravel)

Strict Typing & Classes

  • declare(strict_types=1); is mandatory at the very top of every PHP file.
  • All method parameters, return types, and class properties must have explicit types. Avoid mixed unless handling untyped raw third-party payloads.

Controllers & Business Logic

  • Controllers must remain thin: Validate with FormRequest, delegate domain logic to a single Action, and return an ApiResource or JsonResponse.
  • Business Logic in Actions: Use final class [Verb][Noun]Action with a single public execute(...) method.
  • Strictly No Repositories: Repositories are strictly banned. Use native Eloquent directly (Model::query()->...).

Models & Persistence

  • Every Eloquent model must define protected $guarded = ['id'];.
  • Use modern Laravel casts() method (protected function casts(): array), never the deprecated $casts property.
  • Never trigger external HTTP requests or network calls inside model observers or lifecycle hooks.

Transactions & Boundaries

  • Always wrap state mutations inside DB::transaction(fn () => ...).
  • Never wrap external network/HTTP calls inside database transactions to prevent connection starvation and database lock contention.

๐Ÿงช 3. Testing & Verification

  • Test runner: Pest 4 (php artisan test or ./vendor/bin/pest).
  • Architecture & Coding style: Laravel Pint (./vendor/bin/pint --test).
  • Diagnostics: Run ./reyhan doctor to verify PHP, PostgreSQL, Redis, and directory write permissions.

๐Ÿ“‚ 4. Ecosystem Quick Reference

Component Repository Role
reyhan-commerce/core core Core domain framework package (Facades, Pipelines, Actions, Models)
reyhan-commerce/reyhan reyhan Application skeleton project (This repo)
reyhan-commerce/installer create-reyhan Composer-native CLI installer (reyhan new)
storefront-nuxt storefront-nuxt Decoupled Nuxt 4 Storefront
docs docs Official VitePress documentation portal
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource