Our review
Fixes SwiftUI binding errors caused by missing @Bindable attribute on @Observable view models.
Strengths
- Quickly resolves common '$viewModel' compile errors in SwiftUI.
- Provides specific patterns for common view models (Home, Community, etc.).
- Uses grep to locate error and then edits file programmatically.
Limitations
- Only works when the error is specifically 'cannot find $viewModel' - does not handle other binding errors.
- Assumes the view model is already @Observable; will not work if it's not.
- May require manual adjustment if the view model needs to remain @State for other reasons.
Use this skill when you encounter a SwiftUI compile error 'cannot find $viewModel' and the view model is an @Observable class or struct.
Do not use this skill for other SwiftUI binding errors or when the view model is not declared with @Observable.
Security analysis
SafeThe skill only uses safe tools (Read, Edit, Grep) for local code editing tasks. No network access, destructive commands, or data exfiltration risk.
No concerns found
Examples
Fix the 'cannot find $viewModel' error in HomeView - it uses HomeViewModel and a sheet.The CommunityView has a $viewModel error for showing the create community sheet. Fix it by adding @Bindable.name: swift-binding-fixer description: Fix SwiftUI binding errors ($var issues) by adding @Bindable to @Observable ViewModels in Leavn app allowed-tools: Read, Edit, Grep disable-model-invocation: false context: fork user-invocable: true argument-hint: "[context]"
Swift Binding Fixer
Instructions
Fix "cannot find '$viewModel'" errors:
-
Find the error:
grep "cannot find '\$viewModel'" build_output.txt -
Read the view file:
- Check if viewModel is @Observable type
- Look for
@State var viewModelorvar viewModel - Find all
$viewModel.propertyusages
-
Apply fix:
// BEFORE @State var viewModel: MyViewModel // OR var viewModel: MyViewModel // AFTER (if using $viewModel) @Bindable var viewModel: MyViewModel -
Common Leavn patterns:
- HomeViewModel: Use @Bindable for sheet bindings
- CommunityViewModel: Use @Bindable for showCreate* bindings
- SettingsViewModel: Use @Bindable for alert bindings
- SermonAIView: Use @Bindable for showing* bindings
Use this skill when: $viewModel errors, @Observable binding issues, sheet presentation errors
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.