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,322 @@
1
+ ---
2
+ name: sf-devops-ci-cd
3
+ description: >-
4
+ Use when setting up Salesforce CI/CD pipelines. GitHub Actions, JWT auth, scratch org workflows, sandbox promotion, and deployment automation.
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Salesforce DevOps and CI/CD
9
+
10
+ Reference: @../_reference/DEPLOYMENT_CHECKLIST.md, @../_reference/DOCKER_CI_PATTERNS.md
11
+
12
+ ## When to Use
13
+
14
+ - Setting up GitHub Actions CI/CD pipelines for Salesforce projects
15
+ - Configuring JWT authentication for non-interactive CI/CD deployments
16
+ - Implementing scratch-org-per-branch development workflows
17
+ - Automating deployments across sandbox, staging, and production environments
18
+ - Troubleshooting SF CLI v2 deploy, retrieve, or test commands
19
+
20
+ ---
21
+
22
+ ## SF CLI v2 Key Commands Reference
23
+
24
+ ### Org Management
25
+
26
+ ```bash
27
+ sf org login web --alias myOrg # Browser-based login
28
+ sf org login jwt --client-id <id> --jwt-key-file server.key --username user@org.com --alias ci-org
29
+ sf org list # List all authenticated orgs
30
+ sf org open --target-org myOrg # Open org in browser
31
+ sf org create scratch --definition-file config/project-scratch-def.json --alias myScratch --duration-days 7
32
+ sf org delete scratch --target-org myScratch --no-prompt
33
+ sf org display --target-org myOrg # Show org details including access token
34
+ ```
35
+
36
+ ### Source Deploy and Retrieve
37
+
38
+ ```bash
39
+ sf project deploy start --source-dir force-app --target-org myOrg
40
+ sf project deploy start --manifest manifest/package.xml --target-org myOrg
41
+ sf project deploy validate --manifest manifest/package.xml --target-org myOrg
42
+ sf project deploy quick --job-id <id> --target-org myOrg
43
+ sf project retrieve start --source-dir force-app --target-org myOrg
44
+ sf project deploy start --source-dir force-app --test-level RunLocalTests --target-org myOrg
45
+ ```
46
+
47
+ ### Apex Execution and Testing
48
+
49
+ ```bash
50
+ sf apex run --file scripts/apex/setup.apex --target-org myOrg
51
+ sf apex run test --test-level RunLocalTests --result-format human --target-org myOrg
52
+ sf apex run test --class-names AccountServiceTest --result-format json --target-org myOrg
53
+ sf apex run test --test-level RunAllTestsInOrg --code-coverage --result-format json --output-dir results/
54
+ sf apex tail log --target-org myOrg # Stream live debug logs
55
+ ```
56
+
57
+ ---
58
+
59
+ ## JWT Authentication Setup
60
+
61
+ JWT auth enables non-interactive CI/CD authentication without browser prompts.
62
+
63
+ ### Step 1: Create Connected App in Salesforce
64
+
65
+ 1. Setup > App Manager > New Connected App
66
+ 2. Enable OAuth Settings
67
+ 3. Callback URL: `http://localhost:1717/OauthRedirect`
68
+ 4. Selected OAuth Scopes: `api`, `refresh_token`, `offline_access`
69
+ 5. Enable "Use digital signatures"
70
+ 6. Upload your certificate (.crt file)
71
+ 7. Manage > Edit Policies > IP Relaxation: Relax IP restrictions
72
+ 8. Note the Consumer Key (Client ID)
73
+
74
+ ### Step 2: Generate Certificate and Private Key
75
+
76
+ ```bash
77
+ openssl genrsa -out server.key 2048
78
+ openssl req -new -key server.key -out server.csr
79
+ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
80
+ base64 -i server.key | tr -d '\n' # Encode for GitHub Secrets storage
81
+ ```
82
+
83
+ ### Step 3: Configure GitHub Secrets
84
+
85
+ - `SALESFORCE_JWT_SECRET_KEY` -- base64-encoded server.key content
86
+ - `SALESFORCE_CONSUMER_KEY` -- Connected App Consumer Key
87
+ - `SALESFORCE_USERNAME` -- target org username
88
+
89
+ ---
90
+
91
+ ## Complete GitHub Actions CI/CD Workflow
92
+
93
+ ```yaml
94
+ # .github/workflows/ci.yml
95
+ name: Salesforce CI/CD
96
+
97
+ on:
98
+ push:
99
+ branches: [develop, staging, main]
100
+ pull_request:
101
+ branches: [develop, staging, main]
102
+
103
+ jobs:
104
+ validate-pr:
105
+ name: Validate Pull Request
106
+ runs-on: ubuntu-latest
107
+ if: github.event_name == 'pull_request'
108
+ steps:
109
+ - uses: actions/checkout@v4
110
+ with:
111
+ fetch-depth: 0
112
+
113
+ - name: Install SF CLI
114
+ run: npm install -g @salesforce/cli
115
+
116
+ - name: Authenticate to sandbox
117
+ env:
118
+ JWT_SECRET_KEY: ${{ secrets.SALESFORCE_JWT_SECRET_KEY }}
119
+ CONSUMER_KEY: ${{ secrets.SALESFORCE_CONSUMER_KEY }}
120
+ USERNAME: ${{ secrets.SALESFORCE_USERNAME_SANDBOX }}
121
+ run: |
122
+ echo "$JWT_SECRET_KEY" | base64 --decode > server.key
123
+ sf org login jwt \
124
+ --client-id "$CONSUMER_KEY" \
125
+ --jwt-key-file server.key \
126
+ --username "$USERNAME" \
127
+ --alias validation-org \
128
+ --set-default
129
+ rm server.key
130
+
131
+ - name: Validate deployment
132
+ run: |
133
+ sf project deploy validate \
134
+ --source-dir force-app \
135
+ --test-level RunLocalTests \
136
+ --target-org validation-org \
137
+ --wait 30
138
+
139
+ deploy-production:
140
+ name: Deploy to Production
141
+ runs-on: ubuntu-latest
142
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
143
+ environment: production
144
+ steps:
145
+ - uses: actions/checkout@v4
146
+
147
+ - name: Install SF CLI
148
+ run: npm install -g @salesforce/cli
149
+
150
+ - name: Authenticate to Production
151
+ env:
152
+ JWT_SECRET_KEY: ${{ secrets.SALESFORCE_PROD_JWT_SECRET_KEY }}
153
+ CONSUMER_KEY: ${{ secrets.SALESFORCE_PROD_CONSUMER_KEY }}
154
+ USERNAME: ${{ secrets.SALESFORCE_PROD_USERNAME }}
155
+ run: |
156
+ echo "$JWT_SECRET_KEY" | base64 --decode > server.key
157
+ sf org login jwt \
158
+ --client-id "$CONSUMER_KEY" \
159
+ --jwt-key-file server.key \
160
+ --username "$USERNAME" \
161
+ --instance-url https://login.salesforce.com \
162
+ --alias prod \
163
+ --set-default
164
+ rm server.key
165
+
166
+ - name: Validate deployment
167
+ id: validate
168
+ run: |
169
+ VALIDATION_RESULT=$(sf project deploy validate \
170
+ --source-dir force-app \
171
+ --test-level RunLocalTests \
172
+ --target-org prod \
173
+ --wait 60 \
174
+ --json)
175
+ echo "VALIDATION_JOB_ID=$(echo "$VALIDATION_RESULT" | jq -r '.result.id')" >> "$GITHUB_ENV"
176
+
177
+ - name: Quick deploy
178
+ run: |
179
+ sf project deploy quick \
180
+ --job-id "$VALIDATION_JOB_ID" \
181
+ --target-org prod \
182
+ --wait 10
183
+ ```
184
+
185
+ > Do not use `--use-most-recent` for quick deploy in multi-team orgs. Another team's deployment between validate and quick-deploy invalidates the job. Always pass `--job-id` explicitly.
186
+
187
+ ---
188
+
189
+ ## Branch Strategy
190
+
191
+ ```
192
+ feature/ABC-123-account-service
193
+ |
194
+ v
195
+ develop ---- CI: validate + deploy to dev sandbox
196
+ |
197
+ v
198
+ staging ---- CI: validate + deploy to staging sandbox (RunLocalTests)
199
+ |
200
+ v
201
+ main ---- CI: deploy to production (RunLocalTests)
202
+ ```
203
+
204
+ - `feature/*` -- individual work, scratch org per developer
205
+ - `develop` -- integration branch, auto-deploys to dev sandbox
206
+ - `staging` -- pre-production, mirrors production as closely as possible
207
+ - `main` -- production. Requires pull request review + CI green
208
+
209
+ ---
210
+
211
+ ## Scratch Org Per-Branch Workflow (CI)
212
+
213
+ ```yaml
214
+ test-in-scratch-org:
215
+ name: Test in Scratch Org
216
+ runs-on: ubuntu-latest
217
+ if: startsWith(github.ref, 'refs/heads/feature/')
218
+ steps:
219
+ - uses: actions/checkout@v4
220
+
221
+ - name: Install SF CLI and authenticate Dev Hub
222
+ env:
223
+ JWT_SECRET_KEY: ${{ secrets.DEVHUB_JWT_SECRET_KEY }}
224
+ CONSUMER_KEY: ${{ secrets.DEVHUB_CONSUMER_KEY }}
225
+ USERNAME: ${{ secrets.DEVHUB_USERNAME }}
226
+ run: |
227
+ npm install -g @salesforce/cli
228
+ echo "$JWT_SECRET_KEY" | base64 --decode > server.key
229
+ sf org login jwt \
230
+ --client-id "$CONSUMER_KEY" \
231
+ --jwt-key-file server.key \
232
+ --username "$USERNAME" \
233
+ --alias devhub \
234
+ --set-default-dev-hub
235
+ rm server.key
236
+
237
+ - name: Create scratch org
238
+ run: |
239
+ sf org create scratch \
240
+ --definition-file config/project-scratch-def.json \
241
+ --alias ci-scratch \
242
+ --set-default \
243
+ --duration-days 1 \
244
+ --no-ancestors
245
+
246
+ - name: Push source and run tests
247
+ run: |
248
+ sf project deploy start --source-dir force-app --target-org ci-scratch
249
+ sf apex run test \
250
+ --test-level RunLocalTests \
251
+ --result-format human \
252
+ --code-coverage \
253
+ --target-org ci-scratch
254
+
255
+ - name: Delete scratch org
256
+ if: always()
257
+ run: sf org delete scratch --target-org ci-scratch --no-prompt
258
+ ```
259
+
260
+ ---
261
+
262
+ ## Deployment Test Level Strategy
263
+
264
+ | Environment | Test Level | Rationale |
265
+ |-------------|------------------------|-------------------------------------|
266
+ | Feature CI | RunLocalTests | Fast feedback, catches regressions |
267
+ | Dev Sandbox | RunLocalTests | Full local test suite |
268
+ | Staging | RunLocalTests | Near-production confidence |
269
+ | Production | RunLocalTests | Required by Salesforce (75% min) |
270
+ | Full release | RunAllTestsInOrg | Complete org-wide regression |
271
+
272
+ ---
273
+
274
+ ## Change Detection: Deploy Only Changed Metadata
275
+
276
+ ```bash
277
+ #!/bin/bash
278
+ # scripts/get-changed-metadata.sh
279
+ BASE_BRANCH=${1:-main}
280
+ CHANGED_FILES=$(git diff --name-only origin/$BASE_BRANCH...HEAD)
281
+
282
+ SF_CHANGED=$(echo "$CHANGED_FILES" | grep "^force-app/")
283
+ if [ -z "$SF_CHANGED" ]; then
284
+ echo "No Salesforce metadata changes detected"
285
+ exit 0
286
+ fi
287
+
288
+ # Use sfdx-git-delta plugin
289
+ # Verify command syntax with: sf sgd --help
290
+ sf sgd:source:delta \
291
+ --to HEAD \
292
+ --from origin/$BASE_BRANCH \
293
+ --output-dir changed-sources \
294
+ --generate-delta
295
+
296
+ # Deploy only changed sources
297
+ TEST_CLASSES=$(cat changed-sources/test-classes.txt 2>/dev/null | tr '\n' ',' | sed 's/,$//')
298
+ if [ -n "$TEST_CLASSES" ]; then
299
+ sf project deploy start \
300
+ --source-dir changed-sources/force-app \
301
+ --test-level RunSpecifiedTests \
302
+ --tests "$TEST_CLASSES" \
303
+ --target-org $TARGET_ORG
304
+ else
305
+ sf project deploy start \
306
+ --source-dir changed-sources/force-app \
307
+ --test-level RunLocalTests \
308
+ --target-org $TARGET_ORG
309
+ fi
310
+ ```
311
+
312
+ Install sfdx-git-delta plugin:
313
+
314
+ ```bash
315
+ sf plugins install sfdx-git-delta
316
+ ```
317
+
318
+ ---
319
+
320
+ ## Related
321
+
322
+ - **Constraints**: `sf-deployment-constraints` -- deployment safety rules
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: sf-docs-lookup
3
+ description: >-
4
+ Use when looking up official Salesforce documentation. Apex reference, LWC docs, platform guides, API references, and SF CLI commands via WebSearch.
5
+ ---
6
+
7
+ # Salesforce Documentation Lookup
8
+
9
+ Query Salesforce developer documentation for current, accurate answers. Uses WebSearch to find official documentation, then extracts and summarizes the relevant content.
10
+
11
+ ## When to Use
12
+
13
+ - When you need to look up Apex class, method, or interface documentation
14
+ - When checking LWC component API, wire service, or lifecycle documentation
15
+ - When verifying SOQL/SOSL syntax, functions, or query limits
16
+ - When researching REST API, Metadata API, Tooling API, or Bulk API endpoints
17
+ - When looking up governor limits, security features, or platform event details
18
+ - When checking `sf` CLI command flags and usage
19
+ - When verifying whether a feature is deprecated or version-gated
20
+
21
+ ## Usage
22
+
23
+ ```text
24
+ sf-docs-lookup <query>
25
+ ```
26
+
27
+ ## Workflow
28
+
29
+ ### Step 1 — Identify Topic Category
30
+
31
+ Classify the query into the correct Salesforce documentation area:
32
+
33
+ | Category | Documentation Source | Search Strategy |
34
+ |----------|---------------------|-----------------|
35
+ | Apex Classes/Interfaces | Apex Developer Guide | `site:developer.salesforce.com apex <class>` |
36
+ | Apex System Methods | Apex Reference | `site:developer.salesforce.com "System.<method>"` |
37
+ | LWC Components | LWC Dev Guide | `site:developer.salesforce.com lwc <topic>` |
38
+ | SOQL/SOSL | SOQL and SOSL Reference | `site:developer.salesforce.com soql <topic>` |
39
+ | REST API | REST API Developer Guide | `site:developer.salesforce.com rest api <endpoint>` |
40
+ | Metadata API | Metadata API Developer Guide | `site:developer.salesforce.com metadata api <type>` |
41
+ | Tooling API | Tooling API Reference | `site:developer.salesforce.com tooling api <resource>` |
42
+ | Bulk API | Bulk API 2.0 Developer Guide | `site:developer.salesforce.com bulk api <topic>` |
43
+ | Platform Events | Platform Events Developer Guide | `site:developer.salesforce.com platform events <topic>` |
44
+ | Flows | Flow Builder Guide | `site:help.salesforce.com flow <topic>` |
45
+ | Agentforce | Einstein/Agentforce Docs | `site:developer.salesforce.com agentforce <topic>` |
46
+ | Governor Limits | Apex Developer Guide | `site:developer.salesforce.com "execution governors" limits` |
47
+ | Security | Security Implementation Guide | `site:developer.salesforce.com security <topic>` |
48
+ | CLI (sf) | Salesforce CLI Reference | `site:developer.salesforce.com sf <command>` |
49
+
50
+ ### Step 2 — Search Documentation
51
+
52
+ Use WebSearch with targeted site-scoped queries:
53
+
54
+ ```
55
+ site:developer.salesforce.com <category-specific terms>
56
+ ```
57
+
58
+ For admin/configuration topics, also check:
59
+
60
+ ```
61
+ site:help.salesforce.com <topic>
62
+ ```
63
+
64
+ ### Step 3 — Extract and Format Answer
65
+
66
+ When presenting documentation results:
67
+
68
+ 1. **Lead with the answer** -- do not make the user read through preamble
69
+ 2. **Include code examples** -- Apex, LWC, or SOQL snippets when relevant
70
+ 3. **Note API version** -- Salesforce features are version-gated; specify the minimum API version
71
+ 4. **Link to source** -- provide the URL so the user can read more
72
+ 5. **Flag deprecations** -- if the queried feature is deprecated, say so and recommend the replacement
73
+
74
+ ### Step 4 — Cross-Reference with SCC Knowledge
75
+
76
+ After finding the official docs, check if SCC has relevant skills:
77
+
78
+ - Skills in `skills/` or `skills2/` that cover the topic in depth
79
+ - Mention relevant SCC resources: "For best practices on this, see the `sf-soql-optimization` skill."
80
+
81
+ ## Complex Documentation Queries
82
+
83
+ For complex documentation queries spanning multiple topics, delegate to the `deep-researcher` agent which can perform multi-step research across documentation sources.
84
+
85
+ ## Examples
86
+
87
+ ```text
88
+ sf-docs-lookup Wire service in LWC
89
+ sf-docs-lookup Database.Batchable interface
90
+ sf-docs-lookup Platform Events best practices
91
+ sf-docs-lookup SOQL aggregate functions
92
+ sf-docs-lookup WITH USER_MODE vs WITH SECURITY_ENFORCED
93
+ sf-docs-lookup sf project deploy start flags
94
+ sf-docs-lookup Trigger.operationType enum values
95
+ ```
96
+
97
+ ## Related
98
+
99
+ - **Agent**: `sf-docs-lookup` -- for multi-step documentation research
100
+ - **Constraints**: (none -- this is a search tool, no domain constraints apply)