xarchitecture
Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
Establish and track quality, performance, and security baselines with regression detection
How it fires
How this command gets triggered: by you, by Claude, or both.
/xbaselineContext preview
What this command does when you run it.
Establish and track quality, performance, and security baselines with regression detection
description: Establish and track quality, performance, and security baselines with regression detection tags: [baseline, metrics, performance, quality, regression, thresholds]
Establish intelligent baselines for quality, performance, and security metrics. Detect regressions against baselines. Aligns with the Baseline Management pattern from ai-development-patterns.
**Capture current baseline:**
/xbaseline capture
**Compare current state against baseline:**
/xbaseline check
**Show baseline drift over time:**
/xbaseline drift
**Set custom thresholds:**
/xbaseline threshold --coverage 85 --complexity 8
**Help and options:**
/xbaseline help /xbaseline --help
If $ARGUMENTS contains "help" or "--help": Display this usage information and exit.
Examine project for measurable metrics: !ls -la | grep -E "(pyproject.toml|package.json|go.mod|Cargo.toml)" !find . -name ".coverage" -o -name "coverage.xml" -o -name "lcov.info" | head -5 !find . -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.go" | grep -v node_modules | wc -l
**Mode 1: Capture Baseline (argument: "capture")** If $ARGUMENTS contains "capture":
Collect current metrics and save as baseline:
1. **Code Metrics**: !find . -name "*.py" -not -path "*/node_modules/*" -not -path "*/__pycache__/*" | xargs wc -l 2>/dev/null | tail -1 !find . -name "*.py" -not -path "*/node_modules/*" | wc -l 2>/dev/null
Measure:
2. **Test Metrics**: !python -m pytest --co -q 2>/dev/null | tail -1 || echo "Test count not available"
3. **Quality Metrics**: !ruff check . --statistics 2>/dev/null | tail -5 || echo "No linter baseline"
!grep -r "TODO\|FIXME\|HACK" . --include="*.py" --include="*.js" --include="*.ts" | wc -l 2>/dev/null
4. **Security Metrics**:
5. **Dependency Metrics**:
Save baseline to `.baseline.json` in project root with timestamp.
**Mode 2: Check Against Baseline (argument: "check" or no arguments)** If $ARGUMENTS is empty or contains "check":
Compare current state against saved baseline:
1. Read `.baseline.json` (if not found, suggest running `capture` first) 2. Collect current metrics using same methods 3. Compare each metric and flag regressions:
Report as:
**Mode 3: Drift Analysis (argument: "drift")** If $ARGUMENTS contains "drift":
Show how metrics have changed since baseline was captured:
**Mode 4: Custom Thresholds (argument: "threshold")** If $ARGUMENTS contains "threshold":
Override default thresholds. Parse remaining arguments for:
Save custom thresholds to `.baseline.json`.
## Baseline Report — [date] | Metric | Baseline | Current | Status | |--------|----------|---------|--------| | Test coverage | 82% | 79% | REGRESSED | | Lint violations | 12 | 8 | IMPROVED | | Avg complexity | 4.2 | 4.5 | STABLE | | File count | 45 | 48 | STABLE | | TODO count | 8 | 15 | REGRESSED | ### Regressions Requiring Action - Coverage dropped 3% — review recently added code without tests - TODO count increased — schedule tech debt cleanup
Keep output focused on regressions and actionable improvements.
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…