skill

package
v0.58.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package skill manages downloadable, on-demand instruction packs ("skills"). A skill is a markdown file with light YAML-ish frontmatter (name, description, optional when). Only ENABLED skills contribute a single index line to the system prompt; the model pulls a skill's full body on demand through the skill tool. So the base prompt stays lean no matter how many skills are installed — the same guides-on-demand idea, but user-extensible and downloadable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Skill

type Skill struct {
	Name        string
	Description string
	When        string
	Body        string
	Enabled     bool
	Source      string
}

Skill is one instruction pack.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is the on-disk skills directory plus the enabled/source state. The same *Store is shared between the foreground and background/sub-agent tool registries, so state access must be safe for concurrent use.

func Open

func Open(dir string, hc *http.Client) (*Store, error)

Open prepares the skills directory and loads the enabled/source state.

func (*Store) Body

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

Body returns an enabled skill's full instructions for the model to follow.

func (*Store) Get

func (s *Store) Get(name string) (Skill, bool)

Get returns one installed skill by name.

func (*Store) HasEnabled

func (s *Store) HasEnabled() bool

HasEnabled reports whether at least one skill is enabled (the skill tool and the prompt index are only wired in when this is true).

func (*Store) Index

func (s *Store) Index() string

Index is the compact, prompt-facing catalog of ENABLED skills — one line each, "- name: description". Empty when none are enabled, so the base prompt is untouched until skills are actually in use.

func (*Store) Install

func (s *Store) Install(ctx context.Context, source string) ([]string, error)

Install downloads skills from a source and enables them. The source is a URL to a single .md file, or a git repository (cloned; every *.md at its root or under skills/ is imported). Returns the installed skill names.

func (*Store) List

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

List returns every installed skill (enabled and disabled), sorted by name. A skill file with no state entry counts as enabled, so files dropped in by hand work without ceremony.

func (*Store) Remove

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

Remove deletes an installed skill.

func (*Store) SetEnabled

func (s *Store) SetEnabled(name string, on bool) error

SetEnabled toggles a skill on or off and persists the choice.

Jump to

Keyboard shortcuts

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