MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / render

Function render

tools/skillgen/gen.py:423–455  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

421
422
423def 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
458def render_always_on() -> list[RenderedArtifact]:

Callers 4

render_allFunction · 0.85
audit_coverageFunction · 0.85
schema_singletonFunction · 0.85
monolith_roundtripFunction · 0.85

Calls 5

_read_fragmentFunction · 0.85
RenderedArtifactClass · 0.85
_render_coreFunction · 0.85
_render_agents_md_hooksFunction · 0.85
reference_sourcesMethod · 0.80

Tested by

no test coverage detected