developer-apex-refactor

Analyze Apex and Salesforce frontend code usage relationships with confidence levels.

2|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/PranavNagrecha/Salesforce-Intelligence --skill developer-apex-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: developer-apex-refactor
Source: https://github.com/PranavNagrecha/Salesforce-Intelligence/tree/main/.claude/skills/developer-apex-refactor
Command: npx skills add https://github.com/PranavNagrecha/Salesforce-Intelligence --skill developer-apex-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sfi, and includes scripts (resource) components.

What problem does it solve?

This Skill provides developers with a detailed analysis of their Apex codebase, allowing for targeted refactoring and understanding of code dependencies.

Core Features & Use Cases

  • Apex Code Analysis: Identifies usages of Apex classes, triggers, and frontend components (LWC, Aura, Visualforce).
  • Code Refactoring: Assists in renaming methods and fields with confidence, reducing the risk of breaking related components.
  • Use Case: Before renaming a method, a developer can use this Skill to see which other Apex classes, components, or Visualforce pages are referencing it, reducing the risk of unintended consequences.

Quick Start

Query the 'sfi.find_code_usages' command with 'CustomField:Account.Industry__c' to see how 'Account.Industry__c' is used across the codebase.

Frequently Asked Questions about developer-apex-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find all references to an Apex class before refactoring my Salesforce code?

To find references before refactoring Apex code, query the codebase to identify usages across Apex classes, triggers, and frontend components like LWC, Aura, and Visualforce. The analysis uses heuristic and declared confidence levels to assess references, reducing the risk of breaking related components.

Can I check how a specific CustomField is used across my Apex and frontend codebase?

Yes, you can check CustomField usage across the codebase by querying the find_code_usages command with the field API name, such as CustomField:Account.Industry__c. This identifies usage relationships across Apex and Salesforce frontend components.

What is the best way to safely rename methods and fields in Salesforce Apex?

The best way to safely rename methods and fields in Apex is to analyze code dependencies first. By identifying usage relationships and assessing references with confidence levels, you can refactor with precision and reduce unintended consequences.

Do I need the sfi tool to analyze Salesforce code dependencies?

Yes, you need the sfi tool to analyze Salesforce code dependencies. Understanding Salesforce metadata structures is also required to accurately assess references and narrow the scope to specific code components during analysis.

Can I narrow the scope of my Apex code analysis to specific components?

Yes, you can narrow the scope of your Apex code analysis to specific code components. The analysis provides options to target specific components, utilizing heuristic and declared confidence levels to assess references precisely.