Documentation
¶
Overview ¶
Package skills holds the AI agent skills and rules for working with iximiuz Labs that `labctl skills install` puts into a project (or the user's home directory) in the formats that different AI agents read.
The kit is organized in bundles. Every bundle is a top-level folder with skills/<name>/SKILL.md (plus optional supporting files) and rules/<name>.md files. Skills are copied as is, and rules are rendered in each agent's own format (see layouts.go).
Index ¶
- func AgentNames() []string
- func DetectAgents(home string) []string
- func ResolveAgents(names []string) ([]string, error)
- type Action
- type Agent
- type Bundle
- type Change
- type Item
- type ItemKind
- type ItemState
- type Kit
- func (k *Kit) Bundle(name string) (Bundle, bool)
- func (k *Kit) BundleNames() []string
- func (k *Kit) Bundles() []Bundle
- func (k *Kit) Item(name string) (Item, bool)
- func (k *Kit) Items() []Item
- func (k *Kit) Outdated(t Target) (bool, error)
- func (k *Kit) ResolveBundles(names []string) ([]string, error)
- func (k *Kit) Show(name, agent string) ([]byte, error)
- func (k *Kit) Status(t Target, agents []string) (map[string]ItemState, error)
- func (k *Kit) Sync(t Target, opts SyncOptions) ([]Change, error)
- type Manifest
- type ManifestEntry
- type Rule
- type Scope
- type SyncOptions
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentNames ¶
func AgentNames() []string
func DetectAgents ¶
DetectAgents returns the agents that seem to be installed on the machine (best effort, based on their files in the home directory).
func ResolveAgents ¶
ResolveAgents validates the agent names and returns them in the canonical order (without duplicates).
Types ¶
type Action ¶
type Action string
const ( ActionCreate Action = "created" ActionUpdate Action = "updated" ActionRemove Action = "removed" // ActionTrack means an identical copy of the file was already in place, // and labctl started tracking it. ActionTrack Action = "tracked" // ActionSkip means the file was left as is because it was modified // locally (or is not labctl's) and --force wasn't given. ActionSkip Action = "skipped" )
type Agent ¶
Agent describes where (and in which format) an AI agent reads skills and rules. The layouts follow the agents' docs as of October 2026.
type Bundle ¶
type Bundle struct {
Name string
Description string
// ProjectOnly bundles rely on the content repository layout (e.g., their
// rules are scoped to challenges/**, tutorials/**, etc.), so they can be
// installed into a project but not into the user's home directory.
ProjectOnly bool
// Requires lists the bundles whose skills this bundle's skills refer to.
Requires []string
}
type Item ¶
type Item struct {
Name string
Kind ItemKind
Bundle string
// contains filtered or unexported fields
}
Item is a single skill or rule of the kit.
type ItemState ¶
type ItemState string
const ( StateNotInstalled ItemState = "-" StateInstalled ItemState = "installed" StateOutdated ItemState = "outdated" StateModified ItemState = "modified" StateMissing ItemState = "missing" // StateConflict means a file that labctl didn't install takes the item's // place. StateConflict ItemState = "conflict" )
type Kit ¶
type Kit struct {
// contains filtered or unexported fields
}
func (*Kit) BundleNames ¶
func (*Kit) Outdated ¶
Outdated reports whether syncing the installed agents and bundles would change anything in the target.
func (*Kit) ResolveBundles ¶
ResolveBundles validates the bundle names and adds the bundles they require. The result follows the kit's bundle order.
func (*Kit) Show ¶
Show returns the main file of an item as the given agent sees it: the SKILL.md of a skill or the rule rendered in the agent's format.
type Manifest ¶
type Manifest struct {
// Version is the labctl version that made the last change.
Version string `json:"version"`
// Agents and Bundles are what the user asked to install.
Agents []string `json:"agents"`
Bundles []string `json:"bundles"`
// Files maps the installed files (relative to the target root) to their
// bundles and content hashes at install time. A "<file>#<bundle>" key is
// the bundle's section in an index file (e.g., AGENTS.md#authoring).
Files map[string]ManifestEntry `json:"files"`
}
type ManifestEntry ¶
type Rule ¶
type Rule struct {
Name string
// Paths are the globs (relative to the project root) of the files the rule
// applies to. A rule without paths always applies.
Paths []string
// Description is the rule's first top-level heading.
Description string
// Body is the rule's markdown without the frontmatter.
Body []byte
}
Rule is a kit rule - a markdown instruction file - in an agent-neutral form.
type Scope ¶
type Scope string
Scope tells where the kit is installed: into a project or into the user's home directory.
type SyncOptions ¶
type SyncOptions struct {
// Agents and Bundles to have installed (resolved, see ResolveAgents and
// Kit.ResolveBundles). Everything else that labctl installed earlier is
// removed.
Agents []string
Bundles []string
// Version of labctl to record in the manifest.
Version string
// Force overwrites and removes locally modified files (and overwrites the
// files that labctl didn't install) instead of skipping them.
Force bool
}
type Target ¶
type Target struct {
Scope Scope
// Root is the project directory (ScopeProject) or the home directory
// (ScopeUser). The installed files' paths are relative to it.
Root string
// Manifest is the path of the manifest file, where labctl records what it
// installed, so that it can later tell its own unmodified files from the
// user's ones.
Manifest string
}
Target is where the kit is installed.