{"record":{"id":"cc77c213f5dee756","repo":"Graphify-Labs/graphify","slug":"error-unknown-platform-key-known-join","errorCode":null,"errorMessage":"error: unknown platform '{key}'. Known: {', '.join(sorted(platforms))}","messagePattern":"error: unknown platform '(.+?)'\\. Known: (.+?)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"tools/skillgen/gen.py","lineNumber":649,"sourceCode":"    out: list[RenderedArtifact] = []\n    for basename in sorted(ALWAYS_ON_BLOCKS):\n        body = _read_fragment(f\"always-on/{basename}.md\")\n        out.append(RenderedArtifact(f\"graphify/always_on/{basename}.md\", body))\n    return out\n\n\ndef render_all(platforms: dict[str, Platform], only: str | None = None) -> list[RenderedArtifact]:\n    \"\"\"Render the selected platforms (or all), flattened into one artifact list.\n\n    A full render (no ``only``) also includes the always-on blocks; a single\n    ``--platform`` render does not, since the always-on files are shared, not\n    per-platform.\n    \"\"\"\n    keys = [only] if only else sorted(platforms)\n    out: list[RenderedArtifact] = []\n    for key in keys:\n        if key not in platforms:\n            raise SystemExit(f\"error: unknown platform '{key}'. Known: {', '.join(sorted(platforms))}\")\n        out.extend(render(platforms[key]))\n    if only is None:\n        out.extend(render_always_on())\n    return out\n\n\ndef write_artifacts(artifacts: list[RenderedArtifact]) -> list[str]:\n    \"\"\"Write artifacts to disk under REPO_ROOT. Returns the paths written.\"\"\"\n    written: list[str] = []\n    for art in artifacts:\n        dst = REPO_ROOT / art.path\n        dst.parent.mkdir(parents=True, exist_ok=True)\n        dst.write_text(art.content, encoding=\"utf-8\", newline=\"\\n\")\n        written.append(art.path)\n    return written\n\n\ndef _expected_path(rel: str) -> Path:","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/tools/skillgen/gen.py#L631-L667","documentation":"tools/skillgen/gen.py render_all() validates its `only` argument (from the --platform CLI flag) against the keys of the platforms dict before rendering. An unknown key aborts the generator with SystemExit and a message listing every known platform name. This is a CLI usage error: the generator refuses to silently render nothing for a typo'd platform.","triggerScenarios":"Running the skillgen CLI with `--platform <key>` where <key> is not in the platforms registry — e.g. `--platform Claude` (wrong case), `--platform cursorr` (typo), or a platform whose definition file was removed from tools/skillgen before the registry was rebuilt.","commonSituations":"Typos or wrong casing in the --platform flag; referencing a platform name that was renamed in a newer revision of the generator; running an out-of-date checkout whose platform registry no longer contains a legacy name.","solutions":["Re-run with a platform name exactly as printed in the error's 'Known:' list (keys are case-sensitive)","Run the generator's list/help invocation (or read the platforms dict construction in tools/skillgen/gen.py) to see current valid keys","If you intended a new platform, add its definition to the platforms registry in tools/skillgen/gen.py rather than passing an ad-hoc name"],"exampleFix":"# before\n$ python tools/skillgen/gen.py render --platform Cursor   # error: unknown platform 'Cursor'\n\n# after\n$ python tools/skillgen/gen.py render --platform cursor   # exact key from Known: list","handlingStrategy":"validation","validationCode":"from tools.skillgen.gen import platforms, render_all\n\nONLY = 'cursor'\nif ONLY is not None and ONLY not in platforms:\n    raise SystemExit(f'unknown platform {ONLY!r}; valid: {sorted(platforms)}')\nartifacts = render_all(platforms, only=ONLY)","typeGuard":"def is_known_platform(key: str, platforms: dict) -> bool:\n    \"\"\"True when key is an exact (case-sensitive) platform registry key.\"\"\"\n    return key in platforms","tryCatchPattern":null,"preventionTips":["Source --platform values programmatically from sorted(platforms) instead of typing them","Keep platform names lowercase and stable in the registry; treat renames as breaking CLI changes","Run the generator's audit/list mode after registry changes to catch stale references in scripts"],"tags":["cli","validation","code-generation","python"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}