Skip to content

Commit 6cc2136

Browse files
fix(plugins): relax version field requirement to match Anthropic's plugin patterns
Anthropic's own published plugins (e.g., figma-plugin, miro-plugin) omit the version field from plugin.json, using marketplace.json instead. Changed from error to suggestion to align with observed real-world patterns while still encouraging semver versioning when present. Changes: - Missing version: error → suggestion - Invalid semver: error → warning - Updated comment to reflect Anthropic's marketplace.json pattern
1 parent da3d122 commit 6cc2136

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

internal/cli/plugins.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,24 +146,24 @@ func validatePluginSpecific(data map[string]interface{}, filePath string, conten
146146
}
147147
}
148148

149-
// Version field - required and must be semver
149+
// Version field - recommended (Anthropic's own plugins omit this, using marketplace.json instead)
150150
if version, ok := data["version"].(string); !ok || version == "" {
151151
errors = append(errors, cue.ValidationError{
152152
File: filePath,
153-
Message: "Required field 'version' is missing or empty",
154-
Severity: "error",
155-
Source: cue.SourceAnthropicDocs,
153+
Message: "Consider adding 'version' field in semver format (e.g., 1.0.0)",
154+
Severity: "suggestion",
155+
Source: cue.SourceCClintObserve,
156156
Line: FindJSONFieldLine(contents, "version"),
157157
})
158158
} else {
159-
// Validate semver format
159+
// Validate semver format if present
160160
semverPattern := regexp.MustCompile(`^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?(\+[a-zA-Z0-9.]+)?$`)
161161
if !semverPattern.MatchString(version) {
162162
errors = append(errors, cue.ValidationError{
163163
File: filePath,
164-
Message: fmt.Sprintf("Version '%s' must be in semver format (e.g., 1.0.0)", version),
165-
Severity: "error",
166-
Source: cue.SourceAnthropicDocs,
164+
Message: fmt.Sprintf("Version '%s' should be in semver format (e.g., 1.0.0)", version),
165+
Severity: "warning",
166+
Source: cue.SourceCClintObserve,
167167
Line: FindJSONFieldLine(contents, "version"),
168168
})
169169
}

0 commit comments

Comments
 (0)