agentleFS
vhmarquezvhmarquez/argo/skills/field-impact/SKILL.md

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.

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
  1. Very specific:

    Read ${CLAUDE_PLUGIN_DATA}/argo/org-cache/<org>.json if present

    line 29
  2. Very specific:

    If absent, run sf_cli_describe <Object> <ORG> and extract field list

    line 30
  3. Distinctive:

    If the field doesn't exist, warn but continue with source-only search

    line 31
  4. Very specific:

    Be precise about false positives: When grepping by bare field name, the result may include unrelated symbols.

    line 120
  5. Very specific:

    No string assertEquals on field name: Don't bother flagging test class assertions — they're real references but not interesting for …

    line 122
  6. Distinctive:

    Time-bound the org-side queries: If the FieldDefinition query times out (large orgs), report the partial result and continue — don't fail …

    line 123

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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>.json if 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.

MetadataPatternPath 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 HTMLrecord\.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 referencesforce-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-found is passed (then 1 if any references)

5. Exit codes

  • 0 — informational mode (default), or --fail-if-found and no references found
  • 1 — --fail-if-found and 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 assertEquals on 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.