# Mayleen LLM Guide Purpose: quick index for AI agents to find canonical business logic and avoid payout/rank mistakes. ## Source Priority 1. `AGENTS.md` - Primary implementation guidance for this repository. - Contains BRD-derived rules and code-derived current behavior. 2. Business documents: - `BRD 4.0 - Mayleen Nutricare.docx.pdf` (authoritative business rules) - `MAYLEEN BUSINESS PLAN.pdf` (supporting visual/business context) 3. Live code behavior (current production logic): - `app/Library/Calculation/WalletCalculation.php` -> `wholesaleBonus` - `app/Models/RankAchiever.php` -> `brandPartnerAndGlobalSupervisor`, `globalManager` - `app/Models/RoyaltyBonusDetail.php` -> `calculation` ## Non-Negotiable Rules For Agents - Never invent rank criteria, payout percentages, or carry-forward rules. - If BRD and code differ, report mismatch first; do not silently pick one. - Treat compensation logic edits as high-risk and test-heavy. - Keep PHP syntax compatible with project constraints (Laravel 6, PHP 7.2 platform lock). ## What To Update When Plan Changes - Update `AGENTS.md`: - BRD-derived canonical summary - Code-derived current behavior section - Mismatch/caveat notes - Update tests for: - rank qualification transitions - wholesale differential distribution - royalty level payouts - monthly eligibility checks (`500 PPV` or alternate gate where applicable)