NAME
Langertha::Raider::Context::Frontmatter - Internal lenient reader of the YAML frontmatter of skill and agent files
VERSION
version 0.504
SYNOPSIS
# Internal to Langertha-Raider -- no API promise.
my ( $fm, $body, $problem ) = Langertha::Raider::Context::Frontmatter->parse(
$text, booleans => [qw( disable-model-invocation )],
);
DESCRIPTION
Internal module. Its interface may change without notice.
The one frontmatter reader of the skill catalogue (Langertha::Raider::Context::Skills) and the agent catalogue (Langertha::Raider::Context::Agents): Claude Code's Markdown files with a leading --- ... --- block.
The block is parsed as YAML. What YAML rejects but Claude Code reads -- typically an unquoted : inside a description -- is read line by line instead:
key: valueat column 0: the value is everything after the first:, trimmed, outer quotes stripped. The keys named inbooleansreadtrue/falseas booleans.Indented lines continue the previous key, joined with a space;
- itemlines make it a list; a|/>block becomes its lines joined with spaces.An indented
key:orkey: valuedirectly under a key without a value (not a block) makes a nested mapping, one level deep -- enough forbriefing:/skills:/- item. Its own continuation and- itemlines go to the nested key.
Only when that finds no key either, or the YAML is not a mapping, the frontmatter is empty and a problem is returned.
parse
my ( $fm, $body, $problem ) = $class->parse($text, booleans => \@keys);
The frontmatter as a hash ref (empty without a block), the body without the frontmatter and its leading blank lines, and a problem -- a short reason such as invalid frontmatter: ... or frontmatter is not a mapping -- or undef.
lenient
my $fm = $class->lenient($yaml, { 'user-invocable' => 1 });
The line reader described above on its own: a hash ref, or undef when it finds no key. The second argument names the boolean keys.
SEE ALSO
SUPPORT
Issues
Please report bugs and feature requests at https://github.com/Getty/langertha-raider/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.