# `Jido.Agent.Directive.StopChild`
[🔗](https://github.com/agentjido/jido/blob/v2.3.0/lib/jido/agent/directive.ex#L425)

Request that a tracked child agent stop gracefully.

This directive provides symmetric lifecycle control for child agents
spawned via `SpawnAgent`. It sends a shutdown signal to the child,
allowing it to terminate cleanly.

The child is identified by its `tag` (the key used in `SpawnAgent`).
If the child is not found, the directive is a no-op.

## Fields

- `tag` - Tag of the child to stop (must match a key in the children map)
- `reason` - Reason for stopping (default: `:normal`)

## Examples

    # Stop a worker by tag
    %StopChild{tag: :worker_1}

    # Stop with a specific reason
    %StopChild{tag: :processor, reason: :shutdown}

## Behavior

The runtime sends a `jido.agent.stop` signal to the child process,
which triggers a graceful shutdown. The child's exit will be delivered
back to the parent as a `jido.agent.child.exit` signal.

`SpawnAgent` children default to `restart: :transient`, so a normal
`StopChild` shutdown removes the child instead of immediately restarting it.
Custom reasons are wrapped as `{:shutdown, reason}` so transient children
are still removed cleanly.

# `t`

```elixir
@type t() :: %Jido.Agent.Directive.StopChild{reason: any(), tag: any()}
```

# `schema`

```elixir
@spec schema() :: Zoi.schema()
```

Returns the Zoi schema for StopChild.
