Run AI-powered interaction flow validation for any software type (webapp, Android app, REST API, desktop GUI)
Run AI-powered validation for any software type (webapp, Android, REST API, desktop GUI) with intelligent flow generation and automatic error detection. Use this to test feature implementations before deployment and catch runtime errors automatically.
/plugin marketplace add MartyBonacci/specswarm/plugin install specswarm@specswarmRun comprehensive validation with intelligent flow generation, interactive error detection, and automatic project type detection.
echo "š SpecLabs Feature Validation v2.7.0"
echo "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
echo ""
# Parse arguments
PROJECT_PATH=""
SESSION_ID=""
TYPE_OVERRIDE="auto"
FLOWS_FILE=""
BASE_URL=""
# Check if first arg is a path (doesn't start with --)
if [ -n "$1" ] && [ "${1:0:2}" != "--" ]; then
PROJECT_PATH="$1"
shift
else
PROJECT_PATH="$(pwd)"
fi
while [[ $# -gt 0 ]]; do
case "$1" in
--session-id) SESSION_ID="$2"; shift 2 ;;
--type) TYPE_OVERRIDE="$2"; shift 2 ;;
--flows) FLOWS_FILE="$2"; shift 2 ;;
--url) BASE_URL="$2"; shift 2 ;;
*) shift ;;
esac
done
# Validate project path exists
if [ ! -d "$PROJECT_PATH" ]; then
echo "ā Error: Project path does not exist: $PROJECT_PATH"
exit 1
fi
echo "š Project: $PROJECT_PATH"
echo ""
# Detect web project and Chrome DevTools MCP availability
PLUGIN_DIR="/home/marty/code-projects/specswarm/plugins/speclabs"
SPECSWARM_PLUGIN_DIR="/home/marty/code-projects/specswarm/plugins/specswarm"
if [ -f "$SPECSWARM_PLUGIN_DIR/lib/web-project-detector.sh" ]; then
source "$SPECSWARM_PLUGIN_DIR/lib/web-project-detector.sh"
# Check if Chrome DevTools MCP should be used
if should_use_chrome_devtools "$PROJECT_PATH"; then
export CHROME_DEVTOOLS_MODE="enabled"
export WEB_FRAMEWORK="$WEB_FRAMEWORK"
echo "š Web project detected: $WEB_FRAMEWORK"
echo "šÆ Chrome DevTools MCP: Available for browser automation"
echo " (saves ~200MB Chromium download)"
echo ""
elif is_web_project "$PROJECT_PATH"; then
export CHROME_DEVTOOLS_MODE="fallback"
export WEB_FRAMEWORK="$WEB_FRAMEWORK"
echo "š Web project detected: $WEB_FRAMEWORK"
echo "š¦ Using Playwright fallback for browser automation"
echo ""
else
export CHROME_DEVTOOLS_MODE="disabled"
fi
fi
# Source validation orchestrator
source "${PLUGIN_DIR}/lib/validate-feature-orchestrator.sh"
# Build orchestrator arguments
ORCHESTRATOR_ARGS=(--project-path "$PROJECT_PATH")
[ -n "$SESSION_ID" ] && ORCHESTRATOR_ARGS+=(--session-id "$SESSION_ID")
[ "$TYPE_OVERRIDE" != "auto" ] && ORCHESTRATOR_ARGS+=(--type "$TYPE_OVERRIDE")
[ -n "$FLOWS_FILE" ] && ORCHESTRATOR_ARGS+=(--flows "$FLOWS_FILE")
[ -n "$BASE_URL" ] && ORCHESTRATOR_ARGS+=(--url "$BASE_URL")
# Execute validation
VALIDATION_RESULT=$(validate_feature_orchestrate "${ORCHESTRATOR_ARGS[@]}")
VALIDATION_EXIT_CODE=$?
if [ $VALIDATION_EXIT_CODE -ne 0 ]; then
echo ""
echo "ā Validation failed to execute"
echo ""
echo "Result:"
echo "$VALIDATION_RESULT" | jq '.'
exit 1
fi
# Parse result
STATUS=$(echo "$VALIDATION_RESULT" | jq -r '.status')
TYPE=$(echo "$VALIDATION_RESULT" | jq -r '.type')
TOTAL_FLOWS=$(echo "$VALIDATION_RESULT" | jq -r '.summary.total_flows')
PASSED_FLOWS=$(echo "$VALIDATION_RESULT" | jq -r '.summary.passed_flows')
FAILED_FLOWS=$(echo "$VALIDATION_RESULT" | jq -r '.summary.failed_flows')
ERROR_COUNT=$(echo "$VALIDATION_RESULT" | jq -r '.summary.error_count')
DURATION=$(echo "$VALIDATION_RESULT" | jq -r '.metadata.duration_seconds')
# Display summary using orchestrator helper
print_validation_summary "$VALIDATION_RESULT"
# Update session if session ID provided
if [ -n "$SESSION_ID" ]; then
echo "š¾ Updating session: $SESSION_ID"
# Source feature orchestrator
source "${PLUGIN_DIR}/lib/feature-orchestrator.sh"
feature_init
# Store validation results in session
SESSION_FILE="${FEATURE_SESSION_DIR}/${SESSION_ID}.json"
if [ -f "$SESSION_FILE" ]; then
jq --argjson result "$VALIDATION_RESULT" \
--arg completed_at "$(date -Iseconds)" \
'.validation = $result |
.validation.completed_at = $completed_at' \
"$SESSION_FILE" > "${SESSION_FILE}.tmp"
mv "${SESSION_FILE}.tmp" "$SESSION_FILE"
echo " ā
Session updated with validation results"
else
echo " ā ļø Session file not found (validation results not persisted)"
fi
fi
echo ""
# Display Chrome DevTools MCP tip for web projects (if applicable)
if [ "$CHROME_DEVTOOLS_MODE" = "fallback" ]; then
echo ""
echo "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
echo "š” TIP: Enhanced Web Validation Available"
echo "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
echo ""
echo "Chrome DevTools MCP provides enhanced browser automation:"
echo " ⢠Real-time console error monitoring"
echo " ⢠Network request inspection during flows"
echo " ⢠Runtime state debugging"
echo " ⢠Saves ~200MB Chromium download"
echo ""
echo "Install Chrome DevTools MCP:"
echo " claude mcp add ChromeDevTools/chrome-devtools-mcp"
echo ""
echo "Your validation will automatically use it next time!"
echo "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
echo ""
fi
# Exit with appropriate code based on validation status
if [ "$STATUS" = "passed" ]; then
echo "ā
VALIDATION PASSED"
exit 0
elif [ "$STATUS" = "failed" ]; then
echo "ā ļø VALIDATION FAILED"
exit 1
else
echo "ā VALIDATION ERROR"
exit 1
fi
Detection uses file-based analysis with confidence scoring. Manual override available via --type flag.
# Validate current directory (auto-detect type)
/speclabs:validate-feature
# Validate specific project
/speclabs:validate-feature /path/to/my-app
# Override detected type
/speclabs:validate-feature /path/to/project --type webapp
# Use custom flows
/speclabs:validate-feature --flows ./custom-flows.json
# Override base URL
/speclabs:validate-feature --url http://localhost:3000
# Called automatically by orchestrate-feature when --validate is used
/speclabs:orchestrate-feature "Add shopping cart" /path/to/project --validate
# Manual validation with session tracking
/speclabs:validate-feature /path/to/project --session-id feature_20251103_143022
# Exit code 0 = passed, 1 = failed, useful for CI/CD
/speclabs:validate-feature && echo "Deploy approved" || echo "Fix errors before deploy"
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
VALIDATION SUMMARY
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Type: webapp
Status: passed
Duration: 47s
Flows: 8/8 passed
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
<project>/.speclabs/validation/flow-results.json<project>/.speclabs/validation/screenshots/*.png<project>/.speclabs/validation/dev-server.log<project>/.speclabs/validation/test-output-*.logArchitecture: Generic orchestrator with pluggable type-specific validators. Extensible design allows adding new validator types without breaking changes.
Purpose: Provide comprehensive, automated validation across any software type, with intelligent flow generation and interactive error detection. Reduces manual testing burden and catches errors before deployment.