agent-browser-automati…
Automate browser interactions for development testing using Puppeteer MCP
Intelligent flaky test detection and stabilization system with automated pattern recognition and framework-specific fixes
How it fires
How this command gets triggered: by you, by Claude, or both.
/flaky-fixContext preview
What this command does when you run it.
Intelligent flaky test detection and stabilization system with automated pattern recognition and framework-specific fixes
allowed-tools: Task, Read, Write, Edit, MultiEdit, Bash(fd:*), Bash(rg:*), Bash(bat:*), Bash(jq:*), Bash(gdate:*), Bash(git:*), Bash(gh:*), Bash(docker:*), Bash(deno:*), Bash(cargo:*), Bash(go:*), Bash(mvn:*), Bash(gradle:*), Bash(python:*), Bash(pytest:*), Bash(jest:*), Bash(wc:*), Bash(head:*), Bash(tail:*), Bash(sort:*), Bash(uniq:*) name: "Flaky Fix" description: "Intelligent flaky test detection and stabilization system with automated pattern recognition and framework-specific fixes" author: "wcygan" tags: ["test","fix"] version: "1.0.0" created_at: "2025-07-14T00:00:00Z" updated_at: "2025-07-14T00:00:00Z"
STEP 1: Initialize comprehensive flaky test analysis session
# Initialize flaky test analysis session
echo '{
"sessionId": "'$SESSION_ID'",
"targetTest": "'$ARGUMENTS'",
"testFramework": "auto-detect",
"analysisScope": "determine-from-args",
"flakyPatterns": [],
"stabilizationActions": [],
"monitoringSetup": false
}' > /tmp/flaky-test-session-$SESSION_ID.jsonSTEP 2: Parallel comprehensive analysis using sub-agent coordination
IF project_complexity == "large" OR scope == "project-wide":
LAUNCH parallel sub-agents for comprehensive flaky test investigation:
ELSE:
EXECUTE focused single-test analysis workflow:
STEP 3: Intelligent test framework detection and adaptation
TRY:
**Framework-Adaptive Analysis Pattern:**
# Enhanced framework detection with tool validation
detect_test_framework() {
local session_id="$SESSION_ID"
if [ -f "deno.json" ]; then
FRAMEWORK="deno"
TEST_COMMAND="deno test"
TEST_FILES=$(fd "(test|spec)" --extension ts --extension js | head -20)
STABILITY_TOOLS="deno_test_utils"
elif [ -f "Cargo.toml" ]; then
FRAMEWORK="rust"
TEST_COMMAND="cargo test"
TEST_FILES=$(fd "_test\.rs$|tests/" --type f | head -20)
STABILITY_TOOLS="tokio_test"
elif [ -f "go.mod" ]; then
FRAMEWORK="go"
TEST_COMMAND="go test"
TEST_FILES=$(fd "_test\.go$" | head -20)
STABILITY_TOOLS="testify"
elif [ -f "package.json" ]; then
FRAMEWORK="node"
TEST_COMMAND="npm test"
TEST_FILES=$(fd "(test|spec)\.(js|ts|jsx|tsx)$" | head -20)
STABILITY_TOOLS="jest_retry"
elif [ -f "pyproject.toml" ] || [ -f "requirements.txt" ]; then
FRAMEWORK="python"
TEST_COMMAND="pytest"
TEST_FILES=$(fd "test_.*\.py$|.*_test\.py$" | head -20)
STABILITY_TOOLS="pytest_rerunfailures"
else
echo "❌ Unknown testing framework - manual analysis required"
exit 1
fi
# Update session state with framework details
jq --arg fw "$FRAMEWORK" --arg cmd "$TEST_COMMAND" --arg tools "$STABILITY_TOOLS" '
.testFramework = $fw |
.testCommand = $cmd |
.stabilityTools = $tools
' /tmp/flaky-test-session-$session_id.json > /tmp/flaky-test-session-$session_id.tmp &&
mv /tmp/flaky-test-session-$session_id.tmp /tmp/flaky-test-session-$session_id.json
}
detect_test_frameworkSTEP 4: Advanced CI/CD integration with intelligent failure pattern extraction
**Enhanced CI History Analysis:**
# Advanced GitHub Actions analysis with error categorization
analyze_github_ci() {
local session_id="$SESSION_ID"
if [ -d ".github/workflows" ]; then
echo "🔍 Analyzing GitHub Actions test history..."
# Extract comprehensive CI data
gh run list --limit 100 --json status,conclusion,createdAt,workflowName,databaseId > /tmA lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.
Repo: kiliczsh/claude-cmd
Automate browser interactions for development testing using Puppeteer MCP
Prepare branches for merging across multiple worktrees and coordinate integration
Transform into accessibility expert for WCAG compliance and inclusive design
Transform into an API design specialist who creates well-structured, developer-friendly APIs
Transform into backend specialist for scalable API and system design
Cloud architect persona for designing scalable, secure cloud infrastructure using modern cloud-native technologies