skills

package
v1.222.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt added in v1.210.0

func BuildPrompt(validSkills []*Skill) string

BuildPrompt concatenates system prompts from multiple skills with a separator. Returns an empty string if no skills have system prompts.

func GetDefaultSkill

func GetDefaultSkill(atmosConfig *schema.AtmosConfiguration) string

GetDefaultSkill returns the name of the default skill from configuration. Returns empty string if not specified (caller should handle fallback).

Types

type Registry

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

Registry manages available skills.

func LoadSkills

func LoadSkills(atmosConfig *schema.AtmosConfiguration, marketplaceLoader ...SkillLoader) (*Registry, error)

LoadSkills loads all skills (marketplace-installed and custom) from configuration. If a marketplaceLoader is provided, it loads marketplace-installed skills first.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new skill registry.

func (*Registry) Count

func (r *Registry) Count() int

Count returns the number of registered skills.

func (*Registry) Get

func (r *Registry) Get(name string) (*Skill, error)

Get retrieves a skill by name.

func (*Registry) Has

func (r *Registry) Has(name string) bool

Has checks if a skill exists.

func (*Registry) List

func (r *Registry) List() []*Skill

List returns all registered skills sorted alphabetically by name.

func (*Registry) ListBuiltIn

func (r *Registry) ListBuiltIn() []*Skill

ListBuiltIn returns only built-in skills sorted alphabetically by name.

func (*Registry) ListByCategory

func (r *Registry) ListByCategory(category string) []*Skill

ListByCategory returns skills in a specific category sorted alphabetically by name.

func (*Registry) ListCustom

func (r *Registry) ListCustom() []*Skill

ListCustom returns only custom (user-defined) skills sorted alphabetically by name.

func (*Registry) Register

func (r *Registry) Register(skill *Skill) error

Register adds a skill to the registry.

func (*Registry) ToPromptXML

func (r *Registry) ToPromptXML(currentSkillName string) string

ToPromptXML generates an XML block listing available skills for injection into the system prompt. This follows the Agent Skills integration guide recommendation for Claude models. The XML format helps the model understand what skills are available and when to use them.

func (*Registry) Unregister

func (r *Registry) Unregister(name string) error

Unregister removes a skill from the registry.

type Skill

type Skill struct {
	// Name is the unique identifier for the skill (e.g., "stack-analyzer").
	Name string

	// DisplayName is the user-facing name (e.g., "Stack Analyzer").
	DisplayName string

	// Description explains what this skill does.
	Description string

	// SystemPrompt contains specialized instructions for the AI.
	SystemPrompt string

	// AllowedTools lists tool names this skill can use.
	// Empty list means all tools are allowed.
	AllowedTools []string

	// RestrictedTools lists tools requiring extra confirmation.
	RestrictedTools []string

	// Category groups skills by purpose (e.g., "analysis", "refactor", "security").
	Category string

	// IsBuiltIn indicates if this is a built-in skill.
	IsBuiltIn bool
}

Skill represents a specialized AI assistant with specific expertise and tool access. Skills follow the Agent Skills open standard (https://agentskills.io).

func FromConfig

func FromConfig(name string, config *schema.AISkillConfig) *Skill

FromConfig creates a Skill from configuration.

func LoadAndValidate added in v1.210.0

func LoadAndValidate(atmosConfig *schema.AtmosConfiguration, skillNames []string, loader SkillLoader) ([]*Skill, error)

LoadAndValidate loads the skill registry and validates that all specified skills exist. An optional SkillLoader can be provided to load marketplace-installed skills. Returns the validated skills or a helpful error listing invalid and available skills.

func NewFallbackSkill

func NewFallbackSkill() *Skill

NewFallbackSkill returns a minimal fallback skill for when no skills are installed.

func (*Skill) IsToolAllowed

func (s *Skill) IsToolAllowed(toolName string) bool

IsToolAllowed checks if a tool is allowed for this skill.

func (*Skill) IsToolRestricted

func (s *Skill) IsToolRestricted(toolName string) bool

IsToolRestricted checks if a tool requires extra confirmation.

func (*Skill) LoadSystemPrompt

func (s *Skill) LoadSystemPrompt() (string, error)

LoadSystemPrompt returns the skill's system prompt.

type SkillLoader

type SkillLoader interface {
	LoadInstalledSkills(registry *Registry) error
}

SkillLoader is the interface for loading marketplace-installed skills into a registry. This allows the loader to be decoupled from the marketplace package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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