skills

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 10 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

This section is empty.

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
}

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

type Manager

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

Manager loads and caches skills from the configured directories.

func NewManager

func NewManager(dirs []string) *Manager

NewManager builds a manager over the given directories.

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 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) Get

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

Get returns one skill by name.

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 known skills, 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) Reload

func (m *Manager) Reload() error

Reload rescans every configured directory.

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 configured directory.

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) SetEnabled

func (m *Manager) SetEnabled(name string, enabled bool) error

SetEnabled toggles a skill by rewriting its front matter.

func (*Manager) SetPackDirs

func (m *Manager) SetPackDirs(dirs []string)

SetPackDirs marks directories whose skills are the bundled security library: searchable but not in the prompt catalogue.

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"`
}

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