Render every committed artifact for one platform. A split platform yields the lean core SKILL.md plus one file per reference, in a stable order (core first, then references sorted by name). A monolith yields a single inline skill body.
(platform: Platform)
| 421 | |
| 422 | |
| 423 | def render(platform: Platform) -> list[RenderedArtifact]: |
| 424 | """Render every committed artifact for one platform. |
| 425 | |
| 426 | A split platform yields the lean core SKILL.md plus one file per reference, |
| 427 | in a stable order (core first, then references sorted by name). A monolith |
| 428 | yields a single inline skill body. |
| 429 | """ |
| 430 | if platform.bucket == "monolith": |
| 431 | body = _read_fragment(f"core/{platform.monolith}.md") |
| 432 | return [RenderedArtifact(platform.skill_dst, body)] |
| 433 | |
| 434 | if platform.bucket != "split": |
| 435 | raise ValueError(f"unknown bucket '{platform.bucket}' for platform '{platform.key}'") |
| 436 | |
| 437 | if platform.refs_dst is None: |
| 438 | raise ValueError(f"split platform '{platform.key}' is missing refs_dst") |
| 439 | |
| 440 | artifacts: list[RenderedArtifact] = [ |
| 441 | RenderedArtifact(platform.skill_dst, _render_core(platform)) |
| 442 | ] |
| 443 | |
| 444 | references = platform.reference_sources() |
| 445 | # Sorted reference index keeps the output idempotent regardless of map order. |
| 446 | for name in sorted(references): |
| 447 | # The agents-md hooks reference is a per-host template; everything else is |
| 448 | # read verbatim. |
| 449 | if name == "hooks" and platform.hooks_variant == "agents-md": |
| 450 | body = _render_agents_md_hooks(platform) |
| 451 | else: |
| 452 | body = _read_fragment(references[name]) |
| 453 | rel = f"{platform.refs_dst}/{name}.md" |
| 454 | artifacts.append(RenderedArtifact(rel, body)) |
| 455 | return artifacts |
| 456 | |
| 457 | |
| 458 | def render_always_on() -> list[RenderedArtifact]: |
no test coverage detected