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 RuleConfig
- 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"`
}
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
Source string `toml:"source,omitempty"` // "marketplace" or "local" (default)
}
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"`
}
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,omitempty"`
Command string `toml:"command,omitempty"`
Args []string `toml:"args,omitempty"`
Timeout int `toml:"timeout,omitempty"`
Matcher string `toml:"matcher,omitempty"`
Cursor map[string]any `toml:"cursor,omitempty"`
ClaudeCode map[string]any `toml:"claude-code,omitempty"`
Copilot map[string]any `toml:"copilot,omitempty"`
}
HookConfig represents the [hook] section
func (*HookConfig) Validate ¶
func (h *HookConfig) Validate() error
Validate validates the [hook] section
type MCPConfig ¶
type MCPConfig struct {
Transport string `toml:"transport,omitempty"`
Command string `toml:"command,omitempty"`
Args []string `toml:"args,omitempty"`
URL string `toml:"url,omitempty"`
Env map[string]string `toml:"env,omitempty"`
Timeout int `toml:"timeout,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"`
Rule *RuleConfig `toml:"rule,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 RuleConfig ¶ added in v0.9.0
type RuleConfig struct {
Title string `toml:"title,omitempty"` // Title/heading for the rule (defaults to asset name)
PromptFile string `toml:"prompt-file,omitempty"` // Defaults to RULE.md
Description string `toml:"description,omitempty"` // Rule description (used in frontmatter)
Globs []string `toml:"globs,omitempty"` // File patterns this rule applies to
Cursor map[string]any `toml:"cursor,omitempty"` // Cursor-specific settings
ClaudeCode map[string]any `toml:"claude-code,omitempty"` // Claude Code-specific settings
}
RuleConfig represents the [rule] section
func (*RuleConfig) Validate ¶ added in v0.9.0
func (r *RuleConfig) Validate() error
Validate validates the [rule] section
type SkillConfig ¶
type SkillConfig struct {
PromptFile string `toml:"prompt-file"`
}
SkillConfig represents the [skill] section
func (*SkillConfig) Validate ¶
func (s *SkillConfig) Validate() error
Validate validates the [skill] section