skills

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package skills discovers and renders Codog skill instructions.

Index

Constants

This section is empty.

Variables

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

Functions

func MatchesAnyPath

func MatchesAnyPath(skill Skill, paths []string) bool

func RenderInvocation

func RenderInvocation(skill Skill, args string) string

func RenderInvocationWithSession

func RenderInvocationWithSession(skill Skill, args string, sessionID string) string

func RenderPromptBlock

func RenderPromptBlock(skill Skill) string

Types

type DiscoveryRoot

type DiscoveryRoot struct {
	Source     string  `json:"source"`
	Label      string  `json:"label"`
	Path       string  `json:"path"`
	Exists     bool    `json:"exists"`
	Origin     *Origin `json:"origin,omitempty"`
	PluginID   string  `json:"plugin_id,omitempty"`
	PluginRoot string  `json:"plugin_root,omitempty"`
}

func Sources

func Sources(configHome, workspace string) []DiscoveryRoot

func SourcesWithManifests

func SourcesWithManifests(configHome, workspace string, manifests []plugins.Manifest) []DiscoveryRoot

SourcesWithManifests reports skill roots for a resolved runtime plugin set.

type InstallReport

type InstallReport struct {
	Kind   string `json:"kind"`
	Action string `json:"action"`
	Status string `json:"status"`
	Name   string `json:"name"`
	Source string `json:"source"`
	Path   string `json:"path"`
	Target string `json:"target"`
}

func Install

func Install(source string, targetRoot string, explicitName string, targetLabel string) (InstallReport, error)

type MetadataDrift

type MetadataDrift struct {
	InvocationName  string `json:"invocation_name"`
	FrontmatterName string `json:"frontmatter_name"`
	Path            string `json:"path"`
	Source          string `json:"source"`
}

func MetadataDrifts

func MetadataDrifts(all []Skill) []MetadataDrift

type Origin

type Origin struct {
	ID          string `json:"id"`
	DetailLabel string `json:"detail_label,omitempty"`
}

type Skill

type Skill struct {
	Name                   string   `json:"name"`
	DisplayName            string   `json:"display_name,omitempty"`
	Path                   string   `json:"path"`
	Description            string   `json:"description,omitempty"`
	WhenToUse              string   `json:"when_to_use,omitempty"`
	Version                string   `json:"version,omitempty"`
	AllowedTools           []string `json:"allowed_tools,omitempty"`
	ArgumentHint           string   `json:"argument_hint,omitempty"`
	Arguments              []string `json:"arguments,omitempty"`
	Paths                  []string `json:"paths,omitempty"`
	SkillDir               string   `json:"skill_dir,omitempty"`
	PluginRoot             string   `json:"plugin_root,omitempty"`
	PluginData             string   `json:"plugin_data,omitempty"`
	Model                  string   `json:"model,omitempty"`
	ExecutionContext       string   `json:"execution_context,omitempty"`
	Agent                  string   `json:"agent,omitempty"`
	Effort                 string   `json:"effort,omitempty"`
	UserInvocable          bool     `json:"user_invocable"`
	DisableModelInvocation bool     `json:"disable_model_invocation,omitempty"`
	FrontmatterError       string   `json:"frontmatter_error,omitempty"`
	Body                   string   `json:"body,omitempty"`
	Source                 string   `json:"source"`
	Origin                 *Origin  `json:"origin,omitempty"`
	Active                 bool     `json:"active"`
	ShadowedBy             string   `json:"shadowed_by,omitempty"`
	ShadowedByPath         string   `json:"shadowed_by_path,omitempty"`
	NameDrift              bool     `json:"metadata_drift,omitempty"`
	// contains filtered or unexported fields
}

func Bundled

func Bundled() []Skill

func ContextualForPaths

func ContextualForPaths(configHome, workspace string, paths []string) ([]Skill, error)

func ContextualForPathsWithManifests

func ContextualForPathsWithManifests(configHome, workspace string, paths []string, manifests []plugins.Manifest) ([]Skill, error)

ContextualForPathsWithManifests resolves contextual skills from a runtime plugin set.

func Find

func Find(configHome, workspace, name string) (Skill, error)

func Load

func Load(configHome, workspace string) ([]Skill, error)

func LoadForPaths

func LoadForPaths(configHome, workspace string, paths []string) ([]Skill, error)

func LoadForPathsWithManifests

func LoadForPathsWithManifests(configHome, workspace string, paths []string, manifests []plugins.Manifest) ([]Skill, error)

LoadForPathsWithManifests adds path-contextual skills to a resolved runtime plugin set.

func LoadWithManifests

func LoadWithManifests(configHome, workspace string, manifests []plugins.Manifest) ([]Skill, error)

LoadWithManifests loads skills from a resolved runtime plugin set.

func ParseDocument

func ParseDocument(name string, path string, source string, text string) Skill

type SourceNotFoundError

type SourceNotFoundError struct {
	Source string
	Err    error
}

func (SourceNotFoundError) Error

func (e SourceNotFoundError) Error() string

func (SourceNotFoundError) Unwrap

func (e SourceNotFoundError) Unwrap() error

type UninstallReport

type UninstallReport struct {
	Kind    string `json:"kind"`
	Action  string `json:"action"`
	Status  string `json:"status"`
	Name    string `json:"name"`
	Path    string `json:"path"`
	Removed bool   `json:"removed"`
}

func Uninstall

func Uninstall(name string, roots []string) (UninstallReport, error)

Jump to

Keyboard shortcuts

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