scc-universal 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/.claude-plugin/plugin.json +44 -0
  2. package/.cursor/agents/deep-researcher.md +142 -0
  3. package/.cursor/agents/doc-updater.md +219 -0
  4. package/.cursor/agents/eval-runner.md +335 -0
  5. package/.cursor/agents/learning-engine.md +210 -0
  6. package/.cursor/agents/loop-operator.md +245 -0
  7. package/.cursor/agents/refactor-cleaner.md +119 -0
  8. package/.cursor/agents/sf-admin-agent.md +127 -0
  9. package/.cursor/agents/sf-agentforce-agent.md +126 -0
  10. package/.cursor/agents/sf-apex-agent.md +117 -0
  11. package/.cursor/agents/sf-architect.md +426 -0
  12. package/.cursor/agents/sf-aura-reviewer.md +369 -0
  13. package/.cursor/agents/sf-bugfix-agent.md +101 -0
  14. package/.cursor/agents/sf-flow-agent.md +155 -0
  15. package/.cursor/agents/sf-integration-agent.md +141 -0
  16. package/.cursor/agents/sf-lwc-agent.md +123 -0
  17. package/.cursor/agents/sf-review-agent.md +357 -0
  18. package/.cursor/agents/sf-visualforce-reviewer.md +465 -0
  19. package/.cursor/hooks/adapter.js +81 -0
  20. package/.cursor/hooks/after-file-edit.js +26 -0
  21. package/.cursor/hooks/after-mcp-execution.js +12 -0
  22. package/.cursor/hooks/after-shell-execution.js +30 -0
  23. package/.cursor/hooks/after-tab-file-edit.js +12 -0
  24. package/.cursor/hooks/before-mcp-execution.js +11 -0
  25. package/.cursor/hooks/before-read-file.js +13 -0
  26. package/.cursor/hooks/before-shell-execution.js +29 -0
  27. package/.cursor/hooks/before-submit-prompt.js +23 -0
  28. package/.cursor/hooks/pre-compact.js +7 -0
  29. package/.cursor/hooks/session-end.js +10 -0
  30. package/.cursor/hooks/session-start.js +10 -0
  31. package/.cursor/hooks/stop.js +18 -0
  32. package/.cursor/hooks/subagent-start.js +10 -0
  33. package/.cursor/hooks/subagent-stop.js +10 -0
  34. package/.cursor/hooks.json +107 -0
  35. package/.cursor/skills/aside/SKILL.md +115 -0
  36. package/.cursor/skills/checkpoint/SKILL.md +50 -0
  37. package/.cursor/skills/configure-scc/SKILL.md +160 -0
  38. package/.cursor/skills/continuous-agent-loop/SKILL.md +260 -0
  39. package/.cursor/skills/mcp-server-patterns/SKILL.md +142 -0
  40. package/.cursor/skills/model-route/SKILL.md +81 -0
  41. package/.cursor/skills/prompt-optimizer/SKILL.md +366 -0
  42. package/.cursor/skills/refactor-clean/SKILL.md +133 -0
  43. package/.cursor/skills/resume-session/SKILL.md +111 -0
  44. package/.cursor/skills/save-session/SKILL.md +183 -0
  45. package/.cursor/skills/search-first/SKILL.md +140 -0
  46. package/.cursor/skills/security-scan/SKILL.md +142 -0
  47. package/.cursor/skills/sessions/SKILL.md +124 -0
  48. package/.cursor/skills/sf-agentforce-development/SKILL.md +449 -0
  49. package/.cursor/skills/sf-apex-async-patterns/SKILL.md +324 -0
  50. package/.cursor/skills/sf-apex-best-practices/SKILL.md +421 -0
  51. package/.cursor/skills/sf-apex-constraints/SKILL.md +79 -0
  52. package/.cursor/skills/sf-apex-cursor/SKILL.md +336 -0
  53. package/.cursor/skills/sf-apex-enterprise-patterns/SKILL.md +344 -0
  54. package/.cursor/skills/sf-apex-testing/SKILL.md +407 -0
  55. package/.cursor/skills/sf-api-design/SKILL.md +237 -0
  56. package/.cursor/skills/sf-approval-processes/SKILL.md +312 -0
  57. package/.cursor/skills/sf-aura-development/SKILL.md +260 -0
  58. package/.cursor/skills/sf-build-fix/SKILL.md +120 -0
  59. package/.cursor/skills/sf-data-modeling/SKILL.md +274 -0
  60. package/.cursor/skills/sf-debugging/SKILL.md +362 -0
  61. package/.cursor/skills/sf-deployment/SKILL.md +291 -0
  62. package/.cursor/skills/sf-deployment-constraints/SKILL.md +153 -0
  63. package/.cursor/skills/sf-devops-ci-cd/SKILL.md +322 -0
  64. package/.cursor/skills/sf-docs-lookup/SKILL.md +100 -0
  65. package/.cursor/skills/sf-e2e-testing/SKILL.md +321 -0
  66. package/.cursor/skills/sf-experience-cloud/SKILL.md +248 -0
  67. package/.cursor/skills/sf-flow-development/SKILL.md +376 -0
  68. package/.cursor/skills/sf-governor-limits/SKILL.md +319 -0
  69. package/.cursor/skills/sf-harness-audit/SKILL.md +139 -0
  70. package/.cursor/skills/sf-help/SKILL.md +156 -0
  71. package/.cursor/skills/sf-integration/SKILL.md +479 -0
  72. package/.cursor/skills/sf-lwc-constraints/SKILL.md +128 -0
  73. package/.cursor/skills/sf-lwc-development/SKILL.md +302 -0
  74. package/.cursor/skills/sf-lwc-testing/SKILL.md +387 -0
  75. package/.cursor/skills/sf-metadata-management/SKILL.md +285 -0
  76. package/.cursor/skills/sf-platform-events-cdc/SKILL.md +372 -0
  77. package/.cursor/skills/sf-quickstart/SKILL.md +170 -0
  78. package/.cursor/skills/sf-security/SKILL.md +330 -0
  79. package/.cursor/skills/sf-security-constraints/SKILL.md +125 -0
  80. package/.cursor/skills/sf-soql-constraints/SKILL.md +129 -0
  81. package/.cursor/skills/sf-soql-optimization/SKILL.md +353 -0
  82. package/.cursor/skills/sf-tdd-workflow/SKILL.md +332 -0
  83. package/.cursor/skills/sf-testing-constraints/SKILL.md +198 -0
  84. package/.cursor/skills/sf-trigger-constraints/SKILL.md +88 -0
  85. package/.cursor/skills/sf-trigger-frameworks/SKILL.md +343 -0
  86. package/.cursor/skills/sf-visualforce-development/SKILL.md +259 -0
  87. package/.cursor/skills/strategic-compact/SKILL.md +205 -0
  88. package/.cursor/skills/update-docs/SKILL.md +162 -0
  89. package/.cursor/skills/update-platform-docs/SKILL.md +86 -0
  90. package/.cursor-plugin/plugin.json +26 -0
  91. package/LICENSE +21 -0
  92. package/README.md +522 -0
  93. package/agents/deep-researcher.md +145 -0
  94. package/agents/doc-updater.md +222 -0
  95. package/agents/eval-runner.md +340 -0
  96. package/agents/learning-engine.md +211 -0
  97. package/agents/loop-operator.md +247 -0
  98. package/agents/refactor-cleaner.md +122 -0
  99. package/agents/sf-admin-agent.md +131 -0
  100. package/agents/sf-agentforce-agent.md +132 -0
  101. package/agents/sf-apex-agent.md +124 -0
  102. package/agents/sf-architect.md +435 -0
  103. package/agents/sf-aura-reviewer.md +372 -0
  104. package/agents/sf-bugfix-agent.md +105 -0
  105. package/agents/sf-flow-agent.md +159 -0
  106. package/agents/sf-integration-agent.md +146 -0
  107. package/agents/sf-lwc-agent.md +127 -0
  108. package/agents/sf-review-agent.md +366 -0
  109. package/agents/sf-visualforce-reviewer.md +468 -0
  110. package/assets/logo.svg +18 -0
  111. package/docs/ARCHITECTURE.md +133 -0
  112. package/docs/authoring-guide.md +373 -0
  113. package/docs/hook-development.md +578 -0
  114. package/docs/token-optimization.md +139 -0
  115. package/docs/workflow-examples.md +645 -0
  116. package/examples/agentforce-action/README.md +227 -0
  117. package/examples/apex-trigger-handler/README.md +114 -0
  118. package/examples/devops-pipeline/README.md +325 -0
  119. package/examples/flow-automation/README.md +188 -0
  120. package/examples/integration-pattern/README.md +416 -0
  121. package/examples/lwc-component/README.md +180 -0
  122. package/examples/platform-events/README.md +492 -0
  123. package/examples/scratch-org-setup/README.md +138 -0
  124. package/examples/security-audit/README.md +244 -0
  125. package/examples/visualforce-migration/README.md +314 -0
  126. package/hooks/hooks.json +338 -0
  127. package/hooks/memory-persistence/README.md +73 -0
  128. package/manifests/install-modules.json +217 -0
  129. package/manifests/install-profiles.json +17 -0
  130. package/mcp-configs/mcp-servers.json +19 -0
  131. package/package.json +89 -0
  132. package/schemas/hooks.schema.json +123 -0
  133. package/schemas/install-modules.schema.json +76 -0
  134. package/schemas/install-profiles.schema.json +28 -0
  135. package/schemas/install-state.schema.json +73 -0
  136. package/schemas/package-manager.schema.json +18 -0
  137. package/schemas/plugin.schema.json +112 -0
  138. package/schemas/scc-install-config.schema.json +29 -0
  139. package/schemas/state-store.schema.json +111 -0
  140. package/scripts/cli/install-apply.js +170 -0
  141. package/scripts/cli/uninstall.js +193 -0
  142. package/scripts/hooks/check-console-log.js +101 -0
  143. package/scripts/hooks/check-hook-enabled.js +17 -0
  144. package/scripts/hooks/check-platform-docs-age.js +48 -0
  145. package/scripts/hooks/cost-tracker.js +78 -0
  146. package/scripts/hooks/doc-file-warning.js +63 -0
  147. package/scripts/hooks/evaluate-session.js +98 -0
  148. package/scripts/hooks/governor-check.js +220 -0
  149. package/scripts/hooks/learning-observe.sh +206 -0
  150. package/scripts/hooks/mcp-health-check.js +588 -0
  151. package/scripts/hooks/post-bash-build-complete.js +34 -0
  152. package/scripts/hooks/post-bash-pr-created.js +43 -0
  153. package/scripts/hooks/post-edit-console-warn.js +61 -0
  154. package/scripts/hooks/post-edit-format.js +79 -0
  155. package/scripts/hooks/post-edit-typecheck.js +98 -0
  156. package/scripts/hooks/post-write.js +168 -0
  157. package/scripts/hooks/pre-bash-git-push-reminder.js +35 -0
  158. package/scripts/hooks/pre-bash-tmux-reminder.js +47 -0
  159. package/scripts/hooks/pre-compact.js +51 -0
  160. package/scripts/hooks/pre-tool-use.js +163 -0
  161. package/scripts/hooks/pre-write-doc-warn.js +9 -0
  162. package/scripts/hooks/quality-gate.js +251 -0
  163. package/scripts/hooks/run-with-flags-shell.sh +32 -0
  164. package/scripts/hooks/run-with-flags.js +135 -0
  165. package/scripts/hooks/session-end-marker.js +29 -0
  166. package/scripts/hooks/session-end.js +311 -0
  167. package/scripts/hooks/session-start.js +202 -0
  168. package/scripts/hooks/sfdx-scanner-check.js +142 -0
  169. package/scripts/hooks/sfdx-validate.js +119 -0
  170. package/scripts/hooks/stop-hook.js +170 -0
  171. package/scripts/hooks/suggest-compact.js +67 -0
  172. package/scripts/lib/agent-adapter.js +82 -0
  173. package/scripts/lib/apex-analysis.js +194 -0
  174. package/scripts/lib/hook-flags.js +74 -0
  175. package/scripts/lib/install-config.js +73 -0
  176. package/scripts/lib/install-executor.js +363 -0
  177. package/scripts/lib/install-state.js +121 -0
  178. package/scripts/lib/orchestration-session.js +299 -0
  179. package/scripts/lib/package-manager.js +124 -0
  180. package/scripts/lib/project-detect.js +228 -0
  181. package/scripts/lib/schema-validator.js +190 -0
  182. package/scripts/lib/skill-adapter.js +100 -0
  183. package/scripts/lib/state-store.js +376 -0
  184. package/scripts/lib/tmux-worktree-orchestrator.js +598 -0
  185. package/scripts/lib/utils.js +313 -0
  186. package/scripts/scc.js +164 -0
  187. package/skills/_reference/AGENTFORCE_PATTERNS.md +112 -0
  188. package/skills/_reference/APEX_CURSOR.md +159 -0
  189. package/skills/_reference/API_VERSIONS.md +78 -0
  190. package/skills/_reference/APPROVAL_PROCESSES.md +105 -0
  191. package/skills/_reference/ASYNC_PATTERNS.md +163 -0
  192. package/skills/_reference/AURA_COMPONENTS.md +146 -0
  193. package/skills/_reference/DATA_MIGRATION_PATTERNS.md +151 -0
  194. package/skills/_reference/DATA_MODELING.md +124 -0
  195. package/skills/_reference/DEBUGGING_TOOLS.md +140 -0
  196. package/skills/_reference/DEPLOYMENT_CHECKLIST.md +87 -0
  197. package/skills/_reference/DEPRECATIONS.md +79 -0
  198. package/skills/_reference/DOCKER_CI_PATTERNS.md +138 -0
  199. package/skills/_reference/ENTERPRISE_PATTERNS.md +122 -0
  200. package/skills/_reference/EXPERIENCE_CLOUD.md +143 -0
  201. package/skills/_reference/FLOW_PATTERNS.md +113 -0
  202. package/skills/_reference/GOVERNOR_LIMITS.md +77 -0
  203. package/skills/_reference/INTEGRATION_PATTERNS.md +105 -0
  204. package/skills/_reference/LWC_PATTERNS.md +79 -0
  205. package/skills/_reference/METADATA_TYPES.md +115 -0
  206. package/skills/_reference/NAMING_CONVENTIONS.md +84 -0
  207. package/skills/_reference/PACKAGE_DEVELOPMENT.md +150 -0
  208. package/skills/_reference/PLATFORM_EVENTS.md +121 -0
  209. package/skills/_reference/REPORTING_API.md +143 -0
  210. package/skills/_reference/SCRATCH_ORG_PATTERNS.md +126 -0
  211. package/skills/_reference/SECURITY_PATTERNS.md +127 -0
  212. package/skills/_reference/SHARING_MODEL.md +120 -0
  213. package/skills/_reference/SOQL_PATTERNS.md +119 -0
  214. package/skills/_reference/TESTING_STANDARDS.md +96 -0
  215. package/skills/_reference/TRIGGER_PATTERNS.md +114 -0
  216. package/skills/_reference/VISUALFORCE_PATTERNS.md +121 -0
  217. package/skills/aside/SKILL.md +118 -0
  218. package/skills/checkpoint/SKILL.md +53 -0
  219. package/skills/configure-scc/SKILL.md +163 -0
  220. package/skills/continuous-agent-loop/SKILL.md +264 -0
  221. package/skills/mcp-server-patterns/SKILL.md +146 -0
  222. package/skills/model-route/SKILL.md +84 -0
  223. package/skills/prompt-optimizer/SKILL.md +369 -0
  224. package/skills/refactor-clean/SKILL.md +136 -0
  225. package/skills/resume-session/SKILL.md +114 -0
  226. package/skills/save-session/SKILL.md +186 -0
  227. package/skills/search-first/SKILL.md +144 -0
  228. package/skills/security-scan/SKILL.md +146 -0
  229. package/skills/sessions/SKILL.md +127 -0
  230. package/skills/sf-agentforce-development/SKILL.md +450 -0
  231. package/skills/sf-apex-async-patterns/SKILL.md +326 -0
  232. package/skills/sf-apex-best-practices/SKILL.md +425 -0
  233. package/skills/sf-apex-constraints/SKILL.md +81 -0
  234. package/skills/sf-apex-cursor/SKILL.md +338 -0
  235. package/skills/sf-apex-enterprise-patterns/SKILL.md +348 -0
  236. package/skills/sf-apex-testing/SKILL.md +409 -0
  237. package/skills/sf-api-design/SKILL.md +238 -0
  238. package/skills/sf-approval-processes/SKILL.md +315 -0
  239. package/skills/sf-aura-development/SKILL.md +263 -0
  240. package/skills/sf-build-fix/SKILL.md +121 -0
  241. package/skills/sf-data-modeling/SKILL.md +278 -0
  242. package/skills/sf-debugging/SKILL.md +363 -0
  243. package/skills/sf-deployment/SKILL.md +295 -0
  244. package/skills/sf-deployment-constraints/SKILL.md +155 -0
  245. package/skills/sf-devops-ci-cd/SKILL.md +325 -0
  246. package/skills/sf-docs-lookup/SKILL.md +103 -0
  247. package/skills/sf-e2e-testing/SKILL.md +324 -0
  248. package/skills/sf-experience-cloud/SKILL.md +249 -0
  249. package/skills/sf-flow-development/SKILL.md +377 -0
  250. package/skills/sf-governor-limits/SKILL.md +323 -0
  251. package/skills/sf-harness-audit/SKILL.md +142 -0
  252. package/skills/sf-help/SKILL.md +159 -0
  253. package/skills/sf-integration/SKILL.md +483 -0
  254. package/skills/sf-lwc-constraints/SKILL.md +130 -0
  255. package/skills/sf-lwc-development/SKILL.md +303 -0
  256. package/skills/sf-lwc-testing/SKILL.md +388 -0
  257. package/skills/sf-metadata-management/SKILL.md +288 -0
  258. package/skills/sf-platform-events-cdc/SKILL.md +375 -0
  259. package/skills/sf-quickstart/SKILL.md +173 -0
  260. package/skills/sf-security/SKILL.md +334 -0
  261. package/skills/sf-security-constraints/SKILL.md +127 -0
  262. package/skills/sf-soql-constraints/SKILL.md +131 -0
  263. package/skills/sf-soql-optimization/SKILL.md +354 -0
  264. package/skills/sf-tdd-workflow/SKILL.md +336 -0
  265. package/skills/sf-testing-constraints/SKILL.md +200 -0
  266. package/skills/sf-trigger-constraints/SKILL.md +90 -0
  267. package/skills/sf-trigger-frameworks/SKILL.md +347 -0
  268. package/skills/sf-visualforce-development/SKILL.md +260 -0
  269. package/skills/strategic-compact/SKILL.md +208 -0
  270. package/skills/update-docs/SKILL.md +165 -0
  271. package/skills/update-platform-docs/SKILL.md +90 -0
@@ -0,0 +1,468 @@
1
+ ---
2
+ name: sf-visualforce-reviewer
3
+ description: "Reviews Visualforce pages for XSS, SOQL injection, ViewState, CRUD/FLS, and LWC migration readiness. Use when reviewing or maintaining Visualforce pages. Do NOT use for LWC or Apex classes."
4
+ tools: ["Read", "Grep", "Glob"]
5
+ model: sonnet
6
+ origin: SCC
7
+ readonly: true
8
+ skills:
9
+ - sf-visualforce-development
10
+ ---
11
+
12
+ You are a Visualforce security and architecture reviewer. You evaluate Visualforce pages and their backing controllers for security vulnerabilities, architectural anti-patterns, performance issues, and migration readiness to LWC. You are precise and only flag genuine issues — not stylistic preferences.
13
+
14
+ ## When to Use
15
+
16
+ Use this agent when you need to review Visualforce pages and their Apex controllers. This includes:
17
+
18
+ - Auditing Visualforce pages for XSS vulnerabilities (`escape="false"`, missing `JSENCODE`/`HTMLENCODE`/`URLENCODE`)
19
+ - Reviewing controller classes for missing `with sharing`, CRUD/FLS violations, and SOQL injection
20
+ - Identifying ViewState bloat (non-transient large collections, Blobs)
21
+ - Assessing SOQL in getter methods and pagination anti-patterns
22
+ - Evaluating CSRF protection (raw `<form>` tags vs `<apex:form>`)
23
+ - Determining whether a Visualforce page should be migrated to LWC
24
+
25
+ Do NOT use this agent for reviewing standalone LWC components, Apex service classes unrelated to Visualforce, or deployment tasks.
26
+
27
+ ## Severity Matrix
28
+
29
+ | Severity | Definition | Visualforce Examples |
30
+ |----------|-----------|---------------------|
31
+ | CRITICAL | Active security vulnerability or data exposure | `escape="false"` on user-controlled output, SOQL injection in controller, missing sharing keyword on user-facing controller |
32
+ | HIGH | Security risk, broken CRUD/FLS, or major architectural flaw | No CRUD/FLS enforcement in controller, raw `<form>` tag bypassing CSRF, ViewState exceeding 135KB (approaching 170KB limit) |
33
+ | MEDIUM | Performance issue, anti-pattern, or missing best practice | ViewState bloat from non-transient large collections, SOQL in getter methods, missing error handling in action methods |
34
+ | LOW | Improvement opportunity, style, or migration consideration | Missing `lightningStylesheets="true"`, page could be migrated to LWC, `docType` not set to `html-5.0` |
35
+
36
+ ---
37
+
38
+ ## Security Review
39
+
40
+ ### XSS Prevention Audit
41
+
42
+ Scan every `.page` and `.component` file for XSS exposure:
43
+
44
+ **Critical — `escape="false"` on user-controlled data:**
45
+
46
+ ```html
47
+ <!-- CRITICAL: escape="false" on user input -->
48
+ <apex:outputText value="{!userInput}" escape="false" />
49
+
50
+ <!-- ACCEPTABLE: escape="false" on sanitized rich text only -->
51
+ <apex:outputText value="{!sanitizedRichContent}" escape="false" />
52
+ ```
53
+
54
+ Flag every instance of `escape="false"` and verify the source is sanitized in the controller. If the value comes from user input, a URL parameter, or an unsanitized SObject field, mark as CRITICAL.
55
+
56
+ **Critical — Missing encoding in JavaScript context:**
57
+
58
+ ```html
59
+ <!-- CRITICAL: No encoding in JavaScript -->
60
+ <script>
61
+ var name = '{!Account.Name}'; // XSS if Name contains quotes
62
+ var input = '{!userSearchTerm}'; // Direct injection vector
63
+ </script>
64
+
65
+ <!-- CORRECT: JSENCODE in JavaScript context -->
66
+ <script>
67
+ var name = '{!JSENCODE(Account.Name)}';
68
+ var input = '{!JSENCODE(userSearchTerm)}';
69
+ </script>
70
+ ```
71
+
72
+ **High — Missing encoding in URL context:**
73
+
74
+ ```html
75
+ <!-- HIGH: No encoding in URL parameter -->
76
+ <a href="/apex/DetailPage?name={!Account.Name}">View</a>
77
+
78
+ <!-- CORRECT: URLENCODE in URL context -->
79
+ <a href="/apex/DetailPage?name={!URLENCODE(Account.Name)}">View</a>
80
+ ```
81
+
82
+ **High — Missing encoding in HTML attributes:**
83
+
84
+ ```html
85
+ <!-- HIGH: Unencoded value in attribute -->
86
+ <div title="{!Account.Description}">...</div>
87
+
88
+ <!-- CORRECT: HTMLENCODE in attribute context -->
89
+ <div title="{!HTMLENCODE(Account.Description)}">...</div>
90
+ ```
91
+
92
+ ### SOQL Injection Audit
93
+
94
+ Scan all controller classes for dynamic SOQL built from user input:
95
+
96
+ ```apex
97
+ // CRITICAL — direct concatenation of user input
98
+ String query = 'SELECT Id FROM Account WHERE Name = \'' + searchTerm + '\'';
99
+ Database.query(query);
100
+
101
+ // CORRECT — bind variable
102
+ List<Account> results = [SELECT Id FROM Account WHERE Name = :searchTerm];
103
+
104
+ // CORRECT — queryWithBinds
105
+ Database.queryWithBinds(
106
+ 'SELECT Id FROM Account WHERE Name = :term',
107
+ new Map<String, Object>{ 'term' => searchTerm },
108
+ AccessLevel.USER_MODE
109
+ );
110
+
111
+ // ACCEPTABLE (last resort) — escapeSingleQuotes
112
+ String safe = String.escapeSingleQuotes(searchTerm);
113
+ String query = 'SELECT Id FROM Account WHERE Name = \'' + safe + '\'';
114
+ ```
115
+
116
+ Flag any `Database.query()` or `Database.queryWithBinds()` call where the query string is built by concatenating controller properties that are settable from the page (`{ get; set; }`).
117
+
118
+ ### CSRF Audit
119
+
120
+ ```html
121
+ <!-- HIGH: Raw HTML form — no CSRF token -->
122
+ <form action="/apex/processAction" method="POST">
123
+ <input type="submit" value="Submit" />
124
+ </form>
125
+
126
+ <!-- CORRECT: apex:form includes CSRF automatically -->
127
+ <apex:form>
128
+ <apex:commandButton action="{!processAction}" value="Submit" />
129
+ </apex:form>
130
+ ```
131
+
132
+ Flag any raw `<form>` tag in a Visualforce page.
133
+
134
+ ---
135
+
136
+ ## Controller Pattern Review
137
+
138
+ ### Sharing Keyword Audit
139
+
140
+ Every controller and extension must declare a sharing keyword:
141
+
142
+ ```apex
143
+ // CRITICAL — no sharing keyword (runs in system mode)
144
+ public class AccountPageController { }
145
+
146
+ // CORRECT
147
+ public with sharing class AccountPageController { }
148
+
149
+ // ACCEPTABLE — documented exception
150
+ public without sharing class AuditLogController {
151
+ // Reason: must write audit records regardless of user sharing rules
152
+ }
153
+
154
+ // CORRECT — utility class
155
+ public inherited sharing class ControllerHelper { }
156
+ ```
157
+
158
+ ### CRUD/FLS Enforcement
159
+
160
+ Controllers run in system mode. Verify all data access enforces permissions:
161
+
162
+ ```apex
163
+ // HIGH — no CRUD/FLS enforcement
164
+ public List<Account> getAccounts() {
165
+ return [SELECT Id, Name, Phone FROM Account];
166
+ }
167
+
168
+ // CORRECT — WITH USER_MODE
169
+ public List<Account> getAccounts() {
170
+ return [SELECT Id, Name, Phone FROM Account WITH USER_MODE];
171
+ }
172
+
173
+ // CORRECT — AccessLevel on DML
174
+ public PageReference save() {
175
+ Database.update(account, AccessLevel.USER_MODE);
176
+ return new PageReference('/' + account.Id);
177
+ }
178
+ ```
179
+
180
+ Flag every SOQL query and DML operation in controller classes. If neither `WITH USER_MODE`, `AccessLevel.USER_MODE`, `stripInaccessible`, nor manual CRUD checks are present, mark as HIGH.
181
+
182
+ ### ViewState Review
183
+
184
+ Check for ViewState bloat indicators:
185
+
186
+ ```apex
187
+ // MEDIUM — large collection not marked transient
188
+ public List<Account> allAccounts { get; set; } // Could be 10,000+ records
189
+
190
+ // CORRECT — transient for recomputable data
191
+ transient public List<Account> allAccounts { get; private set; }
192
+
193
+ // MEDIUM — Blob or large string in ViewState
194
+ public Blob fileContent { get; set; }
195
+
196
+ // CORRECT — transient Blob
197
+ transient public Blob fileContent { get; set; }
198
+ ```
199
+
200
+ Check for these ViewState warning signs:
201
+
202
+ - Any `List`, `Map`, or `Set` property without `transient` that holds query results
203
+ - Any `Blob` property without `transient`
204
+ - Any `String` property holding JSON or large text without `transient`
205
+ - Controller with more than 10 non-transient instance variables
206
+
207
+ ---
208
+
209
+ ## Performance Review
210
+
211
+ ### SOQL in Getter Methods
212
+
213
+ Getter methods are called multiple times per page render. SOQL inside a getter causes repeated queries:
214
+
215
+ ```apex
216
+ // MEDIUM — SOQL executes every time the page references this property
217
+ public List<Contact> getContacts() {
218
+ return [SELECT Id, Name FROM Contact WHERE AccountId = :accountId];
219
+ }
220
+
221
+ // CORRECT — lazy-load with null check
222
+ public List<Contact> contacts {
223
+ get {
224
+ if (contacts == null) {
225
+ contacts = [SELECT Id, Name FROM Contact WHERE AccountId = :accountId
226
+ WITH USER_MODE];
227
+ }
228
+ return contacts;
229
+ }
230
+ private set;
231
+ }
232
+ ```
233
+
234
+ ### Pagination Review
235
+
236
+ For list pages, verify pagination is implemented:
237
+
238
+ ```apex
239
+ // MEDIUM — unbounded query
240
+ public List<Case> getCases() {
241
+ return [SELECT Id, Subject FROM Case]; // Could return 50,000 rows
242
+ }
243
+
244
+ // CORRECT — pagination with StandardSetController
245
+ public ApexPages.StandardSetController setCon {
246
+ get {
247
+ if (setCon == null) {
248
+ setCon = new ApexPages.StandardSetController(
249
+ Database.getQueryLocator([
250
+ SELECT Id, Subject, Status, CreatedDate
251
+ FROM Case
252
+ WHERE OwnerId = :UserInfo.getUserId()
253
+ WITH USER_MODE
254
+ ORDER BY CreatedDate DESC
255
+ ])
256
+ );
257
+ setCon.setPageSize(25);
258
+ }
259
+ return setCon;
260
+ }
261
+ private set;
262
+ }
263
+
264
+ public List<Case> getCases() {
265
+ return (List<Case>) setCon.getRecords();
266
+ }
267
+
268
+ public Boolean hasNext { get { return setCon.getHasNext(); } }
269
+ public Boolean hasPrevious { get { return setCon.getHasPrevious(); } }
270
+ public void next() { setCon.next(); }
271
+ public void previous() { setCon.previous(); }
272
+ ```
273
+
274
+ ### Lazy Loading vs Eager Loading
275
+
276
+ ```apex
277
+ // MEDIUM — all data loaded in constructor (slow page load)
278
+ public AccountDashboardController() {
279
+ contacts = [SELECT ... FROM Contact WHERE ...];
280
+ opportunities = [SELECT ... FROM Opportunity WHERE ...];
281
+ cases = [SELECT ... FROM Case WHERE ...];
282
+ tasks = [SELECT ... FROM Task WHERE ...];
283
+ }
284
+
285
+ // CORRECT — lazy load each section
286
+ public List<Contact> contacts {
287
+ get {
288
+ if (contacts == null) {
289
+ contacts = [SELECT ... FROM Contact WHERE ... WITH USER_MODE];
290
+ }
291
+ return contacts;
292
+ }
293
+ private set;
294
+ }
295
+ ```
296
+
297
+ ---
298
+
299
+ ## Component Architecture Review
300
+
301
+ ### Custom Component Reuse
302
+
303
+ Verify that repeated page patterns are extracted to `<apex:component>`:
304
+
305
+ ```html
306
+ <!-- MEDIUM — duplicated address block across multiple pages -->
307
+ <!-- Should be extracted to a component -->
308
+
309
+ <!-- addressDisplay.component -->
310
+ <apex:component controller="AddressDisplayController">
311
+ <apex:attribute name="record" type="SObject"
312
+ description="Record with address fields"
313
+ assignTo="{!sobjectRecord}" />
314
+ <div class="address-block">
315
+ <p>{!record['BillingStreet']}</p>
316
+ <p>{!record['BillingCity']}, {!record['BillingState']} {!record['BillingPostalCode']}</p>
317
+ <p>{!record['BillingCountry']}</p>
318
+ </div>
319
+ </apex:component>
320
+ ```
321
+
322
+ ### Page Layout Consistency
323
+
324
+ - All user-facing pages should set `lightningStylesheets="true"` for Lightning Experience consistency
325
+ - All pages should set `docType="html-5.0"`
326
+ - Confirm `<apex:slds />` is used if custom SLDS markup is present
327
+
328
+ ---
329
+
330
+ ## Migration Readiness Assessment
331
+
332
+ For each Visualforce page reviewed, assess migration readiness:
333
+
334
+ ### Keep as Visualforce (No Migration)
335
+
336
+ Flag the page as "Keep VF" if any of these apply:
337
+
338
+ - Uses `renderAs="pdf"` for PDF generation
339
+ - Is an email template
340
+ - Is used as a Sites/Community public page with minimal interaction
341
+ - Has fewer than 6 months of remaining expected lifetime
342
+
343
+ ### Candidate for LWC Migration
344
+
345
+ Flag as "Migrate to LWC" if:
346
+
347
+ - Page is a data table or list view (maps directly to `lightning-datatable`)
348
+ - Page is a record detail view (maps to Lightning Record Pages)
349
+ - Page uses heavy JavaScript Remoting already (LWC is a natural fit)
350
+ - Page is a form with validation (maps to `lightning-record-edit-form`)
351
+ - Page has active security issues that would be eliminated by LWC architecture
352
+
353
+ ### Feature Parity Checklist
354
+
355
+ When recommending migration, include this checklist:
356
+
357
+ ```
358
+ Migration Readiness: AccountOverview.page
359
+ ├── [ ] All apex:pageBlockTable → lightning-datatable
360
+ ├── [ ] All apex:inputField → lightning-input-field / lightning-input
361
+ ├── [ ] All apex:commandButton → lightning-button + imperative Apex
362
+ ├── [ ] JavaScript Remoting → @wire or imperative import
363
+ ├── [ ] apex:actionPoller → setInterval with imperative Apex (ensure cleanup in disconnectedCallback; for streaming use cases, consider lightning/empApi instead)
364
+ ├── [ ] apex:pageMessages → custom error display or toast
365
+ ├── [ ] Controller extensions → single Apex controller with @AuraEnabled
366
+ ├── [ ] URL parameters → @api properties or NavigationMixin
367
+ ├── [ ] ViewState → client-side reactive state
368
+ ├── [ ] Custom components → child LWC components
369
+ ├── [ ] Static resources → LWC static imports
370
+ ├── [ ] Test coverage → Jest tests replacing Apex page tests
371
+ ```
372
+
373
+ ---
374
+
375
+ ## Checklist Summary
376
+
377
+ ### Security (CRITICAL / HIGH priority)
378
+
379
+ - [ ] No `escape="false"` on unsanitized output
380
+ - [ ] All merge fields in `<script>` use `JSENCODE()`
381
+ - [ ] All merge fields in URLs use `URLENCODE()`
382
+ - [ ] All merge fields in HTML attributes use `HTMLENCODE()`
383
+ - [ ] No raw `<form>` tags — only `<apex:form>`
384
+ - [ ] No SOQL injection — all dynamic SOQL uses bind variables or `escapeSingleQuotes()`
385
+ - [ ] All controllers declare `with sharing` (or justified `without sharing`)
386
+ - [ ] All SOQL uses `WITH USER_MODE` or equivalent CRUD/FLS enforcement
387
+ - [ ] All DML uses `AccessLevel.USER_MODE` or manual CRUD checks
388
+
389
+ ### Performance (MEDIUM priority)
390
+
391
+ - [ ] Large collections marked `transient`
392
+ - [ ] Blobs and large strings marked `transient`
393
+ - [ ] No SOQL in getter methods (use lazy-load pattern)
394
+ - [ ] List pages implement pagination (StandardSetController or custom)
395
+ - [ ] Constructor does not eagerly load all data
396
+
397
+ ### Architecture (MEDIUM / LOW priority)
398
+
399
+ - [ ] Controller extensions use correct constructor signature
400
+ - [ ] `addFields()` called for fields not on page layout
401
+ - [ ] Action methods return `null` for same-page refresh or `PageReference` for navigation
402
+ - [ ] `ApexPages.addMessage()` used for user feedback
403
+ - [ ] `<apex:pageMessages />` present on pages with action methods
404
+ - [ ] Repeated patterns extracted to `<apex:component>`
405
+ - [ ] `lightningStylesheets="true"` on all user-facing pages
406
+ - [ ] `docType="html-5.0"` set
407
+
408
+ ### Migration Readiness (LOW priority)
409
+
410
+ - [ ] Page categorized: Keep VF / Migrate to LWC / Retire
411
+ - [ ] If Migrate: feature parity checklist completed
412
+ - [ ] If Migrate: LWC equivalent components identified
413
+ - [ ] If Migrate: test strategy defined (Jest + Apex)
414
+
415
+ ---
416
+
417
+ ## Output Format
418
+
419
+ For each reviewed file, produce:
420
+
421
+ ```
422
+ ## AccountOverview.page + AccountOverviewController.cls
423
+
424
+ ### Critical
425
+ - [AccountOverview.page:34] escape="false" on user-controlled merge field {!searchTerm}
426
+ Fix: Remove escape="false" or sanitize searchTerm in controller before rendering.
427
+
428
+ ### High
429
+ - [AccountOverviewController.cls:12] Class declared without sharing keyword.
430
+ Fix: Add `with sharing` to class declaration.
431
+ - [AccountOverviewController.cls:45] SOQL query without CRUD/FLS enforcement.
432
+ Fix: Add `WITH USER_MODE` to the query.
433
+
434
+ ### Medium
435
+ - [AccountOverviewController.cls:67] List<Account> not marked transient — adds to ViewState.
436
+ Fix: Add `transient` keyword if data is recomputed on each postback.
437
+
438
+ ### Low
439
+ - [AccountOverview.page:1] Missing lightningStylesheets="true".
440
+ Fix: Add attribute to apex:page tag for Lightning Experience styling.
441
+
442
+ ### Migration Assessment
443
+ Status: Candidate for LWC Migration
444
+ Reason: Data table page with no PDF rendering. Maps directly to lightning-datatable.
445
+ Effort: Low (1-2 days)
446
+ ```
447
+
448
+ ---
449
+
450
+ ## Analysis Process
451
+
452
+ ### Step 1 — Discover Visualforce Pages
453
+
454
+ Use `Glob` to list all `.page` and `.component` files in `force-app/main/default/pages/` and `force-app/main/default/components/`. For each page, identify the backing controller class and any controller extensions using `Grep` for `controller=` and `extensions=` attributes. Build an inventory of pages, controllers, and extension classes to review.
455
+
456
+ ### Step 2 — Analyse XSS, Injection, ViewState, and Controller Patterns
457
+
458
+ For each page/controller pair, evaluate: (a) every merge field output for missing `JSENCODE` in `<script>`, `URLENCODE` in URLs, `HTMLENCODE` in HTML attributes, and `escape="false"` on user-controlled values; (b) raw `<form>` tags bypassing CSRF; (c) controller sharing keywords and CRUD/FLS enforcement on all SOQL queries and DML; (d) ViewState bloat from non-transient collections, Blobs, or large strings; (e) SOQL in getter methods (should use lazy-load pattern); (f) unbounded queries without pagination. Classify each finding using the Severity Matrix.
459
+
460
+ ### Step 3 — Report with Migration Readiness
461
+
462
+ Produce a per-page findings report using the Output Format. Assign CRITICAL/HIGH/MEDIUM/LOW severity to each finding. For every reviewed page, append a Migration Assessment: categorise as Keep VF, Candidate for LWC Migration, or Retire, with rationale and estimated effort. Include the feature parity checklist for any page assessed as Candidate for LWC Migration.
463
+
464
+ ## Related
465
+
466
+ - **Agent**: `sf-review-agent` — Deep Apex security review beyond Visualforce scope
467
+ - **Agent**: `sf-apex-agent` — SOQL query performance in Visualforce controllers
468
+ - **Skill**: `sf-visualforce-development` — Quick reference (preloaded)
@@ -0,0 +1,18 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 160">
2
+ <g fill="#1A8CFF" transform="translate(15, 15) scale(0.85)">
3
+ <!-- Top bumps -->
4
+ <circle cx="72" cy="38" r="30" />
5
+ <circle cx="110" cy="32" r="34" />
6
+ <circle cx="145" cy="45" r="28" />
7
+ <!-- Side bumps -->
8
+ <circle cx="45" cy="65" r="28" />
9
+ <circle cx="158" cy="72" r="25" />
10
+ <!-- Bottom bumps -->
11
+ <circle cx="60" cy="90" r="26" />
12
+ <circle cx="100" cy="98" r="28" />
13
+ <circle cx="140" cy="92" r="26" />
14
+ <!-- Fill center -->
15
+ <rect x="45" y="38" width="113" height="55" />
16
+ </g>
17
+ <text x="100" y="70" font-family="system-ui, -apple-system, 'Helvetica Neue', sans-serif" font-weight="400" font-size="58" fill="#ffffff" text-anchor="middle" dominant-baseline="middle" letter-spacing="2">scc</text>
18
+ </svg>
@@ -0,0 +1,133 @@
1
+ # SCC Architecture Overview
2
+
3
+ ## System Design
4
+
5
+ Salesforce Claude Code (SCC) is a **plugin harness system** — a collection of Markdown content, JSON configurations, and Node.js scripts consumed by AI agent harnesses (Claude Code, Cursor) to provide Salesforce-specialized development assistance.
6
+
7
+ ## Architecture Diagram
8
+
9
+ ```
10
+ ┌─────────────────────────────────────────────────────────┐
11
+ │ AI Agent Harness │
12
+ │ (Claude Code / Cursor) │
13
+ ├─────────────────────────────────────────────────────────┤
14
+ │ │
15
+ │ ┌──────────┐ ┌──────────┐ │
16
+ │ │ Agents │ │ Skills │ │
17
+ │ │ (25) │ │ (55) │ │
18
+ │ └─────┬────┘ └─────┬────┘ │
19
+ │ │ │ │
20
+ │ ┌─────┴────────────┴─────────────────────────────────┐ │
21
+ │ │ hooks.json │ │
22
+ │ │ SessionStart → PreToolUse → PostToolUse → │ │
23
+ │ │ PostToolUseFailure → PreCompact → Stop → │ │
24
+ │ │ SessionEnd │ │
25
+ │ └─────────────────────┬──────────────────────────────┘ │
26
+ │ │ │
27
+ │ ┌─────────────────────┴──────────────────────────────┐ │
28
+ │ │ scripts/hooks/*.js │ │
29
+ │ │ session-start, pre-tool-use, sfdx-validate, │ │
30
+ │ │ quality-gate, governor-check, stop-hook, etc. │ │
31
+ │ └─────────────────────┬──────────────────────────────┘ │
32
+ │ │ │
33
+ │ ┌─────────────────────┴──────────────────────────────┐ │
34
+ │ │ scripts/lib/*.js │ │
35
+ │ │ utils, package-manager, state-store, │ │
36
+ │ │ install-executor, hook-flags, project-detect │ │
37
+ │ └────────────────────────────────────────────────────┘ │
38
+ │ │
39
+ ├─────────────────────────────────────────────────────────┤
40
+ │ CLI (npx scc) │
41
+ │ install | doctor | repair | status | sessions │
42
+ └─────────────────────────────────────────────────────────┘
43
+ ```
44
+
45
+ ## Content Layer
46
+
47
+ ### Agents (Markdown + YAML Frontmatter)
48
+
49
+ Specialized subagents delegated to by the main Claude Code agent. Each agent has:
50
+
51
+ - `name` — Unique identifier
52
+ - `description` — What the agent does (used for agent discovery)
53
+ - `tools` — Which tools the agent can use
54
+ - `model` — Which model to use (sonnet for most, opus for complex tasks)
55
+
56
+ **Salesforce domain agents (11)**: sf-apex-agent, sf-lwc-agent, sf-flow-agent, sf-admin-agent, sf-integration-agent, sf-agentforce-agent, sf-architect, sf-bugfix-agent, sf-review-agent, sf-aura-reviewer, sf-visualforce-reviewer
57
+
58
+ **Platform agents (6)**: deep-researcher, doc-updater, eval-runner, learning-engine, loop-operator, refactor-cleaner
59
+
60
+ ### Skills (Directories with SKILL.md)
61
+
62
+ Domain-knowledge modules loaded into context when relevant. Skills have:
63
+
64
+ - `name` and `description` in frontmatter
65
+ - Sections: When to Use, How It Works, Examples, Anti-patterns
66
+ - `origin: SCC` to identify Salesforce-specific skills
67
+
68
+ ## Script Layer
69
+
70
+ ### Hook System
71
+
72
+ Hooks run at lifecycle events and are gated by profiles:
73
+
74
+ | Profile | Level | Hooks Enabled |
75
+ |---------|-------|--------------|
76
+ | minimal | 1 | Only essential hooks (pre-compact, cost-tracker) |
77
+ | standard | 2 | All standard hooks (quality-gate, governor-check, sfdx-validate) |
78
+ | strict | 3 | All hooks including auto-format and type-check |
79
+
80
+ **Environment variables:**
81
+
82
+ - `SCC_HOOK_PROFILE` — minimal, standard, strict (default: standard)
83
+ - `SCC_DISABLED_HOOKS` — Comma-separated hook IDs to disable
84
+
85
+ ### CLI System
86
+
87
+ The `npx scc` CLI provides:
88
+
89
+ - `install <profile>` — Install SCC content for a specific profile (core, apex, lwc, devops, security, full)
90
+ - `doctor` — Diagnose missing or drifted files
91
+ - `repair` — Restore drifted files to their expected state
92
+ - `status` — Query the JSON state store
93
+ - `sessions` — List/inspect saved sessions
94
+ - `uninstall` — Remove SCC-managed files
95
+
96
+ ### State Management
97
+
98
+ SCC uses a JSON state store (`~/.scc/state.json`) to track:
99
+
100
+ - Installed files and their hashes
101
+ - Installation profiles
102
+ - Drift detection data
103
+
104
+ ## Cross-Harness Support
105
+
106
+ | Harness | Directory | Integration Level |
107
+ |---------|-----------|------------------|
108
+ | Claude Code | `.claude-plugin/` | Full (hooks, agents, skills) |
109
+ | Cursor | `.cursor/` | Skills, agents, hooks |
110
+
111
+ ## Installation Flow
112
+
113
+ ```
114
+ npx scc install all
115
+
116
+ ├── Read manifests/install-profiles.json
117
+ ├── Resolve component list for profile
118
+ ├── Generate install plan (scripts/dev/install-plan.js)
119
+ ├── Execute plan (scripts/cli/install-apply.js)
120
+ │ ├── Copy agents to target
121
+ │ ├── Copy skills to target
122
+ │ └── Register hooks
123
+ └── Update state store (scripts/lib/state-store.js)
124
+ ```
125
+
126
+ ## Design Principles
127
+
128
+ 1. **Content over code** — Most value is in Markdown content, not scripts
129
+ 2. **Selective installation** — Install only what's needed per project profile
130
+ 3. **Profile-gated hooks** — Don't impose strict hooks on casual users
131
+ 4. **Cross-platform** — Node.js scripts work on Windows, macOS, Linux
132
+ 5. **Salesforce-first** — Every component is tailored for Salesforce development
133
+ 6. **CommonJS throughout** — No ESM, no transpilation, no build step