Documentation
¶
Overview ¶
Package plugins loads Claude-format plugins (commands, skills and agents) from <project>/.decsr/plugins and ~/.decsr/plugins. Hooks and MCP servers are detected but never used.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
func Dir() string
Dir is the user plugin directory, ~/.decsr/plugins ("" without a home).
func LoadSkill ¶
LoadSkill returns the body (without frontmatter) of the skill id "<plugin>:<skill>". It wraps os.ErrNotExist when the plugin or skill is missing or the plugin is disabled.
func SetEnabled ¶
SetEnabled adds name to or removes it from the disabled file.
func SplitCommand ¶
SplitCommand returns the description, argument hint and body of a command file. A frontmatter "description" wins. Otherwise a leading "# heading" line becomes the description and leaves the body, or the description is the first 60 characters of the body.
Types ¶
type Agent ¶
type Agent struct {
Plugin, Name string
config.PluginAgent
}
Agent is a plugin agent offered as the workspace role <plugin>:<name>.
type Command ¶
type Command struct {
Plugin, Name, Description, ArgHint, Body string
}
Command is a plugin command, run as /<plugin>:<name>.
type Frontmatter ¶
Frontmatter holds the YAML header of a markdown file as a map.
func ParseFrontmatter ¶
func ParseFrontmatter(text string) (Frontmatter, string)
ParseFrontmatter splits a markdown file that may start with "---\n<yaml>\n---\n". Without a header, or when the header is not valid YAML mapping and holds no "key: value" line, the whole text is returned as the body and the map is nil.
func (Frontmatter) List ¶
func (f Frontmatter) List(key string) (items []string, ok bool)
List returns the value of key as a list: a YAML list, or a string split on commas and spaces. ok is false when the key is absent or null.
func (Frontmatter) String ¶
func (f Frontmatter) String(key string) string
String returns the value of key as one sanitized line ("" when absent). A list value is joined as "[a, b]".
type Plugin ¶
type Plugin struct {
Name, Description, Version string
Scope string // "project" or "user"
Enabled bool
Commands []Command
Skills []Skill
Agents []Agent
HasHooks, HasMCP bool
}
Plugin is one discovered plugin. A disabled plugin has no parts.
type Set ¶
Set is the result of a scan.
func Load ¶
Load scans <projectRoot>/.decsr/plugins and then ~/.decsr/plugins. A project plugin wins over a user plugin of the same name. The result is sorted by name.
func (Set) AgentRoles ¶
func (s Set) AgentRoles() map[string]config.PluginAgent
AgentRoles returns the agents of all enabled plugins keyed by role name.