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 ¶
- Variables
- type Filter
- type Manager
- func (m *Manager) Categories() map[string]int
- func (m *Manager) Chains(name string) []Skill
- func (m *Manager) Count() int
- func (m *Manager) Delete(name string) error
- func (m *Manager) Everyday() []Skill
- func (m *Manager) ForProject(projectDir string) (*Manager, error)
- func (m *Manager) Get(name string) (*Skill, bool)
- func (m *Manager) LegacyDisabled() []string
- func (m *Manager) Library(category string, offset, limit int) ([]Skill, int)
- func (m *Manager) List() []Skill
- func (m *Manager) MarkUsed(name string)
- func (m *Manager) PackCount() int
- func (m *Manager) PromptBlock(limit int) string
- func (m *Manager) Reconfigure(opts Options) error
- func (m *Manager) Reload() error
- func (m *Manager) Save(name, description, body string, tags []string) (*Skill, error)
- func (m *Manager) Search(query string, limit int) []Skill
- func (m *Manager) SearchFiltered(query string, f Filter, limit int) []Skill
- func (m *Manager) SetDisabled(names []string)
- func (m *Manager) Watch(ctx context.Context, interval time.Duration)
- type Options
- type Skill
Constants ¶
This section is empty.
Variables ¶
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 ¶
NewManager builds a manager over independent writable, bundled, user, and project sources. Options are cloned so caller mutations cannot reconfigure it.
func (*Manager) Categories ¶
Categories lists the pack skill categories with their counts, for browsing.
func (*Manager) Chains ¶
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) Everyday ¶
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
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) LegacyDisabled ¶ added in v0.5.0
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 ¶
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) PromptBlock ¶
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
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) Save ¶
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 ¶
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 ¶
SearchFiltered is Search with an optional metadata filter applied first.
func (*Manager) SetDisabled ¶ added in v0.5.0
SetDisabled replaces the profile-wide set of disabled logical skill names. Names are matched exactly after source precedence has selected a winner.
type Options ¶ added in v0.5.0
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.