OpenParable
Skip to content
← Back to skills

Analyzing Shaft Failures

Testing & Quality
analyzing-shaft-failures

Analyzing Shaft Failures is an Agent Skill for testing & quality published in the ShaftHQ/SHAFT_ENGINE repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Use when analyzing SHAFT Allure results, Doctor reports, trace evidence, healer output, flaky locator/wait/assertion failures, retries, or test-fix recommendations.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/ShaftHQ/SHAFT_ENGINE/blob/HEAD/shaft-skills/analyzing-shaft-failures/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/analyzing-shaft-failures, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Analyzing SHAFT Failures

Overview

Analyze populated evidence before changing tests. Separate product defects, test defects, and infrastructure problems; treat Doctor and healer patches as review-only until applied by the calling agent or user.

Evidence Workflow

  1. Count populated Allure *-result.json files before trusting status, summaries, or screenshots.
  2. Preserve the allure-results root; delete contents only when cleanup is explicitly needed.
  3. Use shaft-mcp:doctor_analyze_failed_allure for WebDriver/Selenium SHAFT failures.
  4. Use shaft-mcp:playwright_doctor_analyze_failed_allure for SHAFT Playwright failures.
  5. Use shaft-mcp:doctor_suggest_fix or shaft-mcp:playwright_doctor_suggest_fix only after reviewing the Doctor report.
  6. Prefer shaft-mcp:trace_latest, shaft-mcp:trace_summarize, and shaft-mcp:doctor_analyze_trace when structured trace evidence exists.
  7. Search the guide with shaft-mcp:shaft_guide_search before recommending SHAFT syntax changes.
  8. Call shaft-mcp:shaft_coding_partner_plan with the failed source path, selected failing code, and evidence paths before adding or moving repair code.
  9. Run shaft-mcp:test_code_guardrails_check on any suggested Java patch.

Diagnosis Categories

SymptomFirst check
Locator not found or duplicateCurrent DOM/tree, smart locator, app-owned attributes
Stale/hidden/covered/interactablePage state, frame/window context, synchronized SHAFT action
Assertion mismatchExpected behavior, test data, response/body state
Timeout/flaky retryDeterministic wait condition, environment, network trace
Empty reportTest did not run or result path is wrong; do not infer pass/fail
Product behavior changedReport suspected product bug, do not silently weaken assertions

Healer Rules

  • shaft-mcp:healer_run_failed_test and shaft-mcp:playwright_healer_run_failed_test may rerun and propose fixes, but they do not own source edits.
  • Require a headless, bounded Maven command and workspace-local evidence paths.
  • Do not run cloud/external suites, publish PRs, or use provider advisories unless explicitly approved.
  • Use shaft_coding_partner_plan.reuseMatches to keep repairs in the existing page/test owner instead of creating duplicate helper classes.
  • Validate applied fixes with shaft-mcp:verify_run_focused using the smallest affected test or compile check; see verifying-and-applying-shaft-changes.

Tool Catalog

Every shaft-mcp tool name and description is cached in ../references/shaft-mcp-tools.md. Read it to pick exact tool names instead of listing tools at runtime, and load only the schemas you need — on clients that defer tool schemas, batch the load in one lookup. When a shaft-cli launcher is installed, prefer running the same tools as shell commands per ../references/shaft-cli-commands.md (shaft-cli call <tool>), falling back to shaft-mcp:<tool> MCP calls otherwise.

Official Guide Routes

  • Doctor: https://shafthq.github.io/docs/agentic/doctor
  • MCP: https://shafthq.github.io/docs/agentic/mcp
  • Flakiness: https://shafthq.github.io/docs/testing/flakiness
  • Web locator strategy: https://shafthq.github.io/docs/testing/web#locator-strategy
  • Element validations: https://shafthq.github.io/docs/reference/actions/GUI/Element_Validations

Common Mistakes

MistakeFix
Trusting empty Allure outputCount result JSON first
Fixing only the named testCheck shared page/API helper callers
Weakening assertion to passConfirm expected behavior or report product bug
Applying healer patch blindlyReview evidence and guardrails first
Replacing allure-results directoryPreserve root and clean contents only