forcedotcom avatar

Dx Code Analyzer Custom Rule Create

This is the rule authoring companion to the Code Analyzer suite. It walks you through creating custom rules when the built-in set doesn't cover your org's patterns: banning System.debug, catching hardcoded IDs, enforcing metadata standards, or writing XPath queries against the Apex AST. The skill is opinionated about process (always dump the AST before writing XPath, never hand-edit the YAML after the scripts run) because the failure modes are specific and painful. It handles regex rules, PMD rules for Apex and metadata XML, and ESLint setup for LWC. If you're enforcing team-specific guardrails beyond what ships with Code Analyzer, this is the one that gets you there without trial-and-error escaping hell.

skills.sh installs
4.9K
GitHub stars
1.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add forcedotcom/sf-skills --skill dx-code-analyzer-custom-rule-create --agent claude-code

Installs into .claude/skills of the current project.

Files

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

Sponsors

Details

Repository
github.com/forcedotcom/sf-skills
Categories
Backend & APIs, Documentation, Code Review & Quality, Release Management, Debugging
First seen
Jul 14, 2026

More from forcedotcom/sf-skills

All 158
1giuseppe-trisciuoglio avatarreact-patternsgiuseppe-trisciuoglio/developer-kitProvides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boun4.9Kskills.sh installs
2agricidaniel avataradsagricidaniel/claude-adsOperate professional paid advertising across Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, Apple, Amazon, Reddit, Pinterest, Snapchat, and X. Use for acco4.9Kskills.sh installs
3forcedotcom avataromnistudio-integration-procedure-generateforcedotcom/sf-skillsOmniStudio Integration Procedure creation and validation with 110-point scoring. Use this skill when building server-side process orchestrations that combine Da4.8Kskills.sh installs
4tavily-ai avatarextracttavily-ai/skillsExtract content from specific URLs using Tavily's extraction API. Returns clean markdown/text from web pages. Use when you have specific URLs and need their con4.8Kskills.sh installs
5ccheney avatarclean-ddd-hexagonalccheney/robust-skillsProactively apply when designing APIs, microservices, or scalable backend structure. Triggers on DDD, Clean Architecture, Hexagonal, ports and adapters, entitie4.8Kskills.sh installs
6brave avatarweb-searchbrave/brave-search-skillsUSE FOR web search. Returns ranked results with snippets, URLs, thumbnails. Supports freshness filters, SafeSearch, Goggles for custom ranking, pagination. Prim4.7Kskills.sh installs