skills

package
v4.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package skills serves the bundled Gothic Framework skill documents to AI agents working on a Gothic project.

The markdown files under skills/ are embedded in the CLI binary (//go:embed) — the baseline set is always available, offline, with no filesystem or network access. Each document carries front matter:

name: <skill name>
description: <one-line summary>
applies_to: <module constraints, e.g. "core@>=1.0.0,<2.0.0 middlewares@>=1.3.0">

Version resolution keys off the framework module versions the consuming project pins in its go.mod require block (see cli.Config.FrameworkModules): a skill is part of the resolved set when every applies_to constraint is satisfied. Empty applies_to means the skill applies to any version. When NO pins are known at all (empty pin matrix), the embedded baseline is served in full — nothing can disqualify it.

Discovery (Search / Applicable) is version-gated. Explicit named requests (Info / Load) serve the embedded document whenever the name exists — the caller asked for it by exact name, so intent wins over the pin filter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Ref
	AppliesTo string
	// Body is the markdown content without the front matter block.
	Body string
}

Document is a fully loaded skill: front matter fields plus the markdown body (front matter block stripped).

func Load

func Load(names []string) []Document

Load runs Load on the baseline skill set.

type Ref

type Ref struct {
	Name        string
	Description string
}

Ref is the lightweight descriptor used by discovery (Search/Applicable).

func Search(query string) []Ref

Search runs Search on the baseline skill set (all embedded skills).

type Set

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

Set is a view of the embedded skill set resolved against a pin matrix. The zero-value pin matrix (empty map / nil) selects the full embedded baseline — with no versions observed, nothing can be disqualified.

func New

func New(pins map[string]string) *Set

New builds a Set resolved against a pin matrix of framework module versions. Keys may be the short module name ("core", "components", "middlewares", "htmx-go") or the full module path ("github.com/gothicframework/core"); values are versions like "v1.6.0" (a leading "v" is optional). The pins should come from the consuming project's go.mod require block (cli.Config.FrameworkModules), optionally merged with the CLI's own FrameworkModules baseline where a project omits a pin.

func (*Set) Applicable

func (s *Set) Applicable() []Ref

Applicable returns the Refs of the resolved skill set for these pins, sorted by name.

func (*Set) Info

func (s *Set) Info(names []string) []SkillInfo

Info returns the metadata (front matter) of the named skills, preserving the requested order. Unknown names are omitted. Named requests are NOT version-gated: an agent that names a skill gets its Info regardless of pins.

func (*Set) Load

func (s *Set) Load(names []string) []Document

Load returns the full documents for the named skills, preserving the requested order. Unknown names are omitted. Named requests are NOT version-gated: an agent that names a skill gets the document regardless of pins. An empty names slice loads every embedded document.

func (*Set) Names

func (s *Set) Names() []string

Names lists every embedded skill name (the baseline set), sorted.

func (*Set) Search

func (s *Set) Search(query string) []Ref

Search returns the applicable skills whose name or description contains the query (case-insensitive substring). An empty query returns the whole applicable set.

type SkillInfo

type SkillInfo struct {
	Ref
	AppliesTo string
}

Info is a Ref plus the raw version contract of the document.

func Info

func Info(names []string) []SkillInfo

Info runs Info on the baseline skill set.

Jump to

Keyboard shortcuts

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