> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jataka.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Tech Debt Cleanup

> Use Jataka Autonomous Org Optimization to detect orphaned fields, trigger safe cleanup, and prevent duplicate-field debt.

# Tech Debt Cleanup

## Conquering Tech Debt: Autonomous Salesforce Cleanup

As your Salesforce instance grows, so does the clutter. Salesforce enforces a strict limit of 500 custom fields per object. Approaching this limit is a nightmare for development teams because manually searching for unused fields, and verifying they are not secretly tied to an old Flow, Apex class, or Page Layout, takes countless hours and carries a high risk of breaking something.

Enter Jataka's Autonomous Org Optimization.

Jataka continuously maps your entire Salesforce metadata using an advanced Neo4j Knowledge Graph. Because Jataka understands every single dependency in your org, it can confidently identify orphaned fields, fields taking up precious limits but safely disconnected from the rest of your system.

Here is how you can use Jataka to automatically clean up your org and reclaim your field limits in minutes.

## Step 1: Scan for Dead Weight on the Dashboard

Before deleting anything, Jataka lets you see exactly what is clogging up your system.

Open your Jataka Architect Dashboard.

Navigate to Tech Debt Cleanup on the left-hand menu.

Click the Run Dependency Scan button.

Jataka will instantly calculate your tech debt, showing you:

* **Orphaned Fields Detected**: The exact number of disconnected fields safely available for deletion.
* **Estimated SOQL Speedup**: How much faster your database queries will run once the clutter is gone.
* **Manual Hours Saved**: The time your team just saved by not having to trace dependencies manually.

Scroll down to the Removable Fields List to see the specific fields (labeled as `IDLE NODE`) that Jataka has flagged as 100% safe to remove.

<img src="https://mintcdn.com/jataka/MitCAQH4PVwGsNjj/static/images/tc1.png?fit=max&auto=format&n=MitCAQH4PVwGsNjj&q=85&s=0f0a9ee8a2569f3249b5ea6878e108d7" alt="Tech Debt Cleanup Dashboard" width="1917" height="910" data-path="static/images/tc1.png" />

<img src="https://mintcdn.com/jataka/MitCAQH4PVwGsNjj/static/images/tc2.png?fit=max&auto=format&n=MitCAQH4PVwGsNjj&q=85&s=2f992badf8792806b7c97b3fc29134b6" alt="Removable Fields List" width="1919" height="905" data-path="static/images/tc2.png" />

## Step 2: The Magic Cleanup Command

Once you have reviewed the Removable Fields List on the dashboard, you do not have to manually delete fields one by one in Salesforce. Jataka handles the heavy lifting directly from your code repository.

To safely trigger autonomous cleanup:

Go to any active GitHub Pull Request in your repository.

In the comments, type:

```bash theme={null}
/jataka clean tech debt
```

<img src="https://mintcdn.com/jataka/MitCAQH4PVwGsNjj/static/images/tc4.png?fit=max&auto=format&n=MitCAQH4PVwGsNjj&q=85&s=8273e039eecfd798b1765b7b1086daf2" alt="PR Comment Trigger" width="931" height="513" data-path="static/images/tc4.png" />

## Step 3: Autonomous PR and destructiveChanges.xml

The moment you send the magic command, the Jataka Bot goes to work.

* **Automatic PR creation**: Jataka automatically branches off and generates a brand-new Pull Request dedicated solely to cleaning up tech debt.
* **Precision deletion code**: Inside this PR, Jataka writes the precise `destructiveChanges.xml` file required by Salesforce to delete those specific orphaned nodes.
* **Review and merge**: Your team reviews the generated PR and clicks merge.

With Jataka, what used to be a terrifying multi-day scavenger hunt for unused fields is now a safe, autonomous, three-click process. Reclaim your 500-field limits with confidence.

<img src="https://mintcdn.com/jataka/MitCAQH4PVwGsNjj/static/images/tc5.png?fit=max&auto=format&n=MitCAQH4PVwGsNjj&q=85&s=a043a67525c2897a09f9847d5a5c4ab3" alt="Autonomous Cleanup Pull Request" width="1060" height="467" data-path="static/images/tc5.png" />

<img src="https://mintcdn.com/jataka/MitCAQH4PVwGsNjj/static/images/tc6.png?fit=max&auto=format&n=MitCAQH4PVwGsNjj&q=85&s=c06a2b083ee00f562fbaa2e3488e1969" alt="Cleanup Diff and destructiveChanges.xml" width="1898" height="806" data-path="static/images/tc6.png" />

## Bonus: Preventative Tech Debt Blocking

Jataka does not just clean up old messes, it also stops new ones from being made.

As seen in your GitHub pull requests, Jataka's Static Architecture Agent acts as a gatekeeper. If a developer tries to create a new field (for example, `Batch_Update_Date__c`) that is functionally redundant or highly similar to a standard field, Jataka flags it as `DUPLICATE_FIELD` and blocks the PR. This ensures your org stays clean from day one.

<img src="https://mintcdn.com/jataka/MitCAQH4PVwGsNjj/static/images/tc3.png?fit=max&auto=format&n=MitCAQH4PVwGsNjj&q=85&s=b5d076ca2c4dd243a123253d31a847a4" alt="Preventative Tech Debt Blocking" width="1829" height="820" data-path="static/images/tc3.png" />
