NAME

Langertha::Raider::Briefing - Internal briefing of a subagent: its declared skills in front of its task

VERSION

version 0.504

SYNOPSIS

# Internal to Langertha-Raider -- no API promise.
my $b = Langertha::Raider::Briefing->new(
  agent    => 'raider-worker',
  skills   => [ 'getty-perl-core', 'perl-mcp' ],
  resolver => $context->skill_resolver,
);
return ( $b->missing_note, 1 ) if $b->has_missing;   # no spawn
warn $b->size_note if $b->oversized;                 # spawn anyway
my $prompt = $b->prompt($task);

DESCRIPTION

Internal module. Its interface may change without notice.

ADR 0020 §6: the skills an agent declares are put in front of its task in the format of the briefing plugin (hooks/briefing-preload, main_claude), so an agent reads the same under Claude Code with that plugin and under raider:

BRIEFING_HEADER                    (the plugin's text, word for word)
<skill name="NAME" dir="/abs/dir">
BODY
</skill>                           (one block per skill, "\n\n" between)

---

# Original task

TASK

NAME is the name as declared, dir the directory of the resolved SKILL.md, BODY the file without its frontmatter (the plugin's split_frontmatter) and stripped of leading and trailing whitespace.

Every name goes through "resolver". A name that does not resolve is listed in "missing"; the caller then starts nothing (the plugin's hard-fail policy, never a partial briefing). Above "budget_bytes" of skill text the briefing is "oversized": the spawn goes ahead with "size_note".

agent

The agent's name, for the notes. Required.

skills

The declared skill names, in order (Langertha::Raider::Context::Agents puts Claude Code's skills before briefing.skills, each once). Defaults to none.

resolver

The Langertha::Raider::SkillResolver (anything with resolve($name) returning { name, dir, file } or nothing). Required.

missing

The declared names that did not resolve, in order.

has_missing

True when "missing" lists a name: the spawn is refused.

missing_reason

my $why = $b->missing_reason('tpl');   # 'skilletor: ...' or undef

Why a name of "missing" did not resolve, when the resolver says (why_unresolved, "why_unresolved" in Langertha::Raider::SkillResolver).

blocks

One { name, dir, file } per resolved skill, in order.

text

The <skill> blocks joined by a blank line; empty without skills.

size

The length of "text" in UTF-8 bytes.

split_frontmatter

my $body = $briefing->split_frontmatter($text);

The text after a leading --- ... --- block, or the whole text when there is none -- the plugin's split_frontmatter, which is stricter than Langertha::Raider::Context::Frontmatter.

strip

Leading and trailing whitespace removed, as Python's str.strip does (which counts \x1c-\x1f as whitespace too).

budget_bytes

65536: above this many bytes of skill text the briefing is "oversized".

oversized

True when "size" is over "budget_bytes".

The plugin's BRIEFING_HEADER for Claude Code, word for word (its {dont} is "do NOT call the Skill tool for any of these names").

prompt

my $prompt = $briefing->prompt($task);

The subagent's prompt: "header", "text", then \n\n---\n\n# Original task\n\n and $task. $task unchanged when no skill is declared.

missing_note

briefing: agent 'NAME' references unknown skill(s): a, b
briefing: agent 'NAME' references unknown skill(s): a (skilletor: a@src is a template; ...), b

size_note

briefing: agent 'NAME' is briefed with N kB of skill text (over 64 kB) — consider declaring fewer or smaller skills.

The plugin's texts. A missing name the resolver gives a reason for ("missing_reason") is followed by it in parentheses; without reasons the note is the plugin's word for word.

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.

https://raudssus.de/