{"record":{"id":"0ba67bcc27259588","repo":"bmad-code-org/BMAD-METHOD","slug":"label-has-unsupported-default-type-type-default","errorCode":null,"errorMessage":"{label} has unsupported default type {type(default).__name__}","messagePattern":"(.+?) has unsupported default type (.+?)","errorType":"exception","errorClass":"RenderError","httpStatus":null,"severity":"error","filePath":"src/scripts/render_skill.py","lineNumber":189,"sourceCode":"        if layer.get(\"when\"):\n            section.extend([\"\", f\"Run only when: {layer['when']}\"])\n        section.extend([\"\", layer[\"instruction\"].strip()])\n        sections.append(\"\\n\".join(section))\n    return \"\\n\\n\".join(sections)\n\n\ndef _resolve_customization_value(value: Any, default: Any, label: str) -> tuple[Any, str]:\n    if isinstance(default, str):\n        allow_empty = not default.strip() or label == \"customization.workflow.open_spec\"\n        resolved = _require_string(value, label, allow_empty=allow_empty)\n        return resolved, resolved\n    if isinstance(default, list):\n        if default and all(isinstance(item, dict) for item in default):\n            resolved = _require_review_layers(value, label)\n            return resolved, _format_review_layers(resolved)\n        resolved = _require_string_list(value, label)\n        return resolved, _format_markdown_list(resolved)\n    raise RenderError(f\"{label} has unsupported default type {type(default).__name__}\")\n\n\ndef _resolve_replacements(\n    sources: dict[str, str],\n    central: dict[str, Any],\n    customization: dict[str, Any],\n    defaults: dict[str, Any] | None,\n    project_root: Path,\n) -> tuple[dict[str, str], dict[str, Any]]:\n    replacements: dict[str, str] = {}\n    input_values: dict[str, Any] = {}\n    for content in sources.values():\n        for match in _SHORT_CONFIG_TOKEN.finditer(content):\n            token, key = match.group(0), match.group(1)\n            path, resolved = _resolve_short_config(central, key, project_root)\n            source = f\"config.{path}\"\n            replacements[token] = resolved\n            input_values[source] = resolved","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/bmad-code-org/BMAD-METHOD/blob/b70486b9bdcb0a404d329e2a763b57964e7f1360/src/scripts/render_skill.py#L171-L207","documentation":"_resolve_customization_value only supports customization defaults that are strings or lists (a list of dicts becomes review layers; a list of scalars becomes a markdown bullet list). If customize.toml declares a default that is an int, float, bool, inline table, or datetime, the renderer refuses it because it cannot render that type into markdown.","triggerScenarios":"customize.toml has [workflow] retries = 3 (int) or flag = true (bool) or a nested [workflow.x] table that is referenced by a {workflow.retries} / {workflow.flag} token. The looked-up default is neither str nor list.","commonSituations":"Authoring customization with numeric or boolean settings; using a nested table default where a scalar/list was expected.","solutions":["Change the default in customize.toml to a string (e.g. retries = \"3\").","If a list is intended, use TOML array syntax (retries = [\"a\", \"b\"]).","Remove the unsupported {workflow.*} token from sources, or restructure the default to a supported type."],"exampleFix":"# before\n[workflow]\nretries = 3\n\n# after\n[workflow]\nretries = \"3\"","handlingStrategy":"type-guard","validationCode":"import tomllib\nfrom pathlib import Path\n\ndef assert_supported_defaults(toml_path: Path) -> None:\n    data = tomllib.loads(Path(toml_path).read_text(encoding=\"utf-8\"))\n    def walk(obj, prefix=\"\"):\n        if isinstance(obj, dict):\n            for k, v in obj.items():\n                walk(v, f\"{prefix}.{k}\" if prefix else k)\n        elif not isinstance(obj, (str, list)):\n            raise SystemExit(f\"{prefix}: unsupported default type {type(obj).__name__}\")\n    walk(data)","typeGuard":"def is_supported_default(value: object) -> bool:\n    return isinstance(value, (str, list))","tryCatchPattern":null,"preventionTips":["Keep customize.toml defaults as strings or lists only.","Quote numeric values (retries = \"3\").","Lint defaults for unsupported types (int/bool/table/datetime) before rendering."],"tags":["python","toml","customization","validation","type"],"backgroundTag":null,"analyzedSha":"b70486b9bdcb0a404d329e2a763b57964e7f1360","analyzedAt":"2026-08-13T01:21:12.247Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}