frontmatter

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package frontmatter provides a minimal, dependency-free parser for the ---fenced "key: value" blocks that prefix skill, command, and memory files. It mirrors the YAML-like frontmatter convention without pulling in a YAML library, keeping fairpeer's single-(TOML)-dependency promise.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Split

func Split(s string) (map[string]string, string)

Split separates an optional leading ---fenced block of "key: value" lines from the body. It returns the parsed keys (lowercased) and the remaining body. With no opening/closing fence the whole input is the body. An opened but never closed fence treats the entire input as body (no partial parse).

Values are trimmed of surrounding whitespace and outer quotes (" or '). A key with an empty value heads either a section ("metadata:") whose indented "key: value" lines flatten (metadata.type → fm["type"]), or a YAML list whose "- item" lines are joined comma-separated (allowed-tools → "read_file, grep"), so list-valued keys from skills authored for other agent tools survive. The last write wins for duplicate keys.

Types

This section is empty.

Jump to

Keyboard shortcuts

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