Documentation
¶
Overview ¶
Package parser provides a reusable parser for SKILL.md files.
Index ¶
- func ExtractForgeMeta(meta *contract.SkillMetadata) *contract.ForgeSkillMeta
- func ExtractForgeReqs(meta *contract.SkillMetadata) (*contract.SkillRequirements, []string, *contract.SkillGuardrailConfig)
- func ExtractForgeUses(meta *contract.SkillMetadata) []contract.SkillToolDependency
- func Parse(r io.Reader) ([]contract.SkillEntry, error)
- func ParseWithMetadata(r io.Reader) ([]contract.SkillEntry, *contract.SkillMetadata, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractForgeMeta ¶ added in v0.17.0
func ExtractForgeMeta(meta *contract.SkillMetadata) *contract.ForgeSkillMeta
ExtractForgeMeta extracts the full typed ForgeSkillMeta from the generic metadata map by re-marshaling metadata["forge"] through a yaml round-trip. Returns nil when no forge namespace exists or it fails to parse.
func ExtractForgeReqs ¶
func ExtractForgeReqs(meta *contract.SkillMetadata) (*contract.SkillRequirements, []string, *contract.SkillGuardrailConfig)
ExtractForgeReqs extracts SkillRequirements, egress_domains, and guardrails from the generic metadata map. Thin wrapper over ExtractForgeMeta for existing call sites.
func ExtractForgeUses ¶ added in v0.18.1
func ExtractForgeUses(meta *contract.SkillMetadata) []contract.SkillToolDependency
ExtractForgeUses extracts the skill's governed tool dependencies (metadata.forge.uses — references into the platform tool registry). Thin wrapper over ExtractForgeMeta, mirroring ExtractForgeReqs. Returns nil when the skill declares none — the pre-registry common case.
func Parse ¶
func Parse(r io.Reader) ([]contract.SkillEntry, error)
Parse reads skill entries from an io.Reader and extracts structured SkillEntry values.
Supported formats:
- "## Tool: <name>" heading starts a new entry; paragraph lines become Description
- "**Input:** <text>" sets InputSpec on the current entry
- "**Output:** <text>" sets OutputSpec on the current entry
- "- <name>" (single-word/hyphenated list item) creates an entry with Name only (legacy)
func ParseWithMetadata ¶
func ParseWithMetadata(r io.Reader) ([]contract.SkillEntry, *contract.SkillMetadata, error)
ParseWithMetadata extracts optional YAML frontmatter (between --- delimiters) then passes the markdown body through existing Parse(). Returns entries with metadata attached, plus the top-level SkillMetadata.
Types ¶
This section is empty.