skills

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendSkillToAgentsRC

func AppendSkillToAgentsRC(name, scope string) string

AppendSkillToAgentsRC adds name to the .agentsrc.json Skills list for the project registered under scope. Returns a status message on success, "" if the scope is not registered or the manifest is missing — both are non-fatal "best effort" outcomes used by skillCreationNextSteps. Production wrapper over appendSkillToAgentsRC; passes stdSkillsIO{}.

func CreateSkill

func CreateSkill(name, scope string) error

CreateSkill scaffolds a new skill under ~/.agents/skills/<scope>/<name>/, drops a templated SKILL.md, and (for global-scope skills) wires user-level platform symlinks so the skill is live without requiring `da refresh`. Production wrapper over createSkill; passes stdSkillsIO{}.

func EnsureSkillMarkdown

func EnsureSkillMarkdown(skillMD, name string) error

EnsureSkillMarkdown writes a templated SKILL.md when one does not already exist at skillMD. A pre-existing file is preserved verbatim. Production wrapper over ensureSkillMarkdown; passes stdSkillsIO{}.

func EnsureUserSkillLinks(agentsHome, name, skillDir string)

EnsureUserSkillLinks creates symlinks for a single global skill into all user-level skill directories so the skill is immediately available without requiring a full refresh. Production wrapper over ensureUserSkillLinks.

  • ~/.agents/skills/<name> → agentsHome/skills/global/<name> (Codex)
  • ~/.claude/skills/<name> → agentsHome/skills/global/<name> (Claude Code)

func List

func List(scope string) error

List prints skills under ~/.agents/skills/<scope>/.

func NewSkillsCmd

func NewSkillsCmd(deps Deps) *cobra.Command

NewSkillsCmd builds the `da skills` command tree from injected dependencies. Mirrors agents.NewAgentsCmd: helpers come from Deps so the subpackage stays independent of the parent commands/ package.

func PromoteSkillIn

func PromoteSkillIn(name, projectPath string) error

PromoteSkillIn promotes a repo-local skill (.agents/skills/<name>/) into the shared agents store. The canonical location (~/.agents/skills/<project>/<name>/) becomes the real directory, and the repo-local path is converted to a managed symlink pointing at it.

func SkillCreationNextSteps

func SkillCreationNextSteps(name, scope, skillMD string) []string

SkillCreationNextSteps composes the next-steps list shown after a successful skill creation. For non-global scopes the function also attempts to update the project .agentsrc.json and appends a confirmation line when that succeeded. Production wrapper over skillCreationNextSteps.

Types

type Deps

type Deps struct {
	Flags                 GlobalFlags
	ErrorWithHints        func(message string, hints ...string) error
	UsageError            func(message string, hints ...string) error
	MaximumNArgsWithHints func(n int, hints ...string) cobra.PositionalArgs
	RangeArgsWithHints    func(min, max int, hints ...string) cobra.PositionalArgs
	ExactArgsWithHints    func(n int, hints ...string) cobra.PositionalArgs
}

Deps carries UX helpers from the commands package without an import cycle. Mirrors agents.Deps so the two extracted subpackages share the same shape. Only fields actually consumed by skills subcommands are present.

type GlobalFlags

type GlobalFlags struct {
	Yes bool
}

GlobalFlags mirrors the subset of commands.Flags used by skills subcommands. Kept as a parallel type to commands.GlobalFlags so the skills subpackage has no import on the parent commands/ package.

Jump to

Keyboard shortcuts

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