{"record":{"id":"bb5dede6128f1d37","repo":"github/spec-kit","slug":"preset-requires-spec-kit-required-but-speckit","errorCode":null,"errorMessage":"Preset requires spec-kit {required}, but {speckit_version} is installed.\\nUpgrade spec-kit with: {REINSTALL_COMMAND}","messagePattern":"Preset requires spec-kit (.+?), but (.+?) is installed\\.\\\\nUpgrade spec-kit with: (.+?)","errorType":"exception","errorClass":"PresetCompatibilityError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/presets/__init__.py","lineNumber":818,"sourceCode":"        # Defense in depth: the manifest validator now rejects a non-string\n        # requires.speckit_version, but this method is public and also reachable\n        # with a hand-built manifest object. ``InvalidSpecifier`` alone does not\n        # cover a non-string -- scalars raise TypeError from the constructor, and\n        # a list/dict is iterable so it constructs here and only breaks inside\n        # .contains(). Reject up front so this always reports a\n        # PresetCompatibilityError.\n        if not isinstance(required, str):\n            raise PresetCompatibilityError(\n                \"Invalid version specifier: expected a string, got \"\n                f\"{type(required).__name__} ({required!r})\"\n            )\n        try:\n            SpecifierSet(required)  # Just to validate\n        except InvalidSpecifier:\n            raise PresetCompatibilityError(f\"Invalid version specifier: {required}\")\n\n        if not version_satisfies(speckit_version, required):\n            raise PresetCompatibilityError(\n                f\"Preset requires spec-kit {required}, \"\n                f\"but {speckit_version} is installed.\\n\"\n                f\"Upgrade spec-kit with: {REINSTALL_COMMAND}\"\n            )\n\n        return True\n\n    def _register_commands(\n        self,\n        manifest: PresetManifest,\n        preset_dir: Path\n    ) -> Dict[str, List[str]]:\n        \"\"\"Register preset command overrides with all detected AI agents.\n\n        Scans the preset's templates for type \"command\", reads each command\n        file, and writes it to every detected agent directory using the\n        CommandRegistrar from the agents module.\n","sourceCodeStart":800,"sourceCodeEnd":836,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/presets/__init__.py#L800-L836","documentation":"The preset declares a requires.speckit_version range that the currently installed specify-cli does not satisfy, so install aborts before copying any files. The message includes the required range, the installed version, and the canonical reinstall command (`uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git`).","triggerScenarios":"install_from_directory / install_from_zip / install_from_archive (i.e. `specify preset add ...`) with a preset requiring e.g. \">=2.0\" while the running spec-kit is 1.x. version_satisfies(speckit_version, required) returns False.","commonSituations":"Installing a community preset built against a newer spec-kit, or running an older specify-cli in a locked-down environment. Note the running CLI version is what matters, not the project's spec-kit scaffold version.","solutions":["Upgrade spec-kit with the command shown in the error: uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git.","If you maintain the preset, widen its requires.speckit_version range if the used features exist in older versions.","If you cannot upgrade, find an older release of the preset compatible with your installed version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"from packaging.version import Version\nfrom specify_cli.presets import version_satisfies  # if exposed\nrequired = manifest.requires_speckit_version\nif not version_satisfies(speckit_version, required):\n    print(f\"skip: needs spec-kit {required}, installed {speckit_version}\")","typeGuard":null,"tryCatchPattern":"try:\n    manager.install_from_directory(src, speckit_version)\nexcept PresetCompatibilityError as e:\n    # message embeds the exact upgrade command; surface it to the user verbatim\n    print(e)","preventionTips":["Check `specify --version` before installing community presets.","Keep specify-cli current via the uv tool install command in the error message.","Preset authors: set requires.speckit_version to the minimum that actually works, not the latest."],"tags":["preset","compatibility","version","upgrade"],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}