integrate-agentforce-ios
Installation
SKILL.md
integrate-agentforce-ios
This skill walks a consumer through wiring the Agentforce Mobile SDK into their iOS app. It is interactive — ask the user the questions in each phase before generating code. Don't assume; the wrong auth flow is the most common integration mistake.
Operating rules
- Run inside the consumer's project, not inside the SDK repo. If the working directory contains
Sources/AgentforceSDKTarget/orPackage.swiftdeclares the productAgentforceSDKas abinaryTarget, refuse and tell the user tocdinto their app first. - Discover before deciding. Always run Phase 1 (use-case discovery) before recommending an auth flow. Don't ask "which auth flow do you want?" — most consumers don't know.
- Don't suggest
.Guest(url:)or.OrgJWTby default. They're only correct in specific situations. Recommend the path that matches the user's described use case. - Retain the client for the conversation's lifetime.
AgentforceClientmust live as long as the conversation; deallocating it loses the session. Always scaffold the client inside an@MainActorObservableObjectowned by@StateObjectat the app root. - Default to the latest stable public release. Use
18.26.17(Agentforce Mobile 262.1.3) unless the project already pins another compatible version. Use18.33.14-rc1only when the user explicitly requests the 262.2 prerelease; label it non-production. - Treat SPM as the preferred install path. Add only
https://github.com/salesforce/AgentforceMobileSDK-iOS.git; never addAgentforceMobileService-iOSseparately because the public package already bundles the matchingAgentforceServicebinary. - Use
AskUserQuestionfor branching choices. Don't free-text prompts — give 2–4 explicit options. - Substitute placeholders, don't leave
{{TOKENS}}in the final files. Collect values up front; if the user can't provide a value, leave a clearly-marked// TODO:comment instead.
Phase 0 — Detect the target project
Look in the current working directory for: