Documentation
¶
Index ¶
Constants ¶
const HeadMatterSpec = "YAML front-matter delimited by '---' with required keys: name, version, description, requires.bins[]"
HeadMatterSpec is the exact YAML front-matter schema we expect at the top of each *.SKILL.md file.
The front-matter MUST be the first thing in the file and MUST be delimited by two lines containing only "---".
Required keys:
- name: string (unique skill name; recommended to match file base name)
- version: string (semver-like, eg "0.1.0")
- description: string (one-line summary)
- requires: bins: [string] (CLI binaries required; for now always includes "ivcap")
Example:
--- name: ivcap-job-create version: 0.1.0 description: Create an IVCAP job from a service. requires:
bins: ["ivcap"]
---
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HeadMatter ¶
type SearchResult ¶ added in v0.50.1
SearchResult is a skill doc together with its BM25 relevance score.
func Search ¶ added in v0.50.1
func Search(docs []*SkillDoc, query string) []SearchResult
Search ranks docs against query using BM25 and returns only docs that match at least one query term, best first. Ties are broken by skill name so the output is deterministic. An empty query (or one without any searchable terms) returns no results.
The corpus is small and fixed (embedded in the binary), so the index is simply built on every call.
type SkillDoc ¶
type SkillDoc struct {
HeadMatter
// Path is a stable, repo-like path, eg "skills/ivcap-job-create.SKILL.md".
Path string `json:"path" yaml:"path"`
// SHA256 is the hex digest of the full file content (including front-matter).
SHA256 string `json:"sha256" yaml:"sha256"`
// Content is the full SKILL.md content (including front-matter).
Content string `json:"content,omitempty" yaml:"content,omitempty"`
}