场景定位
让 Codex 识别 iOS 应用中应该暴露给 Shortcuts、Siri、Spotlight、widgets 和系统入口的动作与对象,并用 App Intents 建一个小而有用的系统层。
- 难度
- 高级
- 时间跨度
- 约 1 小时
适合用于
- 已有有价值 actions 或 content,但还不能从 Shortcuts、Siri、Spotlight 或系统表面调用的 iOS app
- 希望先暴露少量高价值动作,并为更 assistant-friendly workflow 做准备的团队
- 拥有 account、list、filter、destination、draft、media 等清晰对象,可转成 app entities 的应用
Skills & Plugins
相关工具
Starter Prompt
起步提示词
Use the Build iOS Apps plugin to audit this iOS app and add App Intents for the actions and entities that should be exposed to the system.
Constraints:
- Start by identifying the app's highest-value user actions and core objects that should be available outside the app in Shortcuts, Siri, Spotlight, widgets, controls, or newer assistant-driven system surfaces.
- Keep the first pass focused. Pick a small set of intents that are genuinely useful without opening the full app, plus any open-app intents that should deep-link into a specific screen or workflow.
- Define app entities only for the data the system actually needs. Do not mirror the entire internal model layer if a smaller entity surface is enough.
- Add App Shortcuts where they make the experience more discoverable, and choose titles, phrases, and display representations that make sense in Siri, Spotlight, and Shortcuts.
- If the app needs to handle the intent inside the main UI, route it cleanly into the right scene, tab, or screen.
Deliver:
- proposed first intent surface
- implemented intents/entities/shortcuts
- build and simulator validation commands
- notes on what should not be exposed yet 在 ChatGPT 中尝试 让合适部分对系统可见
App Intents 是让 iOS app 走出自身 UI 的清晰方式。不要把应用只当作用户必须打开再点击的封闭目的地;让 Codex 暴露系统应该理解的动作和对象。
这对今天的 discoverability 和 automation 有用,也是在为 assistant-driven future 做准备。如果应用已经能 compose、open、filter、route 或 summarize 有价值内容,App Intents 就能给系统一个结构化入口。
从动作和实体开始
第一轮 App Intents 最好不是“镜像整个 app”。让 Codex 先识别用户想在不完整打开应用时触发的少量动作、系统需要理解的 app objects,以及哪些 workflow 应深链到特定屏幕而不是直接完成。
遵循 Apple 的 App Intents 框架:定义 action,定义系统需要的 entity surface,然后让这些动作能被系统体验发现和复用。
- 用户想从系统表面直接触发的少量动作。
- 系统需要理解、展示和路由的 app objects。
- 应该打开 app 到特定状态的 workflow。
- 可以直接从系统入口完成的轻量 workflow。
思考系统表面,而不只是 shortcuts
机会不只是“加一个 shortcut”。好的 App Intents surface 可以让应用出现在更多地方。
- Shortcuts:用户可以直接运行动作,或组合进更大的自动化。
- Siri:暴露有意义的 verbs 和 deep links,而不是泛泛打开应用。
- Spotlight:app entities 和 app shortcuts 成为可发现入口。
- Widgets、Live Activities、controls 等 intent-driven UI surfaces。
- 更 assistant-facing 的体验:结构化 actions 和 entities 比任意 UI flow 更容易被系统理解。
遵循真实 app pattern
多数应用适合采用一个小的系统-facing action layer,而不是把 intents 散落在无关 app 文件里。
常见结构包括 dedicated App Intents target、面向高价值动作的 `AppShortcutsProvider`、用于 account/list/filter 等对象的小型 `AppEntity`,以及能回到主 app scene 的清晰 runtime handoff。
让 Codex 设计第一版 intent surface
最强的 prompt 会给 Codex 应用的核心对象和顶部 user actions,然后要求它选择最小有用 App Intents surface,而不是盲目暴露所有东西。
同时要求它说明什么不应该在第一轮暴露:需要长期 setup、含敏感数据、没有明确系统语义,或只有进入 app 后才有意义的动作都可以先排除。
实用提示
- 暴露用户真的想在 app 外触发的 verbs:compose、open、find、filter、start、continue、inspect。
- 实体要小于 model layer:系统通常不需要完整持久化模型,只需要显示和路由所需的字段。
- 把它当作 assistant infrastructure,而不仅是 shortcuts 功能。
技术栈
把应用动作暴露给 Shortcuts、Siri、Spotlight、widgets 和其它系统表面。
给系统足够上下文来展示、搜索和路由对象,而不暴露完整内部模型。
让动作在 Siri、Spotlight 和 Shortcuts 中更容易被发现和理解。
确保 intent 能构建、被发现,并在需要时正确打开 app 到目标状态。