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,186 @@
1
+ ---
2
+ name: save-session
3
+ description: >-
4
+ Use when saving current Salesforce development session state. Persist org context, Apex progress,
5
+ and pending work to a dated file for future session resumption.
6
+ origin: SCC
7
+ user-invocable: true
8
+ disable-model-invocation: true
9
+ ---
10
+
11
+ # Save Session — Capture and Persist Session Context
12
+
13
+ Capture everything that happened in this session — what was built, what worked, what failed, what's left — and write it to a dated file so the next session can pick up exactly where this one left off.
14
+
15
+ ## When to Use
16
+
17
+ - End of a work session before closing Claude Code
18
+ - Before hitting context limits (run this first, then start a fresh session)
19
+ - After solving a complex Salesforce problem you want to remember
20
+ - Any time you need to hand off context to a future session
21
+
22
+ ## Process
23
+
24
+ ### Step 1: Gather context
25
+
26
+ Before writing the file, collect:
27
+
28
+ - Read all files modified during this session (use git diff or recall from conversation)
29
+ - Review what was discussed, attempted, and decided
30
+ - Note any errors encountered and how they were resolved (or not)
31
+ - Check current test/sf-deployment status if relevant
32
+ - Note org-specific details (scratch org alias, connected org, CLI version)
33
+
34
+ ### Step 2: Create the sessions folder if it doesn't exist
35
+
36
+ ```bash
37
+ mkdir -p ~/.claude/sessions
38
+ ```
39
+
40
+ ### Step 3: Write the session file
41
+
42
+ Create `~/.claude/sessions/YYYY-MM-DD-<short-id>-session.md`, using today's actual date and a short-id:
43
+
44
+ - Allowed characters: lowercase `a-z`, digits `0-9`, hyphens `-`
45
+ - Minimum length: 8 characters
46
+ - No uppercase letters, no underscores, no spaces
47
+
48
+ Full valid filename example: `2026-03-18-apex-trig-session.md`
49
+
50
+ The short-id should include the project name to enable cross-project isolation (e.g., `myapp-apex-trig` instead of just `apex-trig`). This prevents session file collisions when working across multiple Salesforce projects that share the same `~/.claude/sessions/` directory.
51
+
52
+ ### Step 4: Populate the file with all sections below
53
+
54
+ Keep session files under ~500 lines. Focus on decisions, blockers, and next steps — not full code dumps. If you need to reference large code blocks, point to file paths instead.
55
+
56
+ Write every section honestly. Do not skip sections — write "Nothing yet" or "N/A" if a section genuinely has no content.
57
+
58
+ ### Step 5: Show the file to the user
59
+
60
+ After writing, display the full contents and ask:
61
+
62
+ ```
63
+ Session saved to [actual resolved path to the session file]
64
+
65
+ Does this look accurate? Anything to correct or add before we close?
66
+ ```
67
+
68
+ Wait for confirmation. Make edits if requested.
69
+
70
+ ---
71
+
72
+ ## Session File Format
73
+
74
+ ```markdown
75
+ # Session: YYYY-MM-DD
76
+
77
+ **Started:** [approximate time if known]
78
+ **Last Updated:** [current time]
79
+ **Project:** [project name or path]
80
+ **Topic:** [one-line summary of what this session was about]
81
+
82
+ ---
83
+
84
+ ## What We Are Building
85
+
86
+ [1-3 paragraphs describing the feature, bug fix, or task. Include enough
87
+ context that someone with zero memory of this session can understand the goal.
88
+ Include: what it does, why it's needed, how it fits into the Salesforce org.]
89
+
90
+ ---
91
+
92
+ ## What WORKED (with evidence)
93
+
94
+ [List only things that are confirmed working. For each item include WHY you
95
+ know it works — test passed, deployment succeeded, scratch org validated, etc.
96
+ Without evidence, move it to "Not Tried Yet" instead.]
97
+
98
+ - **[thing that works]** — confirmed by: [specific evidence]
99
+
100
+ If nothing is confirmed working yet: "Nothing confirmed working yet."
101
+
102
+ ---
103
+
104
+ ## What Did NOT Work (and why)
105
+
106
+ [This is the most important section. List every approach tried that failed.
107
+ For each failure write the EXACT reason so the next session doesn't retry it.
108
+ Be specific: "threw X error because Y" is useful. "didn't work" is not.]
109
+
110
+ - **[approach tried]** — failed because: [exact reason / error message]
111
+
112
+ If nothing failed: "No failed approaches yet."
113
+
114
+ ---
115
+
116
+ ## What Has NOT Been Tried Yet
117
+
118
+ [Approaches that seem promising but haven't been attempted.]
119
+
120
+ - [approach / idea]
121
+
122
+ If nothing is queued: "No specific untried approaches identified."
123
+
124
+ ---
125
+
126
+ ## Current State of Files
127
+
128
+ [Every file touched this session. Be precise about what state each file is in.]
129
+
130
+ | File | Status | Notes |
131
+ | ----------------- | -------------- | -------------------------- |
132
+ | `path/to/file.cls` | Complete | [what it does] |
133
+ | `path/to/file.cls` | In Progress | [what's done, what's left] |
134
+ | `path/to/file.js` | Broken | [what's wrong] |
135
+
136
+ If no files were touched: "No files modified this session."
137
+
138
+ ---
139
+
140
+ ## Decisions Made
141
+
142
+ [Architecture choices, tradeoffs accepted, approaches chosen and why.]
143
+
144
+ - **[decision]** — reason: [why this was chosen over alternatives]
145
+
146
+ If no significant decisions: "No major decisions made this session."
147
+
148
+ ---
149
+
150
+ ## Blockers & Open Questions
151
+
152
+ [Anything unresolved that the next session needs to address.]
153
+
154
+ - [blocker / open question]
155
+
156
+ If none: "No active blockers."
157
+
158
+ ---
159
+
160
+ ## Exact Next Step
161
+
162
+ [The single most important thing to do when resuming.]
163
+
164
+ ---
165
+
166
+ ## Environment & Setup Notes
167
+
168
+ [Only fill if relevant — scratch org alias, connected org, SF CLI version, etc.]
169
+ ```
170
+
171
+ ---
172
+
173
+ ## Notes
174
+
175
+ - Each session gets its own file — never append to a previous session's file
176
+ - The "What Did NOT Work" section is the most critical — future sessions will blindly retry failed approaches without it
177
+ - The file is meant to be read by Claude at the start of the next session via the resume-session skill
178
+ - Use the canonical global session store: `~/.claude/sessions/`
179
+
180
+ ## Examples
181
+
182
+ ```
183
+ /save-session
184
+ /save-session Save progress on the AccountManagement feature refactor
185
+ /save-session Checkpoint before switching to the hotfix branch
186
+ ```
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: search-first
3
+ origin: SCC
4
+ user-invocable: true
5
+ description: >-
6
+ Use when researching existing Salesforce tools, Apex libraries, or metadata
7
+ patterns before writing custom code. Search-first workflow with agent.
8
+ Do NOT use for implementing code — only for discovery and evaluation.
9
+ ---
10
+
11
+ # /search-first — Research Before You Code
12
+
13
+ Systematizes the "search for existing solutions before implementing" workflow.
14
+
15
+ ## When to Use
16
+
17
+ - Before writing any custom utility, library, or integration code
18
+ - When evaluating whether to use npm, AppExchange, or MCP packages for a requirement
19
+ - When starting a new feature that likely has existing open-source or platform solutions
20
+ - When deciding between adopting, extending, composing, or building custom code
21
+ - When the user asks to "add X functionality" and you're about to write net-new code
22
+
23
+ ## Workflow
24
+
25
+ ```
26
+ +---------------------------------------------+
27
+ | 1. NEED ANALYSIS |
28
+ | Define what functionality is needed |
29
+ | Identify language/framework constraints |
30
+ +---------------------------------------------+
31
+ | 2. PARALLEL SEARCH (general-purpose agent) |
32
+ | +----------+ +----------+ +----------+ |
33
+ | | npm / | | MCP / | | GitHub / | |
34
+ | | AppExch | | Skills | | Web | |
35
+ | +----------+ +----------+ +----------+ |
36
+ +---------------------------------------------+
37
+ | 3. EVALUATE |
38
+ | Score candidates (functionality, maint, |
39
+ | community, docs, license, deps) |
40
+ +---------------------------------------------+
41
+ | 4. DECIDE |
42
+ | +---------+ +----------+ +---------+ |
43
+ | | Adopt | | Extend | | Build | |
44
+ | | as-is | | /Wrap | | Custom | |
45
+ | +---------+ +----------+ +---------+ |
46
+ +---------------------------------------------+
47
+ | 5. IMPLEMENT |
48
+ | Install package / Configure MCP / |
49
+ | Write minimal custom code |
50
+ +---------------------------------------------+
51
+ ```
52
+
53
+ ## Decision Matrix
54
+
55
+ | Signal | Action |
56
+ |--------|--------|
57
+ | Exact match, well-maintained, MIT/Apache | **Adopt** — install and use directly |
58
+ | Partial match, good foundation | **Extend** — install + write thin wrapper |
59
+ | Multiple weak matches | **Compose** — combine 2-3 small packages |
60
+ | Nothing suitable found | **Build** — write custom, but informed by research |
61
+
62
+ ## How to Use
63
+
64
+ ### Quick Mode (inline)
65
+
66
+ Before writing a utility or adding functionality, mentally run through:
67
+
68
+ 0. Does this already exist in the repo? -> `rg` through relevant modules/tests first
69
+ 1. Is this a common problem? -> Search npm/AppExchange
70
+ 2. Is there an MCP for this? -> Check `~/.claude/settings.json` and search
71
+ 3. Is there a skill for this? -> Check `~/.claude/skills/`
72
+ 4. Is there a GitHub implementation/template? -> Run GitHub code search
73
+
74
+ ### Full Mode (agent)
75
+
76
+ For non-trivial functionality, launch a general-purpose agent:
77
+
78
+ ```
79
+ Task(subagent_type="general-purpose", prompt="
80
+ Research existing tools for: [DESCRIPTION]
81
+ Language/framework: [LANG]
82
+ Constraints: [ANY]
83
+
84
+ Search: npm/AppExchange, MCP servers, Claude Code skills, GitHub
85
+ Return: Structured comparison with recommendation
86
+ ")
87
+ ```
88
+
89
+ ## Salesforce-Specific Tool Discovery
90
+
91
+ | Category | Tools to Check | Notes |
92
+ |----------|---------------|-------|
93
+ | **Testing** | ApexMocks, FFLib, at4dx, Apex Replay Debugger | FFLib is the industry standard |
94
+ | **CI/CD** | CumulusCI, sfdx-git-delta, sf scanner, GitHub Actions | sfdx-git-delta for delta deployments |
95
+ | **Data** | SFDX Data Loader, DLRS (Declarative Lookup Rollup Summary), DataWeave | DLRS replaces rollup trigger code |
96
+ | **Security** | Shield Platform Encryption, Event Monitoring, SF Code Analyzer | Scanner catches PMD violations |
97
+ | **Documentation** | ApexDox, SfApexDoc | Auto-generate Apex docs |
98
+ | **MCP** | @salesforce/mcp (official), community MCP servers | Check official first |
99
+ | **Package Mgmt** | CumulusCI, SFDX Package commands | For managed/unlocked packages |
100
+
101
+ ### MCP Server Evaluation
102
+
103
+ Before building custom tooling, check if an MCP server handles it:
104
+
105
+ 1. **@salesforce/mcp** (official) — orgs, metadata, data, testing, code-analysis, LWC, DevOps
106
+ 2. **Community MCP servers** — search npm for `mcp` + your domain
107
+ 3. **Build custom only if** — no existing server covers your specific business logic
108
+
109
+ ### Salesforce Decision Examples
110
+
111
+ **Scenario 1: "We need rollup summary fields on lookup relationships"**
112
+
113
+ ```
114
+ Search: AppExchange "rollup summary lookup"
115
+ Found: DLRS (Declarative Lookup Rollup Summaries) — 4.8★, 5000+ installs
116
+ Decision: ADOPT — install DLRS, configure declaratively
117
+ Result: Zero custom Apex code for rollup calculations
118
+ ```
119
+
120
+ **Scenario 2: "We need delta deployments in CI"**
121
+
122
+ ```
123
+ Search: npm "salesforce delta deployment"
124
+ Found: sfdx-git-delta — actively maintained, 1000+ stars
125
+ Decision: ADOPT — add as sf plugin, configure in GitHub Actions
126
+ Result: Deploy only changed metadata, 10x faster CI
127
+ ```
128
+
129
+ **Scenario 3: "We need custom approval routing based on territory"**
130
+
131
+ ```
132
+ Search: AppExchange "dynamic approval routing territory"
133
+ Found: Several packages but none match exact business rules
134
+ Decision: BUILD — custom Apex approval process with territory-based routing
135
+ Result: Custom code, but informed by research (knew no package fit)
136
+ ```
137
+
138
+ ## Anti-Patterns
139
+
140
+ - **Jumping to code**: Writing a utility without checking if one exists
141
+ - **Ignoring MCP**: Not checking if an MCP server already provides the capability
142
+ - **Over-customizing**: Wrapping a library so heavily it loses its benefits
143
+ - **Not checking AppExchange**: Many common patterns have managed packages with support
144
+ - **Reinventing DLRS**: Writing rollup trigger code when DLRS handles it declaratively
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: security-scan
3
+ origin: SCC
4
+ user-invocable: false
5
+ description: >-
6
+ Use when scanning Salesforce org Claude Code configuration for security
7
+ vulnerabilities, deploy misconfigurations, and injection risks in CLAUDE.md,
8
+ hooks, and MCP servers. Do NOT use for Apex code review — use sf-security.
9
+ ---
10
+
11
+ > **External tool:** AgentShield is published as `ecc-agentshield` on npm by affaan-m.
12
+ > It is a third-party security scanner, not part of SCC itself.
13
+ > **Maintenance risk:** This package has no SLA or maintenance guarantee. If it becomes unavailable, use the manual scanning section below as a fallback.
14
+
15
+ # Security Scan Skill
16
+
17
+ Audit your Claude Code configuration for security issues using [AgentShield](https://github.com/affaan-m/agentshield).
18
+
19
+ ## When to Use
20
+
21
+ - Before submitting an AppExchange managed package for security review
22
+ - When running a pre-deployment security gate in CI/CD pipelines
23
+ - When auditing a new codebase for SOQL injection, XSS, or FLS violations
24
+ - When a PMD or Checkmarx scan surfaces violations that need triaging
25
+ - When validating that new Apex contributors follow secure coding patterns
26
+
27
+ ## What It Scans
28
+
29
+ | File | Checks |
30
+ |------|--------|
31
+ | `CLAUDE.md` | Hardcoded secrets, auto-run instructions, prompt injection patterns |
32
+ | `settings.json` | Overly permissive allow lists, missing deny lists, dangerous bypass flags |
33
+ | `mcp.json` | Risky MCP servers, hardcoded env secrets, npx supply chain risks |
34
+ | `hooks/` | Command injection via interpolation, data exfiltration, silent error suppression |
35
+ | `agents/*.md` | Unrestricted tool access, prompt injection surface, missing model specs |
36
+
37
+ ## Salesforce-Specific Security Checks
38
+
39
+ Beyond configuration scanning, watch for these Salesforce vulnerability patterns:
40
+
41
+ ### SOQL Injection
42
+
43
+ ```apex
44
+ // VULNERABLE — user input concatenated into query
45
+ String query = 'SELECT Id FROM Account WHERE Name = \'' + userInput + '\'';
46
+
47
+ // SAFE — bind variables
48
+ List<Account> results = [SELECT Id FROM Account WHERE Name = :userInput];
49
+
50
+ // SAFE — Database.queryWithBinds for dynamic SOQL
51
+ Map<String, Object> binds = new Map<String, Object>{ 'userInput' => userInput };
52
+ List<Account> results = Database.queryWithBinds(
53
+ 'SELECT Id FROM Account WHERE Name = :userInput',
54
+ binds, AccessLevel.USER_MODE
55
+ );
56
+ ```
57
+
58
+ ### FLS/CRUD Bypass
59
+
60
+ | Pattern | Risk | Fix |
61
+ |---------|------|-----|
62
+ | SOQL without `WITH USER_MODE` | Reads fields user can't see | Add `WITH USER_MODE` |
63
+ | `Database.insert(records)` without AccessLevel | Skips FLS on write | Use `AccessLevel.USER_MODE` |
64
+ | `WITH SECURITY_ENFORCED` | Throws on inaccessible fields, no sharing enforcement | Prefer `WITH USER_MODE` |
65
+
66
+ ### Sharing Model Violations
67
+
68
+ - `without sharing` on class with `@AuraEnabled` methods — privilege escalation
69
+ - `without sharing` on class with `@RemoteAction` — same risk via Visualforce
70
+ - Missing sharing declaration — inherits calling class context
71
+
72
+ ### XSS Patterns
73
+
74
+ - **Visualforce:** `{!userInput}` without `JSENCODE`, `HTMLENCODE`, or `URLENCODE`
75
+ - **LWC:** `lwc:dom="manual"` with `innerHTML` from user data
76
+ - **Aura:** `$A.util.isEmpty()` doesn't sanitize — validate before DOM insertion
77
+
78
+ ## Usage
79
+
80
+ ### AgentShield Scan
81
+
82
+ ```bash
83
+ # Install and scan
84
+ npm install -g ecc-agentshield
85
+ npx ecc-agentshield scan
86
+
87
+ # With severity filter and JSON output for CI
88
+ npx ecc-agentshield scan --min-severity medium --format json
89
+
90
+ # Auto-fix safe issues
91
+ npx ecc-agentshield scan --fix
92
+ ```
93
+
94
+ ### Severity Levels
95
+
96
+ | Grade | Score | Meaning |
97
+ |-------|-------|---------|
98
+ | A | 90-100 | Secure configuration |
99
+ | B | 75-89 | Minor issues |
100
+ | C | 60-74 | Needs attention |
101
+ | D | 40-59 | Significant risks |
102
+ | F | 0-39 | Critical vulnerabilities |
103
+
104
+ ## Manual Scanning (Without AgentShield)
105
+
106
+ ```bash
107
+ # SOQL Injection — string concatenation in queries
108
+ grep -rn "Database.query" force-app/ --include="*.cls" | grep -v "bind"
109
+
110
+ # Missing sharing declaration
111
+ grep -rEL "with sharing|without sharing|inherited sharing" force-app/main/default/classes/*.cls
112
+
113
+ # Hardcoded Salesforce IDs (15 or 18 char)
114
+ grep -rnE "'00[0-9a-zA-Z]{12,15}'" force-app/ --include="*.cls"
115
+
116
+ # Missing CRUD/FLS on DML
117
+ grep -rn "insert \|update \|delete \|upsert " force-app/ --include="*.cls" | grep -v "stripInaccessible\|USER_MODE\|SECURITY_ENFORCED\|isAccessible\|@IsTest"
118
+
119
+ # Hardcoded endpoints
120
+ grep -rn "https://\|http://" force-app/ --include="*.cls" | grep -v "Named\|test\|mock\|example.com"
121
+ ```
122
+
123
+ ## SF Code Analyzer Integration
124
+
125
+ ```bash
126
+ # Full PMD scan
127
+ sf code-analyzer run --target force-app --format table
128
+
129
+ # Security-focused scan
130
+ sf code-analyzer run --target force-app --category "Security" --format table
131
+ ```
132
+
133
+ ## Remediation Patterns
134
+
135
+ | Finding | Vulnerable Code | Fixed Code |
136
+ |---------|----------------|------------|
137
+ | **SOQL Injection** | `Database.query('...WHERE Name=\'' + name + '\'')` | `[SELECT Id FROM Account WHERE Name = :name]` |
138
+ | **Missing Sharing** | `public class MyService {` | `public with sharing class MyService {` |
139
+ | **FLS Bypass** | `insert records;` | `Database.insert(records, AccessLevel.USER_MODE);` |
140
+ | **Hardcoded ID** | `'012000000000ABC'` | `Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Customer').getRecordTypeId()` |
141
+ | **XSS (VF)** | `{!userInput}` | `{!HTMLENCODE(userInput)}` |
142
+
143
+ ## Related
144
+
145
+ - Constraint: sf-security-constraints (co-activates for enforcement rules)
146
+ - Action: sf-security (CRUD/FLS implementation procedures)
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: sessions
3
+ description: >-
4
+ Use when managing Salesforce Claude Code session history. List, load, alias, and inspect saved
5
+ Apex and org development sessions stored in ~/.claude/sessions/.
6
+ origin: SCC
7
+ user-invocable: true
8
+ ---
9
+
10
+ # Sessions — Session History Management
11
+
12
+ Manage Claude Code session history - list, load, alias, and inspect sessions stored in `~/.claude/sessions/`.
13
+
14
+ ## When to Use
15
+
16
+ - Listing all saved sessions to find a specific one
17
+ - Loading a previous session by ID, date, or alias
18
+ - Creating memorable aliases for frequently referenced sessions
19
+ - Inspecting session metadata and statistics
20
+ - Managing session aliases (create, remove, list)
21
+
22
+ ## Usage
23
+
24
+ `/sessions [list|load|alias|info|aliases|help] [options]`
25
+
26
+ `/sessions help` shows this usage guide.
27
+
28
+ ## Actions
29
+
30
+ ### List Sessions
31
+
32
+ Display all sessions with metadata, filtering, and pagination.
33
+
34
+ ```bash
35
+ /sessions # List all sessions (default)
36
+ /sessions list # Same as above
37
+ /sessions list --limit 10 # Show 10 sessions
38
+ /sessions list --date 2026-03-18 # Filter by date
39
+ /sessions list --search apex # Search by session ID
40
+ ```
41
+
42
+ ### Load Session
43
+
44
+ Load and display a session's content (by ID or alias).
45
+
46
+ ```bash
47
+ /sessions load <id|alias> # Load session
48
+ /sessions load 2026-03-18 # By date
49
+ /sessions load apex-trig # By short ID
50
+ /sessions load my-alias # By alias name
51
+ ```
52
+
53
+ ### Create Alias
54
+
55
+ Create a memorable alias for a session.
56
+
57
+ ```bash
58
+ /sessions alias <id> <name> # Create alias
59
+ /sessions alias 2026-03-18 trigger-work
60
+ ```
61
+
62
+ ### Remove Alias
63
+
64
+ Delete an existing alias.
65
+
66
+ ```bash
67
+ /sessions alias --remove <name> # Remove alias
68
+ /sessions unalias <name> # Same as above
69
+ ```
70
+
71
+ ### Session Info
72
+
73
+ Show detailed information about a session.
74
+
75
+ ```bash
76
+ /sessions info <id|alias> # Show session details
77
+ ```
78
+
79
+ ### List Aliases
80
+
81
+ Show all session aliases.
82
+
83
+ ```bash
84
+ /sessions aliases # List all aliases
85
+ ```
86
+
87
+ ## Arguments
88
+
89
+ - `list [options]` - List sessions
90
+ - `--limit <n>` - Max sessions to show (default: 50)
91
+ - `--date <YYYY-MM-DD>` - Filter by date
92
+ - `--search <pattern>` - Search in session ID
93
+ - `load <id|alias>` - Load session content
94
+ - `alias <id> <name>` - Create alias for session
95
+ - `alias --remove <name>` - Remove alias
96
+ - `unalias <name>` - Same as `--remove`
97
+ - `info <id|alias>` - Show session statistics
98
+ - `aliases` - List all aliases
99
+ - `help` - Show this help
100
+
101
+ ## Examples
102
+
103
+ ```bash
104
+ # List all sessions
105
+ /sessions list
106
+
107
+ # Create an alias for today's session
108
+ /sessions alias 2026-03-18 trigger-work
109
+
110
+ # Load session by alias
111
+ /sessions load trigger-work
112
+
113
+ # Show session info
114
+ /sessions info trigger-work
115
+
116
+ # Remove alias
117
+ /sessions alias --remove trigger-work
118
+
119
+ # List all aliases
120
+ /sessions aliases
121
+ ```
122
+
123
+ ## Notes
124
+
125
+ - Sessions are stored as markdown files in `~/.claude/sessions/`
126
+ - Session IDs can be shortened (first 4-8 characters usually unique enough)
127
+ - Use aliases for frequently referenced sessions