This paper addresses the issue of type safe algorithmic skeletons. From a theoretical perspective we contribute by: formally specifying a type system for algorithmic skeletons, and proving that the type system guarantees type safety. From an implementation point of view, we show how it is possible to enforce the type system on an Java based algorithmic skeleton library. The enforcement takes place at the composition of the skeleton program, by typing each skeleton with respect to its construction parameters: sequential functions, and other skeletons. As a result, hierarchical skeleton nesting can be performed safely, since type errors can be detected by the skeleton type system.