/ Verzeichnis / Playground / SwiftUI Agent Skill
● Community twostraws ⚡ Sofort

SwiftUI Agent Skill

von twostraws · twostraws/SwiftUI-Agent-Skill

Paul Hudson's SwiftUI patterns packaged as a Claude skill.

By Paul Hudson (Hacking with Swift), this skill teaches Claude modern SwiftUI: @Observable, NavigationStack, async views, proper state ownership. The result: SwiftUI code that actually compiles and follows Apple's current guidance.

Warum nutzen

Hauptfunktionen

Live-Demo

In der Praxis

swiftui-agent-skill.replay ▶ bereit
0/0

Installieren

Wählen Sie Ihren Client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "swiftui-agent-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/twostraws/SwiftUI-Agent-Skill",
        "~/.claude/skills/SwiftUI-Agent-Skill"
      ],
      "_inferred": true
    }
  }
}

Öffne Claude Desktop → Settings → Developer → Edit Config. Nach dem Speichern neu starten.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "swiftui-agent-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/twostraws/SwiftUI-Agent-Skill",
        "~/.claude/skills/SwiftUI-Agent-Skill"
      ],
      "_inferred": true
    }
  }
}

Cursor nutzt das gleiche mcpServers-Schema wie Claude Desktop. Projektkonfiguration schlägt die globale.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "swiftui-agent-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/twostraws/SwiftUI-Agent-Skill",
        "~/.claude/skills/SwiftUI-Agent-Skill"
      ],
      "_inferred": true
    }
  }
}

Klicken Sie auf das MCP-Servers-Symbol in der Cline-Seitenleiste, dann "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "swiftui-agent-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/twostraws/SwiftUI-Agent-Skill",
        "~/.claude/skills/SwiftUI-Agent-Skill"
      ],
      "_inferred": true
    }
  }
}

Gleiche Struktur wie Claude Desktop. Windsurf neu starten zum Übernehmen.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "swiftui-agent-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/twostraws/SwiftUI-Agent-Skill",
        "~/.claude/skills/SwiftUI-Agent-Skill"
      ]
    }
  ]
}

Continue nutzt ein Array von Serverobjekten statt einer Map.

~/.config/zed/settings.json
{
  "context_servers": {
    "swiftui-agent-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/twostraws/SwiftUI-Agent-Skill",
          "~/.claude/skills/SwiftUI-Agent-Skill"
        ]
      }
    }
  }
}

In context_servers hinzufügen. Zed lädt beim Speichern neu.

claude mcp add swiftui-agent-skill -- git clone https://github.com/twostraws/SwiftUI-Agent-Skill ~/.claude/skills/SwiftUI-Agent-Skill

Einzeiler. Prüfen mit claude mcp list. Entfernen mit claude mcp remove.

Anwendungsfälle

Praxisnahe Nutzung: SwiftUI Agent Skill

Build a settings screen the right way (iOS 17+)

👤 iOS devs ⏱ ~15 min intermediate

Wann einsetzen: You want a Settings screen that's actually idiomatic for iOS 17+.

Voraussetzungen
  • Server/skill installed and authenticated — See repo README
Ablauf
  1. Plan
    Using the SwiftUI skill, design a Settings view with sections: Account, Notifications, About. Use @Observable for the view model.✓ Kopiert
    → View hierarchy + ViewModel sketch
  2. Code
    Write the full file with toggles, NavigationLink to subpages, and a confirmation dialog for sign-out.✓ Kopiert
    → Compiles on Xcode 15+

Ergebnis: Idiomatic SwiftUI you don't have to rewrite next year.

Fallstricke
  • Don't mix @StateObject with @Observable — Don't mix @StateObject with @Observable — the skill enforces one or the other; follow it.

Kosten & Limits

Was der Betrieb kostet

API-Kontingent
See provider docs for rate limits
Tokens pro Aufruf
Varies by tool
Kosten in €
See repo README for pricing details
Tipp
Cache tool results and avoid repeated identical calls.

Sicherheit

Rechte, Secrets, Reichweite

Credential-Speicherung: Use environment variables; never commit secrets
Datenabfluss: Tool calls go to the provider's API as documented

Fehlerbehebung

Häufige Fehler und Lösungen

view doesn't update on state change

Ensure the property is on an @Observable class, not a struct. The skill's checklist covers this.

Prüfen: @Observable annotation present
preview crashes

@Observable views need a real instance in #Preview. The skill's examples show the pattern.

Prüfen: Preview compiles

Alternativen

SwiftUI Agent Skill vs. andere

AlternativeWann stattdessenKompromiss
wholiver/swiftui-design-skillYou want design direction, not code patternsDesign-focused; twostraws is code-focused

Mehr

Ressourcen

📖 Offizielle README auf GitHub lesen

🐙 Offene Issues ansehen

🔍 Alle 400+ MCP-Server und Skills durchsuchen