Plan: E2E Triage Skill — Add Local Mode + CI Re-runs
Context
The current e2e-triage skill is CI-only: it downloads artifacts from a failed GitHub Actions run and classifies failures based on static artifact analysis. This has two problems:
CI mode lacks re-run verification — classification relies on heuristic signals (timeout patterns, error strings) rather than actually re-running the test to see if it reproduces.
No local triage path — when a user wants to triage failures locally, they must manually run tests and interpret results. The skill should support mise run test:e2e for local re-runs.
Goal: Enhance the single SKILL.md with two modes (auto-detected) and add re-run verification to both.
Files to Modify
File
Change
.claude/skills/e2e-triage/SKILL.md
Rewrite with dual-mode (local + CI), re-run logic, updated classification
.github/workflows/e2e-triage.yml
Add actions: write permission, increase timeout to 60m, update Claude prompt
No changes needed:
.github/workflows/e2e-isolated.yml — already has the right workflow_dispatch inputs
mise-tasks/test/e2e/_default — already supports --agent and filter args
SKILL.md Structure
Frontmatter
yaml
name: e2e-triage
description: Triage E2E test failures — run locally with mise or via CI re-runs, classify flaky vs real bug, create PRs for flaky fixes and GitHub issues for real bugs
Mode Detection (new section)
CI mode: WORKFLOW_RUN_ID env var is set (from e2e-triage.yml)
Local mode: User invokes /e2e-triage manually — no WORKFLOW_RUN_ID
Local Mode Steps
Parse user input: test name, agent (optional), or artifact path
First run: mise run test:e2e --agent <agent> <TestName> — capture artifact dir from output
Assistant
Let me start by reading the current files that need to be modified.
Assistant
Now let me also check the e2e-isolated.yml workflow to understand its inputs.
Assistant
★ Insight ─────────────────────────────────────
The architecture here is nicely layered: e2e-triage.yml triggers on failed E2E runs, downloads artifacts, then invokes Claude with the SKILL.md as instructions. The e2e-isolated.yml workflow already supports workflow_dispatch with agent and test inputs — perfect for CI re-runs. The mise run test:e2e task handles local runs with --agent and filter args.
─────────────────────────────────────────────────
Now let me implement both files. Starting with the SKILL.md rewrite:
Assistant
Now update the workflow file:
Assistant
I've reviewed the security hook's guidance. The workflow file uses github.event.workflow_run.id and github.event.workflow_run.html_url — these are numeric IDs and GitHub-controlled URLs, not user-controllable inputs. The existing workflow already safely uses env: blocks for these values in the Slack steps. The change from actions: read to actions: write is safe — it just grants permission to trigger workflows via gh workflow run.
Assistant
Now update the Claude prompt in the workflow to mention re-run capability:
Assistant
Let me verify both files look correct:
Assistant
Both files look good. Let me verify the canary tests still pass since no Go code was changed:
Assistant
All 43 canary tests pass.
★ Insight ─────────────────────────────────────Key design decisions in this implementation:
Mode auto-detection via env var — WORKFLOW_RUN_ID presence is a clean signal that avoids adding CLI flags or config. The CI workflow already sets this env var, so no changes needed on that side.
User
commit
Assistant
Committed as 1e50aba5 on alisha/e2e-triage. Working tree is clean.
If test fails: Run a second time with same params
If results split (1 pass, 1 fail): Run a third time as tiebreaker
Note: Include cost warning — real E2E tests consume API tokens. Confirm with user before running unless specific test names were provided.
CI Mode Steps
Download artifacts from failed run (existing scripts/download-e2e-artifacts.sh)
Identify failures from report.nocolor.txt per agent (existing Step 2)
For each failing test+agent pair, sequentially:
a. Trigger re-run: gh workflow run e2e-isolated.yml -f agent=<agent> -f test=<TestName>
b. Wait ~5s for run to register
c. Find run ID: gh run list -w e2e-isolated.yml -L 1 --json databaseId -q '.[0].databaseId'
d. Poll until complete: loop gh run view <id> --json status,conclusion every 30s
e. Download artifacts: gh run download <id> --dir <rerun-dir>
f. Repeat for second re-run
Collect results: original failure + 2 re-run results per test
Update Claude prompt to mention re-run capability and the e2e-isolated.yml workflow
No changes to allowedTools — Bash(gh *) already covers gh workflow run
Verification
Read the updated SKILL.md and verify both modes are clearly documented
Local mode smoke test: Invoke /e2e-triage TestSomeTest --agent vogon and verify it runs mise run test:e2e:canary (vogon = canary, no API cost)
CI workflow validation: Check that e2e-triage.yml has correct permissions and timeout
Canary tests: mise run test:e2e:canary should still pass (no Go code changes)
If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Users/alisha/.claude/projects/-Users-alisha-Projects-devenv-cli/8f15321d-2333-415f-a295-a31e4d8776e8.jsonl
Re-run strategy differs by mode — Local mode uses mise run test:e2e directly (fast, same machine), while CI mode triggers e2e-isolated.yml via gh workflow run (isolated, same CI environment as the original failure). This is important because flakiness can be environment-dependent.
actions: write permission — Upgrading from read to write is the minimum change needed for gh workflow run to trigger e2e-isolated.yml. The Bash(gh *) allowedTools pattern already covers this command, so no allowedTools changes were needed.
60-minute timeout — Re-running tests in CI (polling gh run view every 30s, waiting up to 25min per re-run, times multiple test+agent pairs) can easily exceed 30 minutes. 60 minutes provides headroom without being wasteful.
─────────────────────────────────────────────────
Here's a summary of all changes:
.claude/skills/e2e-triage/SKILL.md — Full rewrite
Mode detection section: Auto-detects CI vs local based on WORKFLOW_RUN_ID env var
Local mode (Steps L1–L5): Parses user input, runs tests with mise run test:e2e, re-runs failures up to 3 times (with tiebreaker), includes cost warning
CI mode (Steps C1–C4): Downloads artifacts, identifies failures, triggers re-runs via gh workflow run e2e-isolated.yml, polls for completion, downloads re-run artifacts
Shared analysis (Steps 1–5): Classification now uses a re-run results table as the primary signal (all fail = real-bug, mixed = flaky), supplemented by artifact analysis. Summary table gains a "Re-runs" column. triage-summary.json gains rerun_results field.
.github/workflows/e2e-triage.yml — Three targeted edits
actions: read → actions: write — enables gh workflow run for CI re-runs
timeout-minutes: 30 → timeout-minutes: 60 — accommodates re-run polling time
Updated Claude prompt — adds "CI mode" hint and instruction to re-run via e2e-isolated.yml