/add-viewmodel
Create an Android ViewModel with proper state management and data flow.
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/add-viewmodel
Context preview
What this command does when you run it.
Create an Android ViewModel with proper state management and data flow.
Command definition
add-viewmodel.md/add-viewmodel - Add ViewModel
Create an Android ViewModel with proper state management and data flow.
Steps
1. Ask the user for the ViewModel name and the data it manages 2. Create the ViewModel class extending androidx.lifecycle.ViewModel 3. Define sealed interfaces for UI state, UI events, and side effects 4. Initialize StateFlow for the UI state with a sensible default 5. Add repository or use case dependencies via constructor injection (Hilt) 6. Implement event handling: map user actions to state changes 7. Add error handling with proper error state propagation 8. Implement data loading with coroutines in viewModelScope 9. Add retry logic for failed network requests 10. Create unit tests with fake repositories and TestDispatcher 11. Add Hilt @Inject annotation and module binding 12. Document the state machine: states, events, and transitions
Rules
- Never expose mutable state directly; use private MutableStateFlow with public StateFlow
- Use sealed interfaces for UI state to ensure exhaustive handling
- Handle all coroutine exceptions with CoroutineExceptionHandler
- Cancel ongoing operations in onCleared if needed
- Use SavedStateHandle for surviving process death
- Keep ViewModels thin; delegate business logic to use cases
- Do not reference Activity, Context, or View classes in ViewModels
The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.
Repo: rohitg00/awesome-claude-code-toolkit
Other commands on rohitg00-claude-code-toolkit.
- /adr
Write an Architecture Decision Record documenting a significant technical decision.
Open command - /design-review
Conduct a structured design review of a module, feature, or system component.
Open command - /diagram
Generate Mermaid diagrams from codebase analysis or description.
Open command - /migrate
Plan and execute a framework or library migration incrementally.
Open command - /plan
Create a structured implementation plan for the requested feature or change.
Open command - /refactor
Perform a systematic refactoring of the specified code area.
Open command

