一键导入
fix-e2e
Iteratively fix failing E2E tests from a CI run. Analyzes failures, plans fixes, implements them, pushes, and repeats until all E2E tests pass.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Iteratively fix failing E2E tests from a CI run. Analyzes failures, plans fixes, implements them, pushes, and repeats until all E2E tests pass.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Process all open Dependabot PRs and security alerts: review changelogs, merge passing PRs, fix failing ones, remediate orphan alerts, and surface adoption opportunities.
Full development cycle for one or more user stories and/or bug fixes. Covers implementation, testing, PR, review, merge, and user verification — single items or batched into one PR.
Close an epic: refinement, E2E validation, UAT, documentation, and promotion from beta to main. Use after all stories in an epic are merged to beta.
Promote beta to main: branch sync, promotion PR, CI gate, user approval loop, documentation, merge. Works standalone or as part of /epic-close.
Comprehensive PR review using the full agent team. Reviews for duplicates, suspicious changes, dependency changes, architecture violations, and spec compliance. Approves or rejects with consolidated findings.
Autonomous end-to-end epic execution: plans stories, develops each story sequentially, then closes the epic. Only pauses for promotion to main.
基于 SOC 职业分类
| name | fix-e2e |
| description | Iteratively fix failing E2E tests from a CI run. Analyzes failures, plans fixes, implements them, pushes, and repeats until all E2E tests pass. |
You are the orchestrator running an iterative E2E test fix cycle. Follow these steps in order. Do NOT skip steps. The orchestrator delegates all implementation work — never write production code, tests, or architectural artifacts directly.
When to use: When a CI run has failing E2E tests that need to be fixed. This skill analyzes failures, determines root causes (test code vs production code vs spec), implements fixes via the appropriate agents, pushes, and iterates until all E2E tests pass.
When NOT to use: For new feature development (use /develop). For full epic validation (use /epic-close).
$ARGUMENTS contains one of the following:
https://github.com/owner/repo/actions/runs/12345)12345)If empty, ask the user to provide a run URL or ID before proceeding.
Extract the run ID from the input:
At the start of each /fix-e2e invocation, create tasks to track progress. These tasks survive context compression and let you recover your place if context is lost.
Create these tasks upfront (using TaskCreate):
Progress rule: Before starting each step, mark its task in_progress. After completing, mark it completed. If a step is skipped (conditional), mark it completed with a note.
Recovery rule: If you lose track of progress (e.g., after context compression), run TaskList to see which tasks are completed and resume from the first pending task.
Dynamic task rule: For each fix-and-verify iteration beyond the first, create new tasks (e.g., "Iteration 2: Analyze", "Iteration 2: Fix", "Iteration 2: Verify").
Fetch the failed run details:
# Get run summary
gh run view <RUN_ID> --repo steilerDev/cornerstone
# Get unique failed test names
gh run view <RUN_ID> --repo steilerDev/cornerstone --log-failed 2>&1 | grep -E "✘" | sed 's/.*✘/✘/' | sort -u
# Get error details for each failure pattern
gh run view <RUN_ID> --repo steilerDev/cornerstone --log-failed 2>&1 | grep -E "(Error:|expect\(|Expected:|Received:|Timeout)" | head -100
Categorize failures into distinct groups:
Determine root cause classification for each group using the test failure debugging protocol:
Enter plan mode (EnterPlanMode) and write a structured fix plan covering:
For each failure group:
The plan must identify the specific files to modify and the exact changes needed. Read the relevant test files, page objects, and production code before finalizing the plan.
Critical: Read the actual test code, page object models, and production code (API routes, components, schema) to understand the mismatch. Do not guess — verify by reading files.
Exit plan mode (ExitPlanMode) once the plan is approved.
Delegate fixes to the appropriate agents based on the plan:
e2e-test-engineer agentbackend-developer agentfrontend-developer agenttranslator agentProvide each agent with:
Delegation rules (per CLAUDE.md):
Ensure the branch name follows conventions. If on a worktree branch, rename it:
git branch -m fix/<issue-number>-e2e-fixes
Commit with appropriate trailers based on which agents contributed:
git add <specific-files>
git commit -m "$(cat <<'EOF'
fix(e2e): <concise description of fixes>
<details of what was fixed and why>
Co-Authored-By: Claude <agent-name> (<model>) <noreply@anthropic.com>
EOF
)"
git push -u origin <branch-name>
If no PR exists, create one targeting beta:
gh pr create --title "fix(e2e): resolve failing E2E tests" --body "$(cat <<'EOF'
## Summary
- <bullet points describing fixes>
## Test plan
- [ ] All E2E shards pass in CI
- [ ] Quality Gates pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
First, check mergeability:
state=$(gh pr view <PR> --repo steilerDev/cornerstone --json mergeable -q '.mergeable')
if [ "$state" != "MERGEABLE" ]; then echo "PR is not mergeable (state: $state)"; exit 1; fi
Then, wait for ALL E2E shards to complete (not just Quality Gates):
echo "Waiting for Quality Gates + all E2E shards..."
SECONDS=0
while true; do
if [ $SECONDS -ge 900 ]; then echo "TIMEOUT"; exit 1; fi
qg=$(gh pr checks <PR> --repo steilerDev/cornerstone --json name,bucket -q '.[] | select(.name == "Quality Gates") | .bucket' 2>/dev/null)
# Check if ANY E2E shard failed
e2e_fail=$(gh pr checks <PR> --repo steilerDev/cornerstone --json name,bucket -q '.[] | select(.name | startswith("E2E Tests")) | select(.bucket == "fail") | .name' 2>/dev/null | head -1)
# Check if ALL E2E shards completed
e2e_total=$(gh pr checks <PR> --repo steilerDev/cornerstone --json name,bucket -q '.[] | select(.name | startswith("E2E Tests")) | .name' 2>/dev/null | wc -l)
e2e_done=$(gh pr checks <PR> --repo steilerDev/cornerstone --json name,bucket -q '.[] | select(.name | startswith("E2E Tests")) | select(.bucket == "pass" or .bucket == "fail") | .name' 2>/dev/null | wc -l)
if [ "$qg" = "fail" ]; then echo "Quality Gates FAILED"; exit 1; fi
if [ -n "$e2e_fail" ]; then echo "E2E shard failed: $e2e_fail"; break; fi
if [ "$qg" = "pass" ] && [ "$e2e_total" -gt 0 ] && [ "$e2e_done" -eq "$e2e_total" ]; then echo "All $e2e_total E2E shards passed!"; break; fi
echo "Progress: QG=$qg, E2E=$e2e_done/$e2e_total done"
sleep 30
done
After CI completes:
If all E2E tests passed:
Quality Gates to pass (beta variant from CLAUDE.md):
echo "Waiting for Quality Gates..."
SECONDS=0
while true; do
if [ $SECONDS -ge 300 ]; then echo "TIMEOUT"; exit 1; fi
bucket=$(gh pr checks <PR> --repo steilerDev/cornerstone --json name,bucket -q '.[] | select(.name == "Quality Gates") | .bucket' 2>/dev/null)
case "$bucket" in pass) echo "Quality Gates passed"; break ;; fail) echo "Quality Gates FAILED"; exit 1 ;; *) sleep 30 ;; esac
done
gh pr merge <PR> --squash --repo steilerDev/cornerstone
If E2E tests still fail:
gh pr checks <PR> --repo steilerDev/cornerstone --json name,link -q '.[] | select(.name == "Quality Gates") | .link' 2>/dev/null
Iteration cap: If after 5 iterations E2E tests still fail, stop and report the remaining failures to the user for manual review. Include: