skills

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 12 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 manages the agent's learned procedures: Markdown files with YAML front matter that are injected into the prompt when relevant.

Index

Constants

This section is empty.

Variables

View Source
var ErrReadOnly = errors.New("automatically discovered skills are read-only")

ErrReadOnly is returned when a mutation targets an imported skill.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	// CWE matches a CWE id, with or without the "CWE-" prefix (e.g. "89").
	CWE string
	// Tech matches a tech_stack entry (e.g. "web", "api", "cloud").
	Tech string
	// Category matches the skill category exactly.
	Category string
	// EnabledOnly excludes disabled names before ranking and limiting results.
	EnabledOnly bool
}

Filter narrows a skill search by security metadata. Empty fields are ignored.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is a lightweight view over shared skill source snapshots. An empty projectDir denotes the root handle, whose selected project follows the state's current default. A bound handle keeps its logical project path.

func NewManager

func NewManager(opts Options) *Manager

NewManager builds a manager over independent writable, bundled, user, and project sources. Options are cloned so caller mutations cannot reconfigure it.

func (*Manager) Categories

func (m *Manager) Categories() map[string]int

Categories lists the pack skill categories with their counts, for browsing.

func (*Manager) Chains

func (m *Manager) Chains(name string) []Skill

Chains resolves a skill's chains_with entries to the skills that exist, so the agent can see which follow-on techniques compound with this one.

func (*Manager) Count

func (m *Manager) Count() int

Count reports how many skills are enabled.

func (*Manager) Delete

func (m *Manager) Delete(name string) error

Delete removes a writable skill file.

func (*Manager) Everyday

func (m *Manager) Everyday() []Skill

Everyday returns the skills for the everyday catalogue — everything except the bundled library, which is thousands strong and reached by search.

func (*Manager) ForProject added in v0.5.0

func (m *Manager) ForProject(projectDir string) (*Manager, error)

ForProject returns a lightweight catalogue view bound to projectDir. Relative paths resolve against the originally captured startup project. A normalization failure returns a shared-only view rather than another project's catalogue.

func (*Manager) Get

func (m *Manager) Get(name string) (*Skill, bool)

Get returns one effective skill by name.

func (*Manager) LegacyDisabled added in v0.5.0

func (m *Manager) LegacyDisabled() []string

LegacyDisabled returns selected configured-source names carrying the retired enabled: false header. The header is migration input only and never affects the manager's effective state.

func (*Manager) Library

func (m *Manager) Library(category string, offset, limit int) ([]Skill, int)

Library returns pack skills for browsing: filtered by category when given, sorted by name, and paged. It returns the page and the total in that filter.

func (*Manager) List

func (m *Manager) List() []Skill

List returns all effective skills for this scope, sorted by name.

func (*Manager) MarkUsed

func (m *Manager) MarkUsed(name string)

MarkUsed increments the in-memory usage counter shown in the dashboard.

func (*Manager) PackCount

func (m *Manager) PackCount() int

PackCount reports how many skills came from the bundled library.

func (*Manager) PromptBlock

func (m *Manager) PromptBlock(limit int) string

PromptBlock renders the enabled skills as a compact catalogue for the system prompt: name, description, and triggers only. Full bodies are fetched on demand with the skill tool so the prompt stays small.

func (*Manager) Reconfigure added in v0.5.0

func (m *Manager) Reconfigure(opts Options) error

Reconfigure publishes cloned options and their newly scanned layers together. Existing bound handles retain their logical project paths; only the root view follows the new default project. Relative paths keep the original startup base.

func (*Manager) Reload

func (m *Manager) Reload() error

Reload synchronously reparses all shared sources and registered projects.

func (*Manager) Save

func (m *Manager) Save(name, description, body string, tags []string) (*Skill, error)

Save writes (or overwrites) a skill file in the first nonempty configured directory. Imported effective names cannot be shadowed through this API.

func (*Manager) Search

func (m *Manager) Search(query string, limit int) []Skill

Search finds skills by keyword, ranked by relevance. It matches across the name, description, tags, triggers, and — for the security library — the CWE ids, tech stack, OWASP id, and category, so "CWE-89" or "graphql" find the right skills even when the words are not in the prose.

func (*Manager) SearchFiltered

func (m *Manager) SearchFiltered(query string, f Filter, limit int) []Skill

SearchFiltered is Search with an optional metadata filter applied first.

func (*Manager) SetDisabled added in v0.5.0

func (m *Manager) SetDisabled(names []string)

SetDisabled replaces the profile-wide set of disabled logical skill names. Names are matched exactly after source precedence has selected a winner.

func (*Manager) Watch added in v0.5.0

func (m *Manager) Watch(ctx context.Context, interval time.Duration)

Watch blocks in the caller's goroutine until cancellation. A forced parse every twelve ticks bounds detection latency for metadata-preserving edits.

type Options added in v0.5.0

type Options struct {
	Dirs       []string
	PackDirs   []string
	UserHome   string
	ProjectDir string
}

Options describes the independent skill sources. Configured and pack directories retain existing mutation behavior; conventional roots are read-only.

type Skill

type Skill struct {
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Path        string    `json:"path"`
	Enabled     bool      `json:"enabled"`
	Source      string    `json:"source"`
	Tags        []string  `json:"tags"`
	Triggers    []string  `json:"triggers"`
	Category    string    `json:"category,omitempty"`
	Body        string    `json:"-"`
	UpdatedAt   time.Time `json:"updated_at"`
	UsageCount  int       `json:"usage_count"`
	// Security-library metadata, used for filtered search and chaining. Empty
	// for everyday skills.
	TechStack  []string `json:"tech_stack,omitempty"`
	CWEIDs     []string `json:"cwe_ids,omitempty"`
	OWASPID    string   `json:"owasp_id,omitempty"`
	ChainsWith []string `json:"chains_with,omitempty"`
	// Pack marks a skill from the bundled security library: searchable and
	// loadable, but kept out of the prompt catalogue so thousands of them do
	// not bury the conversation.
	Pack bool `json:"pack,omitempty"`
	// ReadOnly marks automatically discovered user/project skills. Pack roots
	// preserve their existing management behavior.
	ReadOnly bool `json:"read_only"`
	// contains filtered or unexported fields
}

Skill is one learned procedure loaded from disk.

Jump to

Keyboard shortcuts

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