skills

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 11 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 skills writes the skills compiled into osapi into a repository, for the agent tools that read them.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is the error for a skill or a reference that the binary does not have.

View Source
var Tools = map[string]Tool{
	"claude": {Name: "claude", SkillsDir: ".claude/skills", Instructions: "CLAUDE.md"},
	"codex":  {Name: "codex", SkillsDir: ".agents/skills", Instructions: "AGENTS.md"},
}

Tools are the supported tools, by name.

Functions

func Dev

func Dev() fs.FS

Dev returns the skills for a person who changes osapi itself. osapi skill install does not install them. osapi skill serves them.

func Installed

func Installed() fs.FS

Installed returns the skills that osapi skill install installs, one directory for each skill.

func Read

func Read(
	installed fs.FS,
	dev fs.FS,
	name string,
	reference string,
) ([]byte, error)

Read returns a file of the skill name: its SKILL.md when reference is empty, or the reference file, relative to the directory of the skill.

Types

type Result

type Result struct {
	Path   string `json:"path"   label:"File"`
	Status Status `json:"status"`
}

Result is one file Install looked at.

func Install

func Install(
	vfs avfs.VFS,
	root string,
	tools []Tool,
	src fs.FS,
	version string,
) ([]Result, error)

Install writes every skill in src, a directory of skills, into root for each tool, removes files an older osapi wrote that this one no longer ships, and writes osapi's section of each tool's instructions file. Running it again is how the skills are upgraded to match the binary.

type Skill

type Skill struct {
	// Name is the directory of the skill, and the name in its frontmatter.
	Name string `json:"name"`
	// Description is the description in its frontmatter.
	Description string `json:"description" table:"-"`
	// Init is true when `osapi skill install` installs the skill.
	Init bool `json:"init" label:"Installed by init"`
	// References are the other files of the skill, relative to its directory.
	References []string `json:"references" table:"-"`
}

Skill is one skill that the binary has.

func Catalog

func Catalog(
	installed fs.FS,
	dev fs.FS,
) ([]Skill, error)

Catalog lists the skills in installed, which `osapi skill install` writes, and in dev, which it does not. Each is a directory of skills. The list is sorted by name.

type Status

type Status string

Status says what Install did to one file.

const (
	// Created means the file did not exist.
	Created Status = "created"
	// Updated means the file existed with different content.
	Updated Status = "updated"
	// Unchanged means the file already had this content.
	Unchanged Status = "unchanged"
	// Removed means the file was left over from an older osapi.
	Removed Status = "removed"
)

type Tool

type Tool struct {
	// Name is what --tool takes.
	Name string
	// SkillsDir is where the tool reads skills, relative to the repository.
	SkillsDir string
	// Instructions is the file the tool reads on every session, where osapi
	// keeps a short managed section pointing at the skill.
	Instructions string
}

Tool is an agent tool osapi can install skills for.

Jump to

Keyboard shortcuts

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