Help us shape the future of Go! Take the 2026 Go Developer Survey

skills

package
v0.13.11 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoadSkillTool

func NewLoadSkillTool(loader *Loader) tool.InvokableTool

NewLoadSkillTool creates the "load_skill" tool that loads a skill's full content on demand (Layer 2 injection via tool_result).

Types

type Loader

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

Loader discovers and caches skills from built-in embeds and user directories.

func NewLoader

func NewLoader() *Loader

NewLoader creates a Loader pre-populated with built-in skills, then scans the user skills directories (~/.agents/skills/ and ~/.jcode/skills/) for additional skills.

func NewLoaderWithDisabled added in v0.5.2

func NewLoaderWithDisabled(disabled []string) *Loader

NewLoaderWithDisabled creates a Loader with the given skill names disabled. Disabled skills are excluded from the system-prompt descriptions, slash commands, and the load_skill tool, but remain visible via All() for management UIs.

func (*Loader) All

func (l *Loader) All() []*Skill

All returns all loaded skills sorted by name.

func (*Loader) Descriptions

func (l *Loader) Descriptions() string

Descriptions returns a compact multi-line string listing all skills. This is injected into the system prompt (Layer 1 — low token cost).

func (*Loader) Get

func (l *Loader) Get(name string) *Skill

Get returns a skill by name, or nil if not found.

func (*Loader) GetBySlash

func (l *Loader) GetBySlash(slash string) *Skill

GetBySlash returns a skill by its slash command, or nil if not found. Matches both explicit slash fields and auto-generated "/<name>" triggers.

func (*Loader) GetContent

func (l *Loader) GetContent(name string) string

GetContent returns the full skill body wrapped in XML-like tags for injection into tool_result (Layer 2 — on-demand, full content).

func (*Loader) IsEnabled added in v0.5.2

func (l *Loader) IsEnabled(name string) bool

IsEnabled reports whether the named skill is active (not disabled).

func (*Loader) Rescan

func (l *Loader) Rescan(projectDir string)

Rescan re-scans all skill sources (preserving built-ins).

func (*Loader) ScanAgentsSkills

func (l *Loader) ScanAgentsSkills()

ScanAgentsSkills scans ~/.agents/skills/ for agent-defined skills. Each subdirectory (or symlink to a directory) containing a SKILL.md is treated as a skill. Agent skills are loaded before user skills, so user skills can override them.

func (*Loader) ScanProjectSkills

func (l *Loader) ScanProjectSkills(projectDir string)

ScanProjectSkills scans <projectDir>/.jcode/skills/ for project-local skills.

func (*Loader) ScanUserSkills

func (l *Loader) ScanUserSkills()

ScanUserSkills scans ~/.jcode/skills/ for user-defined skills. Each subdirectory (or symlink to a directory) containing a SKILL.md is treated as a skill. User skills override built-in skills with the same name.

func (*Loader) SetDisabled added in v0.5.2

func (l *Loader) SetDisabled(disabled []string)

SetDisabled replaces the set of disabled skill names.

func (*Loader) SlashCommands

func (l *Loader) SlashCommands() []*Skill

SlashCommands returns all skills with slash command triggers. Skills with an explicit "slash: false" frontmatter are excluded. Skills with no slash field get an auto-generated "/<name>" trigger. Skills with a custom slash field (e.g. "/review") use that value.

type Skill

type Skill struct {
	Name        string // directory name or frontmatter name
	Description string // short description for system prompt (Layer 1)
	Slash       string // optional slash command trigger (e.g. "/review-pr")
	Body        string // full markdown content (Layer 2, on-demand)
	Builtin     bool   // true if embedded in binary
	Path        string // filesystem path (empty for built-in)
	Source      string // provenance: builtin | agents | user | project
}

Skill represents a loaded skill with metadata and content.

Jump to

Keyboard shortcuts

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