skills

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package skills provides agent detection, install path resolution, and GitHub-based skill fetching for the oodle CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectAgent

func DetectAgent() string

DetectAgent returns the name of the running AI coding agent by checking env vars in priority order (first truthy match wins). Returns "" if none detected.

func FetchContent

func FetchContent(ctx context.Context, name string) (string, error)

FetchContent fetches the SKILL.md content for the named skill. Returns an error wrapping "skill not found: <name>" if the response is 404.

func FindProjectRoot

func FindProjectRoot() string

FindProjectRoot walks up from cwd looking for a directory containing .git. Returns cwd if no .git ancestor is found.

func SetContentsAPIURLOverride

func SetContentsAPIURLOverride(u string)

SetContentsAPIURLOverride sets the URL override for the GitHub contents API. Used in tests only. Pass "" to reset to the real GitHub URL.

func SetRawContentURLOverride

func SetRawContentURLOverride(u string)

SetRawContentURLOverride sets the URL override for GitHub raw content. Used in tests only. Pass "" to reset to the real GitHub URL.

func SkillsDir

func SkillsDir(agent, projectRoot string) string

SkillsDir returns the directory where skills should be installed under projectRoot. If any known skills directory already exists under projectRoot, that path is returned. Otherwise the agent-specific default is used.

Types

type Entry

type Entry struct {
	Name        string // directory name, e.g. "oodle-cli"
	Description string // extracted from SKILL.md frontmatter description: field
}

Entry represents a single skill available in the agent-skills repo.

func List

func List(ctx context.Context) ([]Entry, error)

List fetches the list of available skills from the GitHub contents API. Returns entries sorted alphabetically by Name. Only includes entries of type "dir" (skips files).

type FetchResult added in v0.5.0

type FetchResult struct {
	Name    string
	Content string
	Err     error
}

FetchResult holds the outcome of fetching a single skill's content.

func FetchAllContents added in v0.5.0

func FetchAllContents(ctx context.Context, entries []Entry) []FetchResult

FetchAllContents fetches SKILL.md content for all given entries concurrently using a bounded worker pool. It returns results in the same order as the input entries. If the context is cancelled, in-flight fetches are abandoned and the context error is returned in the remaining results.

Jump to

Keyboard shortcuts

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