01 - Preheat oven to 400°F. Line a baking sheet with parchment paper.
02 - Cut the spaghetti squash in half lengthwise and scoop out seeds. Brush cut sides with olive oil, place cut-side down on baking sheet, and roast for 35–40 minutes until flesh shreds easily with a fork.
03 - While squash roasts, heat large skillet over medium heat with olive oil. Sauté onion, bell pepper, jalapeño if using, and garlic for 4–5 minutes until softened.
04 - Stir in corn, black beans, drained tomatoes, cumin, chili powder, smoked paprika, oregano, salt, and pepper. Cook 3–4 minutes, stirring occasionally. Remove from heat.
05 - When squash is cool enough to handle, shred flesh into strands with a fork. Reduce oven temperature to 375°F.
06 - In a large mixing bowl, combine shredded spaghetti squash with vegetable-bean mixture. Stir in half of the cheddar and Monterey Jack cheeses.
07 - Transfer mixture to a lightly greased 9x13-inch casserole dish. Sprinkle remaining cheese evenly over the top.
08 - Bake for 20–25 minutes until casserole is hot throughout and cheese is bubbly and lightly golden.
09 - Garnish with chopped fresh cilantro and serve with lime wedges.