Salesforce Claude Code (SCC)

Supercharge your Salesforce development with expert agents, automated quality gates, and institutional knowledge.

Salesforce Claude Code (SCC)

npm version License: MIT Node Version

The complete AI development system for Salesforce — expert agents, automated quality gates, and institutional knowledge, powered by @salesforce/mcp

SCC (scc-universal on npm) is a Claude Code plugin that supercharges your Salesforce development workflow with 17 expert subagents, 57 domain knowledge skills, and 29 automated quality gates. Built for Apex, LWC, SOQL, Flow, Visualforce, Aura, DevOps, and Agentforce — covering every layer of the Salesforce platform.


How It Works

SCC is a unified system where each layer serves a distinct role:

LayerWhat It DoesExamples
@salesforce/mcpPlatform capabilities — query orgs, deploy metadata, run tests, analyze codeOrg management, SOQL queries, Apex test execution
17 AgentsLean full-stack agents that design, build, test, and reviewsf-architect, sf-apex-agent, sf-lwc-agent, sf-review-agent
57 SkillsInstitutional knowledge + workflows — 18 user-invocable via /skill-name, 39 auto-activating/sf-help, /sf-quickstart, /configure-scc, /sessions
7 Constraint SkillsAlways-on governance via auto-activating skillssf-apex-constraints, sf-soql-constraints, sf-security-constraints, sf-trigger-constraints
29 HooksAutomated enforcement — quality gates run on every code changeSOQL-in-loop detection, PMD via sf scanner, privilege escalation checks

Together: @salesforce/mcp gives Claude the hands to work with Salesforce. SCC gives Claude the brain to work well.


What's Included

CategoryCountDescription
Agents17Specialized Salesforce subagents (11 domain + 6 platform)
Skills57Domain knowledge + workflow modules (18 user-invocable, 39 auto-activating)
Hooks29Automated quality gates (SessionStart, PreToolUse, PostToolUse, PostToolUseFailure, PreCompact, Stop, SessionEnd)
Harnesses2Claude Code, Cursor

Requirements

  • Node.js >= 20 — required to run the npx scc-universal CLI
  • Python 3.x — required for learning-engine agent (instinct CLI)

Quick Install

For Claude Code

# Install everything (agents → .claude/agents/, skills → .claude/skills/, hooks → .claude/settings.json)
npx scc-universal install

# Install only Apex-focused content
npx scc-universal install apex

# Install only LWC-focused content
npx scc-universal install lwc

For Cursor

# Install everything (agents → .cursor/agents/, skills → .cursor/skills/, hooks → .cursor/hooks.json)
npx scc-universal install --target cursor

# Install only Apex-focused content
npx scc-universal install apex --target cursor

Diagnose and Repair

npx scc-universal doctor       # Check for missing/drifted files
npx scc-universal repair       # Restore drifted files
npx scc-universal status       # View installed components
npx scc-universal uninstall    # Remove SCC-managed files

CLI Reference

CommandDescription
scc-universal install [profile]Install SCC content (default: full profile, claude target)
scc-universal planPreview install manifest (dry run)
scc-universal list-installedShow currently installed SCC files
scc-universal doctorDiagnose missing or drifted files
scc-universal repairRestore drifted files
scc-universal statusQuery JSON state store
scc-universal sessionsList saved sessions
scc-universal uninstallRemove SCC-managed files

Install flags:

FlagDescription
--profile <name>Install profile: apex, lwc, or full (default)
--target <harness>Target harness: claude (default) or cursor
--dry-runPreview changes without applying
--jsonOutput in JSON format

What Gets Installed

ComponentClaude Code (--target claude)Cursor (--target cursor)
Agents.claude/agents/*.md.cursor/agents/*.md
Skills.claude/skills/*/SKILL.md.cursor/skills/*/SKILL.md
Hooks (config)Merged into .claude/settings.json.cursor/hooks.json
Hooks (scripts).claude/hooks/scripts/, .claude/hooks/lib/.cursor/hooks/scripts/, .cursor/hooks/lib/
MCP config.mcp.json (project root).cursor/mcp.json

Install Profiles

SCC content is organized into 7 modules. Profiles compose subsets:

ModuleDescriptionDepends On
coreEssential agents, core skills, quality gates
apexApex agents, skills, SOQL, constraintscore
lwcLWC agent, skills, constraintscore
platformCross-domain agents, universal skills, debugging, integrationcore
devopsCI/CD, deployment, scratch orgs, SF CLI referencecore
securitySecurity agent, CRUD/FLS, governor limits, SOQL optimization, 2GP security reviewcore
extendedFlow, Visualforce, Aura, Agentforce, Admin, Events, API designcore
ProfileModules Included
apexcore + apex + platform + devops + security
lwccore + lwc + platform + devops + security
fullAll 7 modules (default)

Key Features

Apex Best Practices

  • Bulkification patterns, governor limit awareness, and collections-first coding
  • Trigger handler framework integration (FFLIB Enterprise Patterns + pragmatic single-trigger)
  • Async Apex: Queueable, Batch, Schedulable design patterns
  • Exception handling, custom exception hierarchies, and structured logging

LWC Patterns

  • Component lifecycle management and reactive property wiring
  • Base component usage, composition over inheritance
  • Accessibility (ARIA) compliance and keyboard navigation
  • Wire adapters, imperative Apex calls, and error boundary patterns

SOQL Optimization

  • Index-aware WHERE clause construction and selectivity guidance
  • Avoiding full-table scans and non-selective filters
  • Parent-child relationship queries and aggregate optimization
  • SOQL in loops detection and bulk query strategies

Trigger Frameworks

  • FFLIB-style trigger dispatcher and domain layer integration
  • Pragmatic single-trigger-per-object with handler routing
  • Recursive prevention patterns and context-aware execution
  • TriggerOperation enum usage and before/after separation

Security — CRUD / FLS / Sharing

  • Schema.SObjectField.getDescribe() for FLS checks
  • WITH SECURITY_ENFORCED and stripInaccessible() usage
  • Sharing model enforcement and without sharing justification
  • SOQL injection prevention and safe dynamic queries

DevOps / CI-CD

  • SF CLI v2 (sf) command patterns and project structure
  • Scratch org creation, source push/pull, and org pooling
  • Metadata API vs Source format understanding
  • GitHub Actions / GitLab CI pipeline patterns for Salesforce

Agentforce AI Agents

  • Agentforce Agent Builder configuration and topic definitions
  • Custom action creation (Apex, Flow, prompt templates)
  • Agent testing and conversation design patterns
  • Einstein AI feature integration

Salesforce MCP Integration

SCC is designed to complement the official Salesforce MCP server. Install both for the full experience:

  • @salesforce/mcp provides: org management, metadata deployment, SOQL queries, Apex test execution, code analysis, LWC tools, DevOps operations
  • SCC provides: domain expertise to use those tools correctly, quality gates to catch mistakes, and institutional knowledge to follow best practices

MCP config is auto-installed by npx scc-universal install:

npx scc-universal install all --target claude   # Installs .mcp.json at project root
npx scc-universal install all --target cursor   # Installs .cursor/mcp.json

Enhanced Quality Gates

SCC integrates with Salesforce Code Analyzer for machine-enforceable checks:

# Install the scanner (one-time setup)
sf plugins install @salesforce/sfdx-scanner

Once installed, SCC automatically runs PMD analysis:

  • Standard profile: Scanner runs before git push and sf project deploy
  • Strict profile: Scanner runs on every code edit
  • Graceful no-op if scanner is not installed — SCC falls back to regex-based checks

Cross-Harness Support

All content is structured for use across multiple AI harnesses:

  • Claude Code — primary harness with full hook integration
  • Cursor — rules, skills, and hooks exported to .cursor/ directory

Agents

AgentDescription
sf-architectOrchestrator — analyze requirements, design solutions, decompose tasks, final review
sf-apex-agentAll Apex — classes, triggers, batch, async, callouts, tests (TDD)
sf-lwc-agentAll LWC — components, Jest tests, wire service, events, SLDS
sf-flow-agentAll Flow — record-triggered, screen, scheduled, approval processes
sf-admin-agentAll config — objects, permissions, sharing, metadata, Experience Cloud
sf-integration-agentAll integration — REST/SOAP callouts, Named Creds, Platform Events, CDC
sf-agentforce-agentAgentforce — topics, custom Apex actions, prompt templates
sf-review-agentCross-domain review — security audit, performance, test coverage
sf-bugfix-agentFix build errors, test failures, deploy issues (minimal diff)
sf-aura-reviewerAura component review and LWC migration guidance
sf-visualforce-reviewerVisualforce page review and migration guidance
doc-updaterDocumentation generation and maintenance
refactor-cleanerCode refactoring and cleanup
loop-operatorAutonomous loop execution and monitoring
deep-researcherMulti-source Salesforce research and synthesis
learning-engineContinuous learning from session patterns
eval-runnerEval suite definition and execution

Skills

SkillDescription
sf-agentforce-developmentAgentforce agent design, topics, and actions
sf-apex-async-patternsQueueable, Batch, Schedulable design
sf-apex-best-practicesApex coding standards and patterns
sf-apex-cursorApex cursor-based pagination patterns
sf-apex-enterprise-patternsFFLIB and enterprise Apex patterns
sf-apex-testing@IsTest, test data factories, mock patterns
configure-sccSCC plugin configuration and setup
sf-devops-ci-cdGitHub Actions / GitLab CI for Salesforce
sf-flow-developmentFlow types, fault handling, bulkification
sf-governor-limitsLimit tracking, monitoring, and avoidance
sf-lwc-developmentComponent composition, lifecycle, reactivity
sf-lwc-testingLWC Jest testing and component test patterns
sf-metadata-managementMetadata API and source format management
sf-data-modelingObject model, relationships, and data design
sf-debuggingDebug logs, checkpoints, and trace flags
sf-deploymentDeployment validation, partial deploys, rollback
sf-integrationREST/SOAP callouts, named credentials, auth
sf-securityCRUD/FLS, sharing, stripInaccessible patterns
sf-2gp-security-review2GP managed package AppExchange security review and pass/fail prediction
sf-cli-referenceSF CLI command reference and usage patterns
sf-api-designSalesforce API design and best practices
sf-e2e-testingEnd-to-end testing for Salesforce apps
sf-tdd-workflowTest-driven development for Salesforce
sf-soql-optimizationIndex strategies, selective queries, bulkification
strategic-compactStrategic context compaction patterns
sf-trigger-frameworksFFLIB and pragmatic trigger handler patterns
mcp-server-patternsMCP server design and integration patterns
search-firstSearch-first development methodology
security-scanSecurity scanning patterns and automation
continuous-agent-loopContinuous autonomous agent loop patterns and controls
prompt-optimizerAnalyze and rewrite prompts to match SCC components for better agent performance
sf-visualforce-developmentVisualforce page patterns, controllers, and migration to LWC
sf-aura-developmentAura component patterns and LWC migration strategies
sf-platform-events-cdcPlatform Events and Change Data Capture patterns
sf-approval-processesApproval process design and automation patterns
sf-experience-cloudExperience Cloud site development and customization
sf-docs-lookupOfficial Salesforce documentation lookup
sf-helpDiscover SCC skills, agents, and workflows
sf-quickstartInteractive onboarding and project detection
sf-build-fixBuild error resolution and dependency fixes
sf-harness-auditAudit SCC harness configuration
update-platform-docsUpdate platform reference documentation
asideQuick Salesforce answer mid-task without losing context
checkpointSave a development checkpoint via git stash for rollback
model-routeRoute tasks to optimal Claude model tier by complexity
refactor-cleanDead code removal and consolidation via PMD/Code Analyzer
resume-sessionResume a saved Salesforce development session
save-sessionPersist session state for future resumption
sessionsList, load, and inspect saved sessions
update-docsSync documentation after Apex code changes
sf-apex-constraintsAlways-on: governor limits, naming, bulkification rules
sf-deployment-constraintsAlways-on: deploy safety, validation-only first, rollback readiness
sf-lwc-constraintsAlways-on: LWC naming, security, accessibility, performance
sf-security-constraintsAlways-on: CRUD/FLS, sharing, SOQL injection, XSS
sf-soql-constraintsAlways-on: query safety, selectivity, governor compliance
sf-testing-constraintsAlways-on: 75% coverage minimum, test isolation, assertions
sf-trigger-constraintsAlways-on: one-trigger-per-object, handler delegation, recursion

Skills

18 skills are user-invocable via /skill-name. 39 are auto-activating context skills (29 pattern + 7 constraint + 3 platform).

User-Invocable (18)

Invoke with /skill-name in Claude Code or Cursor.

SkillDescription
/sf-helpDiscover SCC skills, agents, and workflows
/sf-quickstartInteractive onboarding and project detection
/sf-docs-lookupLook up Salesforce documentation
/sf-harness-auditAudit SCC harness configuration
/sessionsList and manage sessions
/configure-sccInteractive SCC setup wizard for profiles, modules, and org config
/continuous-agent-loopMulti-agent orchestration and autonomous loops
/prompt-optimizerOptimize prompts for better agent performance
/checkpointSave a development checkpoint for rollback
/save-sessionSave current session state
/resume-sessionResume a saved session
/refactor-cleanDead code removal and consolidation
/update-docsUpdate project documentation
/update-platform-docsUpdate platform reference docs with latest release features
/asideQuick side investigation without losing context
/model-routeRoute tasks to optimal model by complexity
/sf-2gp-security-review2GP managed package AppExchange security review and pass/fail prediction
/search-firstResearch existing tools and patterns before writing custom code

Pattern Skills (29) — Agent-Consulted

Agents read these on demand for domain knowledge. Not directly invocable via /.

SkillDescription
sf-apex-best-practicesApex code review — governor limits, bulkification, security, patterns
sf-apex-testingRun and analyze Apex test results with coverage
sf-apex-async-patternsBatch vs Queueable vs @future decision framework
sf-apex-enterprise-patternsFFLIB selector/domain/service/UoW layers
sf-apex-cursorCursor API for large SOQL result sets
sf-trigger-frameworksTrigger framework patterns — One-Trigger-Per-Object, handler base class
sf-soql-optimizationAnalyze and optimize SOQL queries for performance
sf-governor-limitsGovernor limit audit — SOQL, DML, heap, CPU, callouts
sf-lwc-developmentLWC component review — architecture, reactivity, accessibility
sf-lwc-testingJest testing for LWC — mocks, DOM queries, accessibility
sf-flow-developmentReview Flows for best practices and anti-patterns
sf-approval-processesApproval lifecycle, multi-step, delegation patterns
sf-data-modelingData modeling, sharing rules, and admin configuration
sf-experience-cloudExperience Cloud sites, guest users, external sharing
sf-metadata-managementpackage.xml, .forceignore, source tracking
sf-integrationREST/SOAP callouts, Named Credentials, retry patterns
sf-platform-events-cdcPlatform Events and Change Data Capture review
sf-api-designCustom REST endpoints, batch operations
sf-agentforce-developmentDesign and configure an Agentforce AI agent
sf-securitySecurity audit — CRUD/FLS, sharing, SOQL injection, XSS
sf-e2e-testingEnd-to-end test patterns and deployment verification
sf-debuggingDebug using logs, debug levels, and tracing
sf-deploymentDeployment workflow — validate, test, deploy to sandbox or production
sf-devops-ci-cdGitHub Actions, CI/CD, scratch org CI
sf-tdd-workflowTest-driven Apex development with test-first workflow
sf-build-fixFix build errors and resolve dependencies
sf-visualforce-developmentVisualforce review — XSS, ViewState, LWC migration
sf-aura-developmentAura component review — Locker Service, LWC migration
sf-cli-referenceSF CLI command reference — org management, data, source, package, deploy

Auto-Activating Skills

39 skills activate automatically during development — no / invocation needed.

Constraint Skills (always-on governance):

SkillEnforces
sf-apex-constraintsGovernor limits, naming conventions, bulkification, security
sf-deployment-constraintsValidation-only first, test coverage gates, metadata ordering
sf-lwc-constraintsLWC naming, security, accessibility, performance rules
sf-security-constraintsCRUD/FLS, sharing model, SOQL injection, XSS protection
sf-soql-constraintsQuery safety, selectivity, governor limit compliance
sf-testing-constraints75% coverage minimum, test isolation, assertion requirements
sf-trigger-constraintsOne-trigger-per-object, handler delegation, recursion prevention

Platform Context Skills (3):

SkillActivates When
mcp-server-patternsBuilding MCP servers for Salesforce integration
security-scanScanning Claude Code config for vulnerabilities and misconfigurations
strategic-compactManaging context during long development sessions

Pattern skills (29, listed above) also activate contextually when their domain is relevant.


Hook Profiles

Control which hooks run via the SCC_HOOK_PROFILE environment variable:

ProfileDescription
minimalOnly critical hooks (session start context display)
standardRecommended — session start + pre-tool validation + post-write reminders (default)
strictAll hooks enabled with additional enforcement and stop-hook summaries

Environment Variables

VariableValuesDescription
SCC_HOOK_PROFILEminimal, standard, strictControls which hooks run (default: standard)
SCC_DISABLED_HOOKSComma-separated namesDisable specific hooks (e.g., session-start,auto-format)
SF_ORG_ALIASAny org aliasDefault Salesforce target org for session context
CLAUDE_PACKAGE_MANAGERnpm, pnpm, yarn, bunOverride auto-detected package manager

Tips and Best Practices

Typical Workflows

New Feature: Describe what you want to build — sf-architect activates automatically, designs the solution, and delegates to domain agents (sf-apex-agent, sf-lwc-agent, sf-flow-agent) with TDD.

Bug Fix: Describe the error — sf-bugfix-agent activates, diagnoses root cause, applies minimal fix.

Code Review: Ask to review before deploy — sf-review-agent runs a full quality gate (security, governor limits, test coverage, deploy readiness).

Key Principles

  1. Governor limits are king — Every agent checks for limit violations
  2. Test-first approach — 75% is the SF minimum, aim for 85%+
  3. Be specific — "Review AccountTrigger.cls" not "review everything"
  4. Hook profiles matter — Start with standard, move to strict for CI
  5. Security baked in — CRUD/FLS and sharing model from the start

Documentation

GuideDescription
Hook DevelopmentHow to create, test, and deploy hooks with profile gating
Authoring GuideTemplates for creating agents, skills, and rules
Workflow ExamplesStep-by-step walkthroughs for Apex TDD, LWC dev, deployment, security audit
ArchitectureSystem design overview with diagrams
Token OptimizationSettings and habits to reduce token consumption
Security GuideCRUD/FLS, injection prevention, encryption, session security
TroubleshootingCommon issues and solutions
ChangelogVersion history and release notes

Example Patterns

Production-ready implementations demonstrating Salesforce best practices:

PatternDescription
Apex Trigger HandlerOne-trigger-per-object with virtual base handler
LWC ComponentWire service, Apex calls, Jest tests, meta.xml
Platform Events & CDCReal-time event-driven architecture with empApi
Integration PatternNamed Credentials, retry logic, async callouts
Flow AutomationRecord-Triggered Before Save Flow with XML metadata
Security AuditCRUD/FLS, SOQL injection prevention, sharing model
Agentforce Action@InvocableMethod with structured inputs/outputs
DevOps PipelineGitHub Actions CI/CD with scratch orgs
Scratch Org SetupAutomated org creation and data loading
Visualforce MigrationVF-to-LWC conversion patterns

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Follow the existing file naming convention: lowercase with hyphens.
  2. All agents must have valid YAML frontmatter (name, description, tools, model).
  3. All skills must include a SKILL.md with name, description, and origin: SCC in frontmatter.
  4. Run npm test before submitting a pull request — all CI validators must pass.
  5. Use Conventional Commits format: <type>: <description> (max 100 chars).
  6. Coverage must stay above 80% for lines, functions, branches, and statements.
git clone <repo>
cd salesforce-claude-code
npm install
git config core.hooksPath .githooks   # Enable pre-commit checks
npm test                               # Build + lint + validate + tests
bash scripts/ci/smoke-test.sh          # Pack + install/uninstall smoke test

License

MIT — see LICENSE for details.


Acknowledgements

SCC's plugin architecture was inspired by Everything Claude Code (ECC) by Affaan Mustafa, licensed under the MIT License. Since v1.0.0, SCC is independently maintained with its own roadmap, Salesforce-specific content, and infrastructure.