NAME

App::Briefing - Preload declared skills into Claude Code and Codex subagents at spawn time

VERSION

version 0.006000

SYNOPSIS

Install the plugin in Claude Code:

/plugin marketplace add Getty/marketplace
/plugin install briefing@getty

or in Codex:

codex plugin marketplace add Getty/marketplace
codex plugin add briefing@getty

Declare the skills an agent needs, here in .claude/agents/reviewer.md:

---
name: reviewer
description: Reviews a change and runs the tests
briefing:
  skills:
    - code-style
    - superpowers:brainstorming
---

or as a comment line in a Codex agent's TOML file:

# briefing: skills = ["code-style", "superpowers:brainstorming"]

Check every declaration of a project before anything spawns:

briefing doctor --cwd ~/dev/shop

Or ask the library the same questions:

use App::Briefing;

my $briefing = App::Briefing->new( cwd => '/home/you/dev/shop' );

my $result = $briefing->brief_agent( 'reviewer', harness => 'claude' );
print "missing: @{ $result->{missing} }\n" if $result && @{ $result->{missing} };

for my $agent (@{ $briefing->check_agents( harness => 'both' ) }) {
  printf "%s %s: %d bytes\n", $agent->{harness}, $agent->{agent}, $agent->{size};
}

DESCRIPTION

briefing makes sure a subagent starts with the skills it needs. An agent declares them; when Claude Code or Codex spawns it, briefing's hook puts the full text of each declared skill into the agent's context, so it is briefed before its first turn instead of being told in its prompt to go and load them. If a declared skill cannot be found, nothing goes ahead on a partial briefing: Claude Code refuses the spawn, and a Codex agent, which cannot be stopped at that point, is told not to attempt the task and to report the failure.

Most people use briefing as a plugin, installed from the Getty marketplace as shown above. Codex runs a plugin's hooks only after you trust them, and loads a project's own agents only in a trusted project. The plugin's README covers installation, the first agent and what each platform needs: https://github.com/Getty/briefing.

A Claude Code agent lists its skills under briefing.skills in its frontmatter, one - name per line or as [a, b] on one line. A Codex agent carries one comment line, # briefing: skills = [...], outside any multi-line string: Codex drops an agent file over any key it does not know, so the declaration has to be a comment. An old [briefing] table is still read, and reported as a failure, because Codex 0.153 and later ignores the whole agent over it.

Names resolve nearest first, where the harness itself looks. A bare name such as code-style comes, under Claude Code, from .claude/skills in the project, then ~/.claude/skills, then the skills of installed plugins that are switched on in enabledPlugins. Under Codex it comes from .codex/skills and .agents/skills in the working directory and each parent up to the repository root, then $CODEX_HOME/skills, ~/.agents/skills, $CODEX_HOME/skills/.system and /etc/codex/skills, never from a plugin. A namespaced name such as superpowers:brainstorming goes straight to that plugin: under Claude Code only to one that is installed and enabled, under Codex to its plugin cache. Claude Code agents are the .md files under .claude/agents in the project, then ~/.claude/agents, matched by their name; Codex agents are found by name in any *.toml under agents/, or through [agents.NAME] config_file, in .codex from the working directory up to the repository root, then $CODEX_HOME, then /etc/codex.

Each skill arrives as its own element holding the SKILL.md body without its frontmatter; dir lets the agent read the skill's references/ and scripts/ when it needs them, as they are not included:

<skill name="code-style" dir="/home/you/dev/shop/.claude/skills/code-style">
...
</skill>

Every briefing leaves you one audit line, such as briefing: reviewer ← code-style, review-checklist (13 kB), and a second one when the skills add up to more than 64 kB; such a spawn still goes ahead. When a session starts or resumes, the hook names every declaration of that harness that would fail. briefing doctor (see briefing) shows the whole picture for both harnesses and exits 1 when a spawn would fail, so it can guard CI.

This distribution, App-Briefing, holds briefing's core: this library and the command briefing, which runs the hooks and the doctor. The plugin runs the same core through its own launcher, as a prebuilt binary once a plugin version pins one. Installing App-Briefing gives you the library and the command; it does not install the plugin into Claude Code or Codex.

As a library, an App::Briefing object answers for one project. "cwd", "home" and "codex_home" fix the context explicitly, so the answers do not depend on the process's working directory, and the methods return data instead of printing: "brief_agent" and "check_agents" for declarations, "process_hook" for a whole hook payload. Only "process_notice" writes, its one state file. App::Briefing::Team builds the doctor's tab-separated team findings on it, and App::Briefing::CLI is the command's terminal side. The attributes and methods follow.

filesystem

The filesystem adapter every file and environment read goes through. Defaults to a new App::Briefing::Filesystem object.

cwd

The project directory: agents and skills are looked up as a harness started there would look them up. Defaults to PWD, else the process's current directory. Nothing changes the process's working directory.

home

The user's home directory, which holds .claude and .agents. Defaults to HOME; on Windows then USERPROFILE, then HOMEDRIVE plus HOMEPATH; then the home directory in the user's password entry; then the process's current directory. An empty variable counts as unset.

codex_home

The Codex configuration directory. Defaults to CODEX_HOME, else .codex below "home".

resolve_skill

my $file = $briefing->resolve_skill('superpowers:brainstorming', harness => 'claude');

Returns the path of the SKILL.md a spawn would be briefed with for one declared skill name, or nothing when the name does not resolve. harness is claude (the default) or codex; each searches where that harness looks (see "DESCRIPTION"). The spawn hooks, the session-start check, the doctor and App::Briefing::Team all use this resolution.

skill_problem

my $reason = $briefing->skill_problem('superpowers:brainstorming');

Returns a short reason why a skill name does not resolve under Claude Code, such as plugin 'superpowers' is not installed and enabled, or nothing when it resolves.

claude_agent_skills

my $skills = $briefing->claude_agent_skills($agent_file);

Returns an array reference of the briefing.skills names declared in one Claude Code agent file, read as the spawn hook reads them; empty when the file declares none.

brief_agent

my $result = $briefing->brief_agent('reviewer', harness => 'claude');

Resolves one agent's declaration for harness, claude or codex (required). Returns undef when that harness has no agent by that name or the agent declares no skills, else a hash reference:

  • agent, path, harness

    The agent's name, its file and the harness.

  • skills

    The declared names, in order.

  • missing

    The names that did not resolve.

  • text

    The <skill> elements a spawn receives, without the header. Empty when anything is missing: there is never a partial briefing.

  • size

    The UTF-8 size in bytes of the resolved skill text.

  • legacy

    True when a Codex agent declares its skills in a [briefing] table.

check_agents

my $results = $briefing->check_agents(harness => 'both');

Returns an array reference with the "brief_agent" result of every agent that declares skills, for harness claude, codex or both (the default): Claude Code first, each harness sorted by agent name. The doctor and the session-start check report from it. Nothing is printed or written.

process_hook

my $operation = $briefing->process_hook($payload);
my $operation = $briefing->process_hook($payload, event => 'SubagentStart');

Answers one decoded hook payload as the plugin's hooks do. SubagentStart briefs the agent, or tells it to abort when a skill is missing; SessionStart reports the declarations that would fail; any other payload whose tool_name is Agent goes to the Claude Code guard, which denies a spawn with a missing skill; everything else has no answer. event (SubagentStart, PreToolUse or SessionStart) takes the place of the payload's hook_event_name, and a cwd in the payload applies to this call only.

Returns a hash reference with output (the hook's JSON answer as a hash reference, or undef for none), stderr (text for standard error, possibly empty) and exit_code (0). Nothing is printed or written.

process_notice

my $operation = $briefing->process_notice({});

Evaluates the one-time note that points installs from another marketplace at the shared Getty marketplace, and returns the same hash as "process_hook". The output is empty unless CLAUDE_PLUGIN_ROOT lies in a marketplace cache (.../cache/MARKETPLACE/...) other than getty and .claude/.briefing-marketplace-notice below "home" does not exist yet. Unlike "process_hook", this method writes: it creates that state file, so the note appears once. A state file that cannot be written does not suppress the note. It prints nothing itself.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests at https://github.com/Getty/briefing/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)