# How to Create SwiftUI iOS Development Plugins with the Build‑iOS‑Apps Plugin

> Learn to build SwiftUI iOS development plugins using the OpenAI build-ios-apps plugin. Scaffold refactor and debug your apps within a Codex workflow.

- Repository: [OpenAI/plugins](https://github.com/openai/plugins)
- Tags: how-to-guide
- Published: 2026-06-07

---

**The Build‑iOS‑Apps plugin in the `openai/plugins` repository is a modular Codex skill set that lets you scaffold, refactor, and debug SwiftUI iOS apps without leaving a Codex-driven workflow.**

If you want to create SwiftUI iOS development plugins with the Build‑iOS‑Apps toolkit, start with the `openai/plugins` repo. It bundles discrete skills for UI patterns, performance audits, and simulator previews into a single plugin architecture that runs inside Codex.

## Plugin Manifest and Registration

The top-level configuration lives in [`plugins/build-ios-apps/.codex-plugin/plugin.json`](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/.codex-plugin/plugin.json).

```json
{
  "name": "build-ios-apps",
  "version": "0.1.1",
  "description": "Build iOS apps with workflows for App Intents, SwiftUI UI work, …",
  "skills": "./skills/",
  "interface": {
    "displayName": "Build iOS Apps",
    "capabilities": ["Interactive","Read","Write"]
  }
}

```

This manifest registers the plugin with Codex, declares **Interactive**, **Read**, and **Write** capabilities, and points to the `skills/` directory. *(source: [[`plugins/build-ios-apps/.codex-plugin/plugin.json`](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/.codex-plugin/plugin.json)](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/.codex-plugin/plugin.json))*

## Skill Package Layout

Each skill follows a conventional layout under `plugins/build-ios-apps/skills/<skill-name>/`:

- [`SKILL.md`](https://github.com/openai/plugins/blob/main/SKILL.md) — Human-readable workflow and quick-start.
- `agents/` — Surface-specific agents such as [`openai.yaml`](https://github.com/openai/plugins/blob/main/openai.yaml).
- `references/` — Markdown docs and Swift snippets.
- `scripts/` — Optional helper scripts.
- `assets/` — Optional icons and images.

*(overview: [[`plugins/build-ios-apps/README.md`](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/README.md)](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/README.md))*

## Core SwiftUI Development Skills

### swiftui-ui-patterns

The `swiftui-ui-patterns` skill is the central reference for **state ownership**, **navigation**, and **sheet handling**. Its [`SKILL.md`](https://github.com/openai/plugins/blob/main/SKILL.md) enforces rules such as preferring `@State` and `@Binding`, adopting `@Observable` on iOS 17+, and falling back to `ObservableObject` on earlier OSes.

All component references are indexed in [[`skills/swiftui-ui-patterns/references/components-index.md`](https://github.com/openai/plugins/blob/main/skills/swiftui-ui-patterns/references/components-index.md)](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/skills/swiftui-ui-patterns/references/components-index.md), which links to concrete implementation snippets for `NavigationStack`, `TabView`, and sheets.

### swiftui-liquid-glass

The `swiftui-liquid-glass` skill provides boilerplate for Apple’s **Liquid Glass APIs** (iOS 26+). It walks through adding the `LiquidGlass` dependency via Swift Package Manager and using the `GlassBackground` wrapper, which internally handles `#available(iOS 26, *)` checks.

See [[`skills/swiftui-liquid-glass/SKILL.md`](https://github.com/openai/plugins/blob/main/skills/swiftui-liquid-glass/SKILL.md)](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/skills/swiftui-liquid-glass/SKILL.md) for the exact [`Package.swift`](https://github.com/openai/plugins/blob/main/Package.swift) snippet and Reference 22 for availability patterns.

### swiftui-performance-audit

This skill combines three documents:

- [`profiling-intake.md`](https://github.com/openai/plugins/blob/main/profiling-intake.md) — Describes how to attach Instruments and ETTrace.
- [`report-template.md`](https://github.com/openai/plugins/blob/main/report-template.md) — Auto-populated after an audit run.
- [`code-smells.md`](https://github.com/openai/plugins/blob/main/code-smells.md) — Checklist matched against view code during the audit.

Together they generate a flame-graph and hotspot report via the `optimizing-swiftui-performance` helper script.

## Simulator and Debug Tooling

### ios-simulator-browser

The `ios-simulator-browser` skill runs a **hot-reload preview server** through a small script called `swiftui-preview-browser.mjs`. It exposes compiled previews over a local web server so you can see live UI updates directly inside the Codex UI.

Template entries live in [[`skills/ios-simulator-browser/scripts/templates/PreviewBrowserEntries.swift`](https://github.com/openai/plugins/blob/main/skills/ios-simulator-browser/scripts/templates/PreviewBrowserEntries.swift)](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/skills/ios-simulator-browser/scripts/templates/PreviewBrowserEntries.swift).

### MCP Wiring and Remote Debugging

The plugin ships with a **Multi-Channel Protocol** config in [`.mcp.json`](https://github.com/openai/plugins/blob/main/.mcp.json) that connects the Codex runtime to **XcodeBuildMCP**. This enables **build**, **run**, and **debug** steps on a running simulator without leaving the Codex environment.

*(source: [[`plugins/build-ios-apps/.mcp.json`](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/.mcp.json)](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/.mcp.json))*

## Practical Code Examples

### Adding a New SwiftUI Screen Using UI Patterns

```swift
import SwiftUI

// 1️⃣ Define the view-specific state – narrow as possible
struct SettingsView: View {
    @State private var enableNotifications = false   // local UI state
}

// 2️⃣ Use the recommended navigation pattern (NavigationStack)
struct ContentView: View {
    var body: some View {
        NavigationStack {
            List {
                NavigationLink("Settings", destination: SettingsView())
            }
            .navigationTitle("Demo App")
        }
    }
}

```

This follows Rule 30 in `swiftui-ui-patterns`: isolate UI state with `@State` and adopt `NavigationStack` as documented in [`references/navigationstack.md`](https://github.com/openai/plugins/blob/main/references/navigationstack.md).

### Enabling Liquid Glass in a New View

```swift
import SwiftUI
import LiquidGlass   // added via SwiftPM (see references/liquid-glass.md)

struct GlassyProfileView: View {
    var body: some View {
        GlassBackground {
            VStack {
                Text("Profile")
                    .font(.largeTitle)
                    .foregroundColor(.white)
                // … other UI …
            }
        } // GlassBackground automatically respects iOS 26+ availability
    }
}

```

### Running a Performance Audit from the Skill

```bash

# From the repository root (Codex will invoke the skill)

codex run swiftui-performance-audit \
  --target MyApp \
  --device "iPhone 15 Pro" \
  --profile "MainFlow"

```

The skill will:

1. Launch Instruments with an ETTrace template.
2. Capture a flame-graph and feed it to `optimizing-swiftui-performance`.
3. Generate [`report-template.md`](https://github.com/openai/plugins/blob/main/report-template.md) with hotspots and suggested refactors.

*(Automation details are in [`skills/swiftui-performance-audit/references/optimizing-swiftui-performance.md`](https://github.com/openai/plugins/blob/main/skills/swiftui-performance-audit/references/optimizing-swiftui-performance.md))*

## How to Use the Plugin in Your Own Codex Extension

1. **Add the plugin as a dependency** — Clone the `openai/plugins` repository and reference the `plugins/build-ios-apps` folder in your `.codex-plugin` manifest.

2. **Invoke a skill** via the Codex API:

   ```json
   {
     "plugin": "build-ios-apps",
     "skill": "swiftui-ui-patterns",
     "intent": "Create a new TabView with NavigationStack",
     "params": { "projectName": "MyDemoApp" }
   }
   ```

3. **Follow the skill’s quick-start** found in its [`SKILL.md`](https://github.com/openai/plugins/blob/main/SKILL.md). The skill will generate scaffolding files, update your Xcode project, and optionally launch the simulator browser for live preview.

4. **Iterate** using the `swiftui-view-refactor` skill to break large views, or the `swiftui-performance-audit` skill to optimize after each iteration.

## Summary

- The **Build‑iOS‑Apps** plugin provides a complete SwiftUI development pipeline inside Codex through modular skills.
- The manifest at [`.codex-plugin/plugin.json`](https://github.com/openai/plugins/blob/main/.codex-plugin/plugin.json) registers the plugin and points to the `skills/` directory.
- **swiftui-ui-patterns** enforces modern state ownership and navigation conventions.
- **swiftui-liquid-glass** offers iOS 26+ glassy UI boilerplate with availability guards.
- **swiftui-performance-audit** automates profiling with ETTrace and generates a [`report-template.md`](https://github.com/openai/plugins/blob/main/report-template.md).
- **ios-simulator-browser** delivers hot-reload previews via `swiftui-preview-browser.mjs`.
- **MCP wiring** in [`.mcp.json`](https://github.com/openai/plugins/blob/main/.mcp.json) connects Codex to XcodeBuildMCP for simulator builds and debugging.

## Frequently Asked Questions

### What is the Build‑iOS‑Apps plugin and where is it located?

The Build‑iOS‑Apps plugin is a Codex toolkit inside the `openai/plugins` repository. It lives under `plugins/build-ios-apps` and bundles skills for designing, building, and debugging SwiftUI iOS applications.

### How does the swiftui-ui-patterns skill handle state management?

According to the source code in [[`skills/swiftui-ui-patterns/SKILL.md`](https://github.com/openai/plugins/blob/main/skills/swiftui-ui-patterns/SKILL.md)](https://github.com/openai/plugins/blob/main/plugins/build-ios-apps/skills/swiftui-ui-patterns/SKILL.md), the skill prefers `@State` and `@Binding` for local UI state, recommends `@Observable` on iOS 17 and later, and falls back to `ObservableObject` for earlier OS versions.

### Can I debug a simulator without leaving the Codex environment?

Yes. The plugin ships an [`.mcp.json`](https://github.com/openai/plugins/blob/main/.mcp.json) configuration that wires Codex to XcodeBuildMCP, and the `ios-debugger-agent` skill handles debugging on a running simulator directly from the Codex interface.

### What iOS version is required for the Liquid Glass skill?

The `swiftui-liquid-glass` skill targets **iOS 26 and later**. Its `GlassBackground` wrapper includes `#available(iOS 26, *)` checks so you can adopt the API safely while maintaining backward compatibility.