{"record":{"id":"2d0e9192ff4d6377","repo":"github/spec-kit","slug":"invalid-provides-templates-expected-a-list","errorCode":null,"errorMessage":"Invalid provides.templates: expected a list","messagePattern":"Invalid provides\\.templates: expected a list","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/extensions/__init__.py","lineNumber":386,"sourceCode":"                f\"got {type(requires['speckit_version']).__name__}\"\n            )\n\n        # Validate provides section\n        provides = self.data[\"provides\"]\n        if not isinstance(provides, dict):\n            raise ValidationError(\n                f\"Invalid provides: expected a mapping, got {type(provides).__name__}\"\n            )\n        commands = provides.get(\"commands\", [])\n        templates = provides.get(\"templates\", [])\n        scripts = provides.get(\"scripts\", [])\n        hooks = self.data.get(\"hooks\")\n        events = self.data.get(\"events\")\n\n        if \"commands\" in provides and not isinstance(commands, list):\n            raise ValidationError(\"Invalid provides.commands: expected a list\")\n        if \"templates\" in provides and not isinstance(templates, list):\n            raise ValidationError(\"Invalid provides.templates: expected a list\")\n        if \"scripts\" in provides and not isinstance(scripts, list):\n            raise ValidationError(\"Invalid provides.scripts: expected a list\")\n        if \"hooks\" in self.data and not isinstance(hooks, dict):\n            raise ValidationError(\"Invalid hooks: expected a mapping\")\n        if \"events\" in self.data:\n            from ..events import validate_events\n            validate_events(self.data)\n\n        has_commands = bool(commands)\n        has_hooks = bool(hooks)\n        has_events = bool(events)\n        has_templates = bool(templates)\n        has_scripts = bool(scripts)\n\n        if not has_commands and not has_hooks and not has_events and not has_templates and not has_scripts:\n            raise ValidationError(\n                \"Extension must provide at least one command, hook, or event \"\n                \"(or a declared template/script)\"","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/extensions/__init__.py#L368-L404","documentation":"If provides contains a templates key, its value must be a list. Templates are declared (not inline) artifacts the extension ships; the validator only checks the container type here, with per-artifact validation done by _validate_provided_artifacts afterwards.","triggerScenarios":"`provides:\\n  templates:` set to a single string path or a single mapping instead of a list of entries. The isinstance(templates, list) check fails.","commonSituations":"Author writes `templates: templates/plan.md` as a shortcut instead of the list form the manifest schema expects.","solutions":["Use the list form: `templates:\\n  - path/to/template.md`.","Keep each template entry consistent with what _validate_provided_artifacts expects (a mapping/string per entry).","Model on an existing extension that ships templates."],"exampleFix":"# before\nprovides:\n  templates: templates/plan.md\n\n# after\nprovides:\n  templates:\n    - templates/plan.md","handlingStrategy":"validation","validationCode":"def templates_list_ok(data: dict) -> bool:\n    provides = data.get(\"provides\", {})\n    return \"templates\" not in provides or isinstance(provides[\"templates\"], list)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["templates is a list, not a single path string.","Mirror the commands structure for symmetry and fewer mistakes."],"tags":["extension-manifest","validation","yaml-structure"],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}