apple-foundation-models
4
总安装量
3
周安装量
#48343
全站排名
安装命令
npx skills add https://github.com/jakerains/agentskills --skill apple-foundation-models
Agent 安装分布
opencode
3
gemini-cli
3
claude-code
3
github-copilot
3
codex
3
cursor
3
Skill 文档
Apple Foundation Models and Image Playground
Implement reliable Apple Intelligence features with Apple’s on-device text and image generation APIs.
Workflow
- Classify the request before writing code. Use Foundation Models for on-device text generation in app code, use ImagePlayground for image generation in app code, and use App Intents and Shortcuts guidance when the request is specifically about the “Use Model” action and automation workflows.
- Check platform support and runtime readiness first (
isAvailableandavailabilitystates), then design fallback UI for unavailable states. - Implement a local-first path with clear prompt and instruction design before considering adapters.
- Add tools, guided generation, and performance tuning only as needed for the task.
- Decide whether to route to a larger model path. For Apple-managed routing in automation flows, use App Intents and Shortcuts “Use Model” guidance. For in-app cloud escalation, use an explicit backend model path and keep local execution as the default when possible.
- Validate behavior on physical devices and include robust error handling for language, context size, and tool failures.
References
- Foundation model implementation details:
references/foundation-models-framework.md - Local versus larger-model routing strategy:
references/routing-local-vs-bigger-model.md - Image Playground implementation details:
references/image-playground.md
Execution Rules
- Prefer official Apple docs and WWDC sources for API behavior.
- Treat Foundation Models app APIs as on-device unless Apple docs explicitly document a server-routing API for app code.
- Re-verify docs for “latest” requests because Apple Intelligence behavior can change across OS releases.
- Keep prompts concise and structured to reduce token use and latency.