
dx-code-analyzer-custom-rule-create
Create custom Code Analyzer rules for Regex (pattern matching), PMD
by forcedotcomFree
Description
This agent skill writes custom rules for Salesforce Code Analyzer, for cases where the built-in rules do not cover a team's own standard. It supports three engines. The Regex engine matches text patterns, which suits banning things like System.debug calls, hardcoded record IDs or TODO comments. The PMD engine runs XPath queries against the syntax tree of Apex or metadata XML, for structural checks. The ESLint engine covers custom rules and plugins for Lightning Web Components, JavaScript and TypeScript. The skill is also used to enforce metadata governance, such as API version rules, required field descriptions or dangerous permissions, and to override built-in thresholds like CyclomaticComplexity or ExcessiveParameterList. It can group several rules into shared rulesets, and it helps when a rule that was written does not match what it should. The skill is one of three in a Code Analyzer suite. The other two are dx-code-analyzer-run, for scans and results, and dx-code-analyzer-configure, for setup, configuration and CI/CD. It is published in the forcedotcom sf-skills repository on GitHub.…
Highlights
- Write Regex rules that ban specific patterns
- Write PMD XPath rules for Apex and metadata XML
- Set up ESLint rules for LWC, JavaScript and TypeScript
- Override built-in rule thresholds
- Group custom rules into shared rulesets
Ratings & Reviews
No ratings yet
Be the first to rate dx-code-analyzer-custom-rule-create.
People also visit

dx-code-analyzer-run
Run Salesforce Code Analyzer to scan code for security, performance
trailofbits/semgrep-rule-creator
Create and refine Semgrep rules for vulnerability detection

running-code-analyzer
Run Salesforce Code Analyzer to scan code for security, performance

mantis-researcher
Audits production source code files based on the strategy in workspace/plan.json

qodo-get-rules
Retrieve and apply Qodo coding rules relevant to implementation, planning
dx-code-analyzer-custom-rule-create FAQ
What kinds of rules can it write?
It writes Regex rules for text patterns, PMD rules that use XPath against Apex or metadata XML, and ESLint rules for LWC and JavaScript or TypeScript code.
Can it change the built-in thresholds?
Yes. The skill covers overriding built-in thresholds such as CyclomaticComplexity and ExcessiveParameterList.
Does it run the scans itself?
No. Running scans and reading results is the job of the companion skill dx-code-analyzer-run. Setup and CI/CD work belongs to dx-code-analyzer-configure.
How do I install it?
Run npx skills add https://github.com/forcedotcom/sf-skills --skill dx-code-analyzer-custom-rule-create.
What security audits has it passed?
Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.
What are the best dx-code-analyzer-custom-rule-create alternatives?
Popular alternatives to dx-code-analyzer-custom-rule-create include dx-code-analyzer-run, trailofbits/semgrep-rule-creator and running-code-analyzer. See all dx-code-analyzer-custom-rule-create alternatives













