Documentation
¶
Index ¶
- Constants
- func Marshal(metadata *Metadata) ([]byte, error)
- func ParseDependency(dep string) (name string, constraint string, err error)
- func ValidateDependencyConstraint(constraint string) error
- func Write(metadata *Metadata, filePath string) error
- type AgentConfig
- type Asset
- type ClaudeCodePluginConfig
- type CommandConfig
- type HookConfig
- type MCPConfig
- type Metadata
- type SkillConfig
Constants ¶
const CurrentMetadataVersion = "1.0"
CurrentMetadataVersion is the current version of the metadata format
Variables ¶
This section is empty.
Functions ¶
func ParseDependency ¶
ParseDependency parses a dependency string (e.g., "package>=1.0.0,<2.0.0") Returns the package name and version constraint
func ValidateDependencyConstraint ¶
ValidateDependencyConstraint validates a version constraint string Supports: >=X.Y.Z, ~=X.Y.Z, ~X.Y.Z, and comma-separated constraints
Types ¶
type AgentConfig ¶
type AgentConfig struct {
PromptFile string `toml:"prompt-file"`
Triggers []string `toml:"triggers,omitempty"`
Requires []string `toml:"requires,omitempty"`
}
AgentConfig represents the [agent] section
func (*AgentConfig) Validate ¶
func (a *AgentConfig) Validate() error
Validate validates the [agent] section
type Asset ¶
type Asset struct {
Name string `toml:"name"`
Version string `toml:"version"`
Type asset.Type `toml:"type"`
Description string `toml:"description,omitempty"`
License string `toml:"license,omitempty"`
Authors []string `toml:"authors,omitempty"`
Keywords []string `toml:"keywords,omitempty"`
Homepage string `toml:"homepage,omitempty"`
Repository string `toml:"repository,omitempty"`
Documentation string `toml:"documentation,omitempty"`
Readme string `toml:"readme,omitempty"`
Dependencies []string `toml:"dependencies,omitempty"`
}
Asset represents the asset section (formerly [artifact])
type ClaudeCodePluginConfig ¶ added in v0.8.0
type ClaudeCodePluginConfig struct {
ManifestFile string `toml:"manifest-file,omitempty"` // Default: .claude-plugin/plugin.json
AutoEnable *bool `toml:"auto-enable,omitempty"` // Default: true
Marketplace string `toml:"marketplace,omitempty"` // Optional marketplace name
MinClientVersion string `toml:"min-client-version,omitempty"` // Optional minimum Claude Code version
}
ClaudeCodePluginConfig represents the [claude-code-plugin] section
func (*ClaudeCodePluginConfig) Validate ¶ added in v0.8.0
func (c *ClaudeCodePluginConfig) Validate() error
Validate validates the [claude-code-plugin] section
type CommandConfig ¶
type CommandConfig struct {
PromptFile string `toml:"prompt-file"`
Aliases []string `toml:"aliases,omitempty"`
RequiresAuth bool `toml:"requires-auth,omitempty"`
Dangerous bool `toml:"dangerous,omitempty"`
}
CommandConfig represents the [command] section
func (*CommandConfig) Validate ¶
func (c *CommandConfig) Validate() error
Validate validates the [command] section
type HookConfig ¶
type HookConfig struct {
Event string `toml:"event"`
ScriptFile string `toml:"script-file"`
Async bool `toml:"async,omitempty"`
FailOnError bool `toml:"fail-on-error,omitempty"`
Timeout int `toml:"timeout,omitempty"`
}
HookConfig represents the [hook] section
func (*HookConfig) Validate ¶
func (h *HookConfig) Validate() error
Validate validates the [hook] section
type MCPConfig ¶
type MCPConfig struct {
Command string `toml:"command"`
Args []string `toml:"args"`
Env map[string]string `toml:"env,omitempty"`
Timeout int `toml:"timeout,omitempty"`
Capabilities []string `toml:"capabilities,omitempty"`
}
MCPConfig represents the [mcp] section (for both mcp and mcp-remote)
type Metadata ¶
type Metadata struct {
MetadataVersion string `toml:"metadata-version,omitempty"`
Asset Asset `toml:"asset"`
// Type-specific sections (only one should be present based on asset.type)
Skill *SkillConfig `toml:"skill,omitempty"`
Command *CommandConfig `toml:"command,omitempty"`
Agent *AgentConfig `toml:"agent,omitempty"`
Hook *HookConfig `toml:"hook,omitempty"`
MCP *MCPConfig `toml:"mcp,omitempty"`
ClaudeCodePlugin *ClaudeCodePluginConfig `toml:"claude-code-plugin,omitempty"`
Custom map[string]any `toml:"custom,omitempty"`
}
Metadata represents the complete metadata.toml structure
func Parse ¶
Parse parses metadata from bytes Supports both new asset and old [artifact] section names
func (*Metadata) GetTypeConfig ¶
GetTypeConfig returns the type-specific configuration section
func (*Metadata) ValidateWithFiles ¶
ValidateWithFiles validates metadata and checks that required files exist in the provided file list
type SkillConfig ¶
type SkillConfig struct {
PromptFile string `toml:"prompt-file"`
Triggers []string `toml:"triggers,omitempty"`
Requires []string `toml:"requires,omitempty"`
SupportedLanguages []string `toml:"supported-languages,omitempty"`
}
SkillConfig represents the [skill] section
func (*SkillConfig) Validate ¶
func (s *SkillConfig) Validate() error
Validate validates the [skill] section