Apex test execution & coverage: disciplined run, score and fix loops for Salesforce tests
Run Apex tests via sf CLI with a 120-point scoring rubric, high-signal rules (SeeAllData=false, 251+ record bulk tests), failure-analysis workflows and test templates
- What
- Run Apex tests via sf CLI with a 120-point scoring rubric, high-signal rules (SeeAllData=false, 251+ record bulk tests), failure-analysis workflows and test templates
- Cost
- Free
- Needs
- access to a Salesforce org (Dev org is free) with permission to run tests, and the sf CLI (≥2.0), plus jq and python3 for the helper script
- Install
- Copy the installer prompt below into your Muse — your agent does the rest.
Curated by Skill Harbor — the official @forcedotcom skill for Apex test execution and coverage analysis: running tests, diagnosing failures, improving coverage, and managing a disciplined test-fix loop for Salesforce code. The workflow goes discover test scope → run the smallest useful set first → analyze (failing methods, exception types, uncovered lines, whether failures mean bad test data, brittle assertions, or broken production logic) → disciplined fix loop → intentional coverage improvement (positive, negative/exception, bulk with 251+ records to cross the 200-record trigger batch boundary, callout/async paths). High-signal rules: default to `SeeAllData=false` for test isolation, every test must assert meaningful outcomes, pair `Test.startTest()` with `Test.stopTest()` for async, never hide flaky org dependencies inside tests. Output format is fixed (what ran → pass/fail summary → coverage → root causes → fix or next-run recommendation), and every run is scored on a 120-point rubric (108+ = strong production-grade confidence, <84 = below standard). Ships with reference files (CLI commands, test patterns, best practices, fix-loop decision tree, mocking and performance guides), test-class templates (basic, bulk, mock callout, data factory, DML mock, StubProvider), and a `parse-test-results.py` hook script for the auto-fix loop. Delegates cleanly: production code to platform-apex-generate, LWC/Jest to experience-lwc-generate, Agentforce testing to agentforce-test. Honest caveats: requires a Salesforce org and the `sf` CLI (≥2.0) with access rights — you bring your own org; it never writes production code (it hands that to the companion generate skill). Apache-2.0. Skill Harbor never reviews the code, review it yourself before use. Discovered via skills.sh.
Version:
Quick answer
Apex test execution and coverage is a free Muse skill for running Apex tests via the sf CLI with a 120-point scoring rubric, high-signal rules like SeeAllData=false and bulk tests with 251 or more records, failure-analysis workflows and test templates. The workflow runs from discovering test scope to running the smallest useful set first, analyzing failures, then a fix loop.
Install
Copy the install package below, then paste it into Muse🧪 Install ran in our test sandbox · Nov 11, 2026📌 Pinned version: commit e5164d9Step 0 — before installing anything: read this install prompt, summarize in a few lines what this build does and what installing it involves, then ask me to confirm before you proceed. Prerequisites: access to a Salesforce org (Dev org is free) with permission to run tests, and the sf CLI (≥2.0), plus jq and python3 for the helper script Install "Apex test execution & coverage: disciplined run, score and fix loops for Salesforce tests" for me. It gives my agent the official Salesforce skill for running Apex tests via `sf apex run test`: scope discovery, smallest-useful-set-first runs, failure analysis (failing methods, exception types, uncovered lines, bad test data vs brittle assertions vs broken logic), disciplined test-fix loops, intentional coverage improvement (positive, negative, 251+ record bulk, callout/async paths), high-signal rules (SeeAllData=false default, meaningful assertions, Test.startTest()/stopTest() pairing), fixed output format, and 120-point scoring of every run — plus test templates and a results-parsing hook script. Delegates production code fixes to platform-apex-generate. Apache-2.0. Repository: https://raw.githubusercontent.com/forcedotcom/sf-skills/e5164d94d7511c00fa02a5b8b60754b2361e178f/plugins/builder/salesforce-development/skills/platform-apex-test-run/SKILL.md Pinned version: install the code at commit e5164d94d7511c00fa02a5b8b60754b2361e178f exactly (Skill Harbor tested this version). Do not substitute a newer version. If this commit is unreachable, stop and tell me. 1. Fetch the SKILL.md file (and any helper files) from the repository path into a temporary folder 2. Safety check: review the SKILL.md and scripts for anything suspicious (unexpected network calls, shell commands, credential harvesting). This repo should contain zero secrets in code, credentials only via the secure vault, allowed hosts declared in the SKILL.md. Verify that holds here; STOP on any red flag and tell me. 3. Install it as a skill: copy SKILL.md and its helper files into the agent's skills directory, in a folder named "platform-apex-test-run". 4. Verify with no network calls: frontmatter valid, files in place. 5. Report what was installed, where, and what I still need to do myself (e.g. authenticate the sf CLI against my org with `sf org login web`, then ask the agent to run and analyze your Apex tests). GitHub is optional: if I have a GitHub account or the gh CLI, you may use it; otherwise public access is fine. Never require it unless it's in the prerequisites above. Rules: don't touch anything outside the temp folder and the install target. If anything looks off, stop and ask me.
Saved to your recent installs. Find it anytime on /connect.
🔒 Security, provenance and what this touches
The install prompt below already includes the vetting steps: your agent follows the community checklist before installing anything with executable code. Want more?
Verification certificate
Dated facts about what was checked for this listing, and how. This is not a safety certification.
- Pinned version
- e5164d9 · 2026-10-13
- Sandbox install test
- Install ran in our test sandbox · Nov 11, 2026
- Creator identity
- Not verified
- Fingerprint watch
- Last checked · Nov 19, 2026 : no change detected in the files linked by this install prompt
- Install prompt analysis
- 2026-10-13 : No commands, network calls, packages, file writes or API keys detected.
Skill Harbor never reviews the code of a listed skill. These are dated facts about the install prompt and our install test, not a safety certification. Review a skill yourself before you install it. How we verify
Questions
How do I install a skill?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the skill up for you — no manual configuration.
Where does my money go?
Straight to the seller. Skill Harbor never processes payments: checkout happens on the seller’s own page, usually Stripe.
What does the ✓ next to a creator’s name mean?
It means we confirmed the identity of the person behind the listing. It says nothing about the code itself — always check a skill before installing it.