Conjure.Prompt (Conjure v0.1.1-alpha)

View Source

Generates system prompt fragments for skill discovery.

This module creates the XML-formatted content that should be appended to your system prompt to enable Claude to discover and use available skills.

Prompt Structure

The generated prompt includes:

  • A description of the skills system
  • List of available skills with name, description, and location
  • Instructions for skill usage

Example

skills = Conjure.load("/path/to/skills")
prompt_fragment = Conjure.Prompt.generate(skills)

system_prompt = """
You are a helpful assistant.

#{prompt_fragment}
"""

Token Efficiency

Only metadata (name, description, location) is included per skill. Full skill content is loaded on-demand via progressive disclosure.

Summary

Functions

Generates the <available_skills> XML block.

Counts the approximate tokens for the skills prompt.

Formats a single skill for the available_skills block.

Generates the complete skills system prompt fragment.

Generates skill usage instructions.

Generates the skills description text.

Functions

available_skills_block(skills)

@spec available_skills_block([Conjure.Skill.t()]) :: String.t()

Generates the <available_skills> XML block.

estimate_tokens(skills)

@spec estimate_tokens([Conjure.Skill.t()]) :: pos_integer()

Counts the approximate tokens for the skills prompt.

This is a rough estimate assuming ~4 characters per token.

format_skill(skill)

@spec format_skill(Conjure.Skill.t()) :: String.t()

Formats a single skill for the available_skills block.

generate(skills, opts \\ [])

@spec generate(
  [Conjure.Skill.t()],
  keyword()
) :: String.t()

Generates the complete skills system prompt fragment.

This combines the skills description, available skills listing, and usage instructions into a single XML block.

Options

  • :include_instructions - Whether to include usage instructions (default: true)

skill_usage_instructions(opts \\ [])

@spec skill_usage_instructions(keyword()) :: String.t()

Generates skill usage instructions.

skills_description()

@spec skills_description() :: String.t()

Generates the skills description text.