Graphify-Labs/graphify · error · SystemExit
error: unknown platform '{key}'. Known: {', '.join(sorted(pl
Error message
error: unknown platform '{key}'. Known: {', '.join(sorted(platforms))} What it means
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.
Source
Thrown at tools/skillgen/gen.py:649
out: list[RenderedArtifact] = []
for basename in sorted(ALWAYS_ON_BLOCKS):
body = _read_fragment(f"always-on/{basename}.md")
out.append(RenderedArtifact(f"graphify/always_on/{basename}.md", body))
return out
def render_all(platforms: dict[str, Platform], only: str | None = None) -> list[RenderedArtifact]:
"""Render the selected platforms (or all), flattened into one artifact list.
A full render (no ``only``) also includes the always-on blocks; a single
``--platform`` render does not, since the always-on files are shared, not
per-platform.
"""
keys = [only] if only else sorted(platforms)
out: list[RenderedArtifact] = []
for key in keys:
if key not in platforms:
raise SystemExit(f"error: unknown platform '{key}'. Known: {', '.join(sorted(platforms))}")
out.extend(render(platforms[key]))
if only is None:
out.extend(render_always_on())
return out
def write_artifacts(artifacts: list[RenderedArtifact]) -> list[str]:
"""Write artifacts to disk under REPO_ROOT. Returns the paths written."""
written: list[str] = []
for art in artifacts:
dst = REPO_ROOT / art.path
dst.parent.mkdir(parents=True, exist_ok=True)
dst.write_text(art.content, encoding="utf-8", newline="\n")
written.append(art.path)
return written
def _expected_path(rel: str) -> Path:View on GitHub (pinned to 7fe58b0b0f)
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
Example fix
# before $ python tools/skillgen/gen.py render --platform Cursor # error: unknown platform 'Cursor' # after $ python tools/skillgen/gen.py render --platform cursor # exact key from Known: list
Defensive patterns
Strategy: validation
Validate before calling
from tools.skillgen.gen import platforms, render_all
ONLY = 'cursor'
if ONLY is not None and ONLY not in platforms:
raise SystemExit(f'unknown platform {ONLY!r}; valid: {sorted(platforms)}')
artifacts = render_all(platforms, only=ONLY) Type guard
def is_known_platform(key: str, platforms: dict) -> bool:
"""True when key is an exact (case-sensitive) platform registry key."""
return key in platforms Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- error: unknown platform '{key}'
- communities dict is empty — refusing to clear wiki/. Run `gr
- error: could not read {ref}: {result.stderr.strip()}
- graph not found: {source_path}
- repo '{repo_tag}' not in global graph
AI-assisted analysis of Graphify-Labs/graphify@7fe58b0b0f (2026-08-14).
Data as JSON: /api/errors/cc77c213f5dee756.
Report an issue: GitHub.