sf-eval
Skill17 starsChanged 9 months agoApache-2.0View on GitHub
Evaluate and benchmark Salesforce skill quality. Compares AI-generated code with vs without skill context, scores against a Salesforce-specific rubric (security, governor limits, bulkification, patterns, completeness), and produces a comparison report. Use to run benchmarks, verify skill value, or check Apex code quality. Activate on mentions of "evaluate skills", "benchmark", "skill quality", "run eval", or "compare with/without skills".
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- sf-agentforceSkill
- sf-apexSkill
- sf-dataSkill
- sf-debugSkill
- sf-deploySkill
- sf-diagramSkill
- sf-docsSkill
- sf-findSkill
- sf-flowSkill
- sf-integrationSkill
- sf-lwcSkill
- sf-omnistudioSkill
- sf-permissionsSkill
- sf-schemaSkill
- sf-securitySkill
- sf-soqlSkill
- sf-testSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
When user says /sf-eval or /sf-eval <task-id>:
- Very specific: line 30
Read available tasks from evals/benchmarks/tasks.json
- Very specific: line 37
Read the relevant skill file at skills/<skill>/SKILL.md and its references.
- Very specific: line 40
Read the rubric at evals/benchmarks/rubric.md and the judge prompt at evals/benchmarks/judge-prompt.md.
- Distinctive: line 78
If running all tasks, produce a summary table at the end:
- Very specific: line 92
Run bash evals/checks/static-checks.sh <file> and show the results.
- Distinctive: line 95
When user provides their own code and asks to evaluate it:
- Very specific: line 101
Read evals/benchmarks/tasks.json for the full list.
- Distinctive: line 119
When generating the "baseline" (no skills) code, you MUST intentionally produce typical generic LLM output:
- Very specific: line 120
Use public class (no with sharing)
- Distinctive: line 123
Put logic directly in the trigger body (no handler)
- Distinctive: line 126
Use basic patterns without Salesforce-specific optimizations
- Very specific: line 138
Read tasks.json and rubric.md
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Salesforce Skills Evaluator
You evaluate whether Salesforce skills improve AI-generated code quality. You do this by comparing code generated with vs without skill context and scoring both.
Eval Modes
Mode 1: Run Benchmark Task(s)
When user says /sf-eval or /sf-eval <task-id>:
- Read available tasks from
evals/benchmarks/tasks.json For each task (or the specified one):
Step A — Generate Baseline (no skill context): Generate Salesforce code for the task prompt AS IF you had no Salesforce skill knowledge. Produce typical LLM output — functional but likely missing Salesforce-specific best practices. Do NOT use
WITH USER_MODE, do NOT use trigger handler patterns, do NOT usestripInaccessibleunless the prompt explicitly asks for it. Write code the way a generic AI would.Step B — Generate With Skills: Read the relevant skill file at
skills/<skill>/SKILL.mdand its references. Then generate code following ALL the skill's rules, patterns, and gotchas strictly.Step C — Score Both: Read the rubric at
evals/benchmarks/rubric.mdand the judge prompt atevals/benchmarks/judge-prompt.md. Score each output on 5 categories (0-5 each):Category What to check Security WITH USER_MODE, stripInaccessible, with sharing, no injection, no hardcoded creds Governor Limits No SOQL/DML in loops, uses Map/Set collections, efficient queries Bulkification Handles 200+ records, uses collections, no Trigger.new[0] Patterns Trigger handler, service/selector layers, naming conventions Completeness Requirements met, edge cases, error handling, production-ready Step D — Output Report: Format as a comparison table:
## Task: <task-id> **Prompt**: <prompt text> ### Baseline (No Skills) — X/25 | Category | Score | Reason | |----------|-------|--------| | Security | X/5 | ... | | Governor Limits | X/5 | ... | | Bulkification | X/5 | ... | | Patterns | X/5 | ... | | Completeness | X/5 | ... | ### With Skills — X/25 | Category | Score | Reason | |----------|-------|--------| | Security | X/5 | ... | | Governor Limits | X/5 | ... | | Bulkification | X/5 | ... | | Patterns | X/5 | ... | | Completeness | X/5 | ... | ### Improvement: +X points (+XX%)- If running all tasks, produce a summary table at the end:
## Summary | Task | Baseline | With Skills | Delta | |------|----------|-------------|-------| | ... | X/25 | X/25 | +X | | **Average** | **X/25** | **X/25** | **+X (+XX%)** | - Save the full report to
evals/benchmarks/results/BENCHMARK.md
Mode 2: Static Check
When user says /sf-eval --check <file> or /sf-eval check <file>:
Run bash evals/checks/static-checks.sh <file> and show the results.
Mode 3: Score Custom Code
When user provides their own code and asks to evaluate it:
Score the code against the rubric (same 5 categories, 25 points) and provide improvement suggestions referencing the relevant skill.
Available Benchmark Tasks
Read evals/benchmarks/tasks.json for the full list. Tasks cover:
apex-trigger-bulk— Trigger with handler pattern and bulkificationapex-batch-cleanup— Batch Apex with error handlingapex-rest-api— REST endpoint with securityapex-callout-service— Named Credentials + Queueabletest-trigger-handler— Comprehensive test classtest-callout-mock— HttpCalloutMock patternssoql-complex-query— Aggregate + optimizationsoql-dynamic-search— Dynamic SOQL without injectionlwc-record-list— LWC with LDS + error statesflow-opportunity-automation— Flow XML with bypasssecurity-audit-apex— Fix security violationsschema-custom-object— Metadata XML generationdeploy-cicd-pipeline— GitHub Actions for SFdata-migration-plan— Bulk API + relationshipsapex-platform-events— Event-driven architecture
Critical Rules for Baseline Generation
When generating the "baseline" (no skills) code, you MUST intentionally produce typical generic LLM output:
- Use
public class(nowith sharing) - Skip
WITH USER_MODEin SOQL - Skip
stripInaccessibleon DML - Put logic directly in the trigger body (no handler)
- May have SOQL inside simple loops
- Skip null checks and error handling
- Use basic patterns without Salesforce-specific optimizations
This is NOT about writing bad code on purpose — it's about writing code the way a generic AI would without Salesforce domain expertise. The baseline should be functional but miss platform-specific best practices.
References
- Benchmark Tasks — 15 evaluation tasks
- Scoring Rubric — 25-point quality rubric
- Judge Prompt — LLM scoring instructions
- Static Checks — automated code pattern checks
Workflow
- Identify eval mode (benchmark, static check, or custom code)
- Read tasks.json and rubric.md
- Generate baseline and with-skills code
- Score both against rubric
- Output formatted comparison report
- Save to evals/benchmarks/results/BENCHMARK.md if running full benchmark
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

