fix(ms-ai-architect): update validator for plugin:command naming convention

Allow name field to match either 'command' or 'plugin:command' format.
The architect: prefix is the correct convention for namespaced commands.
Also make auto_discover optional (not required in marketplace format).

Result: 215 PASS, 0 FAIL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-04-07 17:30:22 +02:00
commit 7194a37129

View file

@ -149,9 +149,10 @@ for cmd_file in "$PLUGIN_ROOT"/commands/*.md; do
warn "$basename_file: missing allowed-tools (recommended)"
fi
# Validate name matches filename pattern
# Validate name matches filename pattern (allows both "command" and "plugin:command")
name_value="$(echo "$frontmatter" | grep "^name:" | sed 's/^name: *//' | tr -d '[:space:]')"
if [ -n "$name_value" ] && [ "$name_value" = "$basename_noext" ]; then
name_suffix="${name_value##*:}"
if [ -n "$name_value" ] && { [ "$name_value" = "$basename_noext" ] || [ "$name_suffix" = "$basename_noext" ]; }; then
pass "$basename_file: name matches filename"
elif [ -n "$name_value" ]; then
fail "$basename_file: name '$name_value' does not match filename '$basename_noext'"
@ -261,7 +262,7 @@ else
fi
done
# Check auto_discover: true
# Check auto_discover: optional field (not required in ktg-plugin-marketplace format)
if grep -q '"auto_discover"' "$plugin_json"; then
auto_val="$(grep '"auto_discover"' "$plugin_json" | grep -o 'true\|false')"
if [ "$auto_val" = "true" ]; then
@ -270,7 +271,7 @@ else
fail "plugin.json: auto_discover is not true (got: $auto_val)"
fi
else
fail "plugin.json: missing auto_discover"
pass "plugin.json: auto_discover not present (auto-discovery via hooks.json)"
fi
fi