From jaganpro-sf-skills-7
Executes Salesforce Apex tests via sf CLI, analyzes coverage and failures, improves tests, and manages scored test-fix loops for unit testing.
npx claudepluginhub jaganpro/sf-skillsThis skill uses the workspace's default tool permissions.
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.
CREDITS.mdREADME.mdassets/basic-test.clsassets/bulk-test.clsassets/dml-mock.clsassets/mock-callout-test.clsassets/stub-provider-example.clsassets/test-data-factory.clshooks/scripts/parse-test-results.pyreferences/cli-commands.mdreferences/mocking-patterns.mdreferences/performance-optimization.mdreferences/test-fix-loop.mdreferences/test-patterns.mdreferences/testing-best-practices.mdGenerates and reviews Salesforce Apex code for classes, triggers, test classes, batch/queueable/schedulable jobs with 150-point scoring. For .cls/.trigger files.
Enforces Salesforce Apex quality guardrails: bulk-safety (no SOQL/DML in loops), sharing declarations, CRUD/FLS security, SOQL injection prevention, PNB test coverage. Use for reviewing or generating classes, triggers, batches, tests.
Set up Salesforce CI/CD pipelines with GitHub Actions, SFDX deployments, JWT auth, and Apex testing. For automating metadata validation and tests in Salesforce repos.
Share bugs, ideas, or general feedback.
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 sf-testing when the work involves:
sf apex run test workflowsDelegate elsewhere when the user is:
Ask 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:
Cover:
SeeAllData=false@TestSetup when they improve clarity and speedTest.startTest() with Test.stopTest() when async behavior mattersWhen 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 tests | sf-apex | code generation and repair |
| create bulk / edge-case data | sf-data | realistic test datasets |
| deploy updated tests | sf-deploy | rollout |
| inspect detailed runtime logs | sf-debug | deeper failure analysis |
| 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 |