# `AgentWorkshop.GitContext`
[🔗](https://github.com/joshrotenberg/agent_workshop/blob/main/lib/agent_workshop/git_context.ex#L2)

Git context injection for Workshop agents.

When `git_context: true` is set in `configure/1`, a summary of the
current git state is automatically appended to every agent's system
prompt. Agents always know what branch they're on, what's changed,
and recent commit history.

## Usage

    configure(git_context: true)

## What's injected

- Current branch and tracking info
- Dirty/clean status
- Staged and unstaged file counts
- Last 5 commit subjects
- Uncommitted file list (if dirty)

# `build`

```elixir
@spec build(keyword()) :: String.t() | nil
```

Build a git context string for the current working directory.

Returns a formatted string suitable for appending to an agent's
system prompt, or `nil` if git info is unavailable.

# `changes`

```elixir
@spec changes(keyword()) :: {:ok, String.t()} | {:error, term()}
```

Get uncommitted changes as a formatted string.

# `summary`

```elixir
@spec summary(keyword()) :: {:ok, map()} | {:error, term()}
```

Get a structured summary of the current git state.

Returns a map with branch, status, recent commits, and file changes.

---

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