skillsync

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package skillsync mirrors skill files across all agent skill directories (~/.claude/skills, ~/.codex/skills, ~/.gemini/skills, ~/.agents/skills) without symlinks. Any file in any dir is copied to all others. Newest mtime wins on conflict so no work is lost.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEntry

func DeleteEntry(name string) (int, error)

DeleteEntry removes entryName (file or folder recursively) from all dirs.

func DeleteEntryFromDir

func DeleteEntryFromDir(dir, name string) error

DeleteEntryFromDir removes entryName only from one specific dir.

func DeleteFromAll

func DeleteFromAll(filename string) (int, error)

DeleteFromAll removes a skill file from all known dirs.

func DirLabel

func DirLabel(dir string) string

DirLabel returns a short human label for a dir path (e.g. "claude", "codex").

func KnownDirs

func KnownDirs() []string

KnownDirs returns existing skill dirs in a stable order.

func ReadFile

func ReadFile(filename string) ([]byte, string, error)

ReadFile returns the content of a skill file from the first dir that has it.

func ZipEntry

func ZipEntry(entryName string) ([]byte, error)

ZipEntry creates a zip archive of entryName (folder or file) from first dir that has it. Returns zip bytes.

Types

type ProviderLocation added in v0.14.1

type ProviderLocation struct {
	Label string `json:"label"`
	Dir   string `json:"dir"`
	Path  string `json:"path"` // full path to the skill entry (folder or file)
}

ProviderLocation is one provider that has a skill, with its full path.

type Result

type Result struct {
	Copied  int
	Skipped int
	Errors  []string
	Dirs    []string
}

Result is returned by Sync and Upload.

func Sync

func Sync() (Result, error)

Sync copies every skill file to every known dir. Newest mtime wins.

func Upload

func Upload(filename string, content []byte) (Result, error)

Upload writes content as filename into all known dirs immediately. Used when the user uploads a new skill file from the UI.

func UploadProcessed

func UploadProcessed(filename string, data []byte) (string, Result, error)

UploadProcessed handles upload logic:

  • .md / .txt → write to <skillDir>/<stem>/SKILL<ext>
  • .zip / .skills → extract zip with root-folder detection

Returns (folderName, Result, error).

type SkillEntry

type SkillEntry struct {
	Name    string    // entry name (folder or filename)
	IsDir   bool      // true if it's a folder in at least one dir
	Sources []string  // dirs where this entry exists
	Missing []string  // dirs where this entry is absent
	Newest  time.Time // mtime of newest copy
}

SkillEntry represents one top-level entry (file or folder) found across skill dirs.

func ListDir

func ListDir(entryName string) ([]SkillEntry, []string, error)

ListDir returns entries inside a specific subfolder across all skill dirs. entryName is a top-level folder name (e.g. "imagegen"). Returns entries found in any dir, deduped by name, isDir tracked. Second return is the list of dirs where entryName exists.

type SkillFile

type SkillFile = SkillEntry

SkillFile is an alias kept for callers that only care about files.

func Status

func Status() ([]SkillFile, []string, error)

Status returns current skill state without writing anything.

type SkillInfo added in v0.14.1

type SkillInfo struct {
	Name             string             `json:"name"`
	IsDir            bool               `json:"is_dir"`
	Meta             map[string]string  `json:"meta"`
	InProviders      []ProviderLocation `json:"in_providers"`
	MissingProviders []ProviderLocation `json:"missing_providers"`
}

SkillInfo is an enriched skill entry — name, metadata, and per-provider locations.

func ListSkills added in v0.14.1

func ListSkills() []SkillInfo

ListSkills returns enriched SkillInfo for every top-level entry across all known skill dirs, including parsed metadata and per-provider paths.

Jump to

Keyboard shortcuts

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