Renders skills into prompt text for agent system prompts.
Provides utilities to format skill manifests and bodies into structured text that can be prepended/appended to agent prompts.
Summary
Functions
Collects all allowed tools from a list of skills.
Filters a list of tool modules by the allowed tools from skills.
Renders a list of skills into a formatted prompt section.
Renders a compact, model-facing skill index.
Renders a single skill into formatted prompt text.
Renders a compact index for skills currently registered in the runtime registry.
Functions
@spec collect_allowed_tools([module() | Jido.AI.Skill.Spec.t() | String.t()]) :: [ String.t() ]
Collects all allowed tools from a list of skills.
Returns the union of all allowed_tools from the given skills.
@spec filter_tools([module()], [module() | Jido.AI.Skill.Spec.t() | String.t()]) :: [ module() ]
Filters a list of tool modules by the allowed tools from skills.
Returns only the tools whose names match the union of allowed_tools
from the given skills. If no skills specify allowed_tools, returns all tools.
@spec render( [module() | Jido.AI.Skill.Spec.t() | String.t()], keyword() ) :: String.t()
Renders a list of skills into a formatted prompt section.
Options
:include_body- Include skill body content (default: false). Preferrender_index/2plusJido.AI.Actions.Skill.LoadSkillfor progressive disclosure.:header- Custom header text (default: "You have access to the following skills:")
Example
skills = [MyApp.Skills.Calculator, "code-review"]
Skill.Prompt.render(skills)
# => "You have access to the following skills:\n\n## calculator\n..."
@spec render_index( [module() | Jido.AI.Skill.Spec.t() | String.t()], keyword() ) :: String.t()
Renders a compact, model-facing skill index.
Unlike render/2, this function intentionally omits skill bodies so prompts
can advertise available skills without loading their full instructions. Pair
the rendered index with Jido.AI.Actions.Skill.LoadSkill so a model can load
the selected skill body on demand.
Options
:tags- String, atom, or list of tags used to filter skills.:tag_match-:any(default) or:allwhen multiple tags are provided.:header- Header text (default:"## Skills"). Set tofalseornilto omit.:load_instruction- Instruction appended after the index. Set tofalseornilto omit.:include_allowed_tools- Append allowed tool names to each entry.
@spec render_one( module() | Jido.AI.Skill.Spec.t() | String.t(), keyword() ) :: String.t()
Renders a single skill into formatted prompt text.
Renders a compact index for skills currently registered in the runtime registry.
This is the common entry point for lazy skill loading: register runtime skills,
render a filtered index into the agent system prompt, and expose the
load_skill action so the agent can retrieve the full body only when needed.