forcedotcom avatar

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-code

Installs 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 test workflows
  • 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-generate skill
  • testing Agentforce agents → agentforce-test skill
  • 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
1pproenca avatarvitestpproenca/dot-skillsVitest testing framework patterns for test setup, async testing, mocking with vi.*, snapshots, and test performance (formerly test-vitest). This skill should be7.2Kskills.sh installs
2anthropics avatartesting-strategyanthropics/knowledge-work-pluginsDesign test strategies and test plans. Trigger with "how should we test", "test strategy for", "write tests for", "test plan", "what tests do we need", or when 6.7Kskills.sh installs
3analogjs avatarangular-testinganalogjs/angular-skillsWrite unit and integration tests for Angular v20+ applications using Vitest or Jasmine with TestBed and modern testing patterns. Use for testing components with6.6Kskills.sh installs
4affaan-m avatartdd-workflowaffaan-m/eccUse this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and6.4Kskills.sh installs
5testdino-hq avatarplaywright-skilltestdino-hq/playwright-skillBattle-tested Playwright patterns for writing, debugging, and scaling reliable test suites. Use when you need guidance for E2E, API, component, visual, accessib6.2Kskills.sh installs
6affaan-m avatargolang-testingaffaan-m/eccGo testing patterns including table-driven tests, subtests, benchmarks, fuzzing, and test coverage. Follows TDD methodology with idiomatic Go practices.6.2Kskills.sh installs