The construction police for Swift development. Smith enforces architectural discipline and build health throughout your entire development lifecycle.
Smith is the enforcement agent in the Smith Tools ecosystem. It's not permissive. It's not flexible about rules. It validates code against strict architectural standards and ensures build quality.
Smith's Philosophy: Code quality isn't negotiable. Builds shouldn't hang. Architecture is discipline.
cd /Volumes/Plutonian/_Developer/Smith\ Tools/Smith
./install.shThis installs:
- ✅ Smith CLI (
smith) - ✅ Smith Claude Code skill
- ✅ Integration with build tools
# Analyze your project
smith analyze /path/to/project
# Validate TCA architecture with AI-optimized analysis
smith validate /path/to/project --level=critical --format=json
# Comprehensive architectural analysis
smith validate /path/to/project --level=comprehensive --format=summary
# Use in Claude Code# Type: "@smith validate my code"Always explicitly invoke Smith for analysis and diagnostics:
"@smith validate my TCA reducer"
"@smith check my code against composition rules"
"@smith why is my build hanging?"
"@smith should I use workspace or project?"
Smith automatically intercepts when you run build commands:
xcodebuild -workspace MyApp.xcworkspace -scheme MyApp
# Smith detects → validates → warns of issues → recommends piping to tools
swift build
# Smith detects → validates project type → offers analysisWhen interception happens, Smith:
- Detects project type (workspace/project/package/swift)
- Validates command matches project type
- Warns of issues (e.g., using .xcodeproj when .xcworkspace exists)
- Recommends piping to analysis tools for detailed output
For detailed build analysis and recovery:
# Swift builds with analysis
swift build 2>&1| smith parse --format json
# Xcode analysis and recovery
smith xcode analyze
smith xcode monitor --hang-detection
# Package analysis
smith dependencies --metricsFor automation and CI/CD:
smith analyze /path/to/project
smith validate /path/to/project --level=critical
smith validate /path/to/project --level=comprehensive
smith optimizeSmith enforces strict rules for The Composable Architecture:
| Rule | Validates |
|---|---|
| 1.1 | Monolithic features (State >15 props, Actions >40 cases) |
| 1.2 | Proper dependency injection |
| 1.3 | Code duplication |
| 1.4 | Unclear organization |
| 1.5 | Tightly coupled state |
Smith monitors your build for:
- Build hangs with root cause analysis
- Type inference explosions
- Dependency conflicts
- DerivedData issues
- Memory pressure problems
Smith detects:
- Deprecated patterns (
.@Statein reducers,WithViewStore) - Anti-patterns (hard-wired dependencies, circular imports)
- Testability issues
- Documentation gaps
Smith/
├── README.md ← You are here
├── START-HERE.md ← Quick start guide
├── ARCHITECTURE.md ← Design philosophy
├── Makefile ← Build orchestration
├── install.sh ← Installation script
│
├── agent/
│ └── smith.md ← Agent definition
│
├── skills/
│ └── skill-smith/ ← Claude Code skill
│ ├── skill/SKILL.md
│ ├── patterns/ ← Swift patterns
│ └── platforms/ ← Platform guides
│
├── cli/ ← Smith CLI source
│ ├── Package.swift
│ └── Sources/
│
├── validation/ ← Validation rules
│ ├── Package.swift
│ └── Sources/
│
├── scripts/ ← Analysis scripts
│ ├── smith-smart-builder.sh
│ └── validate-syntax.sh
│
└── resources/
└── trigger-phrases.txt
Tool: smith dependencies
Analyzes package dependencies, detects conflicts, identifies version issues.
swift package dump-package | smith dependencies --format jsonTools: smith parse
Real-time monitoring with hang detection, bottleneck identification, progress tracking.
swift build 2>&1| smith parse --format jsonTools: smith, smith-skill, smith-validation
AI-optimized architectural validation against TCA rules, anti-pattern detection, pattern guidance with progressive intelligence.
smith validate /path/to/project --level=critical --format=json
smith validate /path/to/project --level=standard --format=summary
smith validate /path/to/project --level=comprehensive --format=json
# or use Smith skill in Claude CodeTool: smith xcode
Smart rebuild strategies, intelligent diagnostics, recovery recommendations.
smith xcode rebuild --smart-strategy
smith xcode diagnose --detailedSmith is not flexible about its standards:
✅ Smith Will:
- Give exact error locations
- Explain why rules matter
- Provide concrete fixes
- Suggest code examples
- Help diagnose build issues
- Give confidence scoring
❌ Smith Won't:
- Accept workarounds
- Make exceptions
- Suggest unsound designs
- Ignore architectural debt
- Accept unclear code
- Be permissive
Smith and Maxwell are complementary:
| Aspect | Maxwell | Smith |
|---|---|---|
| Role | Oracle/Teacher | Police/Enforcer |
| Purpose | "How should I write this?" | "Is this correct?" |
| When | Before/during implementation | After implementation |
| Approach | Knowledge-based | Rules-based |
Workflow:
Maxwell teaches pattern → You implement → Smith validates
# Comprehensive analysis
smith analyze /path/to/project
# AI-optimized TCA validation with progressive intelligence
smith validate /path/to/project --level=critical --format=json
smith validate /path/to/project --level=standard --format=summary
smith validate /path/to/project --level=comprehensive --format=json
# Performance suggestions
smith optimize
# Project type detection
smith detect
# Build status
smith status# Monitor Swift builds with hang detection
swift build 2>&1| smith parse --format json
swift build 2>&1| smith monitor --eta
# Analyze SPM dependencies
swift package dump-package | smith dependencies --format json
# Monitor Xcode builds
smith xcode monitor --hang-detection
smith xcode rebuild --smart-strategy# Diagnose build issues
smith xcode diagnose --detailed
# Analyze SPM conflicts
smith dependencies --conflicts
# Check environment
smith environment| Document | Read For |
|---|---|
| START-HERE.md | Quick start and common tasks |
| ARCHITECTURE.md | Design philosophy and phases |
| agent/smith.md | Smith agent definition |
| skills/skill-smith/skill/SKILL.md | Claude Code skill reference |
| skills/skill-smith/patterns/AGENTS-AGNOSTIC.md | Swift patterns and best practices |
./install.shmake installbrew tap elkraneo/tap
brew install smith┌─────────────────────────────────────────┐
│ Your Swift Development Workflow │
├─────────────────────────────────────────┤
│ │
│ 1. Setup Package │
│ ↓ smith dependencies → Check deps │
│ │
│ 2. Get Pattern Guidance │
│ ↓ Maxwell → Learn pattern │
│ │
│ 3. Code Implementation │
│ ↓ Your code │
│ │
│ 4. Build with Monitoring │
│ ↓ smith parse → Real-time feedback │
│ │
│ 5. Code Review │
│ ↓ Smith → Architectural validation │
│ │
│ 6. Build Recovery (if needed) │
│ ↓ smith xcode → Smart recovery │
│ │
│ 7. Production Ready ✓ │
│ │
└─────────────────────────────────────────┘
- Read START-HERE.md
- Check ARCHITECTURE.md
- Review agent/smith.md
- Use
smith --help
- Add validation rules in
validation/ - Add patterns in
skills/skill-smith/patterns/ - Add scripts in
scripts/ - Update
ARCHITECTURE.md
Issues in Smith Tools are tracked in the respective repositories:
- CLI/Skill issues: This repository
- Build tool issues: smith-parser
- Validation issues: smith-validation
- Strict Standards - TCA rules aren't suggestions
- Real-Time Enforcement - Catch problems early
- Clear Communication - Know exactly what's wrong
- Actionable Fixes - Get concrete solutions
- No Exceptions - Rules apply always
- Install Smith:
./install.sh - Read START-HERE.md: Get oriented
- Try smith:
smith analyze /path/to/project - Use Smith in Claude Code:
"@smith validate my code" - Monitor your builds: Pipe through
smith parse
Smith is the architectural guardian of your Swift codebase. It operates throughout your development lifecycle, enforcing discipline and ensuring quality.
Smith is:
- ✅ Strict about architecture
- ✅ Thorough in build monitoring
- ✅ Clear in error reporting
- ✅ Helpful with solutions
- ❌ Not flexible about rules
- ❌ Not permissive about standards
Your code will be better for it.
Smith: The construction police for Swift development.