Typst templates are software --- not documents. And like all software, they collapse under their own weight. This talk covers the lifecycle of a Typst template, from a small snippet over to a function, and finally a full package with public and private APIs, complexity layers, separation of concerns and the final, one rule lib.typ must follow. We use a case study of a template as an example, walking through the complexities of making a full package. You'll leave with an idea of how to write a package that scales over time instead of collapsing.
https://creativecommons.org/licenses/by-sa/4.0/