claude-sfdx-iq 1.2.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 (220) hide show
  1. package/.claude-plugin/plugin.json +27 -0
  2. package/.claude-project-template/CLAUDE.md +148 -0
  3. package/.claude-project-template/README.md +130 -0
  4. package/.claude-project-template/settings.json +19 -0
  5. package/AGENTS.md +124 -0
  6. package/LICENSE +21 -0
  7. package/README.md +445 -0
  8. package/agents/admin-advisor.md +423 -0
  9. package/agents/apex-reviewer.md +239 -0
  10. package/agents/architect.md +230 -0
  11. package/agents/context-assigner.md +98 -0
  12. package/agents/data-modeler.md +417 -0
  13. package/agents/deployment-specialist.md +384 -0
  14. package/agents/flow-analyst.md +291 -0
  15. package/agents/governor-limits-checker.md +312 -0
  16. package/agents/integration-specialist.md +611 -0
  17. package/agents/lwc-reviewer.md +371 -0
  18. package/agents/metadata-analyst.md +255 -0
  19. package/agents/planner.md +263 -0
  20. package/agents/security-reviewer.md +294 -0
  21. package/agents/soql-optimizer.md +265 -0
  22. package/agents/test-guide.md +472 -0
  23. package/commands/apex-doc.md +85 -0
  24. package/commands/apex-review.md +78 -0
  25. package/commands/build-fix.md +64 -0
  26. package/commands/code-review.md +67 -0
  27. package/commands/context.md +38 -0
  28. package/commands/create-scratch-org.md +72 -0
  29. package/commands/csiq-help.md +13 -0
  30. package/commands/data-model.md +121 -0
  31. package/commands/data-seed.md +87 -0
  32. package/commands/debug-log.md +86 -0
  33. package/commands/deploy.md +61 -0
  34. package/commands/destructive-deploy.md +89 -0
  35. package/commands/destructive.md +74 -0
  36. package/commands/doctor.md +13 -0
  37. package/commands/explain-error.md +113 -0
  38. package/commands/flow-review.md +74 -0
  39. package/commands/governor-check.md +85 -0
  40. package/commands/install.md +19 -0
  41. package/commands/integration-test.md +81 -0
  42. package/commands/list.md +19 -0
  43. package/commands/lwc-review.md +76 -0
  44. package/commands/lwc-test.md +80 -0
  45. package/commands/metadata-analyze.md +94 -0
  46. package/commands/metadata-diff.md +73 -0
  47. package/commands/org-health.md +107 -0
  48. package/commands/package-version.md +66 -0
  49. package/commands/package.md +66 -0
  50. package/commands/pick.md +19 -0
  51. package/commands/plan.md +61 -0
  52. package/commands/pmd-scan.md +79 -0
  53. package/commands/push.md +60 -0
  54. package/commands/refresh.md +17 -0
  55. package/commands/repair.md +13 -0
  56. package/commands/retrieve.md +63 -0
  57. package/commands/scaffold-apex-class.md +81 -0
  58. package/commands/scaffold-apex.md +123 -0
  59. package/commands/scaffold-batch.md +124 -0
  60. package/commands/scaffold-flow.md +96 -0
  61. package/commands/scaffold-integration.md +107 -0
  62. package/commands/scaffold-lwc.md +108 -0
  63. package/commands/scaffold-trigger.md +89 -0
  64. package/commands/scratch-org.md +65 -0
  65. package/commands/security-scan.md +76 -0
  66. package/commands/setup-project.md +60 -0
  67. package/commands/sf-help.md +118 -0
  68. package/commands/soql-check.md +50 -0
  69. package/commands/soql-review.md +77 -0
  70. package/commands/status.md +13 -0
  71. package/commands/tdd.md +69 -0
  72. package/commands/test-data.md +82 -0
  73. package/commands/test.md +61 -0
  74. package/commands/tokens.md +18 -0
  75. package/commands/validate.md +56 -0
  76. package/contexts/admin.md +95 -0
  77. package/contexts/debug.md +102 -0
  78. package/contexts/deploy.md +95 -0
  79. package/contexts/develop.md +74 -0
  80. package/contexts/review.md +105 -0
  81. package/hooks/README.md +128 -0
  82. package/hooks/apex-post-edit.json +8 -0
  83. package/hooks/flow-post-edit.json +8 -0
  84. package/hooks/lwc-post-edit.json +8 -0
  85. package/hooks/pre-commit.json +8 -0
  86. package/hooks/soql-check.json +8 -0
  87. package/hooks/trigger-post-edit.json +8 -0
  88. package/manifests/admin.json +60 -0
  89. package/manifests/apex-only.json +76 -0
  90. package/manifests/default.json +178 -0
  91. package/manifests/lwc-only.json +54 -0
  92. package/manifests/minimal.json +51 -0
  93. package/mcp-configs/github-actions.json +23 -0
  94. package/mcp-configs/jest-lwc.json +22 -0
  95. package/mcp-configs/pmd-apex.json +22 -0
  96. package/mcp-configs/salesforce-cli.json +9 -0
  97. package/mcp-configs/sfdx-scanner.json +15 -0
  98. package/mcp-configs/vscode-sfdx.json +28 -0
  99. package/package.json +86 -0
  100. package/rules/README.md +23 -0
  101. package/rules/apex/bulkification.md +208 -0
  102. package/rules/apex/coding-style.md +173 -0
  103. package/rules/apex/error-handling.md +222 -0
  104. package/rules/apex/governor-limits.md +187 -0
  105. package/rules/apex/hooks.md +63 -0
  106. package/rules/apex/patterns.md +217 -0
  107. package/rules/apex/performance.md +105 -0
  108. package/rules/apex/security.md +188 -0
  109. package/rules/apex/testing.md +87 -0
  110. package/rules/common/agents.md +56 -0
  111. package/rules/common/coding-style.md +56 -0
  112. package/rules/common/development-workflow.md +72 -0
  113. package/rules/common/git-workflow.md +89 -0
  114. package/rules/common/governor-limits.md +63 -0
  115. package/rules/common/hooks.md +79 -0
  116. package/rules/common/patterns.md +76 -0
  117. package/rules/common/security.md +81 -0
  118. package/rules/common/testing.md +91 -0
  119. package/rules/flows/best-practices.md +161 -0
  120. package/rules/flows/coding-style.md +55 -0
  121. package/rules/flows/hooks.md +45 -0
  122. package/rules/flows/patterns.md +237 -0
  123. package/rules/flows/performance.md +168 -0
  124. package/rules/flows/security.md +195 -0
  125. package/rules/index.md +53 -0
  126. package/rules/lwc/coding-style.md +74 -0
  127. package/rules/lwc/hooks.md +109 -0
  128. package/rules/lwc/patterns.md +120 -0
  129. package/rules/lwc/performance.md +114 -0
  130. package/rules/lwc/security.md +74 -0
  131. package/rules/lwc/testing.md +122 -0
  132. package/rules/metadata/coding-style.md +62 -0
  133. package/rules/metadata/deployment.md +188 -0
  134. package/rules/metadata/hooks.md +65 -0
  135. package/rules/metadata/naming-conventions.md +270 -0
  136. package/rules/metadata/organization.md +214 -0
  137. package/rules/metadata/patterns.md +75 -0
  138. package/rules/metadata/security.md +77 -0
  139. package/rules/metadata/version-control.md +245 -0
  140. package/rules/soql/anti-patterns.md +226 -0
  141. package/rules/soql/coding-style.md +102 -0
  142. package/rules/soql/hooks.md +50 -0
  143. package/rules/soql/performance.md +173 -0
  144. package/rules/soql/query-patterns.md +200 -0
  145. package/rules/soql/security.md +144 -0
  146. package/scripts/csiq.js +133 -0
  147. package/scripts/doctor.js +173 -0
  148. package/scripts/estimate-tokens.js +403 -0
  149. package/scripts/hooks/apex-lint.js +124 -0
  150. package/scripts/hooks/flow-check.js +119 -0
  151. package/scripts/hooks/lwc-lint.js +101 -0
  152. package/scripts/hooks/post-bash-deploy-complete.js +80 -0
  153. package/scripts/hooks/post-bash-test-complete.js +107 -0
  154. package/scripts/hooks/post-edit-debug-warn.js +53 -0
  155. package/scripts/hooks/post-edit-governor-scan.js +138 -0
  156. package/scripts/hooks/post-edit-pmd-scan.js +139 -0
  157. package/scripts/hooks/post-edit-security-scan.js +116 -0
  158. package/scripts/hooks/pre-bash-destructive-warn.js +69 -0
  159. package/scripts/hooks/pre-commit-check.js +47 -0
  160. package/scripts/hooks/quality-gate.js +131 -0
  161. package/scripts/hooks/run-with-flags.js +67 -0
  162. package/scripts/hooks/session-start.js +69 -0
  163. package/scripts/hooks/soql-check.js +98 -0
  164. package/scripts/hooks/trigger-lint.js +96 -0
  165. package/scripts/install-apply.js +268 -0
  166. package/scripts/install-plan.js +109 -0
  167. package/scripts/lib/apex-parser.js +169 -0
  168. package/scripts/lib/frontmatter-parser.js +86 -0
  169. package/scripts/lib/governor-limits-db.js +112 -0
  170. package/scripts/lib/hook-flags.js +54 -0
  171. package/scripts/lib/install-executor.js +119 -0
  172. package/scripts/lib/metadata-helpers.js +87 -0
  173. package/scripts/lib/pmd-runner.js +102 -0
  174. package/scripts/lib/report-formatter.js +75 -0
  175. package/scripts/lib/sf-cli-wrapper.js +52 -0
  176. package/scripts/lib/soql-analyzer.js +153 -0
  177. package/scripts/list-installed.js +113 -0
  178. package/scripts/pick.js +283 -0
  179. package/scripts/refresh-claude-md.js +139 -0
  180. package/scripts/repair.js +187 -0
  181. package/scripts/setup-project.js +131 -0
  182. package/scripts/status.js +130 -0
  183. package/scripts/tokens.js +139 -0
  184. package/skills/apex-async-patterns/SKILL.md +381 -0
  185. package/skills/apex-coding-standards/SKILL.md +293 -0
  186. package/skills/apex-enterprise-patterns/SKILL.md +380 -0
  187. package/skills/apex-patterns/SKILL.md +257 -0
  188. package/skills/apex-testing/SKILL.md +393 -0
  189. package/skills/aura-patterns/SKILL.md +328 -0
  190. package/skills/change-data-capture/SKILL.md +311 -0
  191. package/skills/ci-cd-pipeline/SKILL.md +425 -0
  192. package/skills/code-analysis/SKILL.md +357 -0
  193. package/skills/data-modeling/SKILL.md +398 -0
  194. package/skills/deployment-strategies/SKILL.md +266 -0
  195. package/skills/error-handling/SKILL.md +429 -0
  196. package/skills/experience-cloud/SKILL.md +365 -0
  197. package/skills/flow-best-practices/SKILL.md +297 -0
  198. package/skills/flow-to-code/SKILL.md +339 -0
  199. package/skills/governor-limits/SKILL.md +332 -0
  200. package/skills/index.md +45 -0
  201. package/skills/integration-patterns/SKILL.md +333 -0
  202. package/skills/logging-framework/SKILL.md +404 -0
  203. package/skills/lwc-patterns/SKILL.md +467 -0
  204. package/skills/lwc-performance/SKILL.md +411 -0
  205. package/skills/lwc-testing/SKILL.md +471 -0
  206. package/skills/metadata-management/SKILL.md +341 -0
  207. package/skills/org-health-check/SKILL.md +360 -0
  208. package/skills/packaging-2gp/SKILL.md +271 -0
  209. package/skills/permission-model/SKILL.md +437 -0
  210. package/skills/platform-events/SKILL.md +307 -0
  211. package/skills/rest-api-patterns/SKILL.md +444 -0
  212. package/skills/salesforce-dx-project/SKILL.md +342 -0
  213. package/skills/scratch-org-management/SKILL.md +368 -0
  214. package/skills/security-patterns/SKILL.md +323 -0
  215. package/skills/shield-encryption/SKILL.md +336 -0
  216. package/skills/soql-optimization/SKILL.md +308 -0
  217. package/skills/sosl-patterns/SKILL.md +360 -0
  218. package/skills/tdd-workflow/SKILL.md +365 -0
  219. package/skills/trigger-framework/SKILL.md +389 -0
  220. package/skills/visualforce-patterns/SKILL.md +458 -0
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "claude-sfdx-iq",
3
+ "version": "1.2.0",
4
+ "description": "Complete Salesforce DX plugin for Claude Code — agents, skills, hooks, commands, and rules for Apex, LWC, SOQL, Flows, and SFDX CI/CD",
5
+ "author": {
6
+ "name": "Bhanu Vakati"
7
+ },
8
+ "homepage": "https://github.com/bhanu91221/claude-sfdx-iq",
9
+ "repository": "https://github.com/bhanu91221/claude-sfdx-iq",
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "claude-code",
13
+ "salesforce",
14
+ "sfdx",
15
+ "apex",
16
+ "lwc",
17
+ "soql",
18
+ "flows",
19
+ "governor-limits",
20
+ "tdd",
21
+ "code-review",
22
+ "security",
23
+ "workflow",
24
+ "automation",
25
+ "best-practices"
26
+ ]
27
+ }
@@ -0,0 +1,148 @@
1
+ # CLAUDE.md — Salesforce DX Project
2
+
3
+ ## Project Overview
4
+
5
+ <!-- Describe your Salesforce project, org type, package namespace if any -->
6
+ This is a Salesforce DX project using [org type: scratch/sandbox/production].
7
+ - Namespace: [your namespace or empty]
8
+ - API Version: 62.0
9
+ - Package Type: [unlocked/managed/unmanaged]
10
+
11
+ ## claude-sfdx-iq Plugin
12
+
13
+ This project uses the **claude-sfdx-iq** plugin for Salesforce development.
14
+
15
+ ### Plugin Configuration
16
+ - **Installed**: v1.2.0
17
+ - **Rules**: 44 rules in `.claude/rules/` (~43k tokens total)
18
+ - **Token Optimization**: context-assigner agent loads only 5-8 rules per task (5k-15k tokens)
19
+ - **Hook Profile**: `standard` (balanced checks)
20
+
21
+ ### Available Commands
22
+
23
+ Run `/help` to see all 53 commands, including:
24
+ - `/deploy` — Deploy to Salesforce org with validation
25
+ - `/test` — Run Apex tests with coverage analysis
26
+ - `/apex-review` — Review Apex code quality
27
+ - `/lwc-review` — Review LWC components
28
+ - `/security-scan` — CRUD/FLS/sharing/injection scan
29
+ - `/governor-check` — Governor limit risk analysis
30
+ - `/tdd` — Test-driven development workflow
31
+ - `/scaffold-trigger` — Generate trigger + handler + test
32
+ - `/scaffold-lwc` — Generate LWC component boilerplate
33
+ - `/code-review` — Full code review with parallel agents
34
+
35
+ ### Context Loading (Skills & Rules) — CRITICAL
36
+
37
+ Skills and rules are loaded dynamically based on each user task. This section defines how context loading works.
38
+
39
+ #### Per-Message Context Analysis
40
+
41
+ On EVERY user message that involves a Salesforce development task:
42
+
43
+ 1. **Invoke the context-assigner agent** with the user's message
44
+ 2. **Parse the recommendation** — the agent returns a `---CONTEXT-RECOMMENDATION---` block listing skills and rules to load
45
+ 3. **Load the recommended components** using the Read tool:
46
+ - Skills: `.claude/skills-available/<skill-name>/SKILL.md`
47
+ - Rules: `.claude/rules/<rule-path>.md`
48
+ 4. **Announce what was loaded** — ALWAYS display this summary to the user:
49
+
50
+ ```
51
+ Context Loaded for: [Task description]
52
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
53
+ Skills ([count]): [comma-separated names]
54
+ Rules ([count]): [comma-separated names]
55
+ ~Tokens: [estimated total]
56
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
57
+ ```
58
+
59
+ 5. **Proceed with the task** using the loaded skill/rule knowledge
60
+
61
+ #### Context Re-evaluation
62
+
63
+ - If the user's next message **changes domain** (e.g., from Apex to LWC), re-invoke context-assigner and load fresh context
64
+ - If the user **continues in the same domain**, reuse current context (no need to re-invoke)
65
+ - If the user **explicitly asks** to reload context, re-invoke context-assigner
66
+
67
+ #### Context Delegation to Subagents
68
+
69
+ When delegating to specialized agents (e.g., apex-reviewer, lwc-reviewer, soql-optimizer):
70
+
71
+ 1. **Include loaded context in the agent prompt** — When invoking a subagent via the Agent tool, include the relevant skill/rule content directly in the prompt so the subagent has access to it. Subagents run in isolated contexts and cannot see what the main agent has loaded.
72
+ 2. **Domain-specific delegation** — When launching multiple agents (e.g., /code-review), each agent should receive ONLY the context relevant to its domain:
73
+ - apex-reviewer gets: apex skills + apex rules + common rules + soql rules (SOQL is part of Apex)
74
+ - lwc-reviewer gets: lwc skills + lwc rules + common rules
75
+ - soql-optimizer gets: soql skills + soql rules + common rules
76
+ - security-reviewer gets: security skills + all security rules across domains
77
+ - governor-limits-checker gets: governor-limits skill + apex/governor-limits rule + common rules
78
+ 3. **Token efficiency** — Only pass the loaded context that matches the agent's domain. Do not dump all loaded context into every agent.
79
+
80
+ #### Handling --custom Mode
81
+
82
+ If the user includes `--custom skills`, `--custom rules`, or `--custom skills rules`:
83
+
84
+ 1. The context-assigner returns CUSTOM_MODE with index table(s)
85
+ 2. **Display the index table(s)** to the user
86
+ 3. **Ask**: "Select by number (e.g., 1,3,5-7), domain name (e.g., apex), or 'all'"
87
+ 4. **Parse the user's selection** and load those items using Read tool:
88
+ - Skills: `.claude/skills-available/<name>/SKILL.md`
89
+ - Rules: `.claude/rules/<name>.md`
90
+ 5. **Display the context summary** as above
91
+ 6. **Proceed with the original task**
92
+
93
+ #### On-demand: /context
94
+
95
+ Use `/context` to inspect currently loaded context or browse available components.
96
+
97
+ **Available components:**
98
+
99
+ @.claude/rules/index.md
100
+
101
+ ## Development Workflow
102
+
103
+ - Default org alias: [your-org-alias]
104
+ - Scratch org duration: 7 days
105
+ - Scratch org definition: config/project-scratch-def.json
106
+ - Test minimum: 90% coverage
107
+ - Deployment: validate first, then quick deploy
108
+
109
+ ## Architecture
110
+
111
+ - **Trigger framework**: one-trigger-per-object with handler delegation
112
+ - **Service layer**: `*Service.cls` for business logic (stateless, bulkified)
113
+ - **Selector layer**: `*Selector.cls` for SOQL (centralized queries)
114
+ - **Domain layer**: `*Domain.cls` for SObject validation/behavior
115
+ - **Test data**: `TestDataFactory.cls` for reusable test data creation
116
+
117
+ ## Team Conventions
118
+
119
+ <!-- Add your team's specific conventions here -->
120
+ - Always use TestDataFactory for test data — no inline record creation
121
+ - All triggers must go through TriggerHandler framework
122
+ - Feature branches: `feature/TICKET-description`
123
+ - Commit format: `feat|fix|refactor|test: description`
124
+ - 90%+ test coverage required for all Apex classes
125
+
126
+ ## External Integrations
127
+
128
+ <!-- List named credentials and their purposes -->
129
+ - [NamedCredential] — [Purpose and target system]
130
+
131
+ ## Environment Notes
132
+
133
+ <!-- Any org-specific notes, limitations, or known issues -->
134
+ - [Document any org-specific configuration here]
135
+ - [Note any managed packages installed and their impact]
136
+
137
+ ## Hook Configuration
138
+
139
+ Current hook profile: **standard** (balanced checks)
140
+
141
+ Available profiles:
142
+ - `minimal` — Critical checks only (fastest)
143
+ - `standard` — Balanced checks (default)
144
+ - `strict` — All checks including style warnings
145
+
146
+ To change: Set `CSIQ_HOOK_PROFILE=minimal` in `.claude/settings.json`
147
+
148
+ To disable specific hooks: Set `CSIQ_DISABLED_HOOKS="post-edit-pmd-scan,post-edit-debug-warn"`
@@ -0,0 +1,130 @@
1
+ # Claude SFDX IQ — Project Template
2
+
3
+ This directory contains the project-level configuration template for claude-sfdx-iq.
4
+
5
+ ## What's Included
6
+
7
+ - **settings.json** — Plugin configuration for this project
8
+ - **CLAUDE.md** — Project documentation template with plugin guidance
9
+
10
+ ## How to Use
11
+
12
+ ### Option 1: Automated Setup (Recommended)
13
+
14
+ From your Salesforce DX project root:
15
+
16
+ ```bash
17
+ npx claude-sfdx-iq setup-project
18
+ # Or if npm is blocked (corporate VPN): use /setup-project slash command in Claude Code
19
+ ```
20
+
21
+ This will:
22
+ 1. Copy all 44 rules to `.claude/rules/`
23
+ 2. Copy settings.json and CLAUDE.md to `.claude/`
24
+ 3. Verify you're in an SFDX project (checks for sfdx-project.json)
25
+
26
+ ### Option 2: Manual Setup
27
+
28
+ ```bash
29
+ cd /path/to/your/sfdx-project
30
+
31
+ # Create .claude directory if it doesn't exist
32
+ mkdir -p .claude
33
+
34
+ # Copy rules from the plugin
35
+ cp -r ~/.claude/plugins/claude-sfdx-iq/rules ./.claude/rules
36
+
37
+ # Copy configuration templates
38
+ cp ~/.claude/plugins/claude-sfdx-iq/.claude-project-template/settings.json ./.claude/settings.json
39
+ cp ~/.claude/plugins/claude-sfdx-iq/.claude-project-template/CLAUDE.md ./CLAUDE.md
40
+ ```
41
+
42
+ ### Option 3: Copy from GitHub
43
+
44
+ If you haven't installed the plugin yet:
45
+
46
+ ```bash
47
+ # Clone the repo temporarily
48
+ git clone https://github.com/bhanu91221/claude-sfdx-iq.git /tmp/claude-sfdx-iq
49
+
50
+ cd /path/to/your/sfdx-project
51
+ mkdir -p .claude
52
+
53
+ # Copy rules
54
+ cp -r /tmp/claude-sfdx-iq/rules ./.claude/rules
55
+
56
+ # Copy templates
57
+ cp /tmp/claude-sfdx-iq/.claude-project-template/settings.json ./.claude/settings.json
58
+ cp /tmp/claude-sfdx-iq/.claude-project-template/CLAUDE.md ./CLAUDE.md
59
+ ```
60
+
61
+ ## What Gets Copied
62
+
63
+ ### Rules Directory (44 files, ~43k tokens total)
64
+
65
+ ```
66
+ .claude/rules/
67
+ ├── index.md # Rules catalog with token counts
68
+ ├── apex/ # 9 Apex rules (~11k tokens)
69
+ ├── common/ # 9 Common rules (~6k tokens)
70
+ ├── lwc/ # 6 LWC rules (~4.5k tokens)
71
+ ├── soql/ # 6 SOQL rules (~6.7k tokens)
72
+ ├── flows/ # 6 Flow rules (~6.9k tokens)
73
+ └── metadata/ # 8 Metadata rules (~8k tokens)
74
+ ```
75
+
76
+ **Token Optimization**: The context-assigner agent loads only 5-8 rules per task, saving ~30,000 tokens per session.
77
+
78
+ ### Configuration Files
79
+
80
+ - **settings.json** — Enables the plugin for this project, configures hook profile
81
+ - **CLAUDE.md** — Project documentation with rule references and command list
82
+
83
+ ## Verification
84
+
85
+ After setup, verify everything is configured:
86
+
87
+ ```bash
88
+ # Check rules are installed
89
+ ls .claude/rules/
90
+
91
+ # Check settings exist
92
+ cat .claude/settings.json
93
+
94
+ # Check CLAUDE.md exists
95
+ cat CLAUDE.md
96
+ ```
97
+
98
+ ## Customization
99
+
100
+ ### Adjust Hook Profile
101
+
102
+ Edit `.claude/settings.json`:
103
+
104
+ ```json
105
+ {
106
+ "environment": {
107
+ "CSIQ_HOOK_PROFILE": "minimal" // or "standard" or "strict"
108
+ }
109
+ }
110
+ ```
111
+
112
+ ### Disable Specific Hooks
113
+
114
+ ```json
115
+ {
116
+ "environment": {
117
+ "CSIQ_DISABLED_HOOKS": "post-edit-pmd-scan,post-edit-debug-warn"
118
+ }
119
+ }
120
+ ```
121
+
122
+ ### Custom Project Conventions
123
+
124
+ Edit `CLAUDE.md` to add your team's conventions, integrations, and environment notes.
125
+
126
+ ## Need Help?
127
+
128
+ - Run `/help` in Claude Code
129
+ - Visit: https://github.com/bhanu91221/claude-sfdx-iq
130
+ - Issues: https://github.com/bhanu91221/claude-sfdx-iq/issues
@@ -0,0 +1,19 @@
1
+ {
2
+ "plugins": {
3
+ "claude-sfdx-iq": {
4
+ "enabled": true,
5
+ "rulesPath": "./.claude/rules",
6
+ "contextAssignerEnabled": true,
7
+ "hookProfile": "standard"
8
+ }
9
+ },
10
+ "environment": {
11
+ "CSIQ_HOOK_PROFILE": "standard",
12
+ "CSIQ_DISABLED_HOOKS": ""
13
+ },
14
+ "metadata": {
15
+ "projectType": "sfdx",
16
+ "setupComplete": true,
17
+ "installedVersion": "1.2.0"
18
+ }
19
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,124 @@
1
+ # Claude SFDX IQ — Agent Instructions
2
+
3
+ This is a **Salesforce DX Claude Code plugin** providing 14 specialized agents, 36 skills, 53 commands, 44 rules across 6 categories, 16 hook scripts, 7 CLI tools, 5 mode contexts, and automated hook workflows for Salesforce development.
4
+
5
+ ## Core Principles
6
+
7
+ 1. **Governor-Limits-First** — Every code path evaluated for SOQL, DML, CPU, heap limits
8
+ 2. **Security-First** — CRUD/FLS enforcement, `with sharing`, no SOQL injection
9
+ 3. **Test-Driven** — 75% minimum (90%+ target), Apex test-first, LWC Jest
10
+ 4. **Bulkification Always** — Handle 200+ records in every trigger and batch context
11
+ 5. **Plan Before Execute** — Plan complex Salesforce features before writing code
12
+ 6. **Agent-First** — Delegate to specialized Salesforce agents for domain tasks
13
+
14
+ ## Available Agents
15
+
16
+ | Agent | Purpose | When to Use |
17
+ |-------|---------|-------------|
18
+ | planner | SFDC implementation planning | Complex features, multi-object changes |
19
+ | architect | Solution architecture | Data model, integration patterns, scalability |
20
+ | apex-reviewer | Apex code quality review | After writing/modifying Apex code |
21
+ | lwc-reviewer | LWC component review | After writing/modifying LWC components |
22
+ | soql-optimizer | SOQL/SOSL query analysis | Query performance, selectivity issues |
23
+ | security-reviewer | Security vulnerability scan | CRUD/FLS, sharing, injection, before commits |
24
+ | governor-limits-checker | Governor limit analysis | Code with loops, queries, DML operations |
25
+ | deployment-specialist | Deployment and packaging | sf deploy, package versions, destructive changes |
26
+ | test-guide | Salesforce TDD workflow | New features, bug fixes, test coverage |
27
+ | flow-analyst | Flow best practices review | Flow automation analysis |
28
+ | integration-specialist | Integration patterns | REST/SOAP callouts, platform events, CDC |
29
+ | metadata-analyst | Metadata analysis | Dependencies, unused components, org health |
30
+ | data-modeler | Data model design | Object relationships, schema optimization |
31
+ | admin-advisor | Declarative configuration | Permission sets, sharing rules, validation rules |
32
+
33
+ ## Agent Orchestration
34
+
35
+ Use agents proactively without user prompt:
36
+ - Complex feature requests → **planner**
37
+ - Apex code written/modified → **apex-reviewer**
38
+ - LWC code written/modified → **lwc-reviewer**
39
+ - SOQL queries added/changed → **soql-optimizer**
40
+ - Bug fix or new feature → **test-guide**
41
+ - Architectural decision → **architect**
42
+ - Security-sensitive code → **security-reviewer**
43
+ - Code with loops/queries → **governor-limits-checker**
44
+ - Deployment operations → **deployment-specialist**
45
+
46
+ Use parallel execution for independent operations — launch multiple agents simultaneously.
47
+
48
+ ## Security Guidelines
49
+
50
+ **Before ANY commit:**
51
+ - [ ] All Apex uses `with sharing` (or explicit justification for `without sharing`)
52
+ - [ ] All SOQL uses bind variables or `WITH SECURITY_ENFORCED`
53
+ - [ ] No dynamic SOQL with string concatenation
54
+ - [ ] `Security.stripInaccessible()` used for DML with user-provided data
55
+ - [ ] No hardcoded credentials, API keys, or tokens
56
+ - [ ] Connected App secrets in Named Credentials, not code
57
+ - [ ] Error messages don't expose field names or object structure to unauthorized users
58
+
59
+ **If security issue found:** STOP → use security-reviewer agent → fix CRITICAL issues → review codebase for similar issues.
60
+
61
+ ## Coding Style
62
+
63
+ **Bulkification (CRITICAL):** All trigger handlers must process `Trigger.new` as a collection. No SOQL or DML inside for loops — ever. Use Maps for lookups.
64
+
65
+ **File organization:** One trigger per object. Handler class per trigger. Service classes for reusable business logic. Selector classes for SOQL encapsulation. 200-400 lines typical, 800 max.
66
+
67
+ **Naming:** PascalCase for classes, camelCase for methods/variables, UPPER_SNAKE for constants. Descriptive names — `AccountTriggerHandler` not `ATH`.
68
+
69
+ ## Testing Requirements
70
+
71
+ **Minimum coverage: 75% (Salesforce requirement), target 90%+**
72
+
73
+ Test types (all required for Apex):
74
+ 1. **Unit tests** — Individual methods, utility classes, trigger handlers
75
+ 2. **Integration tests** — DML operations, SOQL queries, callout mocks
76
+ 3. **Bulk tests** — Test with 200+ records to verify bulkification
77
+
78
+ **TDD workflow:**
79
+ 1. Write test first (RED) — test should FAIL
80
+ 2. Write minimal Apex implementation (GREEN) — test should PASS
81
+ 3. Refactor (IMPROVE) — verify coverage 90%+
82
+
83
+ **Test patterns:**
84
+ - Use `@TestSetup` for shared test data
85
+ - Use `TestDataFactory` pattern for reusable test data creation
86
+ - Use `Test.startTest()`/`Test.stopTest()` for governor limit reset
87
+ - Use `System.runAs()` for user context and sharing tests
88
+ - Implement `HttpCalloutMock` for external callout tests
89
+
90
+ ## Development Workflow
91
+
92
+ 1. **Plan** — Use planner agent for complex features
93
+ 2. **TDD** — Use test-guide agent, write Apex tests first
94
+ 3. **Review** — Use apex-reviewer + security-reviewer agents
95
+ 4. **Deploy** — Use deployment-specialist agent for validation and deploy
96
+ 5. **Commit** — Conventional commits format
97
+
98
+ ## Git Workflow
99
+
100
+ **Commit format:** `<type>: <description>` — Types: feat, fix, refactor, docs, test, chore, perf, ci
101
+
102
+ **Branch naming:** `feature/TICKET-description`, `fix/TICKET-description`, `release/vX.Y.Z`
103
+
104
+ ## Project Structure
105
+
106
+ ```
107
+ agents/ — 14 specialized Salesforce subagents
108
+ skills/ — 36 Salesforce domain skills
109
+ commands/ — 53 slash commands
110
+ hooks/ — Trigger-based automations with 16 hook scripts
111
+ rules/ — 44 always-follow guidelines (common + apex + lwc + soql + flows + metadata)
112
+ contexts/ — 5 mode-specific context files (develop, review, debug, deploy, admin)
113
+ scripts/ — Cross-platform Node.js utilities, 7 CLI tools (claude-sfdx-iq), 10 library scripts
114
+ mcp-configs/ — MCP server configurations
115
+ tests/ — Test suite
116
+ ```
117
+
118
+ ## Success Metrics
119
+
120
+ - All Apex tests pass with 90%+ coverage
121
+ - No security vulnerabilities (CRUD/FLS enforced, no injection)
122
+ - No governor limit violations
123
+ - All code handles 200+ records (bulkified)
124
+ - Code is readable and follows Salesforce best practices
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bhanu Vakati
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.