Skip to main content

Module generate

Module generate 

Source
Expand description

Generate the three distribution files from a ProjectProfile + Intent via Tera templates. Pure (no disk writes here): returns [GeneratedFile]s; the CLI dispatcher decides whether to write them (after pre-commit verify).

Design §5.1 step 3 + §6.3. Idempotent: identical inputs produce byte-identical output across runs (templates use sorted/stable iteration where order matters, and default(value=...) keeps fields present rather than conditionally-present).

Structs§

GeneratedFileOutput
Output path + rendered contents, root-relative. Re-exports the shared GeneratedFile shape; kept as its own type so callers don’t need to import the path tuple awkwardly.
Keywords
A transparent newtype wrapper so the JSON / Tera context exposes the inner array under the field name directly (the templates iterate keywords as a list, not keywords.inner).

Constants§

OUTPUT_PATHS
The three files init emits, relative to the project root. Documented for external tooling/tests; the renderer computes paths itself.

Functions§

build_context
Build the full Tera context from profile + intent.
coerce_kebab
Coerce an arbitrary detected name into valid kebab-case for the plugin/skill namespace. Lowercases, replaces runs of non-[a-z0-9] with a single hyphen, strips leading/trailing hyphens.
render
Renders all three files and returns them with their root-relative paths. The skill path uses the kebab name.
render_targets
Render distribution files for one or more agent ecosystems. Calls render for Claude (the three-file set) and emits additional files for each extra target in targets. Dedupes: if targets contains Claude plus others, Claude files are emitted once.