parser

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package parser provides a reusable parser for SKILL.md files.

Index

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL