skill

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: 7 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 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

View Source
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

type Deps struct {
	Installed fs.FS
	Dev       fs.FS
	FS        avfs.VFS
	Version   func() string
}

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.

func Get

func Get(
	_ context.Context,
	d Deps,
	in GetInput,
) (GetOutput, error)

Get is a skill's SKILL.md, or one of its reference files.

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 ListInput

type ListInput struct{}

ListInput is the input of list, which has none.

type ListOutput

type ListOutput struct {
	Items []skills.Skill `               json:"items"`
	// contains filtered or unexported fields
}

ListOutput is each skill this binary has.

func List

func List(
	_ context.Context,
	d Deps,
	_ ListInput,
) (ListOutput, error)

List 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.

func (Tool) Valid

func (t Tool) Valid() bool

Valid reports whether t is a tool that osapi installs its skills for.

func (Tool) Values

func (Tool) Values() []Tool

Values are the tools that osapi installs its skills for.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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