swift

Swift programming language utilities and migration tools for Claude Code

View on GitHub
Author Ivan Magda
Namespace @ivan-magda/claude-code-marketplace
Category languages
Version 1.0.2
Stars 2
Downloads 4
self.md verified
Table of content

Swift programming language utilities and migration tools for Claude Code

Installation

npx claude-plugins install @ivan-magda/claude-code-marketplace/swift

Contents

Folders: skills

Files: README.md

Documentation

Swift programming language utilities and migration tools for Claude Code.

Features

Skills

Swift 6 Migration

Expert guidance for migrating Swift codebases to Swift 6, including concurrency adoption and strict checking.

Automatically activates when:

Capabilities:

Swift DocC Comments

Guidance for writing proper Swift DocC inline documentation comments.

Automatically activates when:

Capabilities:

Swift DocC GitHub Pages

Automate Swift package documentation publishing to GitHub Pages via GitHub Actions.

Automatically activates when:

Capabilities:

Swift Package Demo

Record and optimize demo GIFs for Swift package READMEs.

Automatically activates when:

Capabilities:

Installation

/plugin marketplace add ivan-magda/claude-superpowers
/plugin install swift@claude-superpowers

Usage

Skills activate automatically based on context. Example prompts:

Swift 6 Migration:

Help me migrate this Swift code to Swift 6

DocC Comments:

Add documentation comments to this Swift file

DocC GitHub Pages:

Set up DocC documentation for this Swift package with GitHub Pages

Demo Recording:

Create a demo GIF for this Swift package README

Version

1.3.0

Included Skills

This plugin includes 4 skill definitions:

swift-6-migration

Use when encountering Swift 6 concurrency errors, Sendable conformance warnings, actor isolation issues, “global variable is not concurrency-safe” errors, or migrating codebases to Swift 6 language mode

View skill definition

Swift 6 Migration

Overview

Swift 6 enforces data race safety at compile time. Migration involves making implicit isolation explicit and ensuring all shared state is thread-safe.

This skill bundles Apple’s complete migration guide. You MUST search it for EVERY error before implementing a fix.

Mandatory Workflow

digraph migration_workflow {
    rankdir=TB;
    node [shape=box];

    "Compiler error/warning" [shape=ellipse];
    "Search migration-guide.md" [label="REQUIRED: Search migration-guide.md\nfor error pattern"];
    "Read matched section" [label="Read the matched FILE: section"];
    "Apply documented fix" [label="Apply Apple's documented fix"];
    "Verify fix" [label="Build and verify"];

    "Compiler error/warning" -> "Search migration-guide.md";
    "Search migration-guide.md" -> "Read matched section";
    "Read matched section" -> "Apply documented fix";
    "Apply documented fix" -> "Verify fix";
    "Verify fix" -> "Compiler error/warning" [label="More errors"];
}

For EACH compiler error/warning:

  1. FIRST search migration-guide.md for the error pattern
  2. THEN read the matched FILE: section
  3. THEN apply the documented fix
  4. FINALLY verify the fix

Checklist

Use TodoWrite to track each item:

…(truncated)

swift-docc-comments

Use when writing or enhancing Swift documentation comments for DocC generation, adding inline doc comments to Swift source files, or when user asks for API documentation

View skill definition

Swift DocC Inline Comments

Overview

Swift DocC inline comments follow a specific structure. Section headers like ## Overview and ## Topics belong in .docc catalog files, NOT in inline source comments.

Structure

/// Summary (first paragraph - one sentence)
///
/// Discussion paragraphs (no header needed)
///
/// ```swift
/// // Code example
/// ```
///
/// - Parameter name: Description
/// - Returns: Description
/// - Throws: Description
/// - Note: Additional info

Quick Reference

ElementFormatLocation
SummaryFirst paragraphInline
DiscussionSubsequent paragraphsInline
Code examplesTriple backticksInline, before parameters
## OverviewSection header.docc catalog ONLY
## TopicsSection header.docc catalog ONLY
Symbol links``SymbolName``Both

Correct Format

/// Brief summary in one sentence.
///
/// Extended discussion explaining behavior, use cases,
/// or important details. No header needed.
///
/// ```swift
/// let example = MyType()
/// example.doSomething()
/// ```
///
/// - Parameter value: What this parameter does.
/// - Returns: What gets returned.
/// - Note: Default value is `.default`.
func method(value: Int) -> String

Com

…(truncated)

swift-docc-github-pages

Use when setting up DocC documentation for a Swift package, deploying to GitHub Pages, or encountering “no such module ‘UIKit’” during doc generation

View skill definition

Swift DocC to GitHub Pages

Automate Swift package documentation publishing to GitHub Pages via GitHub Actions.

Which Build Method?

digraph method_choice {
    "Check Package.swift platforms" [shape=box];
    "iOS only?" [shape=diamond];
    "Use xcodebuild docbuild" [shape=box, style=filled, fillcolor=lightblue];
    "Use swift-docc-plugin" [shape=box];

    "Check Package.swift platforms" -> "iOS only?";
    "iOS only?" -> "Use xcodebuild docbuild" [label=".iOS only"];
    "iOS only?" -> "Use swift-docc-plugin" [label="includes .macOS"];
}

Why? swift package generate-documentation builds for macOS. iOS-only packages fail with “no such module ‘UIKit’”.

Quick Reference

ItemValue
Target nameFrom Package.swift: .target(name: "MyLib")
URL formathttps://USER.github.io/REPO/documentation/targetnamelowercase/
Enable PagesSettings → Pages → Source → “GitHub Actions”

Workflow

Create .github/workflows/docc.yml. Replace TARGET_NAME, TARGET_NAME_LOWERCASE, REPO_NAME.

iOS-only (no Package.swift changes needed):

name: Documentation

on:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: pages
  cancel-in-pr

...(truncated)

</details>

### swift-package-demo

> Use when creating demo GIFs for Swift package READMEs, recording iOS simulator videos, or setting up demo apps for SwiftUI libraries

<details>
<summary>View skill definition</summary>

# Swift Package Demo Recording

## Overview

Record and optimize demo GIFs for Swift package READMEs. Swift packages need a **separate demo app** since SwiftUI previews only run in Xcode Canvas, not the iOS Simulator.

## When to Use

- Adding demo GIFs to a Swift package README
- Recording iOS Simulator for documentation
- User asks to "record a demo" or "add GIFs to README"

## Critical Understanding

```dot
digraph demo_flow {
    "SwiftUI Preview" [shape=box];
    "iOS Simulator" [shape=box];
    "Xcode Canvas only" [shape=box, style=filled, fillcolor=lightyellow];
    "Recordable with xcrun" [shape=box, style=filled, fillcolor=lightgreen];

    "SwiftUI Preview" -> "Xcode Canvas only" [label="runs in"];
    "Demo App" -> "iOS Simulator" [label="runs in"];
    "iOS Simulator" -> "Recordable with xcrun";
}

SwiftUI #Preview macros CANNOT be recorded. You must create a demo app.

Quick Reference

StepCommand/Action
Create demo dirmkdir -p demo
Boot simulatorxcrun simctl boot "iPhone SE (3rd generation)"
Open simulatoropen -a Simulator
Record videoxcrun simctl io booted recordVideo --codec=h264 demo/raw.mov
Stop recordingCtrl+C

…(truncated)

Source

View on GitHub

Tags: languages swiftmigrationswift6concurrencyswiftmigrationswift6concurrency