field-impact
Skill1 starsChanged 7 months agoMITView on GitHub
Find all references to a Salesforce field across LWC, Apex, layouts, validation rules, formula fields, Flows, and reports. Use before deleting or renaming a field, or when assessing the blast radius of a field-level change.
In this repository53 other files it gives its agents.
- templates/CLAUDE.mdCLAUDE.md
- adrSkill
- agent-deploySkill
- agent-discoverSkill
- agent-eval-trendSkill
- agent-exchange-listSkill
- agent-specSkill
- agent-testSkill
- agent-vs-flow-vs-apexSkill
- before-vs-after-triggerSkill
- code-reviewSkill
- complexitySkill
- coverage-trendSkill
- dead-codeSkill
- dependency-graphSkill
- deploySkill
- destructive-changesSkill
- diff-deploySkill
- erdSkill
- flaky-test-finderSkill
- flow-auditSkill
- flow-vs-apexSkill
- fls-auditSkill
- gateway-configSkill
- generate-docsSkill
- limit-usageSkill
- lwc-vs-reactSkill
- mcp-tool-vs-restSkill
- notifySkill
- onboardSkill
- org-diffSkill
- org-exploreSkill
- package-versionSkill
- pattern-packSkill
- perf-reviewSkill
- permset-auditSkill
- pr-prepareSkill
- queueable-vs-batchSkill
- quick-deploySkill
- react-initSkill
- release-notesSkill
- scratch-orgSkill
- security-scanSkill
- sequence-diagramSkill
- sf-initSkill
- sharing-reviewSkill
- slack-agentSkill
- soql-analyzerSkill
- test-coverageSkill
- test-dataSkill
- test-planSkill
- trust-evalSkill
- trust-layer-auditSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Read ${CLAUDE_PLUGIN_DATA}/argo/org-cache/<org>.json if present
- Very specific: line 30
If absent, run sf_cli_describe <Object> <ORG> and extract field list
- Distinctive: line 31
If the field doesn't exist, warn but continue with source-only search
- Very specific: line 120
Be precise about false positives: When grepping by bare field name, the result may include unrelated symbols.
- Very specific: line 122
No string
assertEqualson field name: Don't bother flagging test class assertions — they're real references but not interesting for … - Distinctive: line 123
Time-bound the org-side queries: If the FieldDefinition query times out (large orgs), report the partial result and continue — don't fail …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are computing the blast radius for a field change. The user asks "who depends on Account.Custom_Field__c?" and you answer with a structured report grouped by metadata type.
Read Project Config First
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/config.sh"
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/sf-cli.sh"
LWC_SRC="$(sf_config_get '.paths.lwcSource' "$ENV")"
APEX_SRC="$(sf_config_get '.paths.apexSource' "$ENV")"Input
$ARGUMENTS: required.
<Object>.<Field>— full reference (e.g.,Account.Risk_Score__c)<Field>— bare field; the skill greps without object qualifier (less precise)--target-org <alias>/--env <name>— for org-side checks (formula references, etc.)--ci/--format json|sarif/--out <path>
Steps
1. Validate the field exists (if --target-org/cache available)
- Read
${CLAUDE_PLUGIN_DATA}/argo/org-cache/<org>.jsonif present - If absent, run
sf_cli_describe <Object> <ORG>and extract field list - If the field doesn't exist, warn but continue with source-only search
2. Search source by metadata type
For each metadata type, define a search and capture file + line + snippet. Use Grep (ripgrep-backed) for speed.
| Metadata | Pattern | Path glob |
| Apex | \.<Field>\b and '<Field>' (string) | {paths.apexSource}/**/*.cls, **/*.trigger |
| LWC JS | <Field> (within fields: arrays, string queries, template selectors) | {paths.lwcSource}/**/*.js |
| LWC HTML | record\.fields\.<Field> | {paths.lwcSource}/**/*.html |
| Page Layouts | <fullName>.*\.<Field></fullName> | force-app/**/layouts/*.layout-meta.xml |
| Validation Rules | <Field> in <errorConditionFormula> or <formula> | force-app/**/objects/<Object>/validationRules/*.validationRule-meta.xml |
| Formula Fields | <formula> containing <Field> | force-app/**/objects/<Object>/fields/*.field-meta.xml |
| Flows | <elementReference> containing <Field> | force-app/**/flows/*.flow-meta.xml |
| Reports | <column> or <filter> containing <Field> | force-app/**/reports/**/*.report-meta.xml |
| Email Templates | {!<Object>.<Field>} | force-app/**/email/**/*.email-meta.xml |
| Permission Sets | <field>...<Field></field> | force-app/**/permissionsets/*.permissionset-meta.xml |
| Profiles | <field>...<Field></field> | force-app/**/profiles/*.profile-meta.xml |
| Custom Metadata | <Field> value references | force-app/**/customMetadata/*.md-meta.xml |
For the bare <Field> form (no object qualifier), prefix matches with the object name to reduce false positives — but warn the user that some references may be missed if the field is referenced as a string.
3. Org-side queries (optional, if --target-org)
# Formula fields on OTHER objects that reference this field
sf_cli_query "
SELECT EntityDefinition.QualifiedApiName, QualifiedApiName, FormulaDescription
FROM FieldDefinition
WHERE FormulaDescription LIKE '%<Object>.<Field>%'
" "$ORG"
# Flow definitions referencing this field (best-effort; relies on flow XML being in source)
# (skipped — covered by source search)4. Output
Default Markdown:
# Field Impact: Account.Risk_Score__c
Run at: 2026-04-28T11:00:00Z
Field exists in target org: ✅ (custom number, length 18, scale 2)
Total references: 17
## Apex (5)
- `force-app/main/default/classes/AccountController.cls:42` — `acct.Risk_Score__c`
- ...
## LWC JS (3)
- `force-app/main/default/lwc/acmeAcctRisk/acmeAcctRisk.js:12` — `'Account.Risk_Score__c'`
- ...
## LWC HTML (1)
- `force-app/main/default/lwc/acmeAcctRisk/acmeAcctRisk.html:8` — `record.fields.Risk_Score__c.value`
## Page Layouts (4)
- ...
## Validation Rules (1)
- `force-app/main/default/objects/Account/validationRules/Block_Negative_Risk.validationRule-meta.xml`
## Formula Fields (1)
- `Account.Risk_Tier__c` (formula on the same object) — references `Risk_Score__c`
## Flows (2)
- `Account_Risk_Set` — uses Risk_Score__c in a decision element
- ...
## Reports (0)
None in source. (Reports may live only in setup if not source-tracked.)
## Org-only (formula fields on other objects)
- `Opportunity.Account_Risk__c` (formula `Account.Risk_Score__c`)CI JSON / SARIF:
- Each reference becomes one finding with
ruleId: "FIELD-IMPACT",severity: "note", file/line populated, message describes the metadata type - Exit 0 always (this is informational, not a check) unless
--fail-if-foundis passed (then 1 if any references)
5. Exit codes
- 0 — informational mode (default), or
--fail-if-foundand no references found - 1 —
--fail-if-foundand references exist - 2 — query/setup error
Rules
- Be precise about false positives. When grepping by bare field name, the result may include unrelated symbols. Always prefix the match with
<Object>.when checking Apex. Note any unresolvable matches in a "Possible matches" section - Skip generated files.
package.xml, deployment manifests, log files - No string
assertEqualson field name. Don't bother flagging test class assertions — they're real references but not interesting for impact analysis. Group them in a "Tests (n)" section without per-line detail - Time-bound the org-side queries. If the FieldDefinition query times out (large orgs), report the partial result and continue — don't fail the whole run
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

