/ ディレクトリ / プレイグラウンド / SwiftUI Agent Skill
● コミュニティ twostraws ⚡ 即起動

SwiftUI Agent Skill

作者 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.

なぜ使うのか

主な機能

ライブデモ

実際の動作

swiftui-agent-skill.replay ▶ 準備完了
0/0

インストール

クライアントを選択

~/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
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config を開く。保存後、アプリを再起動。

~/.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 は Claude Desktop と同じ mcpServers スキーマを使用。プロジェクト設定はグローバルより優先。

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
    }
  }
}

Cline サイドバーの MCP Servers アイコンをクリックし、"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
    }
  }
}

Claude Desktop と同じ形式。Windsurf を再起動して反映。

~/.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 はマップではなくサーバーオブジェクトの配列を使用。

~/.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"
        ]
      }
    }
  }
}

context_servers に追加。保存時に Zed がホットリロード。

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

ワンライナー。claude mcp list で確認、claude mcp remove で削除。

ユースケース

実用的な使い方: SwiftUI Agent Skill

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

👤 iOS devs ⏱ ~15 min intermediate

使うタイミング: You want a Settings screen that's actually idiomatic for iOS 17+.

前提条件
  • Server/skill installed and authenticated — See repo README
フロー
  1. Plan
    Using the SwiftUI skill, design a Settings view with sections: Account, Notifications, About. Use @Observable for the view model.✓ コピーしました
    → View hierarchy + ViewModel sketch
  2. Code
    Write the full file with toggles, NavigationLink to subpages, and a confirmation dialog for sign-out.✓ コピーしました
    → Compiles on Xcode 15+

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

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

コストと制限

運用コスト

APIクォータ
See provider docs for rate limits
呼び出しあたりのトークン
Varies by tool
金額
See repo README for pricing details
ヒント
Cache tool results and avoid repeated identical calls.

セキュリティ

権限、シークレット、影響範囲

認証情報の保管: Use environment variables; never commit secrets
データ送信先: Tool calls go to the provider's API as documented

トラブルシューティング

よくあるエラーと対処法

view doesn't update on state change

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

確認: @Observable annotation present
preview crashes

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

確認: Preview compiles

代替案

SwiftUI Agent Skill 他との比較

代替案代わりに使う場面トレードオフ
wholiver/swiftui-design-skillYou want design direction, not code patternsDesign-focused; twostraws is code-focused

その他

リソース

📖 GitHub の公式 README を読む

🐙 オープンな issue を見る

🔍 400以上のMCPサーバーとSkillsを見る