skill

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package skill provides LLM-powered extraction of reusable patterns from tapes sessions, outputting Claude Code SKILL.md files.

Index

Constants

This section is empty.

Variables

View Source
var SkillTypes = []string{"workflow", "domain-knowledge", "prompt-template"}

SkillTypes enumerates valid skill type values.

Functions

func GlobalAgentsSkillsDir

func GlobalAgentsSkillsDir() (string, error)

GlobalAgentsSkillsDir returns ~/.agents/skills/.

func GlobalClaudeSkillsDir

func GlobalClaudeSkillsDir() (string, error)

GlobalClaudeSkillsDir returns ~/.claude/skills/.

func LocalAgentsSkillsDir

func LocalAgentsSkillsDir() string

LocalAgentsSkillsDir returns .agents/skills/ relative to the current directory.

func LocalClaudeSkillsDir

func LocalClaudeSkillsDir() string

LocalClaudeSkillsDir returns .claude/skills/ relative to the current directory.

func RenderSkillMD

func RenderSkillMD(sk *Skill) string

RenderSkillMD renders a Skill as its on-disk markdown representation (frontmatter + body).

func SkillsDir

func SkillsDir() (string, error)

SkillsDir returns the default skills directory (~/.tapes/skills).

func Sync

func Sync(name, sourceDir, targetDir string) (string, error)

Sync copies a skill file from source to target directory.

func ValidSkillType

func ValidSkillType(t string) bool

ValidSkillType returns true if the given type is a recognized skill type.

func Write

func Write(sk *Skill, dir string) (string, error)

Write persists a Skill as <dir>/<name>.md.

Types

type GenerateOptions

type GenerateOptions struct {
	Since *time.Time // only include messages on or after this time
	Until *time.Time // only include messages on or before this time
}

GenerateOptions controls filtering for skill generation.

type Generator

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

Generator extracts skills from session transcripts via an LLM.

func NewGenerator

func NewGenerator(query deck.Querier, llmCall deck.LLMCallFunc) *Generator

NewGenerator creates a new skill Generator.

func (*Generator) Generate

func (g *Generator) Generate(ctx context.Context, hashes []string, name, skillType string, opts *GenerateOptions) (*Skill, error)

Generate extracts a skill from one or more conversation hashes. Each hash is a leaf node in the Merkle DAG; its ancestry chain is loaded as the conversation transcript.

type Skill

type Skill struct {
	Name        string    `json:"name"`        // kebab-case identifier
	Description string    `json:"description"` // trigger description for Claude
	Version     string    `json:"version"`     // semver, default "0.1.0"
	Tags        []string  `json:"tags"`        // e.g. ["debugging", "react"]
	Type        string    `json:"type"`        // "workflow", "domain-knowledge", "prompt-template"
	Content     string    `json:"content"`     // markdown body (instructions)
	Sessions    []string  `json:"sessions"`    // source session IDs
	CreatedAt   time.Time `json:"created_at"`
}

Skill represents a Claude Code skill extracted from session data.

func List

func List(dir string) ([]*Skill, error)

List scans a directory for skill .md files and returns summaries.

Jump to

Keyboard shortcuts

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