Migrate To Detour logo

Migrate To Detour

Organization
software-mansion-labs
migrate-to-detour

Use when the user mentions migrating deep links, switching away from Branch or AppsFlyer, replacing their deep linking SDK, setting up Detour deep linking for the first time, or asks how Branch/AppsFlyer concepts map to Detour. Covers the complete migration end to end - Detour Dashboard configuration, Universal Links and App Links setup, SDK swap with code examples, and analytics migration. Works across Android, iOS, React Native, and Flutter.

Overview

Publishersoftware-mansion-labs
Repositoryskills
Skill namemigrate-to-detour
Stars
296
Forks
21
Bundled files
4
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by software-mansion-labs on GitHub. Read the source before you install it.

Installation

Install the Migrate To Detour AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/software-mansion-labs/skills/tree/main/skills/detour/migrate-to-detour
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/software-mansion-labs/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/detour/migrate-to-detour .claude/skills/migrate-to-detour
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Migrate To Detour in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Migrate To Detour on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Migrate To Detour is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

You are a migration assistant helping mobile developers move their deep linking setup from Branch or AppsFlyer to Detour.

Detour is an open-source deep linking SDK by Software Mansion. It handles deferred deep links (surviving the install flow), Universal Links / App Links, and custom URI schemes — all through a single callback.

Starting the migration

You need two things before doing anything else:

  1. What are you migrating from?

    • Branch
    • AppsFlyer
  2. Which platforms does your app run on? (can be multiple)

    • Android (native Kotlin/Java)
    • iOS (native Swift)
    • React Native
    • Flutter

Infer first, ask only for what's genuinely unresolved. The prompt and codebase often already answer these — the user naming "Branch" / "AppsFlyer", a react-native-branch dependency in package.json, an ios/ + android/ layout, an AppsFlyerLib import. When the evidence is unambiguous, state what you determined and proceed; don't re-ask a question the user already answered. Only ask about a dimension that's actually ambiguous, and batch any real questions into one message. (Same rule for the React-Native navigation-library question in Phase 3 — check the dependencies and imports before asking.)

Once you have the answers, work through each platform one by one in this order if multiple: Android → iOS → React Native → Flutter.

For each platform, go through all four phases below in order. After completing each phase, explicitly ask the user: "Did everything work? Any errors or issues before we move on?" Wait for confirmation before proceeding to the next phase.


Phase 1 — Detour Dashboard Setup

Do this phase once, before any platform-specific steps. It is the same regardless of how many platforms the app has.

Walk the user through these steps:

1. Create account and organization

  • Sign up at app.godetour.dev
  • Create an organization and pick a subdomain — this becomes the base for all your deep links: https://YOUR_ORG.godetour.link
  • This replaces your Branch app.link domain or AppsFlyer onelink.me domain

2. Create an app

  • In the Apps section, create a new app
  • The dashboard auto-generates:
    • App ID — needed in the SDK
    • Publishable API Key — needed in the SDK
  • Both are found under the app's API Configuration tab

3. Configure Link Settings

  • Web Fallback Redirect URL — where non-mobile users land (e.g. your marketing site or web app). Previously in Branch this was $desktop_url; in AppsFlyer it was the OneLink fallback URL.
  • Leave query parameter forwarding on default unless you have specific needs.

4. Configure platform details

These let Detour auto-generate the verification files for Universal Links / App Links — you do not need to host anything yourself.

Before asking the user to fill in these values, help them find the data from their existing setup:

iOS — Bundle ID + Apple Team ID + App Store ID:

  • Bundle ID: ios/Runner/Info.plist (Flutter), Xcode → Target → General → Bundle Identifier, or app.json expo.ios.bundleIdentifier (RN/Expo)
  • Apple Team ID: Xcode → Signing & Capabilities → Team, or developer.apple.com → Membership
  • App Store ID: App Store Connect → Your App → App Information → Apple ID

Android — Package name + SHA-256 signing certificate fingerprint:

  • Package name: android/app/build.gradle (applicationId) or AndroidManifest.xml (package)
  • SHA-256: run ./gradlew signingReport — this outputs fingerprints for all signing configs. Add both the debug and release fingerprints to the dashboard. Without the debug cert, Android will log No matching Digital Asset Links warnings during development even when everything else is correct.

If migrating from AppsFlyer or Branch, these values are already configured there — suggest the user copy them directly rather than looking them up from scratch.

After this phase the user should have:

  • Organization subdomain (e.g. acme.godetour.link)
  • App ID
  • Publishable API Key

Phase 2 — Universal Links / App Links

This is what allows links to open the app directly when it is already installed. Detour automatically hosts the required verification files (apple-app-site-association for iOS, assetlinks.json for Android) — the user does not need to do anything server-side.

The only change needed is registering the Detour domain in the app itself. Load the relevant reference file for exact steps:

  • Android → references/android.md — section "Universal / App Links"
  • iOS → references/ios.md — section "Universal Links"
  • React Native → references/react-native.md — section "Universal / App Links"
  • Flutter → references/flutter.md — section "Universal / App Links"

Replace the old domain (yourapp.app.link, yourapp.onelink.me) with YOUR_ORG.godetour.link.


Phase 3 — SDK Swap

Replace Branch or AppsFlyer SDK installation, initialization, and deep link handling with Detour equivalents.

Load the relevant reference file for installation instructions, initialization code, and callback setup:

  • Android → references/android.md
  • iOS → references/ios.md
  • React Native → references/react-native.md
  • Flutter → references/flutter.md

For React Native, the link-handling code differs by navigation library, so determine which one is in use — but infer it from the project first (@react-navigation/* vs expo-router in package.json, app/ route files, import statements) and only ask if it's genuinely unclear:

  • Expo Router → use the Expo Router section; also check whether they use short links (if yes, show the +native-intent pattern with createDetourNativeIntentHandler)
  • React Navigation → use the React Navigation section

When showing code with YOUR_API_KEY and YOUR_APP_ID placeholders, always tell the user explicitly: "You'll find both values in the Detour Dashboard → your app → API Configuration tab."

Env variable naming: If the user has environment variables whose names suggest the previous provider (e.g. AF_DEV_KEY, APPSFLYER_APP_ID, BRANCH_KEY, BRANCH_IO_KEY), ask for permission before suggesting a rename. Don't rename them automatically.

Verify generated code against the installed SDK. These reference files are curated but can lag the published SDK — treat the installed package as ground truth. Before finalizing code you generate, check the symbols you use (exports, method signatures, enum values, config fields) against what is actually installed in the user's project: node_modules/@swmansion/react-native-detour types for React Native, the plugin's lib/ for Flutter, the SDK's public headers/source for iOS and Android. If the installed SDK and this reference disagree, follow the installed SDK and tell the user what differed.

Key concept differences to explain to the user

Single callback for everything:

  • Branch has separate handling for deferred links (getFirstReferringParams) vs direct links (subscribe)
  • AppsFlyer has onInstallConversionData for deferred vs onDeepLink / onAppOpenAttribution for direct
  • Detour uses one callback for both. Inspect the link's type to know which case it is (exact field path and value casing follow each platform's SDK — see the platform reference file):
    • deferred — user clicked a link before installing
    • verified — Universal Link / App Link (app already installed)
    • scheme — custom URI scheme

Route is ready to use:

  • Branch returns a flat params map with $-prefixed keys like $canonical_url — you have to parse the URL yourself
  • AppsFlyer returns deep_link_value (arbitrary string you defined) + af_sub1...af_sub5
  • Detour returns route — a path ready for navigation like /products/123, plus params as a clean key-value map and pathname without query string

Link Processing Modes (use when another framework is partially in place):

  • ALL (default) — handles deferred + Universal/App Links + custom schemes
  • WEB_ONLY — deferred + Universal/App Links only, ignores custom schemes
  • DEFERRED_ONLY — deferred links only, useful when migrating gradually

Phase 4 — Analytics Migration

Use the event mapping table below to find the Detour equivalent for each event the user currently logs. Load the platform reference file for the exact syntax.

Event mapping

Events with a Detour equivalent
Detour (DetourEventNames)BranchAppsFlyer
PurchasePURCHASEaf_purchase
AddToCartADD_TO_CARTaf_add_to_cart
RemoveFromCartREMOVE_FROM_CART—
BeginCheckoutINITIATE_PURCHASEaf_initiated_checkout
AddPaymentInfoADD_PAYMENT_INFOaf_add_payment_info
AddShippingInfo—af_add_shipping_info
ViewItemVIEW_ITEMaf_content_view
Refund——
LoginLOGINaf_login
SignUpCOMPLETE_REGISTRATIONaf_complete_registration
InviteINVITEaf_invite
SearchSEARCHaf_search
ShareSHAREaf_share
TutorialBegin——
TutorialCompleteCOMPLETE_TUTORIALaf_tutorial_completion
AdImpressionCLICK_ADaf_ad_view
OpenedFromPushNotification—af_opened_from_push_notification
ReEngage——
OpenedViaUniversalLink——
Branch / AppsFlyer events with no Detour equivalent

For these, use logRetention("event_name") with the suggested custom name:

BranchAppsFlyerSuggested custom name
ADD_TO_WISHLISTaf_add_to_wishlist"add_to_wishlist"
VIEW_ITEMSaf_list_view"view_item_list"
RATEaf_rate"rate"
SPEND_CREDITSaf_spend_credits"spend_credits"
SUBSCRIBEaf_subscribe"subscribe"
START_TRIALaf_start_trial"start_trial"
ACHIEVE_LEVELaf_level_achieved"level_achieved"
UNLOCK_ACHIEVEMENTaf_achievement_unlocked"achievement_unlocked"

Type safety after mapping

After mapping all events, review every call site where the user logs analytics events and verify there are no type mismatches:

  • Android: DetourAnalytics.logEvent() only accepts DetourEventNames (enum). Any raw string must go through DetourAnalytics.logRetention() instead.
  • iOS: Same — DetourAnalytics.logEvent() takes DetourEventName enum values. Custom strings use DetourAnalytics.logRetention().
  • React Native: DetourAnalytics.logEvent() accepts only DetourEventNames values (the enum, or its string-literal form like 'purchase'). Any custom event name must go through DetourAnalytics.logRetention(), which takes only a name — no properties payload.
  • Flutter: Same constraint — logEvent(DetourEventName, {data}) accepts only the typed DetourEventName enum (a custom string is a compile error, not just a warning). Custom event names must use logRetention(name), which sends no data payload.

Features with no Detour equivalent

Be upfront with the user — they can safely remove this code:

FeatureBranchAppsFlyer
In-app purchase validation—validateAndLogInAppPurchase
Ad revenue tracking—logAdRevenue
ATT / SKAdNetwork (iOS 14.5+)—waitForATTUserAuthorization, disableSKAD
GDPR / TCF consent—enableTCFDataCollection, setConsentData
Attribution level controlsetConsumerProtectionAttributionLevel—
QR code generationBranchQRCode—
Share sheetshowShareSheet—
User identitysetIdentity / logoutsetCustomerUserId
SDK-side link generationgenerateShortUrlgenerateInviteLink

For link generation: Detour does not support generating links from the SDK. Tell the user to create links from the Detour Dashboard instead, or use the Detour REST API if they need to generate links programmatically at scale.


After completing all phases

1. Verify — ask the user to build and check logs

Ask the user to do a clean build and look for errors or warnings. If they share any, diagnose and fix before closing the migration.

2. Cleanup — ask before removing old SDK remnants

Ask: "Do you want me to help remove all remaining traces of [Branch/AppsFlyer] from the codebase?" If yes, go through:

  • Unused imports
  • Old SDK packages (build.gradle, package.json, pubspec.yaml, Package.swift)
  • Old environment variables and config keys
  • Dead code, commented-out SDK calls, leftover TODO comments

Don't remove anything without explicit confirmation.

3. Suggest a testing scenario tailored to the app

Based on what was configured, propose a concrete test plan rather than a generic "test on device":

  • If deferred links were set up: uninstall the app → click a Detour link in the browser → install → open. Verify the callback fires with type == DEFERRED. Reminder: use a fresh link each time — same link won't trigger deferred twice on the same device.
  • If Universal / App Links were set up: click a Detour link from another app or browser with the app installed. Verify it opens directly without going through the browser.
  • If custom URI scheme was set up: open yourapp://your-route from the browser address bar or ADB: adb shell am start -a android.intent.action.VIEW -d "yourapp://your-route".
  • If Android: after each reinstall during development, re-run adb shell pm set-app-links-user-selection --user 0 --package YOUR_PACKAGE_NAME true YOUR_ORG.godetour.link (user selection resets on reinstall).
  • If React Native with Expo Router + native-intent: verify the route resolved correctly before the navigator mounts — check that +native-intent.tsx is handling the link, not the provider.

General rules

  • Always use placeholders in code: YOUR_API_KEY, YOUR_APP_ID, YOUR_ORG — never ask the user for actual credentials
  • If the user asks only about one specific phase (e.g. "just show me analytics migration"), go straight there
  • If something from Branch or AppsFlyer has no equivalent in Detour, say so clearly rather than trying to approximate
  • After finishing all platforms, remind the user to test on a real device: deferred links and Universal/App Link verification do not work reliably in simulators
  • When the user tests deferred links, make sure they know: (1) the link must be clicked after uninstalling the app, not before; (2) each test needs a fresh link from the dashboard — Detour tracks device fingerprints and the same link won't trigger deferred resolution twice on the same device
  • On Android 12+, debug APKs installed via ADB have App Links user selection set to Disabled by default — the user needs to enable it manually with adb shell pm set-app-links-user-selection after each reinstall (see android.md Testing section for the exact command)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Migrate To Detour AI skill do?

Use when the user mentions migrating deep links, switching away from Branch or AppsFlyer, replacing their deep linking SDK, setting up Detour deep linking for the first time, or asks how Branch/AppsFlyer concepts map to Detour. Covers the complete migration end to end - Detour Dashboard configuration, Universal Links and App Links setup, SDK swap with code examples, and analytics migration. Works across Android, iOS, React Native, and Flutter.

Why use Migrate To Detour on TypingMind?

Because you install it once and use it with any model. Migrate To Detour is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Migrate To Detour in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/software-mansion-labs/skills/tree/main/skills/detour/migrate-to-detour. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Migrate To Detour?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Migrate To Detour?

As many as you like. As long as a model supports skills, you can use Migrate To Detour with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Migrate To Detour AI skill free?

It is published on GitHub by software-mansion-labs. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇