Validate specification files against schemas
Validates YAML specification files against JSON schemas and reports errors.
/plugin marketplace add codingawayy/cc-marketplace/plugin install specs@cc-marketplaceValidate YAML spec files in docs.specs/ against their JSON schemas.
Read ~/.claude/plugins/cache/settings.json and get the pluginPath from the cc-specs-plugin entry.
If the file or entry is missing, tell the user: "Plugin not initialized. Please restart Claude Code to trigger plugin initialization."
Check if node_modules exists in the plugin's validator/ directory. If not, run:
npm install --prefix "<pluginPath>/validator"
Run the Node.js validation script:
node "<pluginPath>/validator/validate.js" --specs "docs.specs" --schemas "<pluginPath>/schemas"
The script outputs JSON with validation results in this format:
{
"summary": { "total": 10, "valid": 8, "invalid": 2 },
"results": [
{ "file": "domain/event/event.yaml", "schema": "entity", "valid": true },
{ "file": "system.yaml", "schema": "system", "valid": false,
"errors": [{ "path": "/users/0", "message": "must have required property 'name'" }] }
]
}
Parse the JSON output and report results in a user-friendly format:
Report the total count and list each file with a checkmark.
For each invalid spec:
Group errors by file for readability.
End with a summary line: "X of Y specs passed validation"