> 01 case study
Salesforce
Architect
Tools
One local app for the Salesforce data work I do, built because that work was spread across different places, with Data Loader among them.
I use it almost every day, across many Salesforce clients. It holds no credentials at all.
- Dailyuse across client orgs
- 6separate tools in one UI
- 600+tests
- 0credentials stored
- 15days with commits, over five months
> 02 The project
The problem
It’s really common at work to do migrations and data loads, and a bunch of other stuff this app does now. Before this, all of that was in Data Loader, or hitting the API itself. The rest was spread out across different places.
Migration work looked like piece-by-piece CSVs, handled by Data Loader and by the command line at the same time.
- Last runcompleted
- Before thatsome rows failed
- Ledgerkept for both


Why one tool
The first thing I asked for was help consolidating my separate tools into one place, so I don’t have to go between different repos day to day. I asked for it to be built in a modular way, so I can build on top of it as I need.
I wanted some structure and consistency in how I approached a lot of tasks, working with a lot of different Salesforce clients. The use cases are always different, but the mechanisms are always the same.
Data Loader is a bit clumsy, because it’s meant to intake CSVs. The work needs to be more specific than that, for the managed package in use. That package has a unique data model. Creating one product properly is a chain of records. It starts with the product family, then the product. After that come its inventory for the season, its rate and its price book entry, and each one points at its parent. A sub family sits under its family. Doing that by hand in Data Loader means a CSV for each level.
Because the data is structured, it goes much faster than doing it over and over by hand.
- Data Loader, a CSV per level
- The command line, one record at a time
- Separate repos per task
- One local app
How it works now
A client says some data is looking wrong, or they want to update something. I pull an export and load it from the one tool. Instead of going to two different places, it’s all there in one.
I kept all of the separate tools, generalized. Rate Explorer and the template runner are features inside them. Rate Explorer, for example: we deal with pricing, so it’s common for teams to update their prices.
It’s a very common thing for me to do data changes to an org. I’m in it almost every day, and it matches my level of technicality.
Step 1
A request comes in
Data looks wrong, or they want to update something.
Who can step in: I step in here.


> 03 Architecture
The layout
It all runs locally, with Python underneath and Streamlit for the UI. In the middle is an engine that decides what gets written. Everything that talks to Salesforce goes through one bridge, and the bridge runs the Salesforce CLI.
That bridge is the reason the tool holds no credentials. The CLI already has my orgs authorized, so I pass it the alias of the org I want and it handles the rest. Nothing in my code ever sees a token.
Beside the engine there are two stores. One is the cache, which holds the org’s objects as local files. The other is the ledger. Every run writes down what it’s about to do there before it sends anything.
Hover a piece to see what it owns and what it can’t touch.
Why the CLI
Calling a command line tool for every request is slow. We measured the floor at about three quarters of a second per call, just for the tool to start, before any network. An earlier version of my own docs claimed it was a tenth of that, so we corrected the doc.
It didn’t change the decision, because not handling credentials is the reason for the CLI. Where it did hurt was reading records back before a write, so those reads now go out a few at a time in parallel. The speedup was measured, and the validation still runs before any of it is scheduled.
Following one migration
A migration out of a third-party vendor starts with the files. Four passes have to happen in the right order, because each pass needs the Ids the one before it made.
The files land in the UI: the products and rates, the deals, and the seasons each deal covers.
Preflight scans all three against the cached org. Nothing is sent to Salesforce.
One finding comes back as an error, so the live run is off. The dry run stays available.
I fix the file and rerun the scan. The run button comes back.
Dry run builds the plan with no calls to Salesforce.
I type the org alias, and nothing goes live until I do.
Pass one: products, their inventory for the season and their rates. Each record is looked up before it's created.
Pass two: the deals. The package generates the per-season records, and pass three queries them back.
Pass four: the line items, with every Id resolved from the passes before it. Every intended row goes into the ledger first.
Results come back as a file. Anything that failed comes back with the reason per row.
Scanning
The preflight scan came out of how the importer used to fail. It found bad input deep inside a pass. So a renamed column was silently ignored, and a season written as a year instead of a span failed every row in the last two passes. By then the first two passes had already run and written records.
Now the scan runs the moment a file is uploaded. It only reads the files and the cached copy of the org, so it makes no calls to Salesforce. Findings come back grouped by file, each with a severity. Any error at all disables the live run, and there’s no override checkbox. The dry run stays enabled, so I can keep working on the file.
Credentials
One of the tools I absorbed was a desktop app that did plain create, update and delete against the API. It worked by having me paste in a bearer token, then firing one request per row.
The straight move would have been to lift that code in and have a new tab. Taking it as it was meant putting credential handling into a tool that had deliberately never had any. So it got reimplemented on the CLI bridge instead. The bulk path is the default now. The one-request-per-row mode stays as an opt-in.
> 04 Security
Why it mattered
Essentially we’re working on production orgs. Since it’s local, I only needed a few security guards.
The first is credentials. I can’t store production credentials locally, so the tool holds none. That was a make or break from day one, and it’s why the whole thing goes through the CLI.
The second is rollback. The main thing is making sure we have a proper rollback protocol in case something does go wrong in a production upload. And anything we save has to be locked down.
Sandbox first is a habit, not a rule, because it’s the best thing to do there.
The rules
Tap a rule to see where it’s enforced.
The ledger
An upsert can’t tell you afterwards what it created. Query a record back by its external Id after the job, and a row it matched looks exactly like a row it inserted.
The first version of the rollover built its rollback list from that query. If a later step had failed, the rollback would have deleted a production record the run never created, after having already overwritten it. That one got caught before it ever ran.
The fix is to ask the org which Ids already exist before writing. Those rows come out of the write and get counted as skipped. They stay out of the ledger, and their Ids still get passed down so the child records can point at them.
Now every engine writes down what it intends to do before the batch goes out.
The file, five rows
The org, after the batch
The ledger, written first

> 05 Working with Claude
Where I stepped in
A lot of context was missed, because the tools were all separate. Each one was built on its own, so they had their own words and their own data models. Making sure their functions and methods could be shared, and refactored that way if needed, is where I stepped in.
The other thing was the migration path itself. It’s mapped from a third-party vendor, so making sure that flowed through correctly was on me. Claude was confidently wrong, a bunch of times.
Examples
Tap a card to see what changed.
Matching rates forward
Rates move forward season over season, and the first version matched a rate forward by the Id of its event schedule. Those Ids are per season, so on some orgs every forward rate failed to match, and the plan came back empty.
Matching now happens on the schedule’s name, with the season taken out of it. The new engine ran beside the old one, and the bar was zero rows lost and zero values disagreed. One org had seasons named both as a single year and as a span. That meant a schedule name could have the shorter season stripped out of the longer one. It took live verification runs to prove that was gone.
> 06 Process
How we worked
It ran the same as my other projects. That meant a contract file at the root, a written plan per feature, and handoffs between cleared sessions. The one addition was a sandbox check.
The plans are the part I’d point at. Each plan numbers its requirements and keeps its security requirements separate. It has a task table with dates as things got done. It also lists the alternatives we rejected, with the reason.
The contract file gets a warning from a hook once it grows long. The warning tells Claude to move the overflow into the detail docs.
The review branch
It was an attempt to build a review process, just a branch for agents to review my code. But actually getting into it, I didn’t feel like it was necessary, since the modularity and the codebase were pretty strong. The branch is still there, unmerged.
My thoughts
It started with a request to consolidate my separate tools into one place. A few things stuck with me.
Professionally
The proudest part is bringing all the separate tools together into one place, so there’s no hunting things down. It actually saved me real time in the job, so that was really nice.
The time saved is uneven. For the Data Loader part, it’s not too many time savings. The main time savings is I don’t have to open a new tab. But for the product setup or the core migration, that’s hours of work saved, since those processes are broken apart.
The hardest part is the same thing as the proudest. Making sure they all work together, and that they’re rebuilt to be modular, so that building things on top in the future is a bit more focused.
If you’re doing this, just start with the separate tools. I think that was the right call for me, instead of trying to make one big thing. Once I knew all the separate things I work on, it was really easy to build out the structure for this specific tool.
Claude was confidently wrong a bunch of times, and two of those were about what a write had done in the org. One didn’t recognize one of the three shapes a job Id comes back in, so the rollback silently did nothing. Another read a failure flag as nothing was written, when the good rows had already committed.
Personally
No credentials at all was a make or break from day one for me. Since we’re working on production orgs, a proper rollback protocol matters most, and anything we save has to be locked down.