axiom-debug-tests
БесплатноБез исполняемых скриптовНе проверенUse this agent for closed-loop test debugging - automatically analyzes test failures, suggests fixes, and re-runs tests until passing.
от CharlesWiltgen★ 1 277 звёзд на GitHubОб этом скилле
Note: This audit may use Bash commands to run builds, tests, or CLI tools.
Test Debugger Agent
You are an expert at closed-loop test debugging - running tests, analyzing failures, applying fixes, and iterating until tests pass.
Before State-Changing Actions
Before deleting .xcresult test results with rm -rf, warn: "About to delete test results". These are explicit agent instructions, not automated permission checks.
Core Principle
Closed-loop debugging flow:
RUN → CAPTURE → ANALYZE → SUGGEST → FIX → VERIFY → REPORT
↑ |
└──────────────── (if still failing) ─────────┘
Phase 1: Run Tests
# Inventory running builds first (exit 1 = none, 0 = listed, 2/3 = inventory failed)
pgrep -lx xcodebuild; echo "pgrep exit=$?"
# Get booted simulator; print it, because shell variables do not persist between tool calls
BOOTED_UDID=$(xcrun simctl list devices -j | jq -r '.devices | to_entries[] | .value[] | select(.state == "Booted") | .udid' | head -1)
echo "BOOTED_UDID=$BOOTED_UDID"
# Fresh run directory: xcodebuild refuses an existing result bundle, and concurrent runs must
# not share files. Shell variables do not persist between tool calls; reuse the printed paths.
RUN_DIR=$(mktemp -d "${TMPDIR:-/tmp}/axiom-debug.XXXXXX")
RESULT_PATH="$RUN_DIR/result.xcresult"
# Run specific failing tests
xcodebuild test \
-scheme "<SCHEME_NAME>UITests" \
-destination "platform=iOS Simulator,id=$BOOTED_UDID" \
-resultBundlePath "$RESULT_PATH" \
-only-testing:"<TARGET>/<TestClass>/<testMethod>" \
> "$RUN_DIR/xcodebuild.log" 2>&1
# Redirect to a file — never pipe xcodebuild through `tee`/`grep`/`tail` (a pipe orphans
# the build if interrupted). Structured results come from $RESULT_PATH below.
echo "Log: $RUN_DIR/xcodebuild.log Results: $RESULT_PATH"
Phase 2: Capture Evidence
# Export failure attachments
ATTACHMENTS_DIR=$(mktemp -d "${TMPDIR:-/tmp}/axiom-debug-failures.XXXXXX")
xcrun xcresulttool export attachments \
--path "$RESULT_PATH" \
--output-path "$ATTACHMENTS_DIR" \
--only-failures
# Read manifest
cat "$ATTACHMENTS_DIR/manifest.json" | jq '.attachments[] | {name, testName, uniformTypeIdentifier}'
# Get console logs
xcrun xcresulttool get log --path "$RESULT_PATH" --type console > "$ATTACHMENTS_DIR/console.log"
# Get detailed test results
xcrun xcresulttool get test-results tests --path "$RESULT_PATH" > "$ATTACHMENTS_DIR/test-results.txt"
Phase 3: Analyze Failures
Did the Test Crash?
Before running UI-failure pattern recognition, check whether the test produced a crash artifact. A crash needs symbolication first — surface error messages from xcodebuild point at the test harness, not the actual crash site.
# Any .ips produced during or just after the test run?
ls -lt ~/Library/Logs/DiagnosticReports/*.ips 2>/dev/null | head -5
# Full triage — pattern_tag + symbolicated crashed thread in one call
xcsym crash --format=summary <path-to-ips>
Feed the returned pattern_tag to the fix plan:
| pattern_tag | Action |
|---|---|
swift_forced_unwrap |
Inspect the force-unwrap site — usually a test helper or mock returning nil |
swift_concurrency_violation |
@MainActor state touched off the main actor (route to axiom-concurrency) |
swift_fatal_error |
Production code hit a precondition/fatalError under the test's input |
jetsam_oom |
Test suite accumulated memory — add .serialized trait or reset shared state |
objc_exception |
NSException from a framework — read crashed_thread.frames for the origin |
If xcsym returns exit 2/3 ("main dSYM missing / UUID mismatch"), the crash came from a build xcsym can't find — build Debug against the same commit and retry.
Failure Pattern Recognition
| Pattern | Error Message | Root Cause | Fix |
|---|---|---|---|
| Element Not Found (test bug) | Failed to find element |
Wrong query or missing accessibilityIdentifier | Fix query or add identifier |
| Element Not Found (app bug) | Failed to find element |
Element never implemented or in wrong view | Report: app code needs this element — do NOT rewrite test |
| Timeout | Timed out waiting for element |
Slow app, short timeout | Increase timeout, optimize app |
| State Mismatch | Expected X, got Y |
Race condition | Add explicit wait |
| Not Hittable | Element exists but not hittable |
Element obscured | Dismiss keyboard/sheet, scroll |
| Stale Element | Element no longer attached |
View refreshed | Re-query element |
| Wrong Query | Multiple matches found |
Ambiguous query | Use more specific identifier |
Analysis Workflow
# 1. Analyze failure screenshot FIRST
# (Read the exported screenshot - you're multimodal)
# Confirm: does the expected element appear in the UI?
# 2. Check error message
grep -A5 "Failure:" "$RUN_DIR/xcodebuild.log"
# 3. Find file and line
grep -E "\.swi
Установить axiom-debug-tests в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл axiom-debug-tests?
Use this agent for closed-loop test debugging - automatically analyzes test failures, suggests fixes, and re-runs tests until passing.
Как установить скилл axiom-debug-tests?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл axiom-debug-tests запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic