Sf Testing
Jaganpro/sf-skills
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring.
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring.
$ npx skills add forcedotcom/sf-skills --skill platform-apex-test-run -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install forcedotcom/sf-skills platform-apex-test-run --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/platform-apex-test-run .claude/skills/platform-apex-test-run && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "platform-apex-test-run" agent skill from https://github.com/forcedotcom/sf-skills/tree/main/skills/platform-apex-test-run into .claude/skills/platform-apex-test-run/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "platform-apex-test-run", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/forcedotcom/sf-skills/tree/main/skills/platform-apex-test-runType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add forcedotcom/sf-skills --skill platform-apex-test-run -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install forcedotcom/sf-skills platform-apex-test-run --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/platform-apex-test-run .agents/skills/platform-apex-test-run && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "platform-apex-test-run" agent skill from https://github.com/forcedotcom/sf-skills/tree/main/skills/platform-apex-test-run into .agents/skills/platform-apex-test-run/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "platform-apex-test-run", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add forcedotcom/sf-skills --skill platform-apex-test-run -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install forcedotcom/sf-skills platform-apex-test-run --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/platform-apex-test-run .cursor/skills/platform-apex-test-run && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "platform-apex-test-run" agent skill from https://github.com/forcedotcom/sf-skills/tree/main/skills/platform-apex-test-run into .cursor/skills/platform-apex-test-run/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "platform-apex-test-run", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/forcedotcom/sf-skills.git --path skills/platform-apex-test-run--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add forcedotcom/sf-skills --skill platform-apex-test-run -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install forcedotcom/sf-skills platform-apex-test-run --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/platform-apex-test-run .gemini/skills/platform-apex-test-run && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "platform-apex-test-run" agent skill from https://github.com/forcedotcom/sf-skills/tree/main/skills/platform-apex-test-run into .gemini/skills/platform-apex-test-run/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "platform-apex-test-run", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install forcedotcom/sf-skills platform-apex-test-runInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add forcedotcom/sf-skills --skill platform-apex-test-run -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/platform-apex-test-run .github/skills/platform-apex-test-run && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "platform-apex-test-run" agent skill from https://github.com/forcedotcom/sf-skills/tree/main/skills/platform-apex-test-run into .github/skills/platform-apex-test-run/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "platform-apex-test-run", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add forcedotcom/sf-skills --skill platform-apex-test-run -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install forcedotcom/sf-skills platform-apex-test-run --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/platform-apex-test-run .opencode/skills/platform-apex-test-run && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "platform-apex-test-run" agent skill from https://github.com/forcedotcom/sf-skills/tree/main/skills/platform-apex-test-run into .opencode/skills/platform-apex-test-run/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "platform-apex-test-run", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
platform-apex-test-runApex test execution, coverage analysis, and test-fix loops with 120-point scoring.
Platform Apex Test Run is an agent skill from forcedotcom/sf-skills. Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use agentforce-test), or Jest/LWC tests (use experience-lwc-generate).
Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 17 other files, including scripts, reference files and assets (for example `README.md`, `references/cli-commands.md` and `references/mocking-patterns.md`).
It sits in Testing & QA, covering Unit testing, Test coverage and Failing and flaky tests. It works with Salesforce and Jest. The repository describes itself as: Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools. The licence is Apache-2.0.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit e5164d9. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
sfFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Platform Apex Test Run loads about 1.9k tokens when it runs, and up to ~14k if it reads all its reference files. Until then it costs about 100 tokens; SKILL.md has 751 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from forcedotcom/sf-skills at commit e5164d9, republished under its Apache-2.0 licence (© forcedotcom). 751 words, ~1,876 tokens.
.claude/skills/platform-apex-test-run/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.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.
Use platform-apex-test-run when the work involves:
sf apex run test workflowsDelegate elsewhere when the user is:
platform-apex-generate skillagentforce-test skillAsk for or infer:
Identify:
Start narrow when debugging a failure; widen only after the fix is stable.
Focus on:
When the issue is code or test quality:
platform-apex-generate skill when neededCover:
| Rule | Rationale |
|---|---|
Default to SeeAllData=false | Ensures test isolation; prevents reliance on org-specific data |
| Every test must assert meaningful outcomes | Tests with no assertions prove nothing and give false confidence |
| Test bulk behavior with 251+ records | Triggers process in batches of 200; 251 records crosses the boundary |
Use factories / @TestSetup when they improve clarity | Consistent data creation in one place; rolled back between test methods |
Pair Test.startTest() with Test.stopTest() for async | Ensures async operations (queueable, future) complete before assertions |
| Do not hide flaky org dependencies inside tests | Prevents intermittent failures tied to org state |
| Issue | Resolution |
|---|---|
| Test passes locally but fails in CI org | Check for SeeAllData=true or undeclared dependencies on org-specific records |
| Coverage drops unexpectedly after refactor | Run focused class-level tests first, then widen to RunLocalTests to confirm |
| "Uncommitted work pending" error in callout test | DML and HTTP callouts cannot be mixed in the same test context without Test.startTest() wrapping |
| Mock not taking effect in test | Ensure Test.setMock() is called before the code that makes the callout |
@TestSetup data missing in test method | @TestSetup data is committed per test method — re-query it; do not store in static variables |
| API version 67.0 and higher without necessary access level checks | Check failing SOQL/DML stack traces for CRUD/FLS access errors, using System.runAs with an assigned permission set when user-mode behavior is intended, or documenting a justified SYSTEM_MODE path when system access is required |
When finishing, report in this order:
Suggested shape:
Test run: <scope>
Org: <alias>
Result: <passed / partial / failed>
Coverage: <percent / key classes>
Issues: <highest-signal failures>
Next step: <fix class, add test, rerun scope, or widen regression>| Need | Delegate to | Reason |
|---|---|---|
| Fix production code or author test classes | platform-apex-generate skill | Code generation and repair |
| Create bulk / edge-case test data | platform-data-manage | Realistic test datasets |
| Deploy updated tests to org | platform-metadata-deploy | Deployment workflows |
| Inspect detailed runtime logs | platform-apex-logs-debug | Deeper failure analysis |
| File | When to read |
|---|---|
references/cli-commands.md | All sf apex run test command flags, output formats, async execution, and coverage commands |
references/test-patterns.md | Test class templates — basic, bulk (251+), mock callout, and data factory patterns |
references/testing-best-practices.md | Core testing principles — AAA pattern, naming conventions, bulk, negative, and mock strategies |
references/test-fix-loop.md | Agentic test-fix loop implementation and failure analysis decision tree |
references/mocking-patterns.md | HttpCalloutMock, DML mocking, StubProvider, and selector mocking patterns |
references/performance-optimization.md | Techniques to reduce test execution time — DML mocking, SOQL mocking, loop optimizations |
assets/basic-test.cls | Template: standard test class with @TestSetup, positive / negative / bulk / edge-case methods |
assets/bulk-test.cls | Template: bulk test with 251+ records that crosses the 200-record trigger batch boundary |
assets/mock-callout-test.cls | Template: HTTP callout mock using HttpCalloutMock |
assets/test-data-factory.cls | Template: reusable TestDataFactory with create and insert helpers |
assets/dml-mock.cls | Template: IDML interface + DMLMock implementation for database-free unit tests |
assets/stub-provider-example.cls | Template: StubProvider-based dependency injection stub |
scripts/parse-test-results.py | Post-tool hook — parses sf apex run test JSON output and formats failures for the auto-fix loop |
| Score | Meaning |
|---|---|
| 108+ | strong production-grade test confidence |
| 96–107 | good test suite with minor gaps |
| 84–95 | acceptable but strengthen coverage / assertions |
| < 84 | below standard; revise before relying on it |
© forcedotcom, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 14 other files (scripts, references, assets) in skills/platform-apex-test-run of forcedotcom/sf-skills.
Open the folder on GitHubat commit e5164d9
Platform Apex Test Run next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Platform Apex Test Run this skillforcedotcom/sf-skills | 1.1k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Sf TestingJaganpro/sf-skills | 424 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Test Guidelinesgetsentry/sentry-react-native | 1.8k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Designing TestsCloudAI-X/claude-workflow-v2 | 1.4k | 1 repos | ~1.5k | Automated safety check: Pass | MIT | |
| Caliber Testingcaliber-ai-org/ai-setup | 1.3k | — | ~3.2k | Automated safety check: Pass | MIT | |
| Write Testsgrafana/synthetic-monitoring-app | 171 | — | ~1.2k | Automated safety check: Pass | AGPL-3.0 |
Jaganpro/sf-skills
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring.
getsentry/sentry-react-native
Enforce Sentry React Native SDK test conventions for naming, structure, mocking, and fixtures with Jest.
CloudAI-X/claude-workflow-v2
Designs and implements testing strategies for any codebase. An agent skill from CloudAI-X/claude-workflow-v2.
caliber-ai-org/ai-setup
Writes Vitest tests following project patterns: tests/ directories, vi.mock() for module mocking with vi.hoisted() for test-time factories, global LLM mock from src/test/setup.ts, environment…
grafana/synthetic-monitoring-app
Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.
chongdashu/vibejam-starter-pack
Plan, implement, and debug frontend tests: unit/integration/E2E/visual/a11y.
forcedotcom/sf-skills
Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins.
forcedotcom/sf-skills
Data Cloud 360° view of a single Agentforce session. An agent skill from forcedotcom/sf-skills.
forcedotcom/sf-skills
Apply a Salesforce sandbox post-copy automation JSON config against a target org.
forcedotcom/sf-skills
Apply a Salesforce sandbox post-copy automation JSON config against a target org.
forcedotcom/sf-skills
Apply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons.
forcedotcom/sf-skills
Lightning Web Components with PICKLES methodology and 165-point scoring.
Works with
Categories
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Platform Apex Test Run is an agent skill from forcedotcom/sf-skills. Apex test execution, coverage analysis, and test-fix loops with 120-point scoring.
Platform Apex Test Run fits situations like: the user runs Apex tests; checks code coverage; fixes failing tests; touches Test.cls / Test.cls files.
Run `npx skills add forcedotcom/sf-skills --skill platform-apex-test-run -a claude-code`. Or copy the skill folder (skills/platform-apex-test-run in forcedotcom/sf-skills) into .claude/skills/platform-apex-test-run in your project. Claude Code loads it when a task matches its description.
Run `npx skills add forcedotcom/sf-skills --skill platform-apex-test-run -a codex`. Or copy the skill folder (skills/platform-apex-test-run in forcedotcom/sf-skills) into .agents/skills/platform-apex-test-run in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add forcedotcom/sf-skills --skill platform-apex-test-run -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/platform-apex-test-run, .gemini/skills/platform-apex-test-run, .github/skills/platform-apex-test-run and .opencode/skills/platform-apex-test-run in your project.
Going by SKILL.md and its folder, Platform Apex Test Run needs Python for the scripts in its folder and the command-line tools its instructions call (sf). Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Platform Apex Test Run is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Platform Apex Test Run: Sf Testing (Jaganpro/sf-skills, 424 stars), Test Guidelines (getsentry/sentry-react-native, 1.8k stars), Designing Tests (CloudAI-X/claude-workflow-v2, 1.4k stars) and Caliber Testing (caliber-ai-org/ai-setup, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
forcedotcom (a GitHub organization) maintains it in forcedotcom/sf-skills, which has 1,060 GitHub stars. The repository holds 251 skills in this directory. The repository was last updated on October 7, 2026.
Source: forcedotcom/sf-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.