Skip to main content

Crate thulp_skill_files

Crate thulp_skill_files 

Source
Expand description

§thulp-skill-files

SKILL.md file parsing and loading for the Thulp execution context platform.

This crate provides functionality for:

  • Parsing SKILL.md files with YAML frontmatter
  • Preprocessing skill content (arguments, commands, variables)
  • Loading skills from directories with scope-based priority

§Quick Start

use thulp_skill_files::{SkillFile, SkillLoader, SkillLoaderConfig, SkillPreprocessor};
use std::collections::HashMap;

// Parse a single skill file
let skill = SkillFile::parse("path/to/SKILL.md")?;
println!("Skill: {}", skill.effective_name());

// Load all skills from configured directories
let config = SkillLoaderConfig::default();
let loader = SkillLoader::new(config);
let skills = loader.load_all()?;

// Preprocess skill content
let pp = SkillPreprocessor::new();
let context = HashMap::new();
let processed = pp.preprocess(&skill.content, "my args", &context)?;

§SKILL.md Format

Skills are defined in SKILL.md files with optional YAML frontmatter:

---
name: my-skill
description: Does something useful
allowed-tools:
  - Read
  - Write
---
# Instructions

When invoked with $ARGUMENTS, do the following...

§Frontmatter Options

FieldTypeDescription
namestringDisplay name (defaults to directory name)
descriptionstringWhat the skill does
argument-hintstringHint for expected arguments
disable-model-invocationboolPrevent automatic invocation
user-invocableboolAllow user to invoke (default: true)
allowed-toolslistRestrict tools the skill can use
contextinline/forkExecution context
requires-approvalboolRequire user approval

§Scope Priority

Skills are loaded with priority: Enterprise > Personal > Project. Plugin skills are namespaced and don’t conflict.

Re-exports§

pub use error::Result;
pub use error::SkillFileError;
pub use frontmatter::PriceModel;
pub use frontmatter::SkillContext;
pub use frontmatter::SkillFrontmatter;
pub use frontmatter::SkillHooks;
pub use loader::LoadedSkill;
pub use loader::SkillLoader;
pub use loader::SkillLoaderConfig;
pub use loader::SkillScope;
pub use parser::SkillFile;
pub use parser::SupportingFile;
pub use parser::SupportingFileType;
pub use preprocessor::SkillPreprocessor;

Modules§

error
Error types for skill file operations.
frontmatter
YAML frontmatter types for SKILL.md files.
loader
Skill loader and directory scanner.
parser
SKILL.md file parser.
preprocessor
Preprocessor for skill content.