Documentation
¶
Overview ¶
Package skill is the skill group: osapi skill list and get, which show the agent skills that this binary has, and osapi skill install, which installs them into a repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Group = command.Register(command.Define( "skill", "Show and install the agent skills that this binary has", command.Uses[Deps](), command.Method[ListInput, ListOutput]("list"). Short("List the skills that this binary has"). Example(""). Prints(sampleList). Example("--json"). Handle(List), command.Method[GetInput, GetOutput]("get"). Short("Print a skill, or one of its reference files"). Long("It prints the file as it is. `--json` has the name, the reference and the\n"+ "content."). Example("--name build-a-behavior"). Prints(sampleGet). Example("--name build-a-behavior --reference references/services.md"). Fails("no name", GetInput{}). Handle(Get), command.Method[InstallInput, InstallOutput]("install"). Short("Install the skills of this binary into a repository"). Long("The command writes the skills in this binary for each `--tool`. It also\n"+ "writes a short section, with links to the skills, in the instructions file\n"+ "of that tool: `CLAUDE.md` or `AGENTS.md`. It does not change text outside\n"+ "the osapi section.\n\n"+ "Run it again after you upgrade osapi. It writes the skills again to agree\n"+ "with the binary. It removes the files that an older version installed.\n"+ "Thus the agent does not read a skill about operations that the binary does\n"+ "not have now."). Example(""). Prints(sampleInstall). Example("--tool claude --tool codex"). Example("--path ./ops-repo --json"). Fails("an unknown tool", InstallInput{Tools: []Tool{"vim"}}). Handle(Install), ))
Group is the skill group's definition.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
Deps is what the skill group's methods use: the skills that osapi skill install installs, the skills for developing osapi itself, the file system that install writes to, and the version of the binary.
type GetInput ¶
type GetInput struct {
Name string `json:"name" validate:"required" doc:"Name of the skill"`
Reference string `json:"reference" validate:"omitempty" doc:"A reference file of the skill, relative to its directory"`
}
GetInput names the skill, and one of its reference files.
type GetOutput ¶
type GetOutput struct {
Name string `json:"name"`
Reference string `json:"reference,omitempty"`
Content string `json:"content" render:"body"`
}
GetOutput is a skill's file: its text, which prints as it is.
type InstallInput ¶
type InstallInput struct {
Path string `` /* 133-byte string literal not displayed */
Tools []Tool `json:"tool" validate:"omitempty,dive,enum" doc:"Agent tool to install for: claude, codex (repeatable); claude without it"`
}
InstallInput is where to install the skills, and for which tools.
type InstallOutput ¶
type InstallOutput struct {
Version string ` json:"version"`
Tools []Tool ` json:"tools"`
Changed int ` json:"changed"`
Files []skills.Result ` json:"files"`
// contains filtered or unexported fields
}
InstallOutput is each file install wrote, and how many changed.
func Install ¶
func Install( _ context.Context, d Deps, in InstallInput, ) (InstallOutput, error)
Install installs the skills of the binary for each tool, claude without one.
type ListOutput ¶
type ListOutput struct {
Items []skills.Skill ` json:"items"`
// contains filtered or unexported fields
}
ListOutput is each skill this binary has.
type Tool ¶
type Tool string
Tool is an AI agent tool that osapi installs its skills for.
const ( // ToolClaude is Claude Code. ToolClaude Tool = "claude" // ToolCodex is Codex. ToolCodex Tool = "codex" )
The tools that osapi installs its skills for.