# Common brief — visit-shell completion (read this first)

Owner request (2026-10-23, Arabic): «كمل كل الي ناقص واعمل كل حاجة ومتسبش حاجة واشتغل بتوصياتك كمان — إضافة للعناصر عايزها بشكل سهل ميكونش من شاشات تانية علشان يبقى سهل». Finish EVERYTHING the prototype review found missing/partial/buggy/deferred, using the orchestrator's recommendations for open decisions. Adding values / configuring elements must be easy and IN PLACE (inside the picker dialog and inside the shell's «✎ تخصيص الشاشة» mode), not on separate admin screens.

Review (source of truth for what is missing): /home/moonui3/public_html/his-analysis/visit-shell-prototype-review.html and the four slice tables:
/home/moonui3/public_html/knowledge-base/plans/visit-shell-completion/review-{A-layout-engine,B-shell-chrome,C-picker-lookups,D-specialties-inpatient}.md
Prototype: /home/moonui3/public_html/knowledge-base/plans/clinical-platform/visit-shell-prototype.html (265 KB — read only line ranges). Spec: knowledge-base/plans/clinical-platform/design-visit-shell.md.

## Environment (moonui3 — never touch /home/moonui or /home/moonui2 or their DBs)
- BE: /home/moonui3/moon-erp-be (Laravel 12, nwidart Modules/*), branch hazemdev3. PHP CLI = /opt/cpanel/ea-php82/root/usr/bin/php (bare `php` is the wrong SAPI). Composer: `$PHP composer.phar …`.
- FE: /home/moonui3/public_html/moon-erp (Angular 21 standalone + PrimeNG 21, signals), branch hazemdev3. Build: `cd /home/moonui3/public_html/moon-erp && npx ng build --base-href /app/` (pre-authorized). Do NOT deploy — the orchestrator deploys.
- Dev DB moonui3_dev_be (live). ⛔ NEVER migrate:fresh / migrate:refresh / db:wipe / RefreshDatabase against it. New migrations: run `$PHP artisan migrate --force` on dev in the same step (timestamps must sort after existing: use 2026_11_20_* or later). Migrations must also run on SQLite (tests).
- Tests: Pest on SQLite. Write tests for BE changes and run ONLY your new/changed test files (`$PHP artisan test --filter=…` or the file path). Do not run whole module suites. Never report a test as passing that you did not run.
- Several agents work in the SAME working trees at once on disjoint files. Touch only the files in your brief; if you must touch a shared file not listed, keep the edit minimal and say so in your report. Do NOT commit, do NOT git add/stash/reset/checkout — the orchestrator commits. Never revert someone else's changes. If the FE build fails in a file you didn't touch, report it, don't "fix" it.
- After editing BE files as root: `chown moonui3:moonui3 <files>`; after BE edits run `$PHP artisan optimize:clear` (and `$PHP composer.phar dump-autoload` if you add classes, using the ea-php82 CLI).
- i18n: add keys to BOTH src/assets/i18n/ar.json and en.json (Arabic is primary, Egyptian-friendly wording consistent with existing VISIT_SHELL.* keys). Do NOT bump I18N_VERSION — the orchestrator does.
- API: header X-Authorization Bearer; money decimal(12,3); permissions via Spatie (catalogue + role seeders + ClinicPermissionDependencies + a bridge migration granting new perms on existing installs — follow how GrantClinicalPlatformPermissionsSeeder / PERM did it).
- Settings: Modules\Core\Services\SettingsService (get/set/getBool/flushCompanyCache); definitions via setting definition seeders (ClinicSettingDefinitionSeeder etc.) and run that seeder on dev after editing.
- Style: match the surrounding code (comments, naming, signals). RTL-first. Shared fixes go in the shared layer, not per screen.
- Report back: files changed, migrations run on dev, tests written + which you ran (with result), what you could NOT verify, and any deviation/decision. Keep it factual.
