agentskill

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package agentskill renders the agent skill that teaches coding agents to work with the daemon, and installs it where Claude Code and Codex look for skills (dirs.go locates their directories). An installed copy is refreshed when the daemon starts, so it follows the binary that serves it.

Index

Constants

View Source
const (
	Missing  = "missing"
	Current  = "current"
	Outdated = "outdated"
	Foreign  = "foreign" // a file with this name this package did not write
)

Installed states of a skill file.

Variables

View Source
var ErrForeign = errors.New("a skill with this name exists and was not installed by " + app.Name)

ErrForeign means a skill with the same name exists that this package did not write.

Functions

func Getenv

func Getenv(key string) string

Getenv returns key from this process's environment. A process started outside a terminal (the daemon under launchd or systemd, the app's helper) lacks the variables set in shell startup files, so there it falls back to the login shell's environment, read once.

func Install

func Install(path, content string, force bool) (bool, error)

Install writes the skill to path. An existing file is replaced only if this package wrote it, unless force is set; a symlinked file is updated where it points. It reports whether the file changed.

func Refresh

func Refresh(port int, cfgPath string) error

Refresh rewrites installed copies that are out of date. Agents without the skill installed are left alone.

func Render

func Render(port int, cfgPath string) string

Render returns the skill for a daemon on port with its config at cfgPath.

func ShellEnv

func ShellEnv() []string

ShellEnv is the login shell's environment, read once (nil when it could not be read).

func State

func State(path, content string) string

State tells whether path holds content.

func Targets

func Targets() []string

Targets are the paths of AgentTargets.

Types

type Dirs

type Dirs struct {
	Home   string
	Claude string // CLAUDE_CONFIG_DIR, else ~/.claude
	Codex  string // CODEX_HOME, else ~/.codex
}

Dirs are the configuration directories of the coding agents.

func Locate

func Locate() (Dirs, error)

Locate resolves the agents' directories from their environment variables (see Getenv); a variable that is unset or not an absolute path leaves the default.

type Target

type Target struct {
	Agent string
	Path  string
}

Target is the skill file one agent reads. Agent is "claude" or "codex".

func AgentTargets

func AgentTargets() []Target

AgentTargets are the skill files of the agents installed for this account: Claude Code (<config dir>/skills) and Codex (~/.agents/skills, or <CODEX_HOME>/skills where an earlier install put the skill, which Codex still reads). Directories linked to one another count once, for the first agent.

Jump to

Keyboard shortcuts

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