# `Jido.AI.Skill.AgentIntegration`
[🔗](https://github.com/agentjido/jido_ai/blob/v2.4.0/lib/jido_ai/skill/agent_integration.ex#L1)

Builds the Agent Skills catalog, loading tool, and reserved tool context for a
`Jido.AI.Agent` when the agent instance initializes.

Discovery is explicit because scanning a project loads instructions from its
filesystem. Passing `true` trusts the standard project and user skill roots;
passing a list trusts only those roots. Keyword options expose the discovery
bounds and a custom trust predicate. Keyword options do not trust any root
unless `:trust` is explicitly set.

Hosts may also pass runtime `%Jido.AI.Skill.Spec{}` values with `source: nil`
and inline bodies:

    agent_skills: [
      specs: runtime_specs,
      resource_provider: &MyApp.SkillResources.handle/2,
      resource_policy: [max_text_bytes: 131_072]
    ]

Runtime specs are validated, preserved without filesystem discovery or
filesystem roots, and added to the same scoped catalog as discovered skills.
Runtime specs take precedence over discovered skills with the same name;
shadowed discovered entries are reported in diagnostics. Duplicate runtime
names are rejected.

The catalog contains metadata-only discovered specs. Full files are read and
strictly validated only after the model selects a filesystem skill. Runtime
specs keep their inline body and metadata exactly as supplied.

Enabled agents receive both `load_skill` and `load_skill_resource`. The
optional `:resource_policy` sets listing and text-loading limits for both
actions.

# `t`

```elixir
@type t() :: %{
  specs: [Jido.AI.Skill.Spec.t()],
  index: String.t(),
  tools: [module()],
  tool_context: map(),
  diagnostics: Jido.AI.Skill.Diagnostics.t()
}
```

# `prepare`

```elixir
@spec prepare(false | nil | true | [String.t()] | keyword()) ::
  {:ok, t()} | {:error, term()}
```

Prepares Agent Skills integration data.

Accepted values:

- `false` or `nil` - disable Agent Skills integration
- `true` - trust and discover the standard project and user roots
- a list of paths - trust and discover only those roots
- keyword options - accepts `:specs`, `:resource_provider`, `:paths`,
  `:trust`, `:max_depth`, `:max_directories`, `:exclude_directories`, and
  `:resource_policy`

---

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