显示HN:AgentSwift – 开源iOS构建代理
Show HN: AgentSwift – Open-source iOS builder agent

原始链接: https://github.com/hpennington/agentswift

## AgentSwift:macOS 自动化 AI 编程 AgentSwift 是一款原生 macOS 应用程序,利用 Claude AI 模型自动化 Apple 平台开发。只需描述您想要进行的更改,AgentSwift 就会处理项目发现、代码实现、构建、测试和验证——所有这些都不需要直接与 Xcode 交互。 它利用多阶段工作流程,驱动工具包括 `xcodebuildmcp`(用于构建/启动)和 `openspec`(用于跟踪实现)。用户需要一个 Anthropic API 密钥并选择他们的 Xcode 项目文件夹。 AgentSwift 智能缓存构建并处理错误,并在提醒用户之前尝试一次修复。它支持 Claude Opus(用于复杂任务)和 Sonnet(用于更快迭代)模型。该应用程序使用纯 SwiftUI 和 Foundation 构建,避免了外部 Swift 依赖,并具有清晰的代码结构,关键文件包括 `AgentSwiftApp.swift` 和 `AnthropicService.swift`。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 展示 HN: AgentSwift – 开源 iOS 构建代理 (github.com/hpennington) 4 分,由 hpen 47 分钟前发布 | 隐藏 | 过去 | 收藏 | 1 条评论 我正在开发一个用于构建 iOS 应用程序的编码代理。它基于 openspec 和 xcodebuildmcp 构建。它是免费且开源的。帮助 trueno 4 分钟前 [–] 作为可能永远不会深入研究这个的人,我很想知道,使用这个相比于.. claude 代码和同时插入 xcode mcp 服务器与 xcode,有什么优势? 我看到它仍然使用 claude,我只是好奇你是否设计了一些额外的安全措施或功能。回复 考虑申请 YC 2026 夏季批次!申请截止至 5 月 4 日 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

Download AgentSwift-0.1.zip You must install the dependencies listed below in order for the binary to work. See below for setup commands.

Dependencies:

  • Xcode
  • Xcode command line tools
  • xcodebuildmcp
  • openspec

AgentSwift settings panel

AgentSwift

A native macOS app that runs an autonomous AI coding agent for Apple platform development. Describe what you want to build, and AgentSwift uses Claude to discover your project, implement changes, build, run, and validate — without you touching Xcode.

AgentSwift drives a multi-phase agentic workflow:

  1. Discover — Claude inspects your Xcode project structure and schemes
  2. Implement — edits source files to match your request
  3. Build — runs xcodebuildmcp to compile
  4. Launch / Validate — boots the app on a simulator or macOS, runs UI automation to verify behavior
  5. Archive — marks the task complete

Install these two CLIs before running the agent:

Provides build, launch, and UI automation capabilities for Xcode projects.

npm install -g xcodebuildmcp

Tracks implementation specs across agent sessions.

npm install -g @fission-ai/openspec
  1. Build and run the app in Xcode.
  2. Open Settings and enter your Anthropic API key.
  3. Select a Project Folder (the root of your Xcode project).
  4. Optionally pick an iOS Simulator from the dropdown.
  5. Type what you want to build and press Cmd+Return.

On the first run the agent discovers your project's scheme and simulator target. Subsequent runs skip discovery and go straight to implementation.

Model Use when
Claude Opus 4.7 Complex tasks, large codebases
Claude Sonnet 4.6 Faster iteration, lighter tasks
  • Message queuing — if you send a new message while the agent is running, the latest supersedes earlier ones
  • Build caching — scheme, project path, and simulator ID are extracted after the first build and reused automatically
  • Error escalation — the agent attempts one fix on a failure, then surfaces the error to you rather than looping
AgentSwiftApp.swift    — app entry point
ContentView.swift      — UI, view models, agentic loop
AnthropicService.swift — Anthropic API client (streaming SSE)
ToolExecutor.swift     — bash / read_file / write_file execution
Item.swift             — chat message model

No external Swift dependencies — pure SwiftUI + Foundation.

联系我们 contact @ memedata.com