thulp-skill-files
SKILL.md file parsing and loading for the Thulp execution context platform.
Features
- SKILL.md Parsing: Parse skill files with YAML frontmatter and markdown content
- Preprocessor: Handle
$ARGUMENTS,!command``,{{variable}}, and `${ENV_VAR}` substitutions - Skill Loader: Discover skills from multiple directories with scope-based priority
- Tool Restrictions: Support for
allowed-toolsto sandbox skill execution
Installation
Add to your Cargo.toml:
[]
= { = "../thulp-skill-files" }
Quick Start
Parsing a Skill File
use SkillFile;
let skill = parse?;
println!;
println!;
Loading Skills from Directories
use ;
let config = default;
let loader = new;
let skills = loader.load_all?;
for skill in &skills
Preprocessing Skill Content
use SkillPreprocessor;
use HashMap;
let pp = new;
let mut context = new;
context.insert;
let content = "Process $ARGUMENTS for {{project}}";
let processed = pp.preprocess?;
// Result: "Process file.txt for myapp"
SKILL.md Format
name: my-skill
description: Does something useful
allowed-tools:
- - - - -
When invoked with $ARGUMENTS, do the following:
1. 2.3.
Frontmatter Fields
| Field | Type | Default | Description |
|---|---|---|---|
name |
string | directory name | Display name |
description |
string | first paragraph | What the skill does |
argument-hint |
string | - | Hint for arguments |
disable-model-invocation |
bool | false | Prevent automatic invocation |
user-invocable |
bool | true | Allow user invocation |
allowed-tools |
list | all | Restrict tool usage |
model |
string | - | Model to use |
context |
inline/fork | inline | Execution context |
agent |
string | - | Subagent type for fork |
requires-approval |
bool | false | Require user approval |
tags |
list | [] | Categorization tags |
version |
string | - | Skill version |
author |
string | - | Skill author |
Scope Priority
Skills are loaded from multiple directories with priority resolution:
- Enterprise (highest) - Organization-wide skills
- Personal - User's personal skills (~/.claude/skills/)
- Project (lowest) - Project-specific skills (./.claude/skills/)
- Plugin - Namespaced, no conflicts
When multiple skills have the same name, higher scope wins.
Preprocessor Substitutions
| Syntax | Description |
|---|---|
$ARGUMENTS |
Replaced with invocation arguments |
!command`` |
Replaced with shell command output |
{{variable}} |
Replaced with context value |
{{a.b.c}} |
Replaced with nested context value |
${ENV_VAR} |
Replaced with environment variable |
License
MIT OR Apache-2.0