Dev Skill
by @tc1993
Generate SwiftUI iOS application code from PRD documents. Use when a PRD document is available and needs to be transformed into a working iOS application wit...
clawhub install dev-skillπ About This Skill
name: dev-skill description: Generate SwiftUI iOS application code from PRD documents. Use when a PRD document is available and needs to be transformed into a working iOS application with proper architecture, UI components, and data management. This skill receives input from prd-skill and automatically triggers qa-skill after code generation.
Dev Skill - SwiftUI iOS Development Generator
Overview
This skill transforms Product Requirements Documents (PRD) into fully functional SwiftUI iOS applications. It analyzes PRD requirements and generates production-ready code with proper architecture, UI components, data models, and business logic.
Architecture Pattern
MVVM Architecture
All generated code follows the Model-View-ViewModel pattern:#### Model Layer
#### ViewModel Layer
#### View Layer
Code Generation Workflow
1. PRD Analysis
2. Project Structure Generation
Create a complete Xcode project with:ProjectName/
βββ ProjectName.xcodeproj
βββ ProjectName/
β βββ Models/
β β βββ DataModel.swift
β β βββ APIModels.swift
β βββ ViewModels/
β β βββ MainViewModel.swift
β β βββ [Feature]ViewModel.swift
β βββ Views/
β β βββ ContentView.swift
β β βββ [Feature]View.swift
β β βββ Components/
β β βββ ButtonStyles.swift
β β βββ CustomViews.swift
β βββ Services/
β β βββ APIService.swift
β β βββ DataService.swift
β βββ Utilities/
β βββ Extensions.swift
β βββ Constants.swift
βββ ProjectNameTests/
βββ [Feature]Tests.swift
3. Core Components Generation
#### 3.1 Data Models
struct Task: Identifiable, Codable {
let id: UUID
var title: String
var isCompleted: Bool
var dueDate: Date?
var category: String
var priority: Priority
}enum Priority: String, Codable, CaseIterable {
case low, medium, high
}
#### 3.2 ViewModels
class TaskViewModel: ObservableObject {
@Published var tasks: [Task] = []
@Published var selectedCategory: String?
private let dataService: DataService
init(dataService: DataService = .shared) {
self.dataService = dataService
loadTasks()
}
func addTask(_ task: Task) { ... }
func deleteTask(_ task: Task) { ... }
func toggleCompletion(_ task: Task) { ... }
}
#### 3.3 SwiftUI Views
struct TaskListView: View {
@StateObject private var viewModel = TaskViewModel()
@State private var showingAddTask = false
var body: some View {
NavigationView {
List {
ForEach(viewModel.tasks) { task in
TaskRowView(task: task)
}
.onDelete(perform: deleteTask)
}
.navigationTitle("Tasks")
.toolbar {
Button(action: { showingAddTask = true }) {
Image(systemName: "plus")
}
}
.sheet(isPresented: $showingAddTask) {
AddTaskView()
}
}
}
}
4. Feature Implementation
#### 4.1 Navigation
#### 4.2 Data Persistence
#### 4.3 Networking
#### 4.4 UI/UX
Example: Todo App from PRD
PRD Input: Todo app with categories, reminders, sharing
Generated Code: 1. Models: Task, Category, Reminder 2. ViewModels: TaskListViewModel, CategoryViewModel 3. Views: TaskListView, CategoryView, AddTaskView, SettingsView 4. Services: NotificationService, SharingService 5. Features: - Push notifications for reminders - Share sheet integration - iCloud sync for data - Widgets for quick access
Auto-Trigger Next Steps
After generating the iOS project, this skill automatically:
1. Creates a complete Xcode project in dev-output/ directory
2. Verifies code compiles without errors
3. Triggers qa-skill with the generated code as input
4. Provides build instructions and next steps
Integration Requirements
Input Format
prd-skill