We hear a lot about “anti-patterns” and “technical debt”. In this article, I’d like to focus on what these terms mean and what their implications are, as well as how to address them to optimize your Salesforce orgs and your CRM team’s performance.
Unfortunately, technical debt is one of the most persistent and underestimated risks in Salesforce environments. Unlike obvious failures, technical debt rarely breaks an org overnight. Instead, it accumulates silently – slowing delivery, increasing defects, and making even simple enhancements unexpectedly complex.
Most Salesforce teams don’t intentionally create technical debt. It emerges from reasonable short-term decisions: tight deadlines, partial requirements, tactical workarounds, or inconsistent design choices. Over time, those decisions compound. Understanding how technical debt forms and how to detect it early is critical to maintaining org health, performance, and long-term CRM ROI.
Definitions: Technical Debt vs. Anti-Patterns
First, let’s define the term technical debt: it is the future cost of choosing an expedient but suboptimal solution instead of a better, more robust, and long-term solution. And similar to financial debt, it accumulates “interest” or additional costs due to:
- Higher, more complex future costs.
- Decreased quality (e.g., brittle, potential negative side-effects, or slower performance).
- Increased risks to the system and the CRM team (e.g., getting near governor limits or brittle code and low-quality test classes).
- Slower progress for the CRM team in follow-on projects or enhancements.
Anti-patterns, on the other hand, are the common design or project execution mistakes CRM teams make in planning and designing software/Salesforce solutions (typically due to time pressures and a never-ending series of urgent business requirements). Anti-patterns then lead to increased technical debt.
In other words, anti-patterns are the cause of many insidious, complex, and lingering problems, and technical debt is the term we use to refer to these types of problems. As a result, anti-patterns and the resulting technical debt become quite costly over time.
Types of Anti-Patterns in Salesforce
There are two types of anti-patterns: non-technical and technical. First, let’s discuss non-technical anti-patterns. Some of the more critical ones are summarized as follows:
- Not involving executives in the CRM goals, objectives, and high-level requirements.
- Not using enterprise architecture (the business version of this) to help determine your org strategy. The theory behind this is discussed in the book: “Enterprise Architecture as Strategy”.
- Adopting an agile release program that has too much formality and/or is too aggressive in its release timelines.
- Allowing business owners and team-leads to ignore non-functional requirements (this is the primary source of technical debt). CRM architects and developers should have the power to define key frameworks and scaffolding so projects can be more extensible, performant, scalable, and manageable.
- The poor governance anti-pattern.
Technical anti-patterns, on the other hand, are also essentially categories of technical debt. As a result, the following list gives you a sense of some common technical anti-patterns, and you can quickly imagine the types of technical debt that result.
- Overly complex flows or Apex code. Complexity obviously leads to numerous problems during the lifetime of Flows and Apex code. And flows with more than 30 or so elements could arguably have more technical debt than a medium-complexity Apex class. I’ve personally been involved in a consulting project where the Flow had 40 or so elements, including some additional complexities, and even the two authors struggled to understand it one month after its initial version was completed.
- Metadata entities (classes, objects, fields, flows) that have numerous dependencies in either direction (depend upon, or have dependencies from other artifacts), and the CRM team does not have good visibility into where to look when debugging problems.
- Object fields where the Label and API name do not match at all (semantic mismatch).
This is certainly not a complete list – you can find a more comprehensive list with information on how to remedy them.
How to Avoid Technical Debt and Anti-Patterns
The way to avoid technical debt is by avoiding anti-patterns, along with utilizing best practices throughout the program and project lifecycle for your Salesforce implementations. I would recommend familiarizing yourself and/or your team with anti-patterns via books or on the Salesforce Well-Architected anti-patterns website.
Anti-patterns and the resulting technical debt hinder the effectiveness of the Salesforce implementation and the CRM team in general. But more generally, avoiding technical debt requires that the entire CRM culture adopt and embrace the idea that we “work smart” and sometimes temporarily “work slower to go faster”.
In other words, by investing a bit more time upfront in the program and projects, we can choose design approaches that leverage best practices and are:
- More extensible (i.e., easier to enhance later).
- More efficient (performance).
- Less likely to break (higher quality).
- Surface errors easily, so the CRM team is aware of them proactively.
- Are configurable so the business can adapt to change more quickly.
- Scales better when dealing with large data volumes and/or hundreds of concurrently processed records.
This does not mean we have to do all of the above for every single project (feature/user story), but it does mean we need to consider these things whenever we start a new project. We have to ask ourselves: what are the non-functional requirements that may not be explicitly called out in the feature or user-story description?
Below is a citation-backed graph of the IT budget, developer time, and implementation project time waste associated with technical debt:

As a result, technical debt requires an ongoing investment to:
- Spend a bit more time on key projects to ensure each solution is well-designed and flexible, but does not unnecessarily add to the complexity of your org.
- Refactor specific solutions or automations that were previously added to your total technical debt.
- Address anti-patterns that crept into your implementation over time.
- Improve or update the associated documentation for problematic or key solutions.
These “investments” seem to slow down future progress and delay the CRM team from addressing new business requirements efficiently and effectively. However, the investments quickly pay off in speeding up future projects, as well as avoiding convoluted complexities that could take days/weeks to unravel.
Finding and Fixing Salesforce Technical Debt
Now, let’s examine the various ways Salesforce teams or consultants can more effectively analyze implementations with regard to anti-patterns and technical debt. The brute force way is to laboriously query your metadata through a custom program using Salesforce metadata APIs. This is, in my opinion, nearly impossible.
The second option is to use one of several pre-existing AppExchange tools. However, we feel that in the age of AI, the easiest and most powerful way to address technical debt is to leverage a domain-specific agentic solution. That is where Platform Technology’s Metalligence solution leads the way.
Metalligence provides numerous powerful features to remediate technical debt (see our demo video). Moreover, we do this using the highest levels of security, scalability, performance, and stringent guardrails. Also, note that we do not charge for LLM usage.
In addition to giving you an overall sense of your Org Health and Technical Debt, here is a brief list of some of the Metalligence features regarding management of technical debt:
- Flow, Apex, and Execution Analysis list your flows and Apex classes, and allow deep-dive analysis on them, including execution ordering, along with recommendations to improve/refactor them.
- Change and impact analysis to detect changes in or between orgs, as well as bi-directional dependency analysis and anti-pattern analysis for your metadata.
- Permissions analysis and recommendations on optimizing your Profiles, Permission-Sets, Permission-Set-Groups, etc. to adhere to best practices and least-privilege standards. This feature-set also provides field-level compliance information for the major compliance standards.
- Field label mismatch analysis: This is more important than people realize and helps the team be more effective and avoid critical mistakes.
- Multi-Org/Cross-org analysis, such as metadata differences between Orgs
See below some of our features in action: including the choice of single-org or multi-org modes, our Flow Optimizer page with the choice of several agentic sub-commands, and our Technical Debt dashboard with a summary of your tech debt statistics.
Summary
Technical debt is not a failure of competence – it is a structural byproduct of evolving systems. The differentiator between resilient and fragile Salesforce environments is not the absence of debt, but how intentionally teams monitor, manage, and reduce it.
AI and automation tooling can assist in this process, but architectural thinking, disciplined design, and human judgment remain central to effectively managing your evolving org(s), as well as your CRM team’s success.
For readers interested in a deeper exploration of Salesforce-specific anti-patterns, “Salesforce Anti-Patterns” by Lars Malmqvist provides an excellent companion perspective.


