Cook the pasta in salted boiling water until just under al dente. (2 minutes under what the package says)
Use a ladle to scoop two cups of water out of the pot and set it aside in a heatproof container (a glass liquid measuring cup works well.)
Drain the rest of the pasta, but don't rinse it.
Sauté onion and garlic in olive oil or butter over medium heat until onions are colored.
Add spices (note 1) and cook for 30 seconds.
Add the paste of your choice.
Cook them until the paste has darkened in color a shade and the whole thing gets more aromatic.
Deglaze the pan with wine or water and scrape up any browned bits on the bottom of the pan.
Keep cooking until the liquid has almost completely evaporated.
Add main ingredient (canned tomatoes, pumpkin, or beans). (note 2)
Add mix-ins (note 3) and simmer for a few minutes.
Combine pasta with sauce and add reserved pasta water if it looks dry.
Top with cheese, nuts, or breadcrumbs if desired.
Notes
Note 1. Classic Italian pasta seasonings like dried oregano, black pepper, and red chile flakes are great, but feel free to experiment with other types of chile flakes, or with bright coriander or smoky cumin. If you want to give your sauce an Italian sausage flavor (without the sausage), add dried rosemary and crushed fennel seeds (or anise seed, ground star anise, or dried tarragon—these herbs and spices all sport similar flavors). Into more of a chorizo-flavored vibe? Add smoked paprika, dried thyme, and coriander.
Note 2. For tomato sauce, add in a 28-ounce can of tomatoes. They can be diced, crushed, fire-roasted, or already made into marinara. If you're adding whole tomatoes, crushed them by hand first or use a wooden spoon to chop them into irregular bits.
For pumpkin sauce, add a 15-ounce can of pumpkin purée (not pre-spiced pie filling, please—unless your aim is to make dessert pasta).
For a bean-based sauce, toss in one or two 15-ounce cans of drained, rinsed legumes or pulses (chickpeas, white beans, lentils, lima beans, black beans, whatever beans).
Note 3. Now's the time to get really creative with your pasta. Add in some chopped olives or jarred tapenade, quartered artichoke hearts, or sun-dried tomatoes in oil, capers, sliced pickled chiles or roasted red peppers, drained canned tuna or other tinned seafood. Have some shrimp in the freezer? Poach 'em right in the sauce, making sure there's ample liquid in your pan (feel free to add a little extra wine here). Got cured salmon in the fridge? It's an excellent match with beans. Leftover roasted vegetables? Let them warm in the sauce and it's like they're new again.
Don't forget fruity things: golden raisins are great in some pastas—same with chopped dried apricots and preserved lemons. You could also add fresh lemon zest and juice to brighten things up, or some brine from those olives or pickled chiles.If you have some frozen greens (kale, spinach, collards) feel free to toss those in—or, if you have some arugula or herbs that are on their way out, stir those in just before serving.
There are some classic combinations to turn to. You can't go wrong adding anchovies, olives, and capers to a tomato sauce for a puttanesca vibe. I love chickpeas in pasta with smoked salmon, artichokes, and lemon. Or how about starting that pumpkin sauce off with smoky Urfa chile and then finishing it with some nuts?
