# `Agentic.AgentFS.Overlay`

Manages temporary overlay directories for agent filesystem materialization.

Creates a temp directory, writes skills and memories into it, and
provides paths for bind-mounting into the agent sandbox.

# `create`

```elixir
@spec create() :: {String.t(), (-&gt; :ok)}
```

Create a new overlay directory for a session.

Returns `{overlay_path, cleanup_fn}` where `cleanup_fn` is a 0-arity
function that deletes the overlay directory.

# `read_memory`

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

Read back memory content modified by the agent.

# `read_skills`

```elixir
@spec read_skills(String.t(), [String.t()]) :: [map()]
```

Read back skills that were created or modified by the agent.

Returns list of `%{name: ..., content: ..., is_new: bool}`.

# `write_memory`

```elixir
@spec write_memory(String.t(), String.t()) :: :ok
```

Write memory content into the overlay directory.

Memory is written as `memory/MEMORY.md`.

# `write_skills`

```elixir
@spec write_skills(String.t(), [map()]) :: :ok
```

Write skills into the overlay directory.

Skills are written as `skills/<name>/SKILL.md`.

---

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