Preheat oven to 350 degrees F.
Prick each potato once or twice with a fork. Cut off and discard top fourth of garlic head; then wrap garlic tightly in foil. Bake garlic and potatoes on same rack in lower third of oven until potatoes are tender, 50 minutes to 1 hour. Remove potatoes from oven and cool on a metal rack 15 minutes. Continue to bake garlic until tender, about 15 minutes more, then cool in foil on rack.
While garlic cools, halve potatoes lengthwise, then quarter each half (to form short wedges). Scoop out potato flesh (reserving it for another use), leaving 1/4-inch-thick potato skins.
Increase oven temperature to 425 degrees F.
Squeeze garlic into a small bowl, discarding garlic skins, and mash to a paste with butter, salt, and pepper using a fork.
Divide garlic paste among potato skins (about 1/2 teaspoon each), spreading evenly, then roast skins in a large shallow baking pan (1 inch deep) until golden and crisp, 20 to 25 minutes.
Onion and Spinach Dip:
Heat oil in a 12-inch heavy skillet over moderately high heat until hot but not smoking, then saute onion and shallots, stirring, until lightly browned, about 2 minutes. Reduce heat to moderate and continue to cook, stirring occasionally, until softened, about 8 minutes more. Add spinach and cook, stirring, just until wilted, about 2 minutes. Remove from heat and cool slightly.
Transfer spinach mixture to a bowl, then stir in cream cheese, sour cream, salt, and pepper until combined well. Chill, covered, at least 1 hour.
Potato skins can be scooped out and spread with garlic paste (but not baked) 1 day ahead and chilled, loosely covered with foil. Bring to room temperature before baking. Dip can be chilled up to 1 day (though the spinach will lose some of its color). Let stand at room temperature 15 minutes before serving.