skill

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package skill loads markdown skills that teach tomo a workflow. A skill is a directory holding SKILL.md: YAML frontmatter (name, description, and a mandatory permission manifest) followed by the instructions themselves. The convention matches Agent Skills, so a SKILL.md written for that ecosystem loads here.

Skills are plain files the user can read and edit, and nothing installs them but the user: there is no remote hub and no auto-install. A skill enters the system prompt as a one-line index entry; its body loads on demand when the agent reaches for it. A skill that cannot be parsed, or that omits its permission manifest, fails closed: it is left out of the index entirely.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Promote

func Promote(from, to *Store, name string) error

Promote moves a draft from one store into another: the explicit step that turns a proposal into an installed skill. It validates the draft loads cleanly first and refuses to clobber an installed skill of the same name, so a broken or colliding proposal never quietly replaces working instructions. Nothing but a deliberate user act calls this.

Types

type Doc

type Doc struct {
	Name        string
	Description string
	Permissions Permissions
	Body        string
}

Doc is a skill in memory, before it is written to disk. The curator builds one when it drafts a skill from a workflow it saw; the CLI never does, since a human writing a skill just edits the file.

type Entry

type Entry struct {
	Name        string
	Description string
	Permissions Permissions
	Enabled     bool
	Err         error
}

Entry is a skill's listing state, whether or not it loaded cleanly. The CLI uses it to show everything on disk, including the broken and the disabled.

type Finding

type Finding struct {
	Skill   string
	Level   string // "error" or "warn"
	Message string
}

Finding is one problem the scanner has with a skill. An error means the skill should not be trusted as written; a warning is worth a look but not fatal.

type Permissions

type Permissions struct {
	Read  bool `yaml:"read"`
	Net   bool `yaml:"net"`
	Write bool `yaml:"write"`
	Exec  bool `yaml:"exec"`
}

Permissions is the capability manifest every skill must declare. It names the classes of action the skill's workflow expects to take, mirroring the policy engine's classes. An empty manifest declares a skill that only reasons over what is already in the conversation.

type Skill

type Skill struct {
	Name        string
	Description string
	Permissions Permissions
	Body        string
	Dir         string
}

Skill is one loaded workflow.

type Store

type Store struct {
	Dir string
}

Store roots the skills under one directory, one subdirectory per skill.

func (*Store) Disable

func (s *Store) Disable(name string) error

Disable drops a marker file in the skill's directory so the loader skips it. The skill stays on disk; it just no longer rides in the prompt.

func (*Store) Enable

func (s *Store) Enable(name string) error

Enable clears a skill's disabled marker so it loads again.

func (*Store) Entries

func (s *Store) Entries() ([]Entry, error)

Entries lists every skill directory with its load state, sorted by name.

func (*Store) Index

func (s *Store) Index() (string, error)

Index is the one-line-per-skill block that rides in the system prompt. It is empty when no skills are installed.

func (*Store) Lint

func (s *Store) Lint() ([]Finding, error)

Lint scans every skill and reports what is wrong: skills that fail to load, skills whose body reaches for a capability the manifest does not declare, and skills carrying hidden instructions. A clean store returns no findings.

func (*Store) List

func (s *Store) List() ([]Skill, error)

List returns every enabled, well-formed skill, sorted by name. Skills that fail to parse or lack a manifest are skipped here so a bad skill never reaches the prompt; use Lint to see why one was rejected.

func (*Store) Read

func (s *Store) Read(name string) (string, error)

Read returns one enabled skill's body by name, for loading on demand.

func (*Store) Remove

func (s *Store) Remove(name string) error

Remove deletes a skill directory. The CLI uses it to discard a draft.

func (*Store) Tools

func (s *Store) Tools() []tool.Tool

Tools returns the agent-facing surface of the skill store: a way to pull one skill's full instructions into the conversation when the index says it fits.

func (*Store) Write

func (s *Store) Write(d Doc) error

Write renders a Doc into a SKILL.md and validates that it loads cleanly, so a malformed draft never lands on disk. It overwrites an existing directory of the same name, which is what a curator re-drafting a skill wants. This is how the curator writes into the drafts store; installed skills are only ever created by the user editing files or by Promote.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL