skills/sf-2gp-security-review/SKILL.md
Use when user asks for a 2GP security review, AppExchange readiness check, or pass/fail prediction for Apex, LWC, SOQL. Do NOT use for general security patterns.
npx skillsauth add jiten-singh-shahi/salesforce-claude-code sf-2gp-security-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill performs a comprehensive security review of a Salesforce 2GP managed package, assesses readiness for AppExchange security review, and produces a pass/fail prediction with actionable remediation steps.
When invoked, you will:
The output is a detailed markdown report saved to the project's docs/security/ directory.
Before auditing, build a complete inventory of the package contents. Run these searches
against the project's force-app/ directory:
Apex classes: force-app/**/classes/*.cls
Apex triggers: force-app/**/triggers/*.trigger
LWC components: force-app/**/lwc/*/
Aura components: force-app/**/aura/*/
Visualforce pages: force-app/**/pages/*.page
Custom objects: force-app/**/objects/*/
Permission sets: force-app/**/permissionsets/*/
Custom metadata: force-app/**/customMetadata/*/
Static resources: force-app/**/staticresources/*/
Named credentials: force-app/**/namedCredentials/*/
Remote site settings: force-app/**/remoteSiteSettings/*/
Connected apps: force-app/**/connectedApps/*/
Record the count of each metadata type. This inventory becomes the header of your report.
Audit every file from Step 1 against 15 categories. For each category, assign a status: PASS (no issues), WARN (minor issues, unlikely to fail review), or FAIL (will likely fail AppExchange security review).
Audit criteria, grep patterns, and PASS/WARN/FAIL thresholds for all 15 categories:
@../_reference/APPEXCHANGE_REVIEW.md
Supporting reference for implementation patterns:
Categories:
After the security audit, assess readiness for 2GP licensing and AppExchange distribution. Check every item and mark as DONE, NOT DONE, or N/A.
Full checklist (Dev Hub, package config, code quality, submission, ISV, post-review):
@../_reference/APPEXCHANGE_REVIEW.md (section: 2GP License Qualification Checklist)
After completing the audit and checklist, calculate the overall score using the scoring rules and produce one of these verdicts: READY TO SUBMIT / NEEDS REMEDIATION / MAJOR REWORK NEEDED.
Scoring rules and verdict criteria:
@../_reference/APPEXCHANGE_REVIEW.md (section: Scoring Rules)
Generate a markdown report with this structure and save it to docs/security/security-review-report.md:
# Security Review Report — [Package Name]
Generated: [Date]
Package Version: [version from sfdx-project.json]
Namespace: [namespace]
## Package Inventory
| Metadata Type | Count |
|--------------|-------|
| Apex Classes | X |
| ... | ... |
## Security Audit Results
### Overall Verdict: [READY TO SUBMIT / NEEDS REMEDIATION / MAJOR REWORK]
Score: X/15 categories passing
### Category Results
| # | Category | Status | Issues |
|---|----------|--------|--------|
| 1 | CRUD/FLS Enforcement | PASS/WARN/FAIL | Details |
| ... | ... | ... | ... |
### Critical Findings (FAIL)
[List each FAIL with file path, line number, and specific remediation]
### Warnings
[List each WARN with recommendation]
## 2GP License Qualification
[Checklist with DONE/NOT DONE status for each item]
## Remediation Plan
[Prioritized list of fixes, ordered by: automatic fails first, then likely fails, then warnings]
## Appendix: Scanner Commands
[Commands the user should run for Code Analyzer, Checkmarx, etc.]
development
Update Salesforce platform reference docs with latest release features and deprecation announcements. Use when SessionStart hook warns docs are outdated or a new Salesforce release has shipped. Do NOT use for Apex or LWC development.
development
Use when syncing documentation after Salesforce Apex code changes. Update README, API docs, and deploy metadata references to match the current org codebase.
development
Use when managing context during long Salesforce Apex development sessions. Suggests manual compaction at logical intervals to preserve deploy and org context across phases.
tools
Visualforce development — pages, controllers, extensions, ViewState, JS Remoting, LWC migration. Use when maintaining VF pages, building PDFs, or planning VF-to-LWC migration. Do NOT use for LWC, Aura, or Flow.