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 ¶
var ErrNotFound = errors.New("not found")
ErrNotFound is the error for a skill or a reference that the binary does not have.
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 ¶
Dev returns the skills for a person who changes osapi itself. osapi skill install does not install them. osapi skill serves them.
Types ¶
type Result ¶
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.
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.