skills

package
v0.1.78 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dir               = types.DirNameSkills // S3 prefix (no leading slash)
	ManifestFile      = "SKILL.md"          // manifest filename
	InstalledMetaFile = ".installed.json"   // install state file
)

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(manifest *SkillManifest, skillContent string) string

BuildPrompt constructs the task prompt from a SKILL.md file's instructions. The prompt includes the skill name and the full instruction body so the agent has complete context when the hook triggers.

func DeleteManagedSourceSkill added in v0.1.71

func DeleteManagedSourceSkill(ctx context.Context, storage ManagedSkillStorage, workspaceExternalID string, integration string) error

func ExtractInstructions

func ExtractInstructions(data []byte) string

ExtractInstructions returns everything after the frontmatter block.

func FindSkillMD

func FindSkillMD(dir string) (string, error)

FindSkillMD looks for a SKILL.md file in a directory.

func KeyToName

func KeyToName(key string) string

KeyToName extracts skill name from S3 key like "skills/email-triage/SKILL.md".

func ManagedSourceSkillName added in v0.1.71

func ManagedSourceSkillName(integration string) string

func ManagedSourceSkillSource added in v0.1.71

func ManagedSourceSkillSource(integration string) string

func ManifestKey

func ManifestKey(name string) string

ManifestKey returns the S3 key for a skill's manifest: "skills/{name}/SKILL.md"

func NameToPath

func NameToPath(name string) string

NameToPath converts a skill name to airstore path: "/skills/{name}"

func PathToName

func PathToName(path string) string

PathToName extracts skill name from an airstore path like "/skills/email-triage".

func SkillNameFromPath

func SkillNameFromPath(path string) string

SkillNameFromPath derives a skill name from a directory path. e.g., "./email-triage/" → "email-triage"

func UpsertManagedSourceSkill added in v0.1.71

func UpsertManagedSourceSkill(ctx context.Context, storage ManagedSkillStorage, workspaceExternalID string, integration string) error

func WriteInstalledMeta

func WriteInstalledMeta(skillDir string, meta *InstalledSkill) error

WriteInstalledMeta saves installed skill metadata to a directory.

Types

type AirstoreSkillMeta

type AirstoreSkillMeta struct {
	Needs  []string // integration names (gmail, slack, github, etc.)
	Writes []string // output paths (created on install)
}

AirstoreSkillMeta holds Airstore-specific metadata extensions.

type InstalledSkill

type InstalledSkill struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Needs       []string `json:"needs"`
	Source      string   `json:"source"` // where the skill was installed from (airstore://, github.com/, or local path)
}

InstalledSkill holds runtime info about an installed skill.

func ReadInstalledMeta

func ReadInstalledMeta(skillDir string) (*InstalledSkill, error)

ReadInstalledMeta loads the installed skill metadata from a directory.

type ManagedSkillStorage added in v0.1.71

type ManagedSkillStorage interface {
	WorkspaceBucketName(workspaceExternalId string) string
	Upload(ctx context.Context, bucket, key string, data []byte) error
	ListObjects(ctx context.Context, bucket, prefix string, maxKeys int32) (*s3.ListObjectsV2Output, error)
	Delete(ctx context.Context, bucket, key string) error
}

type SkillManifest

type SkillManifest struct {
	Name          string         `yaml:"name"`
	Description   string         `yaml:"description"`
	License       string         `yaml:"license,omitempty"`
	Compatibility string         `yaml:"compatibility,omitempty"`
	Metadata      map[string]any `yaml:"metadata,omitempty"`
	AllowedTools  string         `yaml:"allowed-tools,omitempty"`
}

SkillManifest represents the parsed frontmatter of a SKILL.md file, aligned with the Agent Skills specification (https://agentskills.io/specification).

func Parse

func Parse(data []byte) (*SkillManifest, error)

Parse extracts a SkillManifest from the YAML frontmatter of a SKILL.md file.

The format follows the Agent Skills specification (https://agentskills.io/specification):

---
name: email-triage
description: Categorizes emails by urgency. Use when processing Gmail inbox.
license: MIT
metadata:
  author: beam-cloud
  version: "1.0"
  airstore:
    needs:
      - gmail
    writes:
      - /reports/email-triage/
---

# Instructions
...

func ParseFile

func ParseFile(path string) (*SkillManifest, string, error)

ParseFile reads a SKILL.md file and returns its manifest and full content.

func (*SkillManifest) AirstoreMetadata

func (m *SkillManifest) AirstoreMetadata() *AirstoreSkillMeta

AirstoreMetadata returns Airstore-specific extensions from metadata.airstore.

Jump to

Keyboard shortcuts

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