Skip to main content

Authoring Archetypes

An archetype is a directory with a manifest, a Lua script, and templated content. This section teaches you to build them — from a three-file hello-world to composed, library-sharing generators that scaffold entire platforms.

If you haven't yet, do the Your First Archetype tutorial — it's fifteen minutes and gives everything here context.

The authoring loop

mkdir my-archetype && cd my-archetype
archetect ide setup # editor autocomplete for the Lua API
# … write archetype.yaml, archetype.lua, content …
archetect render . ../scratch # render from the local directory

Local directories render directly (no cache, no git), so iteration is instant: edit, render, inspect, repeat. See Testing & Debugging for the full workflow, including dry runs and replayable answer files.

In this section

Kinds of archetypes

The same machinery covers a spectrum of uses:

KindDescriptionTypical trait
Project archetypeGenerates a standalone projectWraps output in a {{ project_name }}/ directory
ComponentA building block composed by other archetypes (prompt sets, sub-trees like an xtask/ crate)Marked show: false in catalogs; renders into the parent's destination
LibraryShares Lua modules and template includes with consumersMounted with library: true; often renders nothing itself
CatalogPresents a menu of other archetypesHas a catalog: section; may have no content at all

These compose: a project archetype might mount two libraries, render three components, and be published inside a catalog. Composition and Libraries cover the mechanics.