Instructions
- Preheat oven to 450°F. Roughly mash about ½ cup of the drained beans with a fork in a small bowl; set aside (optional but thickens the sauce nicely).
- Heat olive oil in a 10-inch oven-safe skillet over medium-high. Add onion and ¼ tsp salt. Cook, stirring often, until tender, 3–5 minutes.
- Add garlic and red pepper flakes. Cook, stirring constantly, until garlic edges turn golden, about 30 seconds.
- Stir in tomato paste (watch for splatters). Scrape up browned bits; cook 30 seconds, reducing heat to prevent burning.
- If using spinach, add half, stir until bright and wilted, then repeat with the rest.
- Add all beans (including mashed), water, and remaining ¼ tsp salt. Stir to combine and scrape up any browned bits. Bring to a simmer on the stovetop.
- Sprinkle mozzarella evenly over the top. Transfer skillet to oven and bake until cheese is nicely melted, 7–9 minutes.
- Let cool 5 minutes before serving. Top with basil if using.