Skip to main content

Module parser

Module parser 

Source
Expand description

Dual-format parser. Canonical YAML is the source of truth; markdown frontmatter is the human-authoring surface that round-trips via canonical_from_markdown() / markdown_from_canonical().

Enums§

ParseError

Functions§

parse_canonical
Parse canonical skill.yaml.
parse_legacy_markdown
Parse a legacy skill file — pre-M0 markdown with minimal frontmatter (just name + description). Fills in defaults so the file can be loaded by the new pipeline without rewriting it.
parse_markdown
Parse markdown-frontmatter skill source. Frontmatter (between two --- fences) is YAML; the body becomes content.abstract plus — if it has a ## Steps heading — a synthesised content.procedure, or otherwise a content.context. This is the human-authoring surface; canonical YAML remains source of truth on disk.
serialize_canonical
Serialise a SkillManifest to canonical YAML. Deterministic field order matches the struct definition.
serialize_markdown
Render a SkillManifest back to markdown frontmatter form. The body is derived from the populated content mode: context → context body, procedure → “## Steps” list, command → fenced block.
yaml_to_markdown
Convenience: parse canonical YAML, serialise back to markdown. Used by ensure_mur_skill so built-in yaml skills produce AI-tool-consumable markdown at SKILL.md.