We describe HTN-Maker, an algorithm for learning hierarchical planning knowledge in the form of task-reduction methods for Hierarchical Task Networks (HTNs). HTN-Maker takes as input a set of planning states from a classical planning domain and plans that are applicable to those states, as well as a set of semantically-annotated tasks to be accomplished. The algorithm analyzes this semantic information in order to determine which portion of the input plans accomplishes a particular task and constructs task-reduction methods based on those analyses.We present theoretical results showing that HTN-Maker is sound and complete. Our experiments in five well-known planning domains confirm the theoretical results and demonstrate convergence toward a set of HTN methods that can be used to solve any problem expressible as a classical planning problem in that domain, relative to a set of goal types for which tasks have been defined. In three of the five domains, HTN planning with the learned methods scales much better than a modern classical planner.