github/spec-kit · error · PresetValidationError
Template missing 'type', 'name', or 'file'
Error message
Template missing 'type', 'name', or 'file'
What it means
Error "Template missing 'type', 'name', or 'file'" thrown in github/spec-kit.
Source
Thrown at src/specify_cli/presets/__init__.py:418
# reports the accurate type error rather than the misleading "must
# provide at least one template". An empty list still reports the
# latter, since that genuinely is a list with no templates.
templates = provides["templates"]
if not isinstance(templates, list):
raise PresetValidationError(
"Invalid provides.templates: expected a list"
)
if not templates:
raise PresetValidationError(
"Preset must provide at least one template"
)
for tmpl in templates:
if not isinstance(tmpl, dict):
raise PresetValidationError(
"Each template entry in 'provides.templates' must be a mapping"
)
if "type" not in tmpl or "name" not in tmpl or "file" not in tmpl:
raise PresetValidationError(
"Template missing 'type', 'name', or 'file'"
)
# 'name' feeds re.match and 'file' feeds os.path.normpath below;
# both raise a bare TypeError on a non-string, which is not a
# PresetValidationError and so escapes the callers that handle a
# malformed manifest. The sibling extension manifest already
# rejects a non-string command 'file' via
# relative_extension_path_violation().
for field in ("type", "name", "file"):
if not isinstance(tmpl[field], str):
raise PresetValidationError(
f"Invalid template {field}: expected a string, "
f"got {type(tmpl[field]).__name__}"
)
if tmpl["type"] not in VALID_PRESET_TEMPLATE_TYPES:
raise PresetValidationError(View on GitHub (pinned to bf88c9f9a8)
Solutions
- Add 'type', 'name', and 'file' to each template entry in the preset manifest.
When it happens
Trigger: Thrown at src/specify_cli/presets/__init__.py:418 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of github/spec-kit@bf88c9f9a8 (2026-08-14).
Data as JSON: /api/errors/645a2e63cae948bf.
Report an issue: GitHub.