xarchitecture
Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
Run tests with smart defaults, maturity-aware thresholds, and centralized-rules integration
How it fires
How this command gets triggered: by you, by Claude, or both.
/xtestContext preview
What this command does when you run it.
Run tests with smart defaults, maturity-aware thresholds, and centralized-rules integration
description: Run tests with smart defaults, maturity-aware thresholds, and centralized-rules integration tags: [testing, coverage, quality, tdd, property-based]
Run tests with intelligent defaults aligned to centralized-rules testing standards. No parameters needed for basic usage.
**Basic usage (runs all available tests):**
/xtest
**Run with coverage report:**
/xtest coverage
**Quick unit tests only:**
/xtest unit
**Run tests for changed files only:**
/xtest changed
**Property-based testing:**
/xtest property
**Help and options:**
/xtest help /xtest --help
If $ARGUMENTS contains "help" or "--help": Display this usage information and exit.
Examine the project structure, detect language, framework, and maturity level: !ls -la | grep -E "(pyproject.toml|setup.py|requirements.txt|package.json|go.mod|Cargo.toml|pom.xml)" !find . -name "*test*" -o -name "*spec*" -o -name "__tests__" | head -5 !python -c "import pytest; print('pytest available')" 2>/dev/null || npm test --version 2>/dev/null || echo "Detecting test framework..."
Assess project maturity to set appropriate thresholds (per centralized-rules/base/testing-philosophy):
| Practice | MVP/POC | Pre-Production | Production | |----------|---------|----------------|------------| | Unit tests | Recommended | Required | Required | | Integration tests | Optional | Recommended | Required | | Coverage threshold | 40%+ | 60%+ | 80%+ | | TDD | Optional | Recommended | Required |
Detect maturity signals:
**Mode 1: Default Test Run (no arguments)** If $ARGUMENTS is empty or contains "all":
Auto-detect and run available tests:
!python -m pytest -v --tb=short 2>/dev/null || npm test 2>/dev/null || go test ./... 2>/dev/null || echo "No standard test configuration found"
**Mode 2: Unit Tests Only (argument: "unit")** If $ARGUMENTS contains "unit":
Run fast, isolated tests only (target: <100ms each per testing-philosophy): !python -m pytest -v -k "unit" --tb=short -x 2>/dev/null || npm test -- --testNamePattern="unit" 2>/dev/null
**Mode 3: Coverage Analysis (argument: "coverage")** If $ARGUMENTS contains "coverage":
Run with coverage and apply maturity-appropriate threshold: !python -m pytest --cov=. --cov-report=term-missing -v 2>/dev/null || npm test -- --coverage 2>/dev/null
Report against centralized-rules thresholds:
**Mode 4: Changed Files Only (argument: "changed")** If $ARGUMENTS contains "changed":
Run tests only for files changed since last commit: !git diff --name-only HEAD~1 | grep -E "\.(py|js|ts|go|rs)$" | head -20
Map changed source files to their test files and run only those:
**Mode 5: Property-Based Testing (argument: "property")** If $ARGUMENTS contains "property":
Scan for existing property-based tests and run them: !grep -r "hypothesis\|fast-check\|gopter\|proptest" . --include="*.py" --include="*.ts" --include="*.go" -l 2>/dev/null
If none found, suggest property-based test candidates by identifying:
Per centralized-rules testing-philosophy, property patterns include:
Follow the testing pyramid (centralized-rules standard):
Provide:
1. **Test Summary**: Pass/fail status with counts 2. **Failed Tests**: Failures with concise explanations 3. **Coverage Status**: Percentage vs maturity-appropriate threshold 4. **Testing Pyramid Balance**: Current ratio of unit/integration/e2e 5. **Next Steps**: Specific actions to improve test quality
Report format:
Keep output concise and actionable.
Transform Claude Code into a complete development platform with 45 AI-powered commands that automate your entire software development workflow. Now with improved git identity management!
Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
Manage project configuration files, environment variables, and application settings
Continue an execution plan from where it left off across sessions
Interactive debugging support with error analysis and fix suggestions - integrates with Debug Specialist sub-agent for complex…