Ship embedded Agent Skills with your Go CLI.
skillsmith is a Go library for distributing Agent Skills through your CLI tool. Agent Skills are an open format for giving AI agents new capabilities — portable instruction sets that work across Claude Code, GitHub Copilot, OpenAI Codex, and other compatible agents.
With skillsmith, you can embed skill files into your Go binary using embed.FS and expose a skills subcommand that lets users install, update, and manage those skills on their machine. This makes your CLI tool AI-agent-friendly without pulling in a full CLI framework.
//go:embed skills
var skillsFS embed.FS
func run(ctx context.Context, args []string) error {
if len(args) > 0 && args[0] == "skills" {
s, err := skillsmith.New("mytool", version, skillsFS)
if err != nil {
log.Fatal(err)
}
return s.Run(ctx, args[1:])
}
// ... existing command handling
return nil
}This gives your tool the following subcommands:
mytool skills list # List embedded skills
mytool skills install # Install skills to ~/.agents/skills
mytool skills update # Update skills to newer versions
mytool skills reinstall # Reinstall all managed skills
mytool skills uninstall # Remove managed skills
mytool skills status # Show install status and version diff- Drop-in integration — add a
skillssubcommand to your existing CLI with a few lines of code - No CLI framework dependency — uses the standard
flagpackage only embed.FSsupport — embed skill files in your binary; theskills/prefix is auto-detected and stripped- agentskills compliant — follows the open Agent Skills specification for SKILL.md format and directory structure
- Metadata tracking — writes
.skillsmith.jsonalongside each installed skill for version-aware update and uninstall - Semantic versioning — uses
semver.Comparefor version comparison; prevents accidental downgrades - Lenient validation — warns on name mismatches; only skips skills with missing descriptions or unparseable YAML
agentskillssubpackage — SKILL.md parsing and discovery can be used independently of the CLI layer
| Option | Description |
|---|---|
--prefix |
Override the install directory (ignores --scope) |
--scope |
user (default: ~/.agents/skills) or repo (auto-detects repository root) |
--dry-run |
Preview changes without applying |
--force |
Overwrite unmanaged skills or force downgrade |
% go get github.com/Songmu/skillsmith