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.
npx agentmods add skills/forcedotcom/sf-skills/dx-code-analyzer-custom-rule-createnpx skills add forcedotcom/sf-skills --skill dx-code-analyzer-custom-rule-creategit clone --depth 1 https://github.com/forcedotcom/sf-skillsWrote 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.
[](https://agentmods.dev/skills/forcedotcom/sf-skills/dx-code-analyzer-custom-rule-create)<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="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00228 | $0.09630 |
| Opus 5 | $0.00114 | $0.04815 |
| Sonnet 5 | $0.00046 | $0.01926 |
| Haiku 4.5 | $0.00023 | $0.00963 |
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 2d ago.
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 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-runskill - Configuring engines, prerequisites, CI/CD →
dx-code-analyzer-configureskill - Explaining what an existing built-in rule means →
dx-code-analyzer-runskill - Writing Apex code or tests →
generating-apex/running-apex-testsskills
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)
What ships with it
23 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assets/pmd-ruleset-template.xml 877 B
- examples/metadata-xml-example-fields-api.md 2.8 KB
- examples/metadata-xml-example-flows.md 2.9 KB
- examples/metadata-xml-example-permissions.md 2.8 KB
- examples/metadata-xml-examples.md 3.7 KB
- examples/regex-examples.md 4.2 KB
- examples/xpath-examples.md 5.5 KB
- references/advanced-pmd-patterns.md 8.7 KB
- references/apex-ast-reference.md 5.0 KB
- references/eslint-custom-plugins.md 6.8 KB
- references/eslint-rules-discovery.md 6.9 KB
- references/eslint-tier2-configurable.md 2.6 KB
- references/eslint-tier3-custom-plugins.md 2.8 KB
- references/metadata-xml-rules.md 10 KB
- references/regex-rule-schema.md 6.9 KB
- references/troubleshooting.md 11 KB
- references/xpath-patterns-governor-limits.md 2.7 KB
- references/xpath-patterns-method-calls.md 2.9 KB
- references/xpath-patterns-security.md 1.7 KB
- references/xpath-patterns-structure.md 3.0 KB
- references/xpath-patterns.md 7.5 KB
- scripts/create-pmd-rule.js 7.6 KB runs code
- scripts/create-regex-rule.js 8.4 KB runs code
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.
- 2d ago First seen · 488 lines · 228 tokens per session scan C 5c52e68e9bd3
dx-code-analyzer-custom-rule-create is a skill published in the GitHub repository forcedotcom/sf-skills (964 stars, last pushed yesterday), licensed Apache-2.0. It adds 228 tokens to every session and 9,630 once invoked, about $0.0011 per session on Opus 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.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…
chronicle
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…
imagegen
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…