From pencil-design-tools
Generates SwiftUI code directly from natural language descriptions without creating visual mockups first. Perfect for rapid prototyping when you already know what you want. Supports iOS, macOS, iPadOS, watchOS, tvOS, and visionOS.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pencil-design-tools:swiftui-directThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generates production-ready SwiftUI code directly from natural language descriptions, bypassing the visual mockup step.
Generates production-ready SwiftUI code directly from natural language descriptions, bypassing the visual mockup step.
Use when:
Use /pencil-design-tools:mockup instead when:
/pencil-design-tools:swift [description]
/pencil-design-tools:swift [description] --platform [ios|macos|ipados|watchos|tvos|visionos]
/pencil-design-tools:swift Login form with email and password
/pencil-design-tools:swift macOS settings window with sidebar
/pencil-design-tools:swift Video card with thumbnail, title, and duration badge
/pencil-design-tools:swift Encoding progress view with queue list --platform macos
// VideoCard.swift
struct VideoCard: View { ... }
#Preview {
VideoCard(...)
}
// LoginView.swift
struct LoginView: View { ... }
// MARK: - Subviews
private struct EmailField: View { ... }
private struct PasswordField: View { ... }
private struct LoginButton: View { ... }
#Preview {
LoginView()
}
struct ContentView: View {
var body: some View {
NavigationStack {
// Content
}
}
}
struct ContentView: View {
var body: some View {
NavigationSplitView {
// Sidebar
} detail: {
// Detail
}
}
}
struct ContentView: View {
var body: some View {
ScrollView {
// Compact, glanceable content
}
}
}
struct ContentView: View {
var body: some View {
NavigationStack {
// Spatial content
}
}
}
// 1. State at the top
@State private var email = ""
@State private var isLoading = false
// 2. Body with clear structure
var body: some View {
VStack(spacing: 24) {
header
content
actions
}
.padding()
}
// 3. Computed properties for subviews
private var header: some View {
Text("Title")
.font(.largeTitle)
}
// Primary
Button("Sign In") { }
.buttonStyle(.borderedProminent)
// Secondary
Button("Cancel") { }
.buttonStyle(.bordered)
// Destructive
Button("Delete", role: .destructive) { }
// Text input
TextField("Email", text: $email)
.textFieldStyle(.roundedBorder)
.textContentType(.emailAddress)
.keyboardType(.emailAddress)
// Secure input
SecureField("Password", text: $password)
.textFieldStyle(.roundedBorder)
.textContentType(.password)
List {
ForEach(items) { item in
ItemRow(item: item)
}
.onDelete(perform: delete)
}
.listStyle(.insetGrouped) // iOS
.listStyle(.sidebar) // macOS
NavigationSplitView {
List(selection: $selection) {
ForEach(items) { item in
NavigationLink(value: item) {
Label(item.title, systemImage: item.icon)
}
}
}
.navigationSplitViewColumnWidth(min: 200, ideal: 250)
} detail: {
DetailView(item: selection)
}
.toolbar {
ToolbarItem(placement: .primaryAction) {
Button(action: add) {
Label("Add", systemImage: "plus")
}
}
ToolbarItem(placement: .destructiveAction) {
Button(action: delete) {
Label("Delete", systemImage: "trash")
}
}
}
struct SettingsView: View {
var body: some View {
TabView {
GeneralSettings()
.tabItem {
Label("General", systemImage: "gearshape")
}
EncodingSettings()
.tabItem {
Label("Encoding", systemImage: "film")
}
}
.frame(width: 500, height: 400)
}
}
.commands {
CommandGroup(replacing: .newItem) {
Button("New Video") { }
.keyboardShortcut("n")
}
CommandMenu("Encoding") {
Button("Start Encoding") { }
.keyboardShortcut("e")
}
}
struct AsyncContentView: View {
@State private var isLoading = false
@State private var items: [Item] = []
var body: some View {
Group {
if isLoading {
ProgressView()
} else if items.isEmpty {
ContentUnavailableView(
"No Videos",
systemImage: "film",
description: Text("Add videos to get started")
)
} else {
List(items) { item in
ItemRow(item: item)
}
}
}
.task {
await loadItems()
}
}
}
Generated code is saved to:
Sources/Views/[ViewName].swift
Sources/Components/[ComponentName].swift
Or in current directory if no Sources folder exists.
If you want to visualize the generated code:
/pencil-design-tools:swift/pencil-design-tools:mockup for spec documentationnpx claudepluginhub kjetilge/kjetil-claude-marketplace --plugin pencil-design-toolsSwiftUI fundamentals for all Apple platforms. Use when building views, navigation, data persistence, or state management with SwiftUI across iOS, macOS, iPadOS, watchOS, visionOS.
Converts Stitch mobile designs to native iOS SwiftUI views with VStack/HStack/ZStack layout mapping, dark mode color assets, NavigationStack/TabView routing, and Xcode project structure.
Provides best practices and examples for SwiftUI views, components, navigation hierarchies, custom modifiers, responsive layouts with stacks/grids, and state management (@State/@Binding). Use for creating/refactoring iOS UI.