
Platform Apex Test Run
This handles Apex test execution and the full test-fix cycle: running tests, parsing coverage, diagnosing failures, and looping until things pass. It knows when to run a single class versus local tests, enforces disciplined patterns like SeeAllData=false and 251-record bulk tests, and reports results in a structured format with root cause and next steps. The skill includes templates for mocks, data factories, and a Python script that parses test JSON for automated fix loops. It deliberately stays in its lane, handing off production code changes to platform-apex-generate and agent testing to agentforce-test. The 120-point scoring system gives you a quick read on test quality. Useful when coverage drops after a refactor or CI starts failing on tests that passed locally.
- skills.sh installs
- 7.2K
- GitHub stars
- 1.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add forcedotcom/sf-skills --skill platform-apex-test-run --agent claude-codeInstalls into .claude/skills of the current project.
Files
platform-apex-test-run: Salesforce Test Execution & Coverage Analysis
Use this skill when the user needs Apex test execution and failure analysis: running tests, checking coverage, interpreting failures, improving coverage, and managing a disciplined test-fix loop for Salesforce code.
When This Skill Owns the Task
Use platform-apex-test-run when the work involves:
sf apex run testworkflows- Apex unit-test failures
- code coverage analysis
- identifying uncovered lines and missing test scenarios
- structured test-fix loops for Apex code
Delegate elsewhere when the user is:
- writing or refactoring production Apex →
platform-apex-generateskill - testing Agentforce agents →
agentforce-testskill - testing LWC with Jest → experience-lwc-generate
Required Context to Gather First
Ask for or infer:
- target org alias
- desired test scope: single class, specific methods, suite, or local tests
- coverage threshold expectation
- whether the user wants diagnosis only or a test-fix loop
- whether related test data factories already exist
Recommended Workflow
Sponsors
Details
- Repository
- github.com/forcedotcom/sf-skills
- Categories
- Testing & QA, Documentation, AI & Agent Building, Debugging
- First seen
- Jul 14, 2026
More from forcedotcom/sf-skills
All 158- Platform Apex Logs Debug7.1K
- Platform Soql Query7.1K
- Platform Metadata Deploy7K
- Platform Metadata Retrieve6.9K
- Platform Custom Field Generate6.8K
- Platform Docs Get6.8K
- Platform Permission Set Generate6.8K
- Dx Code Analyzer Run6.7K
- Platform Custom Object Generate6.6K
- Automation Flow Generate6.5K
- Experience Lwc Generate6.4K
- Platform Validation Rule Generate6.3K
- Platform Data Manage6.3K
- Dx Org Manage6.2K
- Platform Flexipage Generate6.2K
- Platform Metadata Api Context Get6.2K
- Platform Sharing Rules Generate6.2K
- Design Systems Slds Apply6.1K
- Design Systems Slds Validate6K
- Agentforce Generate6K
- Platform Custom Tab Generate6K
- Dx Code Analyzer Configure5.9K
- Platform Custom Application Generate5.9K
- Platform List View Generate5.9K