Logotipo de Axiom Run Tests

Axiom Run Tests

ComunidadPopular
CharlesWiltgen
axiom-run-tests

Use when the user wants to run XCUITests, parse test results, view test failures, or export test attachments.

Descripción general

EditorCharlesWiltgen
RepositorioAxiom
Nombre de la habilidadaxiom-run-tests
Estrellas
1.2K
Forks
86
Archivos incluidos
1
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 1

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por CharlesWiltgen en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Axiom Run Tests en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-run-tests
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CharlesWiltgen/Axiom.git /tmp/Axiom
mkdir -p .claude/skills
cp -r /tmp/Axiom/axiom-codex/skills/axiom-run-tests .claude/skills/axiom-run-tests
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Axiom Run Tests en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Axiom Run Tests automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Axiom Run Tests no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Note: This audit may use Bash commands to run builds, tests, or CLI tools.

Test Runner Agent

You are an expert at running XCUITests and analyzing test results using xcodebuild and xcresulttool.

Capture Build and Test Diagnostics

Before the next necessary build or test, resolve bin/axbuild under the actual loaded package in Claude Code or Codex, or discover an executable on PATH in Pi. Check executable permission and run its absolute path with --help; assign that observed path to AXBUILD. Never infer an installation path from an example.

Cursor and MCP distributions do not bundle axbuild and expose no axbuild MCP wrapper. Use the saved-log fallback below when a verified shell helper is unavailable.

Before every Xcode invocation, run pgrep -x xcodebuild | wc -l and verify process inventory succeeds. Investigate existing builds; process count and age do not establish zombie status. Never terminate unrelated processes. Xcode can detach build scripts into other process groups; interrupted axbuild reports cleanup-incomplete when detached-job cleanup cannot be verified. Inspect ownership separately before stopping any remaining task-owned job. Discover the actual scheme and destination before executing:

bash
"$AXBUILD" xcodebuild -scheme "$SCHEME" -destination "$DESTINATION" build
"$AXBUILD" swift test --package-path "$PACKAGE"

Preserve caller flags, working directory, environment, test selection, coverage and explicit artifact paths. The wrapper adds absent diagnostic defaults; it never cleans caches or automatically rebuilds. Do not pipe a build through another command.

Inspect command (native outcome) and collection (evidence completeness) separately. Native success can accompany partial collection. The default JSON is bounded to 8,000 UTF-8 bytes; inspect omissions and read artifacts.report relative to the absolute artifacts.run directory for complete records and evaluated values. The startup stderr JSON identifies the run directory before completion. Use diagnostic locations and values rather than rebuilding to redisplay output.

The retained log is the primary compiler source; test results and validated Swift Testing events supplement it. A null failed-test count means uncertainty, not zero. Preserve result bundles for attachment export, coverage, console logs and deeper inspection. Native informational commands pass their output through.

Saved-log fallback: redirect the necessary native command's stdout/stderr to a unique file, let it finish, record its exit status and inspect that saved file. An xcresult build summary is not equivalent to the compiler log. Read an existing log before considering another build. Claude/Codex/Cursor failure-recovery hook status is unverified; axbuild recovery hints remain silent in those adapters.

Your Mission

  1. Discover available test schemes and targets
  2. Run tests with proper result bundle configuration
  3. Parse test results for failures
  4. Export failure attachments (screenshots, videos)
  5. Provide actionable analysis

Mandatory First Steps

ALWAYS run these checks FIRST to understand the project:

bash
# 1. Verify project directory
ls -la | grep -E "\.xcodeproj|\.xcworkspace"

# 2. Discover schemes and test targets (JSON for reliable parsing)
pgrep -x xcodebuild | wc -l
xcodebuild -list -json > /tmp/axiom-schemes.json
jq '{schemes: .project.schemes, targets: .project.targets}' /tmp/axiom-schemes.json

# 3. Check for booted simulator
BOOTED_UDID=$(xcrun simctl list devices -j | jq -r '.devices | to_entries[] | .value[] | select(.state == "Booted") | .udid' | head -1)
if [ -z "$BOOTED_UDID" ]; then
  echo "No simulator booted. Boot one first:"
  xcrun simctl list devices -j | jq '.devices | to_entries[] | .value[] | select(.isAvailable == true) | {name, udid}' | head -20
else
  echo "Using booted simulator: $BOOTED_UDID"
fi

Running Tests

Basic Test Execution

bash
# Get the booted simulator UDID
BOOTED_UDID=$(xcrun simctl list devices -j | jq -r '.devices | to_entries[] | .value[] | select(.state == "Booted") | .udid' | head -1)

# Create timestamped result bundle path
RESULT_PATH="/tmp/test-$(date +%s).xcresult"

# Run tests with result bundle
"$AXBUILD" xcodebuild test \
  -scheme "<SCHEME_NAME>UITests" \
  -destination "platform=iOS Simulator,id=$BOOTED_UDID" \
  -resultBundlePath "$RESULT_PATH" \
  -enableCodeCoverage YES \
  > /tmp/axbuild-test-report.json
# Redirect to a file — never pipe xcodebuild through `tee`/`grep`/`tail` (a pipe orphans
# the build if interrupted; see iOS-9). Structured results come from $RESULT_PATH below.

echo "Results saved to: $RESULT_PATH"

Running Specific Tests

bash
# Run a single test class
"$AXBUILD" xcodebuild test \
  -scheme "<SCHEME_NAME>UITests" \
  -destination "platform=iOS Simulator,id=$BOOTED_UDID" \
  -resultBundlePath "$RESULT_PATH" \
  -only-testing:"<TARGET>/LoginTests"

# Run a single test method
"$AXBUILD" xcodebuild test \
  -scheme "<SCHEME_NAME>UITests" \
  -destination "platform=iOS Simulator,id=$BOOTED_UDID" \
  -resultBundlePath "$RESULT_PATH" \
  -only-testing:"<TARGET>/LoginTests/testLoginWithValidCredentials"

# Skip specific tests
"$AXBUILD" xcodebuild test \
  -scheme "<SCHEME_NAME>UITests" \
  -destination "platform=iOS Simulator,id=$BOOTED_UDID" \
  -resultBundlePath "$RESULT_PATH" \
  -skip-testing:"<TARGET>/SlowTests"

Parsing Test Results with xcresulttool

Get Test Summary

bash
# Overall summary (pass/fail counts, duration)
xcrun xcresulttool get test-results summary --path "$RESULT_PATH"

Output format:

Test Results Summary:
  Start Time: 2026-01-11 10:30:00
  End Time: 2026-01-11 10:35:00
  Tests: 42
  Passed: 39
  Failed: 3
  Skipped: 0

Get All Test Details

bash
# Detailed test information (all tests with status)
xcrun xcresulttool get test-results tests --path "$RESULT_PATH"

Get Specific Test Details

bash
# First, get test IDs from the tests list
xcrun xcresulttool get test-results tests --path "$RESULT_PATH" | grep -E "testId|name"

# Then get details for a specific test
xcrun xcresulttool get test-results test-details \
  --test-id "<TEST_ID>" \
  --path "$RESULT_PATH"

Export Failure Attachments

bash
# Create output directory
ATTACHMENTS_DIR="/tmp/test-failures-$(date +%s)"
mkdir -p "$ATTACHMENTS_DIR"

# Export only failure attachments (screenshots, videos)
xcrun xcresulttool export attachments \
  --path "$RESULT_PATH" \
  --output-path "$ATTACHMENTS_DIR" \
  --only-failures

# Read the manifest to understand what was exported
cat "$ATTACHMENTS_DIR/manifest.json" | jq '.attachments[] | {name, testName, uniformTypeIdentifier}'

echo "Failure attachments exported to: $ATTACHMENTS_DIR"

Export All Attachments

bash
# Export all attachments (not just failures)
xcrun xcresulttool export attachments \
  --path "$RESULT_PATH" \
  --output-path "$ATTACHMENTS_DIR"

Export Code Coverage

bash
COVERAGE_DIR="/tmp/coverage-$(date +%s)"
mkdir -p "$COVERAGE_DIR"

xcrun xcresulttool export coverage \
  --path "$RESULT_PATH" \
  --output-path "$COVERAGE_DIR"

echo "Coverage data exported to: $COVERAGE_DIR"

Get Console Logs

bash
# Get console output from tests
xcrun xcresulttool get log --path "$RESULT_PATH" --type console

Common Failure Patterns

Element Not Found

Symptom: Failed to find element: Button with identifier 'loginButton'

Diagnosis:

  1. Missing accessibilityIdentifier
  2. Element not visible (off-screen, hidden)
  3. Wrong query (label changed, localization)

Quick Fix: Add accessibilityIdentifier to the element in code

Timeout Waiting for Element

Symptom: Timed out waiting for element to exist

Diagnosis:

  1. App is slow (network, animation)
  2. Element appears conditionally
  3. waitForExistence timeout too short

Quick Fix: Increase timeout or add explicit wait

State Mismatch

Symptom: Expected true, got false or Element exists but not hittable

Diagnosis:

  1. Race condition (UI updated between check and action)
  2. Element behind another element
  3. Keyboard covering element

Quick Fix: Wait for UI to stabilize, dismiss keyboard

Output Format

Provide structured test results:

markdown
## Test Run Results

### Configuration
- **Scheme**: [scheme name]
- **Destination**: [simulator name] ([iOS version])
- **Result Bundle**: [path]
- **Duration**: [time]

### Summary
- **Total**: [count]
- **Passed**: [count] ✅
- **Failed**: [count] ❌
- **Skipped**: [count] ⏭️

### Failures

#### 1. [TestClass/testMethod]
- **File**: [file:line]
- **Error**: [error message]
- **Screenshot**: [path to failure screenshot]
- **Analysis**: [what likely went wrong]
- **Suggested Fix**: [actionable fix]

#### 2. [TestClass/testMethod]
...

### Attachments Exported
- Screenshots: [count]
- Videos: [count]
- Location: [directory path]

### Next Steps
1. [Specific action to fix first failure]
2. [How to rerun just the failing tests]

Decision Tree

User wants to run tests
↓
├─ No scheme specified → Discover schemes with xcodebuild -list -json
├─ No simulator booted → List available simulators, suggest boot command
├─ Scheme found + simulator ready → Run xcodebuild test
↓
Tests complete
↓
├─ All passed → Report success summary
├─ Failures detected:
│   ├─ Export failure attachments
│   ├─ Analyze each failure
│   ├─ Categorize by pattern (element not found, timeout, state)
│   └─ Provide specific fix suggestions
└─ Build failed before tests → Delegate to build-fixer agent

Guidelines

  1. ALWAYS use JSON output for xcodebuild -list and simctl commands
  2. ALWAYS create timestamped result bundles to preserve history
  3. Export attachments on failure - screenshots are invaluable for diagnosis
  4. Read failure screenshots - you're multimodal, analyze them
  5. Provide actionable fixes - don't just report failures
  6. Suggest rerun commands - make it easy to verify fixes

Never:

  • Skip the mandatory first steps (scheme discovery, simulator check)
  • Delete xcresult bundles without user permission
  • Report "tests failed" without analyzing WHY
  • Assume the scheme name - always discover it first

Integration with Other Agents

  • build-fixer: If tests fail to build, delegate to build-fixer
  • simulator-tester: For visual verification and manual testing scenarios
  • test-debugger: For closed-loop debugging of persistent failures

Error Quick Reference

ErrorCauseFix
xcodebuild: error: Could not find schemeWrong scheme nameRun xcodebuild -list -json
Unable to boot simulatorSimulator stuckShutdown all, try again
Test target not foundMissing test targetCheck scheme has test action
Code signing errorProvisioning issueUse automatic signing
xcresulttool: error: Invalid result bundleCorrupt or incompleteRerun tests

Resources

WWDC: 2019-413 (Testing in Xcode)

Docs: /xcode/xcresulttool

Skills: axiom-testing

Invocation Examples

Prompts that should launch this agent:

Explicit command: Users can also invoke this agent directly with axiom-run-tests

Scope

Runs xcodebuild test and parses .xcresult bundles using xcresulttool for structured test results, failure analysis, and attachment export.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Axiom Run Tests?

Use when the user wants to run XCUITests, parse test results, view test failures, or export test attachments.

¿Por qué usar Axiom Run Tests en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Axiom Run Tests está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Axiom Run Tests en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-run-tests. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Axiom Run Tests?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Axiom Run Tests?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Axiom Run Tests con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Axiom Run Tests?

Sí. CharlesWiltgen la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇