skill

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package skill implements the reusable prompt macro library. Skills are named prompt fragments stored in .cloop/skills/<name>.md that can be referenced in task descriptions and prompts as {{skill:name}}. Three built-in skills are always available: tdd, secure, and minimal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(workDir, name string) error

Delete removes a user-defined skill file. Built-in skills that have no corresponding user file cannot be deleted.

func Expand

func Expand(workDir, prompt string) string

Expand replaces all {{skill:name}} references in prompt with the content of the named skill. Unknown skills are left as-is with a warning comment appended. Returns the expanded prompt unchanged if workDir is empty.

func Save

func Save(workDir, name, content string) error

Save writes skill content to .cloop/skills/<name>.md, creating the directory if necessary. This always saves to the user-file layer, even for built-in names.

Types

type Skill

type Skill struct {
	Name    string
	Content string
	Builtin bool // true for built-in skills not overridden by a user file
}

Skill represents a named prompt fragment.

func Get

func Get(workDir, name string) (Skill, error)

Get returns the content of a skill by name. User files take precedence over built-ins. Returns an error if the skill does not exist.

func List

func List(workDir string) ([]Skill, error)

List returns all available skills (built-in + user-defined), sorted by name. User skills with the same name as a built-in override the built-in.

Jump to

Keyboard shortcuts

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