Documentation
¶
Index ¶
- func CreateProjectSkillsDir(projectDir string) error
- func ProjectSkillDirs(projectRoot string) []string
- type Manager
- func (m *Manager) BuildAllSkillsContext() string
- func (m *Manager) BuildSkillContext(name string) string
- func (m *Manager) Get(name string) *Skill
- func (m *Manager) List() []*Skill
- func (m *Manager) ListBySource(source string) []*Skill
- func (m *Manager) ListReferences(skillName string) []*SkillReference
- func (m *Manager) Load() error
- func (m *Manager) LoadReference(skillName, refPath string) (string, bool)
- func (m *Manager) Names() []string
- type Skill
- type SkillReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProjectSkillsDir ¶
CreateProjectSkillsDir creates the .skills directory in the project root.
func ProjectSkillDirs ¶
ProjectSkillDirs returns project-local skill directories in priority order.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages skill discovery and loading.
func NewManager ¶
NewManager creates a new skills manager.
func NewManagerWithProjectDirs ¶
NewManagerWithProjectDirs creates a new skills manager with explicit project directories in priority order.
func (*Manager) BuildAllSkillsContext ¶
BuildAllSkillsContext returns a summary of all available skills for the system prompt.
func (*Manager) BuildSkillContext ¶
BuildSkillContext returns the content of a skill for injection into the system prompt. It includes the SKILL.md content plus all auto-loaded references.
func (*Manager) ListBySource ¶
ListBySource returns skills filtered by source.
func (*Manager) ListReferences ¶
func (m *Manager) ListReferences(skillName string) []*SkillReference
ListReferences returns the reference files for a skill with their load status.
func (*Manager) Load ¶
Load discovers and loads all skills from global and project directories. Project-local skills override global skills with the same name.
func (*Manager) LoadReference ¶
LoadReference loads a specific reference file by path for a skill. Returns the content and true if successful.
type Skill ¶
type Skill struct {
Name string // skill name (directory name)
Path string // absolute path to SKILL.md
Dir string // skill directory
Description string // first line or heading description
Content string // full SKILL.md content
Source string // "global" or "project"
References []*SkillReference // parsed references
}
Skill represents a loaded skill.
type SkillReference ¶
type SkillReference struct {
Path string // relative path (e.g. "references/audio.md")
FullPath string // absolute path
Label string // display label (e.g. "音频")
AutoLoad bool // true if marked [已加载], false if [待按需加载]
Loaded bool // whether this reference has been loaded
Content string // loaded content
}
SkillReference represents a reference file within a skill.