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 ¶
- func Promote(from, to *Store, name string) error
- type Doc
- type Entry
- type Finding
- type Permissions
- type Skill
- type Store
- func (s *Store) Disable(name string) error
- func (s *Store) Enable(name string) error
- func (s *Store) Entries() ([]Entry, error)
- func (s *Store) Index() (string, error)
- func (s *Store) Lint() ([]Finding, error)
- func (s *Store) List() ([]Skill, error)
- func (s *Store) Read(name string) (string, error)
- func (s *Store) Remove(name string) error
- func (s *Store) Tools() []tool.Tool
- func (s *Store) Write(d Doc) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Promote ¶
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 ¶
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 ¶
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) Index ¶
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 ¶
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 ¶
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) Tools ¶
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 ¶
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.