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,369 @@
1
+ ---
2
+ name: prompt-optimizer
3
+ description: >-
4
+ Use when improving a Salesforce, Apex, or LWC prompt. Analyze intent and gaps,
5
+ match SCC skills/agents, output a ready-to-paste optimized prompt. Advisory only.
6
+ origin: SCC
7
+ user-invocable: true
8
+ ---
9
+
10
+ # Prompt Optimizer
11
+
12
+ Analyze a draft prompt, critique it, match it to SCC ecosystem components,
13
+ and output a complete optimized prompt the user can paste and run.
14
+
15
+ ## When to Use
16
+
17
+ - User says "optimize this prompt", "improve my prompt", "rewrite this prompt"
18
+ - User says "help me write a better prompt for..."
19
+ - User says "what's the best way to ask Claude Code to..."
20
+ - User pastes a draft prompt and asks for feedback or enhancement
21
+ - User says "I don't know how to prompt for this"
22
+ - User says "how should I use SCC for..."
23
+ - User explicitly invokes `/prompt-optimizer`
24
+
25
+ ### Do Not Use When
26
+
27
+ - User wants the task done directly (just execute it)
28
+ - User says "optimize this code", "optimize performance" — these are refactoring tasks, not prompt optimization
29
+ - User is asking about SCC configuration (use `configure-scc` instead)
30
+ - User wants a skill inventory (use `/sf-harness-audit` skill instead)
31
+ - User says "just do it"
32
+
33
+ ## How It Works
34
+
35
+ **Advisory only — do not execute the user's task.**
36
+
37
+ Do NOT write code, create files, run commands, or take any implementation
38
+ action. Your ONLY output is an analysis plus an optimized prompt.
39
+
40
+ If the user says "just do it" or "don't optimize, just execute",
41
+ do not switch into implementation mode inside this skill. Tell the user this
42
+ skill only produces optimized prompts, and instruct them to make a normal
43
+ task request if they want execution instead.
44
+
45
+ Run this 6-phase pipeline sequentially. Present results using the Output Format below.
46
+
47
+ ### Analysis Pipeline
48
+
49
+ ### Phase 0: Project Detection
50
+
51
+ Before analyzing the prompt, detect the current project context:
52
+
53
+ 1. Check if a `CLAUDE.md` exists in the working directory — read it for project conventions
54
+ 2. Detect tech stack from project files:
55
+ - `sfdx-project.json` → Salesforce (Apex / LWC / SOQL / Flow / Agentforce)
56
+ - `package.json` → Node.js / LWC tooling / Jest tests
57
+ 3. Note detected tech stack for use in Phase 3 and Phase 4
58
+
59
+ If no project files are found (e.g., the prompt is abstract or for a new project),
60
+ skip detection and flag "tech stack unknown" in Phase 4.
61
+
62
+ ### Phase 1: Intent Detection
63
+
64
+ Classify the user's task into one or more categories:
65
+
66
+ | Category | Signal Words | Example |
67
+ |----------|-------------|---------|
68
+ | New Feature | build, create, add, implement | "Build a lead scoring trigger" |
69
+ | Bug Fix | fix, broken, not working, error | "Fix the trigger recursion" |
70
+ | Refactor | refactor, clean up, restructure | "Refactor to trigger framework" |
71
+ | Research | how to, what is, explore, investigate | "How to add Platform Events" |
72
+ | Testing | test, coverage, verify | "Add tests for AccountService" |
73
+ | Review | review, audit, check | "Review my Apex trigger" |
74
+ | Documentation | document, update docs | "Update the API docs" |
75
+ | Infrastructure | deploy, CI, scratch org, DevOps | "Set up CI/CD with scratch orgs" |
76
+ | Design | design, architecture, plan | "Design the data model" |
77
+
78
+ ### Phase 2: Scope Assessment
79
+
80
+ If Phase 0 detected a project, use codebase size as a signal. Otherwise, estimate
81
+ from the prompt description alone and mark the estimate as uncertain.
82
+
83
+ | Scope | Heuristic | Orchestration |
84
+ |-------|-----------|---------------|
85
+ | TRIVIAL | Single file, < 50 lines | Direct execution |
86
+ | LOW | Single component or module | Single command or skill |
87
+ | MEDIUM | Multiple components, same domain | Command chain + sf-review-agent agent |
88
+ | HIGH | Cross-domain, 5+ files | Use sf-architect agent first, then phased execution |
89
+ | EPIC | Multi-session, multi-PR, architectural shift | Use sf-architect agent for multi-session plan |
90
+
91
+ ### Phase 3: SCC Component Matching
92
+
93
+ Map intent + scope + tech stack (from Phase 0) to specific SCC components.
94
+
95
+ #### By Intent Type
96
+
97
+ | Intent | Invocable Skills | Skills | Agents |
98
+ |--------|----------|--------|--------|
99
+ | New Feature | /sf-tdd-workflow, /sf-apex-best-practices | sf-apex-best-practices, sf-apex-enterprise-patterns | sf-architect, sf-apex-agent, sf-review-agent |
100
+ | Bug Fix | /sf-tdd-workflow, /sf-build-fix | sf-apex-testing, sf-debugging | sf-bugfix-agent, sf-apex-agent |
101
+ | Refactor | /refactor-clean, /sf-apex-best-practices | sf-trigger-frameworks, sf-apex-enterprise-patterns | refactor-cleaner, sf-review-agent |
102
+ | Testing | /sf-tdd-workflow, /sf-apex-testing, /sf-e2e-testing | sf-apex-testing, sf-tdd-workflow | sf-apex-agent |
103
+ | Review | /sf-apex-best-practices, /sf-lwc-development, /sf-security | sf-security | sf-review-agent, sf-review-agent |
104
+ | Documentation | /update-docs | — | doc-updater, deep-researcher |
105
+ | Infrastructure | /sf-deployment | sf-devops-ci-cd, sf-deployment | sf-architect |
106
+ | Design (EPIC) | — | — | sf-architect, sf-architect |
107
+
108
+ #### By Tech Stack
109
+
110
+ | Tech Stack | Skills to Add | Agent |
111
+ |------------|--------------|-------|
112
+ | Apex | sf-apex-best-practices, sf-apex-testing, sf-security | sf-review-agent |
113
+ | LWC | sf-lwc-development, sf-lwc-testing | sf-lwc-agent |
114
+ | SOQL | sf-soql-optimization | sf-apex-agent |
115
+ | Flow | sf-flow-development | sf-flow-agent |
116
+ | Agentforce | sf-agentforce-development | sf-agentforce-agent |
117
+ | DevOps | sf-devops-ci-cd, sf-deployment | sf-architect |
118
+ | Security | sf-security | sf-review-agent |
119
+ | EPIC | — | sf-architect, sf-architect |
120
+
121
+ ### Phase 4: Missing Context Detection
122
+
123
+ Scan the prompt for missing critical information. Check each item and mark
124
+ whether Phase 0 auto-detected it or the user must supply it:
125
+
126
+ - [ ] **Tech stack** — Detected in Phase 0, or must user specify?
127
+ - [ ] **Target scope** — Files, directories, or modules mentioned?
128
+ - [ ] **Acceptance criteria** — How to know the task is done?
129
+ - [ ] **Error handling** — Edge cases and failure modes addressed?
130
+ - [ ] **Security requirements** — Auth, input validation, secrets?
131
+ - [ ] **Testing expectations** — Unit, integration, E2E?
132
+ - [ ] **Performance constraints** — Governor limits, bulk patterns, SOQL selectivity?
133
+ - [ ] **UI/UX requirements** — Design specs, SLDS compliance, accessibility? (if LWC)
134
+ - [ ] **Database changes** — Schema, migrations, indexes? (if data layer)
135
+ - [ ] **Existing patterns** — Reference files or conventions to follow?
136
+ - [ ] **Scope boundaries** — What NOT to do?
137
+
138
+ **If 3+ critical items are missing**, ask the user up to 3 clarification
139
+ questions before generating the optimized prompt. Then incorporate the
140
+ answers into the optimized prompt.
141
+
142
+ ### Phase 5: Workflow & Model Recommendation
143
+
144
+ Determine where this prompt sits in the development lifecycle:
145
+
146
+ ```
147
+ Research → Plan → Implement (TDD) → Review → Verify → Commit
148
+ ```
149
+
150
+ For MEDIUM+ tasks, always start with the sf-architect agent. For EPIC tasks, use the sf-architect agent.
151
+
152
+ **Model recommendation** (include in output):
153
+
154
+ | Scope | Recommended Model | Rationale |
155
+ |-------|------------------|-----------|
156
+ | TRIVIAL-LOW | Sonnet | Fast, cost-efficient for simple tasks |
157
+ | MEDIUM | Sonnet | Best coding model for standard work |
158
+ | HIGH | Sonnet (main) + Opus (planning) | Opus for architecture, Sonnet for implementation |
159
+ | EPIC | Opus (sf-architect) + Sonnet (execution) | Deep reasoning for multi-session planning |
160
+
161
+ **Multi-prompt splitting** (for HIGH/EPIC scope):
162
+
163
+ For tasks that exceed a single session, split into sequential prompts:
164
+
165
+ - Prompt 1: Research + Plan (use search-first skill, then sf-architect agent)
166
+ - Prompt 2-N: Implement one phase per prompt (each ends with sf-review-agent agent)
167
+ - Final Prompt: Integration test + /sf-apex-best-practices across all phases
168
+ - Use /save-session and /resume-session to preserve context between sessions
169
+
170
+ ---
171
+
172
+ ## Output Format
173
+
174
+ Present your analysis in this exact structure. Respond in the same language
175
+ as the user's input.
176
+
177
+ ### Section 1: Prompt Diagnosis
178
+
179
+ **Strengths:** List what the original prompt does well.
180
+
181
+ **Issues:**
182
+
183
+ | Issue | Impact | Suggested Fix |
184
+ |-------|--------|---------------|
185
+ | (problem) | (consequence) | (how to fix) |
186
+
187
+ **Needs Clarification:** Numbered list of questions the user should answer.
188
+ If Phase 0 auto-detected the answer, state it instead of asking.
189
+
190
+ ### Section 2: Recommended SCC Components
191
+
192
+ | Type | Component | Purpose |
193
+ |------|-----------|---------|
194
+ | Command | /sf-tdd-workflow | TDD workflow for Apex |
195
+ | Skill | sf-apex-best-practices | Apex coding standards |
196
+ | Agent | sf-review-agent | Post-implementation review |
197
+ | Model | Sonnet | Recommended for this scope |
198
+
199
+ ### Section 3: Optimized Prompt — Full Version
200
+
201
+ Present the complete optimized prompt inside a single fenced code block.
202
+ The prompt must be self-contained and ready to copy-paste. Include:
203
+
204
+ - Clear task description with context
205
+ - Tech stack (detected or specified)
206
+ - /command invocations at the right workflow stages
207
+ - Acceptance criteria
208
+ - Verification steps
209
+ - Scope boundaries (what NOT to do)
210
+
211
+ For items that reference blueprint, write: "Use the sf-architect agent to..."
212
+ (not `/blueprint`, since sf-architect is an agent, not a command).
213
+
214
+ ### Section 4: Optimized Prompt — Quick Version
215
+
216
+ A compact version for experienced SCC users. Vary by intent type:
217
+
218
+ | Intent | Quick Pattern |
219
+ |--------|--------------|
220
+ | New Feature | `Use sf-architect agent for [feature]. /sf-tdd-workflow to implement. /sf-apex-best-practices. Use sf-review-agent agent.` |
221
+ | Bug Fix | `/sf-tdd-workflow — write failing test for [bug]. Fix to green. Use sf-review-agent agent.` |
222
+ | Refactor | `/refactor-clean [scope]. /sf-apex-best-practices. Use sf-review-agent agent.` |
223
+ | Research | `Use search-first skill for [topic]. Use sf-architect agent based on findings.` |
224
+ | Testing | `/sf-tdd-workflow [class]. /sf-e2e-testing for critical flows. /sf-apex-testing.` |
225
+ | Review | `/sf-apex-best-practices. Then use sf-review-agent agent.` |
226
+ | Docs | `/update-docs. Use deep-researcher agent.` |
227
+ | EPIC | `Use sf-architect agent for "[objective]". Execute phases with sf-review-agent agent gates.` |
228
+
229
+ ### Section 5: Enhancement Rationale
230
+
231
+ | Enhancement | Reason |
232
+ |-------------|--------|
233
+ | (what was added) | (why it matters) |
234
+
235
+ ### Footer
236
+
237
+ > Not what you need? Tell me what to adjust, or make a normal task request
238
+ > if you want execution instead of prompt optimization.
239
+
240
+ ---
241
+
242
+ ## Examples
243
+
244
+ ### Trigger Examples
245
+
246
+ - "Optimize this prompt for SCC"
247
+ - "Rewrite this prompt so Claude Code uses the right commands"
248
+ - "How should I prompt SCC for this task?"
249
+
250
+ ### Example 1: Vague Salesforce Prompt (Project Detected)
251
+
252
+ **User input:**
253
+
254
+ ```
255
+ Help me write an Account trigger
256
+ ```
257
+
258
+ **Phase 0 detects:** `sfdx-project.json` → Salesforce project; `package.json` with Jest
259
+
260
+ **Optimized Prompt (Full):**
261
+
262
+ ```
263
+ Implement an Account trigger using the project's existing Trigger Framework pattern.
264
+
265
+ Technical requirements:
266
+ - Follow the project's existing trigger handler architecture (check for TriggerHandler base class or similar framework)
267
+ - Implement bulkification — all SOQL queries and DML operations must be outside loops
268
+ - Add appropriate error handling and custom exception classes
269
+ - Follow Salesforce governor limits best practices
270
+
271
+ Workflow:
272
+ 1. Use sf-architect agent to plan trigger handler structure and business logic
273
+ 2. /sf-tdd-workflow — write failing test class first (use @TestSetup and test data factory)
274
+ 3. Implement AccountTrigger and AccountTriggerHandler
275
+ 4. /sf-apex-best-practices to review implementation
276
+ 5. Use sf-review-agent agent to verify all tests pass and coverage reaches 75%+
277
+
278
+ Security requirements:
279
+ - Use WITH USER_MODE for SOQL queries
280
+ - Verify CRUD/FLS permissions
281
+
282
+ Acceptance criteria:
283
+ - Test coverage 85%+
284
+ - Zero governor limit violations
285
+ - Passes /sf-security review
286
+ ```
287
+
288
+ ### Example 2: Moderate English Prompt
289
+
290
+ **User input:**
291
+
292
+ ```
293
+ Add a REST API endpoint for account creation with validation
294
+ ```
295
+
296
+ **Phase 0 detects:** `sfdx-project.json` → Salesforce project
297
+
298
+ **Optimized Prompt (Full):**
299
+
300
+ ```
301
+ Add a REST API endpoint for account creation (POST /api/accounts).
302
+
303
+ Tech stack: Salesforce Apex REST (detected from sfdx-project.json)
304
+
305
+ Requirements:
306
+ - @RestResource(urlMapping='/api/accounts')
307
+ - Input validation: Name (required), Industry, BillingCountry
308
+ - Auth: Connected App OAuth — caller must have Account create permission
309
+ - Return 201 with created Account Id on success
310
+ - Return 400 with validation errors on invalid input
311
+ - Return 403 for insufficient permissions
312
+
313
+ Workflow:
314
+ 1. Use sf-architect agent for the endpoint structure, validation logic, and error response envelope
315
+ 2. /sf-tdd-workflow — write tests for success, validation failure, permission failure
316
+ 3. Implement AccountAPI class following existing REST patterns
317
+ 4. /sf-security — verify CRUD/FLS enforcement
318
+ 5. /sf-apex-best-practices
319
+ 6. Use sf-review-agent agent — run full test suite, confirm no regressions
320
+
321
+ Do not:
322
+ - Modify existing Account fields or validation rules
323
+ - Add new custom fields without a separate plan step
324
+ ```
325
+
326
+ ### Example 3: EPIC Project
327
+
328
+ **User input:**
329
+
330
+ ```
331
+ Migrate our legacy Apex triggers to a trigger framework
332
+ ```
333
+
334
+ **Optimized Prompt (Full):**
335
+
336
+ ```
337
+ Use the sf-architect agent to plan: "Migrate all legacy Apex triggers to trigger framework"
338
+
339
+ Before executing, answer these questions in the blueprint:
340
+ 1. Which trigger framework is preferred (custom TriggerHandler, Apex Commons, or other)?
341
+ 2. How many triggers exist and which objects are highest priority?
342
+ 3. Are there existing test classes that need to be preserved?
343
+ 4. What is the deployment strategy (all at once vs object-by-object)?
344
+
345
+ The blueprint should produce phases like:
346
+ - Phase 1: Audit all existing triggers and document business logic
347
+ - Phase 2: Implement TriggerHandler base class and factory
348
+ - Phase 3: Migrate highest-priority object triggers with /sf-tdd-workflow gates
349
+ - Phase 4: Migrate remaining triggers
350
+ - Phase N: Remove legacy trigger code, run full regression
351
+
352
+ Each phase = 1 deployment unit, with sf-review-agent agent gates between phases.
353
+ Use /save-session between phases. Use /resume-session to continue.
354
+
355
+ Recommended: Opus for blueprint planning, Sonnet for phase execution.
356
+ ```
357
+
358
+ ---
359
+
360
+ ## Related Components
361
+
362
+ | Component | When to Reference |
363
+ |-----------|------------------|
364
+ | `configure-scc` | User hasn't set up SCC yet |
365
+ | `/sf-harness-audit` (skill) | Audit which components are installed (use instead of hardcoded catalog) |
366
+ | `search-first` | Research phase in optimized prompts |
367
+ | `sf-architect` (agent) | EPIC-scope optimized prompts |
368
+ | `strategic-compact` | Long session context management |
369
+ | `strategic-compact` (token tips) | Token optimization recommendations |
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: refactor-clean
3
+ description: >-
4
+ Use when cleaning up Salesforce Apex or LWC code. Dead code removal and consolidation using PMD
5
+ and Salesforce Code Analyzer for safe cleanup.
6
+ origin: SCC
7
+ user-invocable: true
8
+ disable-model-invocation: true
9
+ ---
10
+
11
+ # Refactor Clean — Dead Code Removal and Consolidation
12
+
13
+ Remove dead code and consolidate duplicates safely. Uses Salesforce Code Analyzer (`sf code-analyzer run`) for detection when available, falls back to manual analysis.
14
+
15
+ ## When to Use
16
+
17
+ - When cleaning up unused Apex classes, methods, or LWC components
18
+ - When consolidating duplicate utility methods across multiple service classes
19
+ - When preparing a codebase for a security review or AppExchange submission
20
+ - When Salesforce Code Analyzer or PMD reports high-severity findings that need cleanup
21
+ - When reducing technical debt by removing commented-out code and unreferenced classes
22
+
23
+ ## Workflow
24
+
25
+ ### Step 1 — Detect Dead Code
26
+
27
+ **Option A: Salesforce Code Analyzer (preferred)**
28
+
29
+ ```bash
30
+ sf code-analyzer run --target force-app --format table
31
+ sf code-analyzer run --target force-app --format json | jq '.[] | select(.severity <= 2)'
32
+ ```
33
+
34
+ **Option B: Manual analysis**
35
+
36
+ ```bash
37
+ # Find Apex classes with no references.
38
+ # Uses sfdx-project.json packageDirectories to find all source paths,
39
+ # rather than hardcoding force-app/main/default.
40
+ # Note: This heuristic searches source files for class name strings. Results may
41
+ # be incomplete — classes can be referenced dynamically (Type.forName), from
42
+ # managed packages, external integrations, or metadata not in source control.
43
+ # Always verify before deleting.
44
+ SRC_DIRS=$(node -e "
45
+ const p = require('./sfdx-project.json');
46
+ console.log(p.packageDirectories.map(d => d.path).join(' '));
47
+ " 2>/dev/null || echo "force-app")
48
+ for dir in $SRC_DIRS; do
49
+ find "$dir" -name "*.cls" -not -name "*Test*" | while read cls; do
50
+ name=$(basename "$cls" .cls)
51
+ # Note: Use word-boundary matching for precise results to avoid partial name matches
52
+ refs=$(grep -rlw "$name" $SRC_DIRS --include="*.cls" --include="*.trigger" --include="*.js" --include="*.xml" 2>/dev/null | grep -v "$cls" | wc -l)
53
+ if [ "$refs" -eq 0 ]; then echo "UNREFERENCED: $name"; fi
54
+ done
55
+ done
56
+
57
+ # Find unused methods within a class (private methods not called internally)
58
+ grep -n "private.*void\|private.*String\|private.*List\|private.*Map" <file>.cls
59
+ ```
60
+
61
+ ### Step 2 — Classify Safety
62
+
63
+ Categorize each finding before removing anything:
64
+
65
+ | Safety Level | Criteria | Action |
66
+ |-------------|----------|--------|
67
+ | **SAFE** | Private methods with no internal callers, unreferenced private classes, commented-out code blocks | Remove immediately |
68
+ | **CAUTION** | Public methods not referenced in code (may be called by Flows, Process Builders, or external systems) | Check metadata references first |
69
+ | **DANGER** | `global` methods, `@AuraEnabled`, `@InvocableMethod`, `@InvocableVariable`, `@RemoteAction`, `@HttpGet/Post`, managed package components | Do NOT remove without explicit verification |
70
+
71
+ ### Step 3 — Check Metadata References
72
+
73
+ Before removing any CAUTION or DANGER items:
74
+
75
+ ```bash
76
+ # Check if a method is referenced in Flows
77
+ grep -rl "ClassName.MethodName" force-app/main/default/flows/
78
+
79
+ # Check if a class is used in Process Builders
80
+ grep -rl "ClassName" force-app/main/default/workflows/
81
+
82
+ # Check if a class is referenced in Custom Metadata
83
+ grep -rl "ClassName" force-app/main/default/customMetadata/
84
+
85
+ # Check if an LWC component is used in FlexiPages
86
+ grep -rl "c-component-name" force-app/main/default/flexipages/
87
+
88
+ # Check if a class is referenced in page layouts
89
+ grep -rl "ClassName" force-app/main/default/layouts/
90
+ ```
91
+
92
+ ### Step 4 — Managed Package Considerations
93
+
94
+ Never remove without checking:
95
+
96
+ - `@AuraEnabled` methods — may be called by LWC/Aura components not in your source
97
+ - `@InvocableMethod` — may be called by Flows you can't see in source control
98
+ - `global` methods — may be called by subscriber orgs or external packages
99
+ - `webService` methods — may be called by external integrations
100
+ - Methods referenced in Permission Sets or Custom Permissions
101
+
102
+ ### Step 5 — Remove One at a Time
103
+
104
+ For each SAFE item:
105
+
106
+ 1. Delete the dead code
107
+ 2. Run tests: `sf apex run test --test-level RunLocalTests --wait 15`
108
+ 3. Verify deployment: `sf project deploy start --dry-run --wait 10`
109
+ 4. If tests fail, revert the deletion immediately
110
+
111
+ ### Step 6 — Consolidate Duplicates
112
+
113
+ After dead code removal, look for consolidation opportunities:
114
+
115
+ 1. Identify similar methods across classes (same logic, different names)
116
+ 2. Extract shared logic into a utility/service class
117
+ 3. Update all callers to use the shared implementation
118
+ 4. Run full test suite after each consolidation
119
+
120
+ ## Safety Rules
121
+
122
+ - Always create a checkpoint before starting: `/checkpoint refactor-start`
123
+ - Remove one item at a time — never batch deletions
124
+ - Run tests after each removal
125
+ - Never remove `@AuraEnabled`, `@InvocableMethod`, or `global` without verifying all callers
126
+ - Check metadata references (Flows, Process Builders, FlexiPages) before deleting any public method
127
+ - Keep a log of what was removed and why
128
+
129
+ ## Examples
130
+
131
+ ```
132
+ refactor-clean Remove unused Apex classes and dead methods from force-app/
133
+ refactor-clean Consolidate duplicate utility methods across AccountService and ContactService
134
+ refactor-clean Find and remove unreferenced LWC components
135
+ refactor-clean Run Salesforce Code Analyzer and clean up all HIGH severity PMD findings
136
+ ```
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: resume-session
3
+ description: >-
4
+ Use when resuming a previous Salesforce development session. Load saved org context and Apex
5
+ work-in-progress to continue where the last session ended.
6
+ origin: SCC
7
+ user-invocable: true
8
+ ---
9
+
10
+ # Resume Session — Restore and Orient from a Saved Session
11
+
12
+ Load the last saved session state and orient fully before doing any work.
13
+ This skill is the counterpart to the save-session skill.
14
+
15
+ ## When to Use
16
+
17
+ - Starting a new session to continue work from a previous day
18
+ - After starting a fresh session due to context limits
19
+ - When handing off a session file from another source (just provide the file path)
20
+ - Any time you have a session file and want Claude to fully absorb it before proceeding
21
+
22
+ ## Usage
23
+
24
+ ```
25
+ /resume-session # loads most recent file in ~/.claude/sessions/
26
+ /resume-session 2026-03-18 # loads most recent session for that date
27
+ /resume-session ~/.claude/sessions/2026-03-18-apex-trig-session.md # loads a specific file
28
+ ```
29
+
30
+ ## Process
31
+
32
+ ### Step 1: Find the session file
33
+
34
+ If no argument provided:
35
+
36
+ 1. Check `~/.claude/sessions/`
37
+ 2. Pick the most recently modified `*-session.md` file
38
+ 3. If the folder does not exist or has no matching files, tell the user:
39
+
40
+ ```
41
+ No session files found in ~/.claude/sessions/
42
+ Run /save-session at the end of a session to create one.
43
+ ```
44
+
45
+ Then stop.
46
+
47
+ If an argument is provided:
48
+
49
+ - If it looks like a date (`YYYY-MM-DD`), search `~/.claude/sessions/` for matching files
50
+ and load the most recently modified variant for that date
51
+ - If it looks like a file path, read that file directly
52
+ - If not found, report clearly and stop
53
+
54
+ ### Step 2: Read the entire session file
55
+
56
+ Read the complete file. Do not summarize yet.
57
+
58
+ ### Step 3: Confirm understanding
59
+
60
+ Respond with a structured briefing in this exact format:
61
+
62
+ ```
63
+ SESSION LOADED: [actual resolved path to the file]
64
+
65
+ PROJECT: [project name / topic from file]
66
+
67
+ WHAT WE'RE BUILDING:
68
+ [2-3 sentence summary in your own words]
69
+
70
+ CURRENT STATE:
71
+ Working: [count] items confirmed
72
+ In Progress: [list files that are in progress]
73
+ Not Started: [list planned but untouched]
74
+
75
+ WHAT NOT TO RETRY:
76
+ [list every failed approach with its reason — this is critical]
77
+
78
+ OPEN QUESTIONS / BLOCKERS:
79
+ [list any blockers or unanswered questions]
80
+
81
+ NEXT STEP:
82
+ [exact next step if defined in the file]
83
+
84
+ Ready to continue. What would you like to do?
85
+ ```
86
+
87
+ ### Step 4: Wait for the user
88
+
89
+ Do NOT start working automatically. Do NOT touch any files. Wait for the user to say what to do next.
90
+
91
+ ---
92
+
93
+ ## Edge Cases
94
+
95
+ **Multiple sessions for the same date:**
96
+ Load the most recently modified matching file for that date.
97
+
98
+ **Session file references files that no longer exist:**
99
+ Note this during the briefing — "WARNING: `path/to/file.cls` referenced in session but not found on disk."
100
+
101
+ **Session file is from more than 7 days ago:**
102
+ Note the gap — "WARNING: This session is from N days ago. Things may have changed." — then proceed normally.
103
+
104
+ **Session file is empty or malformed:**
105
+ Report: "Session file found but appears empty or unreadable. You may need to create a new one with /save-session."
106
+
107
+ ---
108
+
109
+ ## Notes
110
+
111
+ - Never modify the session file when loading it — it's a read-only historical record
112
+ - The briefing format is fixed — do not skip sections even if they are empty
113
+ - "What Not To Retry" must always be shown, even if it just says "None"
114
+ - After resuming, the user may want to run `/save-session` again at the end of the new session