/ Каталог / Песочница / 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 использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

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

Щёлкните значок MCP Servers на боковой панели Cline, затем "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 использует массив объектов серверов, а не 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"
        ]
      }
    }
  }
}

Добавьте в 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

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills