Documentation
¶
Overview ¶
Package agents installs bundled mysql-cli skills into AI agents in each agent's native format. It is the Go port of scripts/install-skills.sh and depends only on the standard library; skill content is injected via fs.FS.
Index ¶
Constants ¶
const ( Claude = "claude" Cursor = "cursor" Codex = "codex" OpenCode = "opencode" Copilot = "copilot" Windsurf = "windsurf" Aider = "aider" )
Agent name constants.
const ( SelAuto = "auto" SelAll = "all" )
Selection constants for Run.
Variables ¶
AllAgents is the canonical ordered list, matching install-skills.sh.
var ErrProjectOnly = errors.New("agent is project-only; pass --project-dir")
ErrProjectOnly indicates an agent is project-only and --project-dir was not set.
Functions ¶
func Detect ¶
Detect returns the agents present on the system, mirroring install-skills.sh detect_agents(). projectDir may be "".
func MergeInstructionFile ¶
MergeInstructionFile returns instruction-file content after idempotently replacing the marked mysql-cli block with merged. Absent block => append. Properly idempotent (no whitespace accumulation; improves on the bash script).
func SkillBody ¶
SkillBody returns the body of a SKILL.md: content after the second "---" frontmatter delimiter. Mirrors install-skills.sh skill_body().
func ValidAgent ¶
ValidAgent reports whether name is a known agent.
Types ¶
type InstallResult ¶
type InstallResult struct {
Agent string `json:"name"`
Detected bool `json:"detected"`
Paths []string `json:"paths"`
Status string `json:"status"` // installed | skipped | error
Error string `json:"error,omitempty"`
}
InstallResult is the outcome for one agent.
func Install ¶
func Install(agent string, opts Options) InstallResult
Install installs all skills for one agent per opts.
func Run ¶
func Run(sel string, opts Options) []InstallResult
Run resolves the agent selection and installs skills for each. For SelAuto, agents are detected via Detect; if none detected, defaults to Claude (matching install-skills.sh). Detected reflects actual presence.
type Options ¶
type Options struct {
Home string // user home dir
ProjectDir string // project root ("" = no project-level install)
NoGlobal bool // skip global install
DryRun bool // report paths without writing
FS fs.FS // skills subtree (contains <name>/SKILL.md)
Names []string // skill names to install
}
Options controls install behavior.