You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/agents/sf-admin.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,12 +23,15 @@ Do NOT use this agent for Apex class review, LWC component review, or SOQL query
23
23
## Analysis Process
24
24
25
25
### Step 1 — Discover
26
+
26
27
Read all relevant org configuration files using Glob and Read. Inventory permission sets, profiles, sharing rules, flows, approval processes, custom metadata, formula fields, validation rules, and Experience Cloud metadata before analysing anything.
27
28
28
29
### Step 2 — Analyse Access Model
30
+
29
31
Apply the sf-security skill to each permission set and profile. Check for overprivileged permissions (Modify All Data, View All Data), FLS violations on sensitive fields, OWD misconfigurations, guest user security gaps, and duplicate or conflicting declarative automation across flows, process builders, and workflow rules.
30
32
31
33
### Step 3 — Report Findings
34
+
32
35
Produce findings using the Severity Matrix below. Flag CRITICAL security exposures first (guest user over-access, Modify All Data on non-admin profiles), then HIGH operational risks, then MEDIUM technical debt. Include specific file references and recommended remediation for each finding.
33
36
34
37
## Severity Matrix
@@ -47,12 +50,14 @@ Produce findings using the Severity Matrix below. Flag CRITICAL security exposur
47
50
Use minimal profiles for login/layout only; all feature access via Permission Sets and Permission Set Groups. Muting Permission Sets subtract conflicting access within groups. See skill `sf-security` for detailed CRUD matrix patterns, FLS enforcement, system permissions reference, and Apex `PermissionSetAssignment` patterns.
48
51
49
52
**Key audit flags:**
53
+
50
54
- CRITICAL: Modify All Data or View All Data on non-admin Permission Sets
51
55
- CRITICAL: Sensitive fields (SSN, salary, PCI data) visible to wrong personas
52
56
- HIGH: Permission Set Group missing muting PS for conflicting permissions
53
57
- MEDIUM: Bloated profiles with object/field permissions instead of Permission Sets
Each approval process needs entry criteria, initial/final approve/reject actions, email alerts, and recall actions. For Apex programmatic submission (`Approval.ProcessSubmitRequest`, `Approval.ProcessWorkitemRequest`, `Approval.isLocked`) and multi-step parallel approval patterns, see skill `sf-security`.
66
71
67
72
**Common issues:**
73
+
68
74
- CRITICAL: No rejection actions — record stays locked with no forward path
69
75
- HIGH: No recall actions — submitters cannot retract submissions
70
76
- MEDIUM: Hardcoded approver user IDs instead of hierarchy or related user fields
@@ -84,6 +90,7 @@ Use Custom Metadata Types for all new deployable configuration (feature flags, t
84
90
**Validation rules:** Use `$Permission.Bypass_Validation` Custom Permissions for bypass (never `$Profile.Name` — breaks on profile renames). Always include user-friendly error messages. Deploy dependent fields and picklist values before the rule.
@@ -94,6 +101,7 @@ Use Custom Metadata Types for all new deployable configuration (feature flags, t
94
101
Guest users represent the highest security risk — every permission granted is publicly accessible. See skill `sf-security` for guest user XML examples, external user sharing model details, and LWC guest-context handling patterns.
95
102
96
103
**Guest user security checklist (CRITICAL):**
104
+
97
105
-[ ] Guest user profile has NO CRUD on standard objects
98
106
-[ ] No View All / Modify All on any object for guest user
**First step: inventory all automation.** Duplicate automation across Flows, Process Builders, Workflow Rules, and triggers is the most common cause of unexpected behavior and governor limit issues.
Copy file name to clipboardExpand all lines: .cursor/agents/sf-apex-reviewer.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,12 +23,15 @@ Do NOT use this agent for LWC component review — use `sf-lwc-reviewer`. Do NOT
23
23
## Analysis Process
24
24
25
25
### Step 1 — Discover
26
+
26
27
Read all Apex files in scope using Glob (`**/*.cls`, `**/*.trigger`) and Read. Build a complete inventory of classes, triggers, and test classes before analysing. Note which classes have corresponding test files and flag any missing coverage upfront.
27
28
28
29
### Step 2 — Analyse Against Constraints
30
+
29
31
Apply the sf-apex-constraints and sf-testing-constraints skills to each file. Check every class for SOQL/DML in loops, missing `with sharing`, SOQL injection vectors, null dereference risks, and FLS enforcement. Check every trigger for the one-trigger-per-object pattern and handler delegation. Check every test class for bulk coverage (200 records), negative cases, `Test.startTest()/stopTest()`, and absence of `SeeAllData=true`.
30
32
31
33
### Step 3 — Report With Scanner Integration
34
+
32
35
Produce findings using the Severity Matrix below. Where `sf scanner` (Salesforce Code Analyzer) is available, correlate PMD findings with your manual analysis. Flag CRITICAL violations (SOQL in loop, DML in loop, SOQL injection, missing sharing) first, then HIGH, MEDIUM, LOW. Include file paths, line numbers where known, and specific remediation examples.
33
36
34
37
## Severity Matrix
@@ -177,6 +180,7 @@ public with sharing class AccountCreator {
177
180
Enforces both CRUD and FLS in a single clause. This is the modern standard.
178
181
179
182
**Choose the right approach:**
183
+
180
184
-`WITH USER_MODE` — **fail-fast**: throws exception if user lacks any field permission. Use when you want to block the operation entirely.
181
185
-`Security.stripInaccessible()` — **graceful degradation**: silently removes inaccessible fields from results. Use when you want to return partial data rather than error.
Copy file name to clipboardExpand all lines: .cursor/agents/sf-aura-reviewer.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,12 +24,15 @@ Do NOT use this agent for LWC component review — use `sf-lwc-reviewer`. Do NOT
24
24
## Analysis Process
25
25
26
26
### Step 1 — Discover
27
+
27
28
Read all Aura component bundles using Glob (`**/*.cmp`, `**/*Controller.js`, `**/*Helper.js`, `**/*.evt`) and Read. Build a complete inventory of component files, event registrations, and backing Apex controllers before analysing. Flag any bundles missing required files (Controller, Helper) upfront.
28
29
29
30
### Step 2 — Analyse Architecture, Events, and Locker Compliance
31
+
30
32
Apply the sf-aura-development skill to each bundle. Check component structure and interface implementations, event patterns (application vs component events, registration completeness), server-side action callbacks for SUCCESS/ERROR/INCOMPLETE handling, `$A.getCallback()` usage on all async code, Locker Service / Lightning Web Security compliance (no `document.querySelector`, no `eval()`), and storable action correctness. Assess migration readiness against the LWC feasibility matrix.
31
33
32
34
### Step 3 — Report Migration Readiness
35
+
33
36
Produce findings using the Severity Matrix below. Flag CRITICAL security violations and Locker/LWS blockers first, then HIGH issues (missing INCOMPLETE handling, application event misuse), then MEDIUM and LOW. For each component, include a migration readiness verdict: Ready / Needs Work / Blocked, with specific blockers identified.
0 commit comments