Documentation
¶
Overview ¶
Package skill provides LLM-powered extraction of reusable patterns from tapes sessions, outputting Claude Code SKILL.md files.
Index ¶
- Variables
- func GlobalAgentsSkillsDir() (string, error)
- func GlobalClaudeSkillsDir() (string, error)
- func LocalAgentsSkillsDir() string
- func LocalClaudeSkillsDir() string
- func RenderSkillMD(sk *Skill) string
- func SkillsDir() (string, error)
- func Sync(name, sourceDir, targetDir string) (string, error)
- func ValidSkillType(t string) bool
- func Write(sk *Skill, dir string) (string, error)
- type GenerateOptions
- type Generator
- type Skill
Constants ¶
This section is empty.
Variables ¶
var SkillTypes = []string{"workflow", "domain-knowledge", "prompt-template"}
SkillTypes enumerates valid skill type values.
Functions ¶
func GlobalAgentsSkillsDir ¶
GlobalAgentsSkillsDir returns ~/.agents/skills/.
func GlobalClaudeSkillsDir ¶
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 ¶
RenderSkillMD renders a Skill as its on-disk markdown representation (frontmatter + body).
func ValidSkillType ¶
ValidSkillType returns true if the given type is a recognized skill type.
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.