Individual skill
dx-code-analyzer-custom-rule-create
Create custom Code Analyzer rules for Regex (pattern matching), PMD (XPath/AST for Apex and metadata XML), and ESLint (LWC/JavaScript/TypeScript). Use when users want to enforce coding standards, ban patterns, detect hardcoded values, govern metadata, or add rules not in the built-in set. TRIGGER when: user says 'create a rule', 'ban System.debug', 'enforce naming convention', 'detect hardcoded IDs', 'custom rule', 'xpath rule', 'regex rule', 'add a PMD rule', 'enforce a policy', 'create a check for', 'flag this pattern', 'make a rule that catches', 'metadata rule', 'check permissions', 'enforce API version', 'eslint rule', 'lwc rule', 'override rule threshold', 'customize complexity', or describes a pattern to enforce. DO NOT TRIGGER when: user wants to run a scan (use dx-code-analyzer-run), configure engines (use dx-code-analyzer-configure), or explain existing rules (use dx-code-analyzer-run).
skills/dx-code-analyzer-custom-rule-create/SKILL.md
Source commit a8a18ce1e4ba12e69b4073eab98ce31bfbd8271e
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 4, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 1,151
- Repository last updated
- Nov 6, 2026
- License
- Apache-2.0
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- engineering Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesSKILL.mdcore · 39,975 bytesassets/pmd-ruleset-template.xmlasset · 877 bytesexamples/metadata-xml-example-fields-api.mddoc · 2,845 bytesexamples/metadata-xml-example-flows.mddoc · 3,008 bytesexamples/metadata-xml-example-permissions.mddoc · 2,830 bytesexamples/metadata-xml-examples.mddoc · 3,778 bytesexamples/regex-examples.mddoc · 4,281 bytesexamples/xpath-examples.mddoc · 5,595 bytesreferences/advanced-pmd-patterns.mddoc · 8,946 bytesreferences/apex-ast-reference.mddoc · 5,102 bytesreferences/eslint-custom-plugins.mddoc · 6,986 bytesreferences/eslint-rules-discovery.mddoc · 7,045 bytesreferences/eslint-tier2-configurable.mddoc · 2,698 bytesreferences/eslint-tier3-custom-plugins.mddoc · 2,863 bytesreferences/metadata-xml-rules.mddoc · 10,600 bytesreferences/regex-rule-schema.mddoc · 7,025 bytesreferences/troubleshooting.mddoc · 11,140 bytesreferences/xpath-patterns-governor-limits.mddoc · 2,728 bytesreferences/xpath-patterns-method-calls.mddoc · 3,006 bytesreferences/xpath-patterns-security.mddoc · 1,768 bytesreferences/xpath-patterns-structure.mddoc · 3,029 bytesreferences/xpath-patterns.mddoc · 7,653 bytesscripts/create-pmd-rule.jsruns · 7,753 bytesscripts/create-regex-rule.jsruns · 8,558 bytes
Read excerpt
# dx-code-analyzer-custom-rule-create: Custom Code Analyzer Rule Authoring
> **Ecosystem:** This skill is part of a 3-skill Code Analyzer suite — `dx-code-analyzer-run` (scans & results) · `dx-code-analyzer-configure` (setup, config, CI/CD) · `dx-code-analyzer-custom-rule-create` (custom rule authoring).
Use this skill when the user needs to **create a custom rule** that enforces a pattern not covered by Code Analyzer's built-in rules. Supports Regex engine (text pattern matching) and PMD engine (structural XPath queries against the AST).
## When This Skill Owns the Task
Use `dx-code-analyzer-custom-rule-create` when the work involves:
- Creating a new custom rule for Code Analyzer (any engine)
- Enforcing team-specific coding standards via static analysis
- Banning specific patterns (System.debug, hardcoded IDs, TODOs)
- Writing XPath expressions for PMD rules (Apex or metadata XML)
- Writing regex patterns for the Regex engine