Skip to main content
skill CX Codex

swift — Claude Code skill: what it does, how to install

Guides your agent to write clean Swift and SwiftUI code for iOS, macOS, watchOS, and tvOS using the MVVM pattern.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill swift -a claude-code
Open on GitHub

What swift does

This skill instructs the agent on engineering standards for Apple platforms. Before generating code, the model outlines its implementation plan in pseudocode. It enforces fully working output without placeholders or TODO markers. SwiftUI serves as the primary UI toolkit, leaving UIKit strictly as a fallback.

Architecture follows MVVM with struct-based types and clear separation of concerns. State management relies on @State, @Binding, @ObservedObject, and @StateObject, with @Environment handling dependency injection. Automated testing mandates XCTest for unit tests and XCUITest across multiple screen dimensions.

Readability takes clear priority over raw performance optimization here. Sensitive user credentials must reside in Keychain rather than plain files, while user interfaces must meet Dynamic Type and VoiceOver accessibility requirements.

What it helps with

  • structure SwiftUI views using the MVVM architectural pattern
  • store credentials securely in Keychain with biometric authentication
  • write unit tests with XCTest and UI tests with XCUITest
  • prepare layouts for App Store accessibility reviews using Dynamic Type and VoiceOver

Example prompts for the agent

  • Build a SwiftUI settings view with an MVVM ViewModel and dark mode toggle
  • Implement secure token storage on iOS using Keychain and biometric access
  • Write an XCTest test suite for our subscription checkout logic

How to install swift

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill swift -a claude-code

2Manually: put the files in place

~/.claude/skills/swift/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/swift/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about swift

How to install swift in Claude Code?

Run npx skills add Mindrally/skills --skill swift -a claude-code in your terminal. This downloads the skill into ~/.claude/skills/swift/SKILL.md.

What architecture does the swift skill enforce?

It mandates MVVM with a SwiftUI-first approach and struct-based models. UIKit is reserved solely as a fallback when SwiftUI lacks support.

What are the security and testing requirements in this skill?

All sensitive credentials must go into Keychain with encryption, while testing requires thorough XCTest and XCUITest suites across varied screen sizes.

Source text

SKILL.md · Apache-2.0
---
name: swift
description: Expert in Swift and SwiftUI development for iOS, macOS, and Apple platforms
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Swift / SwiftUI

You are an expert in Swift and SwiftUI development for Apple platforms including iOS, macOS, watchOS, and tvOS.

## Core Principles

- Produce clear, readable SwiftUI code using latest versions
- First think step-by-step - describe your plan for what to build in pseudocode
- Deliver correct, up to date, bug free, fully functional and working code
- Focus on readability over being performant
- Leave NO todo's, placeholders or missing pieces

## Architecture

- Follow MVVM architecture pattern
- Use struct-based code where appropriate
- SwiftUI-first approach with UIKit as fallback
- Implement clean separation of concerns

## SwiftUI Best Practices

- Use @State for local view state
- Use @Binding for passing state to child views
- Use @ObservedObject and @StateObject for complex state
- Leverage @Environment for dependency injection
- Use ViewModifiers for reusable view styling

## Security

- Use encryption for sensitive data
- Store credentials in Keychain
- Implement biometric authentication where appropriate
- Follow Apple security guidelines

## Testing

- Use XCTest for unit testing
- Use XCUITest for UI testing
- Write comprehensive test coverage
- Test on multiple device sizes

## App Store Compliance

- Follow Apple Human Interface Guidelines
- Implement accessibility standards (VoiceOver, Dynamic Type)
- Handle app lifecycle properly
- Follow App Store review guidelines

## Performance

- Optimize view rendering
- Use lazy loading for large data sets
- Implement proper caching strategies
- Profile with Instruments

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

Everything for Mobile →

From the same set214

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor