Skip to main content

Overview

Resources are created as part of the skill creation and update workflow. They cannot be created independently - they must be associated with a parent skill. Resources bundle supporting files like reference documentation, scripts, assets, and other content with your skills.

Creating Resources with New Skills

When creating a skill using skills.create, you can include an array of resources:

Input Schema

resources
array
default:"[]"
Array of resource objects to create with the skill

Example: Creating a Skill with Resources

import { trpc } from './trpc';

const skill = await trpc.skills.create.mutate({
  slug: 'docker-setup',
  name: 'Docker Setup',
  description: 'Complete Docker installation and configuration guide',
  skillMarkdown: `
# Docker Setup

A comprehensive guide to Docker installation.

See the installation script in resources.
  `.trim(),
  resources: [
    {
      path: 'scripts/install.sh',
      kind: 'script',
      content: `#!/bin/bash\n\n# Install Docker\ncurl -fsSL https://get.docker.com | sh`,
      metadata: {
        platform: 'linux',
        version: '1.0'
      }
    },
    {
      path: 'reference/troubleshooting.md',
      kind: 'reference',
      content: `
# Troubleshooting

If you encounter issues, check [[docker-logs]] or [[system-requirements]].
      `.trim()
    },
    {
      path: 'assets/architecture.png',
      kind: 'asset',
      content: '<base64-encoded-image-data>',
      metadata: {
        format: 'png',
        size: '1024x768'
      }
    }
  ]
});

console.log(`Created skill with ${skill.resources.length} resources`);

Resource Types

The kind field helps organize and identify resources:

reference

Documentation, guides, API references, and other text-based reference material. Default type if not specified.

script

Executable scripts in any language (bash, Python, JavaScript, etc.) that automate tasks or provide utilities.

asset

Static assets like images, data files, configuration templates, or binary files.

other

Any other type of resource that doesn’t fit the above categories.

Skill Mentions in Resources

Resources support the same [[skill-name]] mention syntax as skill markdown:
# Installation Guide

Before proceeding, ensure you have [[docker]] and [[git]] installed.

For more details, see [[system-requirements]].
Mentions are:
  • Validated during creation to ensure referenced skills exist and are accessible
  • Rendered as clickable links in the renderedContent field
  • Tracked as graph links for the knowledge graph
  • Synced automatically when resource content changes

Validation

Resources undergo validation during creation:
  1. Path validation - Must be non-empty and unique within the skill
  2. Mention validation - All [[skill-name]] mentions must reference accessible skills
  3. Vault access - Referenced skills must be in the same vault or an accessible vault
  4. Content validation - Mention syntax must be well-formed

Access Control

Resources inherit access control from their parent skill:
  • Resources belong to the skill’s vault
  • Read/write permissions match the skill’s vault permissions
  • Resources are automatically deleted when their parent skill is deleted
  • skills.create - Create a skill with resources
  • skills.update - Update resources (see Update Resources)
  • resources.getById - Retrieve a resource
  • skills.getById - Get a skill with all its resources

Build docs developers (and LLMs) love