Documentation
¶
Overview ¶
skill parses SKILL.md files
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAgentFile ¶ added in v0.31.0
IsAgentFile returns true if the filename matches the *.agent.md pattern.
Types ¶
type AgentFrontmatter ¶ added in v0.31.0
type AgentFrontmatter struct {
Frontmatter `yaml:",inline"`
Tools *[]string `yaml:"tools,omitempty"`
Model string `yaml:"model,omitempty"`
Handoffs []AgentHandoff `yaml:"handoffs,omitempty"`
MCPServers []AgentMCPServer `yaml:"mcp-servers,omitempty"`
Agents []string `yaml:"agents,omitempty"`
}
AgentFrontmatter holds parsed agent-specific YAML fields from .agent.md files.
Tools is a pointer to a slice so callers can distinguish three cases:
- Absent (`nil`): the frontmatter has no `tools:` key at all. The agent did not opt in to tool-usage constraints; graders should NOT inject an implicit allow-list.
- Explicit empty (`&[]string{}`): the frontmatter contains `tools: []`. The agent has explicitly declared that no tools are permitted. Graders should inject a deny-all allow-list.
- Populated (`&[]string{...}`): the agent has declared an allow-list of tool names. Graders should inject those names as an allow-list.
func LoadAgentDefinition ¶ added in v0.31.0
func LoadAgentDefinition(path string) (*AgentFrontmatter, string, error)
LoadAgentDefinition reads an .agent.md file and returns its parsed frontmatter and body. Returns nil if path is not an agent file or doesn't exist.
func ParseAgentFrontmatter ¶ added in v0.31.0
func ParseAgentFrontmatter(content string) (*AgentFrontmatter, string, error)
ParseAgentFrontmatter splits an .agent.md file into its YAML frontmatter and markdown body. It reuses the existing parseFrontmatter helper to split the --- delimited blocks, then unmarshals agent-specific fields.
type AgentHandoff ¶ added in v0.31.0
type AgentHandoff struct {
Name string `yaml:"name"`
Description string `yaml:"description,omitempty"`
}
AgentHandoff describes a handoff target for an agent.
type AgentMCPServer ¶ added in v0.31.0
type AgentMCPServer struct {
Name string `yaml:"name"`
Config map[string]any `yaml:"config,omitempty"`
}
AgentMCPServer describes an MCP server configuration for an agent.
type Frontmatter ¶
Frontmatter holds parsed YAML frontmatter from SKILL.md.
type Skill ¶
type Skill struct {
Frontmatter Frontmatter
FrontmatterRaw map[string]any
FrontmatterNode *yaml.Node
Body string
Path string
RawContent string
Tokens int
Characters int
Lines int
}
Skill represents the current state of a skill for scoring.