Skip to content
Back to search

Salesforce-Code-Review-Agent

Salesforce DX code review: Apex, LWC, Flows, security (CRUD/FLS), governors, and Bugbot.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/rediga--salesforce-code-review-agent/badge.svg)](/listings/rediga--salesforce-code-review-agent)

HTML

<a href="/listings/rediga--salesforce-code-review-agent"><img src="/api/listings/rediga--salesforce-code-review-agent/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Pick one path. **Project install** is the usual choice for a team Salesforce repo.

1. Clone this repository

git clone https://github.com/rediga/Salesforce-Code-Review-Agent.git
cd Salesforce-Code-Review-Agent

macOS / Linux:

git clone https://github.com/rediga/Salesforce-Code-Review-Agent.git
cd Salesforce-Code-Review-Agent
chmod +x scripts/install.sh

2a. Install into a Salesforce DX project (recommended)

Copies skills, the subagent, commands, and rules into that project's `.cursor/` folder. Commit those files so everyone on the repo gets the same reviewer.

Windows (PowerShell):

.\scripts\install.ps1 -Target "C:\path\to\your-sfdx-project"

macOS / Linux:

./scripts/install.sh Project /path/to/your-sfdx-project

The script also adds `BUGBOT.md` and `AGENTS.md` if those files are not already present.

Then:

1. Open the Salesforce DX project in Cursor. 2. Command Palette → **Developer: Reload Window**. 3. Open **Agent** chat and type `/review-salesforce` to confirm the command appears.

2b. Install as a local Cursor plugin (all local projects)

Use this when you want the reviewer on every project on your machine without copying files into each repo.

Windows:

.\scripts\install.ps1 -Scope UserPlugin

macOS / Linux:

./scripts/install.sh UserPlugin

Then:

1. In Cursor Settings, allow third-party plugins / local plugin imports if your org requires it (Teams and Enterprise: an admin may need to enable **Allow Local Plugin Imports**). 2. Command Palette → **Developer: Reload Window**. 3. Open **Customize → Plugins** and confirm **salesforce-code-review** is listed.

2c. Install as personal skills (this Cursor user only)

Windows:

.\scripts\install.ps1 -Scope UserSkills

macOS / Linux:

./scripts/install.sh UserSkills

This writes:

- `~/.cursor/skills/salesforce-code-review/` - `~/.cursor/agents/salesforce-code-reviewer.md`

Reload the window. Invoke with `/salesforce-code-review`.

2d. Team marketplace (Teams / Enterprise)

The most reliable team rollout is **2a**: commit `.cursor/` into each Salesforce DX repo.

Admins on Teams or Enterprise can also import this GitHub repo from the Cursor Dashboard → **Plugins**. If the import UI expects a multi-plugin marketplace manifest, use **2a** or **2b** instead.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 220 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Salesforce Code Review Agent
  2. A [Cursor](https://cursor.com) agent that reviews Salesforce DX source the way a platform architect would: Apex, Lightning Web Components, Aura, Flows, and metadata.
  3. It packages:
  4. - A **skill** (`/salesforce-code-review`) with checklists for governors, CRUD/FLS, injection, tests, LWC XSS, and Flow bulkification
  5. - A read-only **subagent** (`salesforce-code-reviewer`) so reviews run in their own context
  6. - A **slash command** (`/review-salesforce`)
  7. - **Rules** that apply when Apex, LWC, or Flow files are in scope
  8. - `BUGBOT.md` so Cursor Agent Review / Bugbot uses the same Salesforce bar
  9. Repository: [github.com/rediga/Salesforce-Code-Review-Agent](https://github.com/rediga/Salesforce-Code-Review-Agent)
  10. **Created:** 2025
  11. ## Prerequisites
  12. - [Cursor](https://cursor.com) (desktop)
  13. - Git
  14. - A Salesforce DX project (`sfdx-project.json` and usually `force-app/`) if you are installing into a project
  15. - Optional: [Salesforce CLI](https://developer.salesforce.com/tools/salesforcecli) and Code Analyzer, if you want the agent to merge scanner output into the report
  16. ## Install
  17. Pick one path. **Project install** is the usual choice for a team Salesforce repo.
  18. ### 1. Clone this repository
  19. ```powershell
  20. git clone https://github.com/rediga/Salesforce-Code-Review-Agent.git
  21. cd Salesforce-Code-Review-Agent
  22. ```
  23. macOS / Linux:
  24. ```bash
  25. git clone https://github.com/rediga/Salesforce-Code-Review-Agent.git
  26. cd Salesforce-Code-Review-Agent
  27. chmod +x scripts/install.sh
  28. ```
  29. ### 2a. Install into a Salesforce DX project (recommended)
  30. Copies skills, the subagent, commands, and rules into that project's `.cursor/` folder. Commit those files so everyone on the repo gets the same reviewer.
  31. Windows (PowerShell):
  32. ```powershell
  33. .\scripts\install.ps1 -Target "C:\path\to\your-sfdx-project"
  34. ```
  35. macOS / Linux:
  36. ```bash
  37. ./scripts/install.sh Project /path/to/your-sfdx-project
  38. ```
  39. The script also adds `BUGBOT.md` and `AGENTS.md` if those files are not already present.
  40. Then:
  41. 1. Open the Salesforce DX project in Cursor.
  42. 2. Command Palette → **Developer: Reload Window**.
  43. 3. Open **Agent** chat and type `/review-salesforce` to confirm the command appears.
  44. ### 2b. Install as a local Cursor plugin (all local projects)
  45. Use this when you want the reviewer on every project on your machine without copying files into each repo.
  46. Windows:
  47. ```powershell
  48. .\scripts\install.ps1 -Scope UserPlugin
  49. ```
  50. macOS / Linux:
  51. ```bash
  52. ./scripts/install.sh UserPlugin
  53. ```
  54. Then:
  55. 1. In Cursor Settings, allow third-party plugins / local plugin imports if your org requires it (Teams and Enterprise: an admin may need to enable **Allow Local Plugin Imports**).
  56. 2. Command Palette → **Developer: Reload Window**.
  57. 3. Open **Customize → Plugins** and confirm **salesforce-code-review** is listed.
  58. ### 2c. Install as personal skills (this Cursor user only)
  59. Windows:
  60. ```powershell
  61. .\scripts\install.ps1 -Scope UserSkills
  62. ```
  63. macOS / Linux:
  64. ```bash
  65. ./scripts/install.sh UserSkills
  66. ```
  67. This writes:
  68. - `~/.cursor/skills/salesforce-code-review/`
  69. - `~/.cursor/agents/salesforce-code-reviewer.md`
  70. Reload the window. Invoke with `/salesforce-code-review`.
  71. ### 2d. Team marketplace (Teams / Enterprise)
  72. The most reliable team rollout is **2a**: commit `.cursor/` into each Salesforce DX repo.
  73. Admins on Teams or Enterprise can also import this GitHub repo from the Cursor Dashboard → **Plugins**. If the import UI expects a multi-plugin marketplace manifest, use **2a** or **2b** instead.
  74. ## Use
  75. Open your **Salesforce DX project** in Cursor (not only this agent repo). Then run a review in any of these ways.
  76. ### Agent chat
  77. Examples:
  78. - `Review this Apex class for CRUD/FLS and bulkification`
  79. - `Review the current branch against main as a Salesforce code review`
  80. - `Review PR 1234 for Salesforce security issues`
  81. - `/review-salesforce`
  82. - `/salesforce-code-review`
  83. Keep the skill on for the whole session by using it as a **Custom Mode** (Windows: Alt+Enter on the skill, macOS: Option+Enter).
  84. ### What the agent reviews
  85. | Area | Typical files | What it checks |
  86. |------|----------------|----------------|
  87. | Apex / triggers | `.cls`, `.trigger` | SOQL/DML in loops, sharing, CRUD/FLS, injection, handler pattern, Named Credentials |
  88. | LWC / Aura | `lwc/`, `aura/` | XSS, cacheable DML, error handling, `@api` mutation, a11y |
  89. | Flows | `.flow-meta.xml` | Collection DML, recursion, fault paths, user vs system context |
  90. | Tests | `*Test.cls`, `test*.cls` | Isolation, asserts, bulk, `runAs`, callout mocks |
  91. | Security metadata | permission sets, guest access, credentials | Least privilege, secrets, Experience Cloud |
  92. ### Report shape
  93. You should get a markdown report with:
  94. - **Verdict:** Approve / Approve with comments / Request changes
  95. - A table of findings sorted Critical → Low, with `file:line` and a Salesforce-specific fix
  96. - Notes on tests and residual risk
  97. The subagent is **read-only**. It will not edit or deploy unless you separately ask to apply fixes.
  98. ### Agent Review / Bugbot
  99. After project install, `BUGBOT.md` is in the Salesforce repo root.
  100. - Slash: `/agent-review` or `/review-bugbot`
  101. - Or enable Agent Review in **Cursor Settings → Agents** (or **Git & PRs → Pull Requests** on newer Cursor)
  102. ### Optional scanner
  103. If Salesforce Code Analyzer is installed, you can ask:
  104. ```text
  105. Run sf code-analyzer on the changed Apex and include those results in the review
  106. ```
  107. The skill will use the CLI when it is available and will skip it when it is not.
  108. ## Update
  109. From this clone:
  110. ```powershell
  111. git pull
  112. .\scripts\install.ps1 -Target "C:\path\to\your-sfdx-project"
  113. ```
  114. For a user plugin or personal skills install, re-run the same `-Scope` you used originally, then reload Cursor.
  115. ## Customize
  116. | Goal | Where |
  117. |------|--------|
  118. | Change review checklists | `.cursor/skills/salesforce-code-review/references/` |
  119. | Change when the subagent is used | `.cursor/agents/salesforce-code-reviewer.md` (`description` field) |
  120. | Org-specific rules (naming, trigger framework) | Add another `.cursor/rules/*.mdc` in the DX project |
  121. | Stop auto-invoking the skill | Set `disable-model-invocation: true` in the skill frontmatter |
  122. Do not put secrets in rules or skills. Named Credential configuration belongs in the org, not in this repo.
  123. ## Layout
  124. ```text
  125. .cursor-plugin/plugin.json Cursor plugin manifest
  126. .cursor/skills/salesforce-code-review/
  127. .cursor/agents/salesforce-code-reviewer.md
  128. .cursor/commands/review-salesforce.md
  129. .cursor/rules/ Apex, LWC, Flow, security
  130. scripts/install.ps1 Windows installer
  131. scripts/install.sh macOS / Linux installer
  132. templates/AGENTS.md Copied into DX projects if missing
  133. BUGBOT.md Agent Review / Bugbot guidance
  134. ```
  135. ## License
  136. MIT. See [LICENSE](LICENSE).
  137. ## Contributing
  138. Contributions are welcome.
  139. ### Quick workflow
  140. 1. Fork this repository on GitHub.
  141. 2. Create a new branch for your changes.
  142. 3. Make your changes and test them.
  143. 4. Commit and push your changes.
  144. 5. Open a Pull Request against the `main` branch.
  145. For larger changes, please explain the problem being solved and include relevant testing steps in the Pull Request description.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.