Assembles the runtime system prompt for an agent.
Called before every LLM turn by the agent's private build_system_prompt function.
Sections are added only when the relevant tools are present in the agent's
tool map, so agents only receive guidance for what they can actually do.
Assembly order
- Identity line — "You are a <type>." / "You are <name>, a <type>."
- Base system prompt from
spec.system_prompt - Per-tool guidance sections (one per inter-agent tool present)
- Skills section (from
skill_refresh_fnif present)
Summary
Functions
Build the full system prompt for an agent turn.
Types
@type opts() :: %{ system_prompt: String.t(), name: String.t() | nil, type: String.t() | nil, tools: %{required(String.t()) => Planck.Agent.Tool.t()}, skill_names: [String.t()], skill_refresh_fn: (-> [Planck.Agent.Skill.t()]) | nil }
Fields extracted from the agent state needed to build the prompt.