# Code Review Prompt Template

Use this template every time you need a full code review in Cursor.

---

## How to Use

1. **Copy** the prompt below
2. **Replace** the placeholders inside `[...]` with actual values
3. **Paste** into Cursor chat
4. The `@` references auto-attach the rule files from `.cursor/rules/`

---

## Full Code Review Prompt

```
@code-review-rules.mdc @project-overview.mdc @check-helpers-and-modules-first.mdc

## Code Review Request — Full

| Field     | Value                  |
|-----------|------------------------|
| Developer | [Developer Name]       |
| Branch    | [current-branch-name]  |

### Instructions

1. Compare the current branch with `master`. Focus ONLY on changed/added files.
2. Run ALL 16 sections from `@code-review-rules.mdc` — skip nothing.
3. Follow the exact output format (Block 1 through Block 8) as defined in the rules.
4. End with a numeric rating (X/10) and final verdict (Approved / Suggestions Only / Needs Fixes / Reopened / Rejected).

### Save Report

Once the review is complete, save the full report as a markdown file at:

docs/code-reviews/[YYYY-MM-DD]_[current-branch-name]_[Developer-Name].md
```

---

## Quick Review Prompt (Specific Files Only)

Use this when you only want to review specific files instead of the full branch diff.

```
@code-review-rules.mdc @project-overview.mdc @check-helpers-and-modules-first.mdc

## Code Review Request — Targeted

| Field     | Value                  |
|-----------|------------------------|
| Developer | [Developer Name]       |
| Branch    | [current-branch-name]  |
| Files     | [list the files or use @ to attach them] |

### Instructions

1. Review ONLY the listed/attached files against the rules in `@code-review-rules.mdc`.
2. Run all applicable sections (skip sections that don't apply to the files).
3. Follow the exact output format (Block 1 through Block 8).
4. End with a numeric rating (X/10) and final verdict.

### Save Report

Once the review is complete, save the full report as a markdown file at:

docs/code-reviews/[YYYY-MM-DD]_[current-branch-name]_[Developer-Name].md
```

---

## Module-Only Review Prompt

Use this when reviewing a single module (e.g. hotel, flight, payment).

```
@code-review-rules.mdc @project-overview.mdc @check-helpers-and-modules-first.mdc

## Code Review Request — Module

| Field     | Value                          |
|-----------|--------------------------------|
| Developer | [Developer Name]               |
| Branch    | [current-branch-name]          |
| Module    | [module-name, e.g. hotel]      |

### Instructions

1. Review all changed files inside `application/modules/[module-name]/` and any related assets, helpers, or config changes.
2. Compare with `master` — focus on what changed.
3. Run all applicable sections from `@code-review-rules.mdc`.
4. Pay special attention to: access control, input validation, query safety, and backward compatibility.
5. Follow the exact output format (Block 1 through Block 8).
6. End with a numeric rating (X/10) and final verdict.

### Save Report

Once the review is complete, save the full report as a markdown file at:

docs/code-reviews/[YYYY-MM-DD]_[module-name]_[current-branch-name]_[Developer-Name].md
```

---

## Placeholder Reference

| Placeholder              | Replace With                                  | Example                          |
|--------------------------|-----------------------------------------------|----------------------------------|
| `[Developer Name]`       | The developer who wrote the code              | `John Doe`                       |
| `[current-branch-name]`  | Git branch being reviewed                     | `feature/hotel-booking`          |
| `[YYYY-MM-DD]`           | Today's date                                  | `2026-03-09`                     |
| `[module-name]`          | CodeIgniter module name                       | `hotel`                          |

---

## Tips

- Always attach `@code-review-rules.mdc` — it contains the full checklist and output format.
- Attach `@project-overview.mdc` so the reviewer knows the tech stack and conventions.
- Attach `@check-helpers-and-modules-first.mdc` so it checks for code reuse before flagging issues.
- For frontend-heavy changes, also attach `@frontend-js-scss.mdc`.
- For PHP/CI-specific patterns, also attach `@php-codeigniter-hmvc.mdc`.
- The report is auto-saved to `docs/code-reviews/` — create the folder if it doesn't exist.
