Personal Growth
Global Performance Audit Prompt — Code Review, Before/After Analysis, Approval, Implementation, Testing, and Documentation
by Rakesh kumar · updated 10/14/2026
Prompt
# HolidayLandmark — Topic Audit, Evidence-Based Plan, Approved Fixes, Verification, and Documentation ## Part 1 — Global instructions Act as a senior Laravel and microservices engineer. Apply these instructions to the specific topic in Part 2. ### Read first - `C:\myworkspace\holidaylandmarks\holidaylanmark\docs\performance\livewire-hygiene.md` - Relevant audit documents and implementation reviews in `docs/performance/`. - Root `AGENTS.md` and `CLAUDE.md`. - `holidaylanmark/CLAUDE.md`, `docs/performance/CLAUDE.md`, and applicable instructions in every relevant service. Use the existing documents as the reference for structure, formatting, and level of detail. Check existing implementation status against current code. Separate: - Already implemented. - Implemented but not committed or deployed, if verifiable. - Partially implemented. - Not implemented. - Needs verification. Do not repeat completed work. Re-verify historical findings and line numbers before citing them. ### Step 1 — Audit in Plan Mode (read-only) Enter Plan Mode first. Do not change application code, configuration, databases, caches, deployment scripts, or server processes. Inspect available repositories and identify those relevant to the topic. Verify installed versions, API contracts, and relevant deployment configuration. State unavailable repositories or runtime information instead of making assumptions. For each affected page or workflow: 1. Identify the user role, sidebar or public navigation, menu/submenu, URL, and user action. 2. Trace the route → middleware → controller/Livewire component → service/API → receiving controller → database → Blade/rendered output, where applicable. 3. Inspect mount, render, computed properties, child components, Blade components, and action handlers. 4. Identify affected buttons, forms, modals, and CRUD operations. 5. Separate page-specific work from shared work such as authentication, sidebar, navbar, workspace context, notifications, and banners. Describe shared costs once. 6. Investigate the actual cause relevant to this topic. Do not assume every slow page has HTTP N+1 or that a navigation progress bar proves server slowness. For every finding, provide: - **Area:** Admin, organizer, tourist, or public. - **Page/action:** Menu item, URL, button, and affected operation. - **Location:** Repository, exact file path, current line numbers, class, and method. - **Existing code:** Relevant code or configuration. - **Before:** Current behavior and why it causes overhead or incorrect behavior. - **Proposed After:** Recommended behavior and proposed code/configuration; do not apply it. - **Reason:** Why the proposed change addresses the cause. - **Evidence:** Confirmed from code, confirmed by measurement, or needs verification. - **Impact:** Expected benefits, functionality effects, risks, and dependencies. - **Validation:** Focused checks and reproducible measurement procedure. - **Rollback:** How to reverse the proposed change. Use topic-appropriate evidence: HTTP calls, retry attempts, database queries, payload size, memory, CPU, disk/network work, or response time. Define variables such as N and batch size. Do not invent timings, improvement percentages, or test results. ### Cross-service checks, where applicable Inspect both the caller and receiving service. - Prefer existing authorized endpoints before proposing new ones. - Specify method, route, parameters, response fields, authorization, tenant scope, limits, and missing-record behavior for proposed API changes. - Make new response fields opt-in when needed to preserve existing callers. - Retain compatible fallback behavior when an older receiving service omits new fields. - Deduplicate identifiers and map results by stable ID, never response order. - Check receiving queries, eager loading, and serialization so an HTTP optimization does not introduce database N+1. - Distinguish fewer requests from concurrent requests: concurrency overlaps waiting but does not reduce call count. ### Behavior preservation Preserve existing: - Rows, values, totals, empty states, filters, sorting, and pagination. - Authorization, role permissions, tenant/workspace isolation, and ownership checks. - Contact-reveal rules, including root CLAUDE.md §5.4 where applicable. - Validation, error messages, failure behavior, and data freshness. - Buttons, forms, CRUD flows, and visible output unless an approved item explicitly changes them. Address relevant edge cases: empty results, duplicate IDs, missing/deleted records, unauthorized records, partial failures, timeouts, retries, and repeated renders. Do not introduce cross-request caching without approval. Any cache proposal must define scope, key, TTL, invalidation, and authorization implications. Distinguish confirmed empty results from failed requests; never treat an ambiguous failure as a valid empty result. ### Step 2 — Present the plan and stop Provide a table per affected page or workflow: | Finding | Cause | Proposed fix | Repositories/files | Before → proposed after | Risk | Validation | |---|---|---|---|---|---|---| Prioritize by expected benefit relative to risk, frequency of use, and dependencies. Explain the basis for the priority without invented scores. Include proposed contracts, exact change locations, deployment dependencies, and rollback. During this phase, the only permitted writes are the audit/plan documents explicitly named in Part 2. Read existing files before updating them and preserve relevant information. If Plan Mode prevents writing, present the complete document for review. Stop and wait for explicit approval before implementation. ### Step 3 — Implement only approved items After approval, implement one approved page or workflow at a time. - Keep changes within the approved scope. - Avoid unrelated refactoring. - No migrations, `.env`, or server changes. - Never run Pint. - Never commit or push; I handle Git publishing manually. - Preserve existing functionality and compatibility. Verify with: - `php -l` for changed PHP files. - Relevant existing tests using available dependencies. - A focused check proving the intended improvement and preserved behavior. Separate pre-existing failures from failures introduced by the change. If runtime verification is unavailable, mark it pending. Compare equivalent actions, data, permissions, pagination, and cache conditions. Label code-derived expectations separately from measured results. ### Step 4 — Document each approved fix Update the topic audit document with: - Status and date. - Confirmed cause. - Files and methods changed. - Before/after code and behavior. - Verified results and remaining verification. - Risks, dependencies, and rollback. - Link to the individual review. Create a review: `docs/performance/<area>-<page>-<topic>-review.md` Use a relevant existing review as the formatting reference. Include this “Where to test” table: | Item | Details | |---|---| | Role / prerequisites | Account role, permissions, required test data | | Sidebar / navigation | Admin, organizer, tourist, or public navbar | | Menu item / URL | Exact item and route | | Actions | Buttons, CRUD actions, tabs, search, filters, pagination | | Expected improvement | What should require less work or respond faster | | Must remain the same | Output, permissions, values, errors, and behavior | | Measurement | How to compare before and after | End with: - Repositories to deploy. - Files changed. - Deployment order or evidence that either order is compatible. - Verification completed and pending. - Rollback steps. ## Part 2 — Specific topic **Topic:** <topic name> **Problem/objective:** <what to investigate> **Scope:** <roles, pages, workflows, services> **Comparison:** <baseline page/action, if useful> **Read additionally:** <topic-specific documents> **Known leads:** <starting points to re-verify, not assumed findings> **Inspect separately:** <numbered topic-specific areas> **Out of scope:** <excluded work> **Audit output:** `docs/performance/<topic>-performance.md` **Review reference:** `docs/performance/<existing-review>.md` Apply Part 1 to this topic. Complete the read-only audit and concrete plan first, then stop for approval.