github/spec-kit · error · PresetValidationError

Invalid requires.speckit_version: expected a non-empty strin

Error message

Invalid requires.speckit_version: expected a non-empty string, got {type(requires['speckit_version']).__name__}

What it means

Error "Invalid requires.speckit_version: expected a non-empty string, got {type(requires['speckit_version']).__name__}" thrown in github/spec-kit.

Source

Thrown at src/specify_cli/presets/__init__.py:379

        requires = self.data["requires"]
        if "speckit_version" not in requires:
            raise PresetValidationError("Missing requires.speckit_version")
        # Presence alone is not enough: check_compatibility() feeds this value to
        # ``SpecifierSet(required)``, guarded only by ``except InvalidSpecifier``,
        # which a non-string escapes two different ways. A float/int/bool/None
        # raises TypeError from the constructor, while a list or dict is an
        # *iterable*, so SpecifierSet accepts it and the failure surfaces much
        # later as ``AttributeError: 'str' object has no attribute 'filter'`` from
        # inside .contains(). Neither is a PresetCompatibilityError, so both
        # bypass the CLI's "Compatibility Error" handler and exit 1 with a raw
        # traceback naming no field. An unquoted ``speckit_version: 1.0`` is an
        # easy YAML slip. Mirrors the sibling IntegrationDescriptor, which already
        # requires a non-empty string here.
        if (
            not isinstance(requires["speckit_version"], str)
            or not requires["speckit_version"].strip()
        ):
            raise PresetValidationError(
                "Invalid requires.speckit_version: expected a non-empty string, "
                f"got {type(requires['speckit_version']).__name__}"
            )

        # Validate provides section
        provides = self.data["provides"]
        if "templates" not in provides:
            raise PresetValidationError(
                "Preset must provide at least one template"
            )

        # Validate templates. Guard the container and each entry's shape so a
        # malformed third-party preset.yml (e.g. ``templates: 5`` or
        # ``templates: [null]``) raises a clean PresetValidationError the
        # install handler already catches, instead of a raw TypeError
        # ('int'/'NoneType' object is not iterable) that escapes to an
        # unhandled traceback. Mirrors the sibling ExtensionManifest guards.
        #

View on GitHub (pinned to bf88c9f9a8)

Solutions

  1. Set requires.speckit_version to a non-empty string specifier.

When it happens

Trigger: Thrown at src/specify_cli/presets/__init__.py:379 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/66d57cedd49682cb. Report an issue: GitHub.