CLI-based Swift architectural analysis tool
smith-validation is an AI-optimized Swift architectural analysis tool that provides progressive intelligence analysis with JSON output perfect for CI/CD pipelines, AI agents, and automated workflows.
🤖 AI-Optimized for Anthropic Work: Enhanced with actionable insights, automation confidence scores, and progressive intelligence levels designed for AI agent consumption.
- Progressive Intelligence: Three analysis levels optimized for token efficiency
- Actionable Insights: AI-ready recommendations with implementation steps
- Automation Confidence: Scores for automated fix reliability (0-1.0)
- JSON Output: Structured results perfect for AI agents and automation
- Efficiency Metrics: Performance scores for analysis optimization
- TCA Missing Error Handling: Detects Action enums without error cases
- TCA Monolithic State: Identifies State structs with >15 properties
- High Coupling: Files with >15 imports
brew tap Smith-Tools/smith
brew install smith-validationgit clone https://github.com/Smith-Tools/smith-validation.git
cd smith-validation
swift build -c release# Critical violations only (token-optimized, fastest)
smith-validation /path/to/project --level=critical --format=json
# Standard analysis (all violations, balanced)
smith-validation /path/to/project --level=standard --format=json
# Comprehensive analysis with architectural hotspots (rich details)
smith-validation /path/to/project --level=comprehensive --format=json
# Human-readable summary
smith-validation /path/to/project --level=standard --format=summary
# Default is critical level with JSON output
smith-validation /path/to/project# AI-optimized analysis for Claude Code integration
smith-validation . --level=critical --format=json
# Standard analysis for development workflow
smith-validation ~/Projects/MyApp --level=standard --format=json
# Comprehensive analysis for strategic planning
smith-validation ~/Projects/MyApp --level=comprehensive --format=jsonsmith-validation produces AI-optimized JSON with actionable insights and progressive intelligence:
{
"analysisType": "smith-validation-progressive-intelligence",
"analysisLevel": "critical",
"timestamp": "2025-11-26T19:16:00Z",
"projectPath": "/path/to/project",
"summary": {
"totalFiles": 25,
"violationsCount": 2,
"healthScore": 85,
"severityBreakdown": {
"critical": 1,
"high": 1,
"medium": 0,
"low": 0
},
"automation": {
"automatableFixes": 2,
"averageConfidence": 0.85
}
},
"findings": [
{
"ruleName": "TCA-Missing-Error-Handling",
"severity": "critical",
"fileName": "FeatureReducer.swift",
"filePath": "/path/to/FeatureReducer.swift",
"hasViolation": true,
"automationConfidence": 0.88,
"recommendedAction": "Add error-related action cases like 'errorOccurred(String)' or 'loadFailed(Error)'",
"type": "missing_error_handling"
}
],
"recommendations": [
"🚨 Address 1 critical violations immediately"
]
}Only critical violations with maximum token efficiency:
- Perfect for AI agents and CI/CD checks
- Minimal output, fastest execution (<1s for most projects)
- 90%+ automation confidence on violations
All violations with complete architectural analysis:
- Recommended for development workflows
- Medium severity issues included
- 80%+ automation confidence on violations
Standard analysis plus strategic insights:
- Cross-domain pattern analysis
- Architectural hotspots identification
- Detailed implementation steps
- 70%+ automation confidence on violations
name: Smith Validationon: [push, pull_request]jobs:
analyze:
runs-on: macos-lateststeps:
- uses: actions/checkout@v4
- name: Install smith-validationrun: brew tap Smith-Tools/smith && brew install smith-validation
- name: Critical Analysisrun: | smith-validation . --level=critical > smith-results.json echo "## Smith Validation Results" >> $GITHUB_STEP_SUMMARY cat smith-results.json >> $GITHUB_STEP_SUMMARY.PHONY: smith-critical smith-standard smith-comprehensive
smith-critical:
smith-validation . --level=critical | jq .smith-standard:
smith-validation . --level=standard | jq .smith-comprehensive:
smith-validation . --level=comprehensive | jq .| Analysis Level | Small (<50 files) | Medium (50-200 files) | Large (200+ files) |
|---|---|---|---|
| Critical | <1 second | <3 seconds | <10 seconds |
| Standard | <2 seconds | <8 seconds | <25 seconds |
| Comprehensive | <3 seconds | <15 seconds | <45 seconds |
- AI-Optimized CLI Tool: External analysis with progressive intelligence
- SwiftSyntax Integration: AST-based analysis with accurate violation detection
- JSON Output: AI-ready results for automation and agents
- Progressive Intelligence: Three analysis levels with token optimization
- Actionable Insights: Automation confidence scores and implementation steps
- Swift 5.9+: Foundation + Regex only
- SwiftSyntax: Via swift-testing transitive dependency
- Swift Testing: Advanced testing framework (unused in current CLI)
git clone https://github.com/Smith-Tools/smith-validation.git
cd smith-validation
swift build -c releaseswift testMIT License - see LICENSE file for details.
smith-validation v2.1.0 - AI-optimized progressive intelligence analysis for Swift, built with ❤️ by the Smith Tools team
🤖 Perfect for: AI agents, CI/CD pipelines, automated code review, architectural debt analysis
smith-validation is specifically designed for AI agent integration:
- Token-Efficient Output: Progressive levels minimize context usage
- Structured Data: Easy parsing and processing by AI agents
- Actionable Recommendations: AI can take direct action on violations
- Confidence Scores: AI can assess reliability of automated fixes
- Implementation Steps: Clear guidance for automated remediation