deep-linking
Generate deep linking infrastructure with URL schemes, Universal Links, and App Intents for Siri/Shortcuts. Use when handling custom URL schemes, Universal Links/Associated Domains, or routing to specific content from external sources.
What this skill does
# Deep Linking Generator
Generate deep linking infrastructure with URL schemes, Universal Links, and App Intents for Siri/Shortcuts.
## When This Skill Activates
- User wants to handle custom URL schemes (myapp://)
- User mentions Universal Links or Associated Domains
- User wants Siri Shortcuts or App Intents
- User needs to navigate to specific content from external sources
## Pre-Generation Checks
Before generating, verify:
1. **Existing Deep Link Handling**
```bash
# Check for existing URL handling
grep -r "onOpenURL\|open.*url\|handleOpen" --include="*.swift" | head -5
```
2. **URL Scheme in Info.plist**
```bash
# Check for CFBundleURLTypes
find . -name "Info.plist" -exec grep -l "CFBundleURLSchemes" {} \;
```
3. **Associated Domains Entitlement**
```bash
find . -name "*.entitlements" -exec grep -l "associated-domains" {} \;
```
## Configuration Questions
### 1. URL Scheme
- What custom URL scheme? (e.g., `myapp`)
- This enables `myapp://path/to/content` links
### 2. Universal Links
- **Yes** - Handle HTTPS links (requires AASA file on server)
- **No** - Custom URL scheme only
### 3. App Intents / Siri Shortcuts
- **Yes** - Enable voice commands and Shortcuts app
- **No** - URL-based deep linking only
### 4. Link Types
- Profile: `/users/{id}`
- Content: `/items/{id}`
- Actions: `/actions/share`, `/actions/create`
- Custom routes based on app needs
## Generated Files
### Core Infrastructure
```
Sources/DeepLinking/
├── DeepLinkRouter.swift # Central router
├── DeepLink.swift # Route definitions
└── UniversalLinkHandler.swift # Universal link processing
```
### App Intents (Optional)
```
Sources/AppIntents/
├── OpenContentIntent.swift # Open specific content
├── AppShortcuts.swift # Shortcuts provider
└── ContentEntity.swift # Entities for Spotlight/Siri
```
### Server Files (Universal Links)
```
.well-known/
└── apple-app-site-association # AASA file template
```
## Key Features
### Route Definitions
```swift
enum DeepLink: Equatable {
case home
case profile(userId: String)
case item(itemId: String)
case settings
case action(ActionType)
enum ActionType {
case share(itemId: String)
case create
}
}
```
### URL Parsing
```swift
extension DeepLink {
init?(url: URL) {
guard let components = URLComponents(url: url, resolvingAgainstBaseURL: true) else {
return nil
}
let pathComponents = components.path.split(separator: "/").map(String.init)
switch pathComponents {
case ["users", let userId]:
self = .profile(userId: userId)
case ["items", let itemId]:
self = .item(itemId: itemId)
case ["settings"]:
self = .settings
default:
self = .home
}
}
}
```
### SwiftUI Integration
```swift
@main
struct MyApp: App {
@State private var router = DeepLinkRouter()
var body: some Scene {
WindowGroup {
ContentView()
.environment(router)
.onOpenURL { url in
router.handle(url)
}
}
}
}
```
## App Intents Integration
### OpenIntent for Navigation
```swift
struct OpenItemIntent: OpenIntent {
static let title: LocalizedStringResource = "Open Item"
@Parameter(title: "Item")
var target: ItemEntity
func perform() async throws -> some IntentResult {
await router.navigate(to: .item(itemId: target.id))
return .result()
}
}
```
### App Shortcuts
```swift
struct AppShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: OpenItemIntent(),
phrases: [
"Open \(\.$target) in \(.applicationName)",
"Show \(\.$target)"
],
shortTitle: "Open Item",
systemImageName: "doc"
)
}
}
```
## Required Capabilities
### URL Scheme (Info.plist)
```xml
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp</string>
</array>
<key>CFBundleURLName</key>
<string>com.yourcompany.myapp</string>
</dict>
</array>
```
### Universal Links (Entitlements)
```xml
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:yourapp.com</string>
<string>applinks:www.yourapp.com</string>
</array>
```
### Server Configuration (AASA)
Host at `https://yourapp.com/.well-known/apple-app-site-association`:
```json
{
"applinks": {
"apps": [],
"details": [
{
"appID": "TEAMID.com.yourcompany.yourapp",
"paths": [
"/items/*",
"/users/*",
"/share/*"
]
}
]
}
}
```
## Integration Steps
### 1. Basic URL Handling
```swift
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.onOpenURL { url in
handleDeepLink(url)
}
}
}
}
```
### 2. Universal Links (UIKit)
```swift
// In SceneDelegate
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL else {
return
}
handleUniversalLink(url)
}
```
### 3. App Intents Setup
1. Create entities for Spotlight indexing
2. Implement OpenIntent for each content type
3. Define AppShortcuts for Siri phrases
4. Index entities with CSSearchableIndex
## Testing
### URL Schemes
```bash
# Simulator
xcrun simctl openurl booted "myapp://items/123"
# Device
# Open Safari and navigate to myapp://items/123
```
### Universal Links
```bash
# Test AASA file
curl -I "https://yourapp.com/.well-known/apple-app-site-association"
# Should return Content-Type: application/json
# Validate with Apple
# Use Apple's tool or Branch.io validator
```
### App Intents
1. Build and run on device
2. Open Shortcuts app
3. Your app's shortcuts should appear
4. Test with Siri: "Hey Siri, [your phrase]"
## References
- [Supporting Universal Links](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app)
- [App Intents Framework](https://developer.apple.com/documentation/appintents)
- [Defining Custom URL Schemes](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app)
- [Making App Entities Available in Spotlight](https://developer.apple.com/documentation/appintents/making-app-entities-available-in-spotlight)
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.