Files as Skills

An agent that uses file resources as dynamically loadable skills - using blueprint introspection to list available files with their names and descriptions, then reading file content on demand to learn new capabilities at runtime.

skills
files
dynamic
2116

The Files as Skills blueprint demonstrates how plain file resources become a dynamic skill system through two simple abilities: blueprint introspection and file reading.

Skills are defined as ordinary file resources attached to the blueprint. Each file has a name (the skill's title) and a description (when to use it). The file's content holds the full instructions. This mirrors how professionals organize knowledge - a title tells you what it covers, a summary tells you if it is relevant, and the full document gives you the details.

How It Works

The architecture relies on two abilities and the progressive disclosure pattern:

  1. List Skills uses the blueprint/resource/list template filtered to type: file. This returns the id, name, and description of every file resource in the blueprint without loading any content. The agent sees the full catalogue of available skills and can match user requests to the right skill by description alone.

  2. Read Skill uses the file/read[by-id] template to fetch the full content of a specific file by its id. The agent calls this only after identifying the relevant skill from the list. Instructions are loaded just in time, keeping context focused and efficient.

This two-step introspect-then-read pattern means adding a new skill is as simple as adding a new file resource to the blueprint with a clear name and description. No abilities need to change, no backstory needs updating, and no code is involved.

Why This Pattern Works

  • Progressive disclosure - the agent sees only metadata until it needs the full content, preventing context bloat with dozens of skills.
  • Zero-touch extensibility - adding a file resource with a name and description instantly makes a new skill available. The agent discovers it automatically through introspection.
  • Self-describing - each file's name and description serve as the skill's catalogue entry. Well-written descriptions are all the agent needs to decide relevance.
  • Scalable - the blueprint can hold dozens or hundreds of skill files without performance impact since content is loaded on demand.
  • Shareable - file resources can be reused across blueprints or shared between agents.

Skill File Format

Each skill file is plain Markdown with clear instructions:

# Summarize URL

## Instructions
1. Ask the user for the URL if not provided
2. Fetch the content of the URL
3. Produce a 3-5 sentence summary of the main points
4. Include the page title and publication date if available

The file's name and description fields (set on the file resource itself) are what the List Skills ability returns during introspection. The file content is only fetched when the agent decides to use that skill.

Getting Started

  1. Add file resources to the blueprint - each one is a skill. Give each file a clear name and a description that explains when to use it.
  2. Write the skill's instructions as the file content.
  3. Chat with the agent - it will introspect the blueprint, discover your skills, and use them automatically.
  4. To add more skills, just add more file resources. The agent picks them up immediately through introspection.

The example includes three placeholder skills (Data Analysis, Content Writing, Code Review) to illustrate the pattern. Replace them with your own domain-specific skills.

Backstory

Common information about the bot's experience, skills and personality. For more information, see the Backstory documentation.

You are an AI assistant whose capabilities are defined by skill files attached to this blueprint. You discover skills dynamically and load them on demand. ## HOW YOU WORK Before responding to any user request, follow this workflow: 1. LIST AVAILABLE SKILLS Call the "List Skills" ability to introspect the blueprint and discover all available skill files. This returns the id, name, and description of each file resource. Never assume a capability is unavailable without checking first. 2. MATCH THE REQUEST TO A SKILL Review the skill names and descriptions from the list. Identify which skill best matches what the user is asking for. If no skill matches, tell the user what skills are available and suggest which ones might help. 3. READ THE SKILL Call the "Read Skill" ability with the id of the matching skill file to load its full instructions. 4. FOLLOW THE INSTRUCTIONS Execute the skill's instructions step by step. Do not skip steps or improvise unless the skill explicitly allows it. 5. REPORT THE RESULT Clearly report what you did and the outcome. ## RULES - ALWAYS list skills before responding to any task request - NEVER hardcode capabilities - your skills come from the file resources - If a skill's instructions are ambiguous, ask the user for clarification rather than guessing - When multiple skills could apply, tell the user which ones match and let them choose - The current date is ${EARTH_DATE}

Skillset

This example uses a dedicated Skillset. Skillsets are collections of abilities that can be used to create a bot with a specific set of functions and features it can perform.

  • 🆖

    List Skills

    Lists all available skill files in the blueprint by introspecting file resources. Returns the id, name, and description for each skill.
  • 🌓

    Read Skill

    Reads the full content of a skill file by its id. Use List Skills first to discover available skill ids.

Terraform Code

This blueprint can be deployed using Terraform, enabling infrastructure-as-code management of your ChatBotKit resources. Use the code below to recreate this example in your own environment.

Copy this Terraform configuration to deploy the blueprint resources:

Next steps:

  1. Save the code above to a file named main.tf
  2. Set your API key: export CHATBOTKIT_API_KEY=your-api-key
  3. Run terraform init to initialize
  4. Run terraform plan to preview changes
  5. Run terraform apply to deploy

Learn more about the Terraform provider

A dedicated team of experts is available to help you create your perfect chatbot. Reach out via or chat for more information.