I'm Runbo Li, Co-founder & CEO at Magic Hour.
The answer is almost always: ship the customer-facing feature. And I say "almost" only because there's one exception, which I'll get to.
When you're a two-person team serving millions of users, you don't have the luxury of "investing in the platform" as some abstract long-term bet. Every hour you spend on internal tooling is an hour you're not solving a problem a real person emailed you about that morning. We have a simple rule: if the developer improvement doesn't unblock a customer-facing feature shipping this week, it waits.
Here's the story that crystallized this for us. Early on, we had a choice. We could spend two weeks refactoring our rendering pipeline to make it "cleaner" and more extensible, or we could ship a new template category that users had been requesting constantly. The engineer brain says refactor. The builder brain says ship. We shipped. That template category drove a measurable spike in new user activation within days. And you know what happened to the rendering pipeline? We refactored it three months later, but by then we actually understood the real requirements because we'd shipped five more features on top of the messy version. The refactor took four days instead of two weeks because we finally knew what "extensible" actually needed to mean.
That's the exception I mentioned. When your internal infrastructure is actively causing customer-facing failures, like dropped renders, slow processing times, broken outputs, then the platform improvement IS the customer-facing feature. You're not choosing between two categories. You're just fixing the product.
The framework I use is dead simple. I ask: "Will a user notice this by Friday?" If yes, do it. If no, it's probably a story you're telling yourself about future productivity gains that may never materialize. Most developer platform investments are procrastination disguised as strategy.
Build for the person using your product today, not for the imaginary engineering team you might have next year.