In a pot of boiling water, parboil crab for 2 minutes. Drain, rinse with cold water and drain again. Pull off the top shell in one piece and reserve for garnish. Remove and discard the gills and spongy parts under the shell. Twist off the claws and legs; crack them with a cleaver or mallet. Cut the body into 4 pieces.
Place a wok over high heat until hot. Add oil, swirling to coat sides. Add garlic, ginger and chili; cook, stirring, for 1 minute.
Add crab and stir fry for 2 minutes. Add sauce and reduce heat to low; cover and simmer, stirring once or twice, until crab is cooked, 6 to 7 minutes.
Stir in egg and cook just until it begins to set, about 1 minute. Arrange crab and top shell on a serving plate. Pour sauce over all and garnish with green onion.