Skip to main content

TemplateConfig API

TemplateConfigModule describes how Skaff should render your template. The table below lists the properties used most often. Consult the generated TypeDoc at /skaff/template-types-lib for complete signatures.

PropertyPurpose
templateConfigMetadata for the template (name, author, description, multiInstance, etc.).
templateSettingsSchemaZod schema that defines prompts and validation rules. The inferred type drives TypeScript tooling.
templateFinalSettingsSchemaSchema that validates stored settings when Skaff reloads a template or applies migrations.
mapFinalSettingsModify settings after validation and before rendering. Receives { templateSettings, parentSettings, fullProjectSettings, aiResults }.
targetPathAbsolute or relative path where rendered files are written. Accepts a string or callback.
autoInstantiatedSubtemplatesDeclare subtemplates to run automatically. Can return a static list or compute it dynamically.
sideEffectsApply programmatic edits to existing files. Each entry supplies a filePath and an apply function.
redirectsRedirect rendered files to alternative destinations. Useful for multi-instance templates.
allowedOverwritesWhitelist files that may be overwritten when a conflict occurs.
commandsSurface helpful follow-up commands in the CLI and web UI (for example, npm test).
migrationsUpgrade stored settings when schemas change between template revisions.
templatesThatDisableThisPrevent incompatible combinations by disabling a template when another instance is present.
handlebarHelpersRegister additional Handlebars helpers before rendering templates.
assertionsFail generation early if a predicate returns false (for example, when prerequisites are missing).

Additional helpers cover AI-assisted settings through aiAutoGenerate and aiUserConversationSettings, plus caching hints and other utility types. Reference the README for repository-level conventions and release steps.