Skill manifest
A skill is a directory under <data_dir>/skills/<slug>/:
<slug>/├─ manifest.json # metadata + test status├─ skill.rhai # fn run(input)├─ test.rhai # fn test()└─ history/v<N>/ # archived previous versionsManifest
Section titled “Manifest”{ name: string; // slug (lowercase, alphanumerics + single hyphens) version: number; // integer, bumped on every update description: string; created_at: number; updated_at: number; test_status: { status: "passed" } | { status: "failed"; detail: string };}The contract
Section titled “The contract”skill.rhaidefinesfn run(input)— takes one string, returns a value.test.rhaidefinesfn test()— returnstruewhen the skill is correct, and callsrun(...)with at least one concrete example.
On every save and re-test, run + test are compiled together and test() is
executed. Passed → the skill is runnable. Failed → it’s flagged and
run_skill refuses it until it passes.
The language
Section titled “The language”Skills are written in Rhai — a small, embedded scripting
language. Useful string methods: .len(), .to_upper(), .to_lower(),
.trim(), .contains(s), .replace(a, b), .split(s), .sub_string(start, len).
The sandbox
Section titled “The sandbox”Rhai is sandboxed by construction — scripts see only language built-ins (no filesystem, no network). Each execution runs under hard caps: 200,000 operations, bounded call depth, and bounded string/array/map sizes. A runaway loop terminates instead of hanging the assistant.
Versioning & rollback
Section titled “Versioning & rollback”Updating a skill archives the outgoing skill.rhai / test.rhai to
history/v<N>/ and increments the version. A rollback restores the previous
version’s sources as a new version (a revert, preserving the chain), or
deletes the skill if it’s on v1 with nothing to revert to.