Documentation
¶
Overview ¶
Package skills discovers Agent Skills (folders holding a SKILL.md) in the project's and the user's .agents/skills directories, renders the catalog added to the system prompt, and loads a skill's instructions or one of its bundled files for the skill tool.
Index ¶
Constants ¶
const ( // MaxSkillFileBytes caps how much of a SKILL.md or bundled file is read. MaxSkillFileBytes = 1 << 20 // MaxCatalogChars caps the catalog section in the system prompt. MaxCatalogChars = 8000 // MaxListedFiles caps the bundled file list in a skill's result. MaxListedFiles = 100 )
Bounds.
const ( ScopeProject = "project" ScopeUser = "user" )
Scopes.
const ContentPrefix = "<skill_content name=\""
ContentPrefix starts every successful instructions result.
const ToolName = "skill"
ToolName is the tool that loads a skill.
Variables ¶
This section is empty.
Functions ¶
func ProjectDirs ¶
ProjectDirs returns the .agents/skills directories to scan for root, nearest first: root and each parent up to the repository root (the nearest directory containing .git), or root alone when there is no .git above it.
Types ¶
type Set ¶
type Set struct {
Skills []Skill
// Omitted counts valid skills left out because the catalog was full.
Omitted int
}
Set is the skills discovered for one run, sorted by name.
func Discover ¶
Discover scans the project directories for root, then userDir ("" skips the user scope). Problems never fail discovery: each is returned as a warning and the affected skill is skipped (or loaded, for cosmetic name problems).
func (*Set) Catalog ¶
Catalog returns the system prompt section listing every skill, or "" when there are none. Descriptions are shortened when the full list would exceed MaxCatalogChars.