# `Planck.Agent.SystemPrompt`
[🔗](https://github.com/alexdesousa/planck/blob/v0.2.2/lib/planck/agent/system_prompt.ex#L1)

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

1. Identity line — "You are a <type>." / "You are <name>, a <type>."
2. Base system prompt from `spec.system_prompt`
3. Per-tool guidance sections (one per inter-agent tool present)
4. Skills section (from `skill_refresh_fn` if present)

# `opts`

```elixir
@type opts() :: %{
  system_prompt: String.t(),
  name: String.t() | nil,
  type: String.t() | nil,
  tools: %{required(String.t()) =&gt; Planck.Agent.Tool.t()},
  skill_pool: [Planck.Agent.Skill.t()],
  ranked_skill_names: [String.t()],
  top_skills: pos_integer(),
  prompt_hook: module() | nil,
  session_id: String.t() | nil,
  sidecar_node: atom() | nil
}
```

Fields extracted from the agent state needed to build the prompt.

# `build`

```elixir
@spec build(opts()) :: String.t()
```

Build the full system prompt for an agent turn.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
