원클릭으로
creating-viewmodel
Scaffolds a ViewModel with @MainActor, ObservableObject, async/await, and Swinject DI. Use when creating a new ViewModel.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Scaffolds a ViewModel with @MainActor, ObservableObject, async/await, and Swinject DI. Use when creating a new ViewModel.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Standard editorial template for any standalone HTML output (reports, RCAs, dashboards, diagrams, slides, recaps). Use EVERY time you generate an HTML file so output follows one consistent house style instead of ad-hoc theming.
Findings-first review agent for code changes. Use when the user asks to review a branch, PR, diff, commit range, or recent changes and wants prioritized, actionable issues instead of implementation work.
Scan and clean stale Claude Code sessions from the shared store at ~/.local/share/claude/projects (used by all .claude / .claude-accountN dirs via symlink). Removes session JSONLs older than N days, orphan subagent dirs, and reports reclaimable space.
Triage ShopHelp XCTest/Swift Testing failures before proposing fixes.
Manage Jira issues through jhelp shell functions (jv, jm, jd, jc, jforward, etc.). Use when the user wants to view, transition, assign, comment on, edit, search, or create Jira work items; when they provide a bare issue number, Jira issue key, or Jira URL; or when the task involves the current git branch ticket.
Create git commits. Use when user says "commit", "commit this", "commit changes", "split commit", "split commit change", "split the changes".
| name | creating-viewmodel |
| description | Scaffolds a ViewModel with @MainActor, ObservableObject, async/await, and Swinject DI. Use when creating a new ViewModel. |
Scaffolds a ViewModel following project patterns from docs/PATTERNS.md.
{Feature}ViewModel.swift → placed in {App}/Presentation/{Feature}/
//
// {Feature}ViewModel.swift
// {App}
//
// Created by Man Tran on DD/MM/YY.
//
import Foundation
@MainActor
final class {Feature}ViewModel: ObservableObject {
@Published var state: {Feature}State = .loading
@Published var isLoading = false
@Published var errorMessage: String?
private let dependencies: {Feature}Dependencies
init(dependencies: {Feature}Dependencies) {
self.dependencies = dependencies
}
func onAppear() async {
await loadData()
}
func loadData() async {
isLoading = true
errorMessage = nil
do {
let result = try await dependencies.someUseCase.execute()
state = .loaded(result)
} catch {
state = .error
errorMessage = error.localizedDescription
}
isLoading = false
}
}
Every ViewModel must have a corresponding {Feature}Dependencies.swift:
//
// {Feature}Dependencies.swift
// {App}
//
// Created by Man Tran on DD/MM/YY.
//
struct {Feature}Dependencies {
let someUseCase: SomeUseCaseProtocol
let anotherUseCase: AnotherUseCaseProtocol
}
Dependencies struct, not individual parameters (when > 2 dependencies).@Published for all observable state.enum {Feature}State {
case loading
case loaded(DomainModel)
case empty
case error
}
async.@Published properties.func performAction() async {
do {
let result = try await dependencies.useCase.execute()
state = .loaded(result)
} catch {
errorMessage = error.localizedDescription
}
}
Separate concerns into extensions for tracking, performance:
{Feature}ViewModel+Tracking.swift for analytics{Feature}ViewModel+SaleFunnelPerfTrace.swift for performance@MainActor final class + ObservableObject@Published for all observable stateSee docs/PATTERNS.md for the canonical ViewModel pattern.
See existing ViewModels in ShopHelp/Presentation/ for real examples.