Salesforce apex lwc code review skill

From Raishin/vanguard-frontier-agentic · View interactive version

Salesforce apex lwc code review skill is an AI agent skill from the GitHub repository Raishin/vanguard-frontier-agentic. Use this skill when Salesforce Apex classes, triggers, Lightning Web Components (LWC), or async jobs (Queueable, Batch, Future, Schedulable) must be reviewed for security vulnerabilities and governor-limit risk. Flags: SOQL and DML inside loops, missing test coverage patterns, WITH SECURITY_ENFORCED

How to use this skill

Skill file

Salesforce Apex and LWC Code Review Skill

Purpose

This skill reviews Salesforce Apex classes, triggers, Lightning Web Components

(

LWC), and async jobs for security

vulnerabilities, governor-limit risk, test coverage patterns, and sharing

enforcement. It flags patterns that cause data exposure, runaway resource

consumption, or privilege escalation. It does not execute code, access live

orgs, or authorize deployments.

When to use

When not to use

Minimum payload (required inputs)

(JS controller, HTML template, or Apex controller).

(trigger, batch, scheduled, invocable, REST endpoint, LWC component).

Workflow

1. SOQL inside loops

while loops, or recursive method calls.

SOQL query.

2. DML inside loops

undelete) inside loops.

3. Sharing enforcement

or omits the keyword.

4. Field-level security enforcement

5. Governor limit risk

without timeout handling.

6. Test coverage patterns

deprecated pattern).

System.assert).

7. LWC security surface

innerHTML bindings with unsanitized values (XSS risk).

equivalents.

without FLS enforcement in the backing Apex.

: flag cross-namespace

DOM access patterns that depend on bypassing Locker Service.

8. Async job design

scope limitation; flag missing finish method implementations.

condition (runaway chaining).

concurrency guard.

Evidence requirements

Output format

apex_lwc_code_review_findings:
  soql_in_loops:
    - location: [class/method or line range]
      severity: High
      recommendation: [brief]
  dml_in_loops:
    - location: [...]
      severity: High
      recommendation: [...]
  sharing_enforcement:
    - class: [name]
      keyword: with sharing | without sharing | inherited sharing | missing
      severity: Critical | High | Medium | Low
      justification_required: true | false
      recommendation: [...]
  fls_enforcement:
    - query_location: [...]
      with_security_enforced: present | absent
      strip_inaccessible: present | partial | absent
      severity: [...]
      recommendation: [...]
  governor_limit_risks:
    - pattern: [description]
      severity: [...]
      recommendation: [...]
  test_coverage_patterns:
    - finding: [description]
      severity: [...]
      recommendation: [...]
  lwc_security_findings:
    - finding: [description]
      severity: [...]
      recommendation: [...]
  async_job_findings:
    - finding: [description]
      severity: [...]
      recommendation: [...]

summary:
  total_findings: [count]
  critical_count: [count]
  high_count: [count]
escalation_gates_fired: [from salesforce-risk-taxonomy, or "none"]
assumptions: [list]
missing_evidence: [what would improve the review]

Redaction rules

Privilege / data handling rules

Handoff rules

salesforce-permission-model-review-skill (if sharing or FLS findings are systemic),

salesforce-release-readiness-skill (for deployment readiness after review).

sharing_enforcement summary.

Audit log fields

Stop conditions

Security notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.