skilldef

package
v0.139.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPreamble

func BuildPreamble(skillsDir string, skillNames []string) string

BuildPreamble returns a markdown section listing the given skills as a table. Only skills whose names appear in skillNames are included. If skillNames is empty the function returns "". The result is NOT cached.

func NeedsReconcile added in v0.139.2

func NeedsReconcile(skillsDir string) bool

NeedsReconcile reports whether ReconcileSkills would do real work for skillsDir — i.e. whether the on-disk stamp is missing or does not match the embedded FS hash. Callers can use this to surface a progress indicator only when the upcoming reconcile is going to be slow.

func ParseEmbedded

func ParseEmbedded() (map[string]SkillDef, error)

ParseEmbedded reads all SKILL.md files from the embedded skills FS and returns a map of skill name -> definition. The result is cached after the first call.

func ReadBody

func ReadBody(name string) (string, error)

ReadBody returns the frontmatter-stripped body of the named skill. Returns an error if the skill is not found in the embedded FS.

func ReconcileSkills

func ReconcileSkills(skillsDir string) error

ReconcileSkills mirrors every embedded skill directory to disk under skillsDir. For each top-level skill directory it walks the full subtree and writes every file (SKILL.md plus any companion assets such as user-guide/*.md). Files whose content already matches on disk are skipped; writes use atomic temp-file + rename.

A content hash of the embedded FS is persisted to a sibling stamp file after a successful reconcile. If the next call finds a matching stamp, the full walk is skipped — the common steady-state path where the binary hasn't been rebuilt. To force a re-reconcile (e.g. after manually editing or deleting an on-disk file), delete the stamp file.

Types

type SkillDef

type SkillDef struct {
	Name        string
	Description string
	Topics      string // comma-separated keywords/topics for discovery
	License     string
	Body        string
}

SkillDef represents a single skill definition parsed from an embedded SKILL.md file.

Jump to

Keyboard shortcuts

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