# `CommBus.Prompts`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

Prompt catalog with optional overrides and cached runtime loading.

# `body!`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec body!(
  String.t(),
  keyword()
) :: String.t()
```

Returns the prompt body for the given key, checking the override store first,
then falling back to the cached prompt's body.

## Parameters

  - `key` — The prompt identifier string.
  - `opts` — Keyword options forwarded to the override store.

## Returns

The prompt body as a `String.t()`.

# `default_root`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec default_root() :: String.t()
```

Returns the configured prompt root directory, falling back to
`config/comm_bus/prompts` relative to the project root.

## Returns

A string path to the prompt directory.

# `get_prompt!`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec get_prompt!(String.t()) :: CommBus.Template.Prompt.t()
```

Fetches a cached prompt by its key (slug, name, or path), raising if not found.

## Parameters

  - `key` — The prompt identifier string.

## Returns

A `%CommBus.Template.Prompt{}` struct.

## Raises

Raises if no prompt matches the given key.

# `list_prompts`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec list_prompts() :: [CommBus.Template.Prompt.t()]
```

Returns all cached prompts as a list, loading from disk if not yet cached.

## Returns

A list of `%CommBus.Template.Prompt{}` structs.

# `load_from_disk!`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec load_from_disk!(keyword()) :: map()
```

Loads all prompt files from the configured root directory, caches them in
`:persistent_term`, and returns the prompt map.

## Parameters

  - `opts` — Keyword options: `:root` (directory path), `:schema` (`:devman`, `:human`, `:flex`).

## Returns

A map of prompt keys to `%CommBus.Template.Prompt{}` structs.

## Raises

Raises if any prompt files fail validation.

# `reload!`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec reload!() :: map()
```

Reloads all prompts from disk, refreshing the `:persistent_term` cache.

## Returns

A map of prompt keys to `%CommBus.Template.Prompt{}` structs.

# `render!`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec render!(String.t(), map(), keyword()) :: String.t()
```

Renders a prompt by key with the given variables, applying any active
override before rendering. Raises on failure.

## Parameters

  - `key` — The prompt identifier string.
  - `vars` — A map of template variable bindings.
  - `opts` — Keyword options forwarded to the template engine.

## Returns

The rendered content as a `String.t()`.

---

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