agentskills

package
v1.43.7 Latest Latest
Warning

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

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

Documentation

Overview

Package agentskills installs Stripe agent skills natively, reproducing what `npx skills add https://docs.stripe.com` does without any Node/npx dependency. It fetches the skills index from docs.stripe.com and writes each skill's files to a destination directory, preserving the skill/relative-path layout.

Index

Constants

View Source
const (
	StatusNotInstalled = "not_installed"
	StatusCurrent      = "current"
	StatusOutOfDate    = "out_of_date"
	StatusError        = "error"
)

Variables

View Source
var IndexURL = "https://docs.stripe.com/.well-known/skills/index.json"

IndexURL is the canonical Stripe skills index. It is a var (not a const) so tests can point it at an httptest server; individual file URLs are derived from it, so overriding it redirects file fetches too.

Functions

func Install

func Install(ctx context.Context, httpClient *http.Client, destDir string) ([]string, error)

Install fetches every file of every skill in the index and writes it under destDir preserving the skill/relative-path layout (destDir/<skill>/<file>). Installation is best-effort: a file that fails to fetch or write is skipped. It returns the names of skills that had at least one file written.

Types

type DirStatus

type DirStatus struct {
	Dir            string       `json:"dir"`
	Status         string       `json:"status"`
	Skills         []SkillCheck `json:"skills,omitempty"`
	InstalledCount int          `json:"installed_count"`
	OutOfDateCount int          `json:"out_of_date_count"`
	Error          string       `json:"error,omitempty"`
}

DirStatus summarizes installed skills under a single destination directory.

func Check

func Check(ctx context.Context, httpClient *http.Client, destDir string) (*DirStatus, error)

Check compares the skills installed under destDir against the remote index. It fetches remote content for each indexed file and compares SHA256 hashes with the local copies.

type Index

type Index struct {
	Skills []Skill `json:"skills"`
}

Index is the top-level response from IndexURL.

func FetchIndex

func FetchIndex(ctx context.Context, httpClient *http.Client) (*Index, error)

FetchIndex retrieves the skills index from docs.stripe.com.

type Skill

type Skill struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Files       []string `json:"files"`
}

Skill is one entry in the index. Files lists the skill's artifacts as paths relative to the skill directory (e.g. "SKILL.md", "references/billing.md").

type SkillCheck

type SkillCheck struct {
	Name         string   `json:"name"`
	Status       string   `json:"status"`
	MissingFiles []string `json:"missing_files,omitempty"`
	ChangedFiles []string `json:"changed_files,omitempty"`
}

SkillCheck is the per-skill result of comparing a local install to the index.

Jump to

Keyboard shortcuts

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