Preheat oven to 350°F, and lightly grease a 9x13-inch baking pan.
In a large frying pan, sauté the onion in the olive oil, over medium-high heat until tender (about 3 minutes).
Add the ground beef and sauté, breaking up the large pieces with a wooden spoon, until well browned (about 5 minutes).
Stir in the spaghetti sauce, garlic, basil, fennel, red pepper and black pepper.
Bring to a boil.
Reduce heat and simmer, uncovered, for 10–15 minutes.
Meanwhile, cook the pasta shells according to package instructions (omitting the salt).
Drain well and set aside.
In a small bowl, combine the ricotta cheese and egg, mix well and set aside.
Layer 1⁄3 of the meat mixture in the bottom of the prepared baking pan.
Layer 1⁄2 the shells over the meat, then 1⁄2 the ricotta mixture, 1⁄2 the Mozzarella, and 1⁄2 the Parmesan.
Spoon 1⁄2 the remaining meat mixture over the cheeses.
Layer the remaining shells, ricotta mixture, and Mozzarella.
Spoon remaining meat mixture evenly over top and sprinkle with remaining Parmesan.
Bake, uncovered, at 350°F for 45 minutes, or until bubbly and lightly browned.