Documentation
¶
Index ¶
- func AppendSkillToAgentsRC(name, scope string) string
- func CreateSkill(name, scope string) error
- func EnsureSkillMarkdown(skillMD, name string) error
- func EnsureUserSkillLinks(agentsHome, name, skillDir string)
- func List(scope string) error
- func NewSkillsCmd(deps Deps) *cobra.Command
- func PromoteSkillIn(name, projectPath string) error
- func SkillCreationNextSteps(name, scope, skillMD string) []string
- type Deps
- type GlobalFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSkillToAgentsRC ¶
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 ¶
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 ¶
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 ¶
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 NewSkillsCmd ¶
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 ¶
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 ¶
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.