dx-code-analyzer-custom-rule-create

dx-code-analyzer-custom-rule-create is a skill for Claude Code from forcedotcom/sf-skills. It costs 228 tokens per session (9,630 once invoked), scanned C, original, Apache-2.0.

A rule-authoring tool for Salesforce Code Analyzer, which checks Apex, metadata XML, JavaScript, and TypeScript for patterns your team defines.

In plain words
What is it for?
Use it to write regular-expression, PMD, or ESLint rules that enforce coding standards and metadata governance.
Why use it?
It catches project-specific problems that built-in checks do not cover, such as banned patterns, hardcoded values, or missing metadata details.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the salesforce-code-quality plugin — 4 skills, 1 agent shipped together

Good fit Use it to write regular-expression, PMD, or ESLint rules that enforce coding standards and metadata governance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/forcedotcom/sf-skills/dx-code-analyzer-custom-rule-create
About the project

forcedotcom/sf-skills is a collection of reusable instructions that help AI coding agents build and work with Salesforce applications and platform features. Developers use it for Agentforce agents, Lightning apps, Flow, Apex, SOQL, Lightning Web Components, and related Salesforce configuration. The catalogue entries are the repository’s skills, plugins, commands, MCP servers, and agents for AI tools that support skills.

forcedotcom/sf-skills · 1,201 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add forcedotcom/sf-skills --skill dx-code-analyzer-custom-rule-create
Clone the repo
git clone --depth 1 https://github.com/forcedotcom/sf-skills

Made for: Claude Code.

Or install salesforce-code-quality, the plugin that ships this one along with the rest of its 4 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dx-code-analyzer-custom-rule-create

README.md
[![agentmods](https://agentmods.dev/badge/skills/forcedotcom/sf-skills/dx-code-analyzer-custom-rule-create/github.svg)](https://agentmods.dev/skills/forcedotcom/sf-skills/dx-code-analyzer-custom-rule-create)
Your own site
<a href="https://agentmods.dev/skills/forcedotcom/sf-skills/dx-code-analyzer-custom-rule-create"><img src="https://agentmods.dev/badge/skills/forcedotcom/sf-skills/dx-code-analyzer-custom-rule-create/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dx-code-analyzer-custom-rule-create

Your own site · 80×15
<a href="https://agentmods.dev/skills/forcedotcom/sf-skills/dx-code-analyzer-custom-rule-create"><img src="https://agentmods.dev/badge/skills/forcedotcom/sf-skills/dx-code-analyzer-custom-rule-create.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 228 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,630 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 19 Aug 2026
  • Snyk pass 19 Aug 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00228 $0.09630
Opus 5.5 $0.00091 $0.03852
Sonnet 5.5 $0.00046 $0.01926
Haiku 4.5 $0.00023 $0.00963

Measured 3mo ago against content hash 5c52e68e9bd3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

dx-code-analyzer-custom-rule-create scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/create-pmd-rule.js, scripts/create-regex-rule.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

8. **Cleanup** — delete ALL sample files AND their parent directories (LWC requires a folder per component). Use `rm -rf <directory>`, not just `rm <file>`. Do not leave empty directories or temporary test fixtures in th
plugins/builder/salesforce-code-quality/skills/dx-code-analyzer-custom-rule-create/SKILL.md · 488 lines

How it starts

The opening of the file, as written. The whole thing — 488 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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
  • Setting up custom ESLint rules/plugins for LWC/JavaScript
  • Enforcing metadata governance (API versions, field descriptions, dangerous permissions)
  • Overriding built-in rule thresholds (CyclomaticComplexity, ExcessiveParameterList, etc.)
  • Organizing multiple rules into shared rulesets
  • Iterating on a custom rule that isn't matching correctly

Delegate elsewhere when the user is:

  • Running a scan against existing rules → dx-code-analyzer-run skill
  • Configuring engines, prerequisites, CI/CD → dx-code-analyzer-configure skill
  • Explaining what an existing built-in rule means → dx-code-analyzer-run skill
  • Writing Apex code or tests → generating-apex / running-apex-tests skills

Required Context to Gather First

Ask for or infer:

  • What pattern to catch — what code should be flagged? (If user selected code in their IDE, the selection IS the answer — do not re-ask.)
  • What to allow — any exceptions? (test classes, specific contexts)
  • File scope — which file types? (.cls, .trigger, .js, all?)
  • Severity — how critical? (default: 3/Moderate)

Read the full file on GitHub · 488 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 488 lines · 228 tokens per session scan C 5c52e68e9bd3

Subscribe to this mod's changes

dx-code-analyzer-custom-rule-create is a skill published in the GitHub repository forcedotcom/sf-skills (1,201 stars, last pushed 5d ago), licensed Apache-2.0. It adds 228 tokens to every session and 9,630 once invoked, about $0.0009 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

dx-code-analyzer-custom-rule-create compared with skills from other repositories

dx-code-analyzer-custom-rule-create next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dx-code-analyzer-custom-rule-createforcedotcom/sf-skillsSkill1.2k5d agoApache-2.0C228Claude Code
autoreviewopenclaw/clawhubSkill9.6ktodayMITA17Claude Code, Codex
omh-code-reviewrlaope/oh-my-hermesSkill6.2kyesterdayMITA18Claude Code
agent-teams-simplify-and-hardenLeoYeAI/openclaw-master-skillsSkill2.2k10d agoMITA115Claude Code, Codex
asplos-writing-stylebrycewang-stanford/Awesome-Journal-SkillsSkill1.5k4d agoMITA65Claude Code
revdiff-planumputun/revdiffSkill974todayMITA84Claude Code
re0-mergeLilMGenius/paperthinSkill1.5kyesterdayMITA51Claude Code, Codex