app-clip
Skill777 starsChanged 5 months agoMITView on GitHub
Generates App Clip targets with invocation URL handling, lightweight experiences, and full app upgrade prompts. Use when user wants NFC/QR/Safari banner invocation, instant app experiences, or App Clip Card setup.
In this repository183 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- app-intentsSkill
- foundation-modelsSkill
- apple-intelligenceSkill
- visual-intelligenceSkill
- ad-attributionSkill
- app-description-writerSkill
- apple-search-adsSkill
- iap-finalizerSkill
- keyword-optimizerSkill
- marketing-strategySkill
- originality-checkSkill
- ratings-mechanicsSkill
- rejection-handlerSkill
- review-response-writerSkill
- screenshot-plannerSkill
- app-storeSkill
- web-presenceSkill
- core-mlSkill
- animation-patternsSkill
- game-feelSkill
- liquid-glassSkill
- sf-symbolsSkill
- designSkill
- typographySkill
- ui-prototypingSkill
- ux-writingSkill
- attributed-stringSkill
- foundationSkill
- accessibility-generatorSkill
- account-deletionSkill
- analytics-setupSkill
- announcement-bannerSkill
- app-extensionsSkill
- app-icon-generatorSkill
- app-store-assetsSkill
- auth-flowSkill
- background-processingSkill
- ci-cd-setupSkill
- cloudkit-syncSkill
- consent-flowSkill
- custom-product-pagesSkill
- data-exportSkill
- debug-menuSkill
- deep-linkingSkill
- error-monitoringSkill
- feature-flagsSkill
- featuring-nominationSkill
- feedback-formSkill
- force-updateSkill
- http-cacheSkill
- image-loadingSkill
- in-app-eventsSkill
- lapsed-userSkill
- live-activity-generatorSkill
- localization-setupSkill
- logging-setupSkill
- milestone-celebrationSkill
- networking-layerSkill
- offer-codes-setupSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 10 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use this skill when the user:
- Distinctive: line 33
Search for existing App Clip targets:
- Distinctive: line 39
If existing App Clip target found:
- Distinctive: line 40
Ask if user wants to replace or extend it
- Distinctive: line 41
If extending, identify which components are missing
- Distinctive: line 48
Ask user via AskUserQuestion:
- Distinctive: line 55
All of the above — recommended
- Distinctive: line 60
Check in (event/location)
- Very specific: line 74
Read templates.md for production Swift code.
- Very specific: line 75
Read patterns.md for constraints, testing, and best practices.
- Very specific: line 92
If Sources/ exists -> Sources/AppClip/
- Very specific: line 93
If main app target folder exists -> AppClip/ at the same level
- Very specific: line 119
Add appclips:{your-domain.com} to both main app and App Clip entitlements
- Very specific: line 122
Add group.{your-bundle-id} to both targets for shared data
- Distinctive: line 227
Every App Clip starts from a URL.
- Distinctive: line 237
After the user completes the primary task, show an SKOverlay banner with clear benefits of the full app.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
App Clip Generator
Generate production App Clip infrastructure — a lightweight version of your app invoked from NFC tags, QR codes, Safari banners, or Messages. Includes App Clip target setup, invocation URL handling, experience routing, location confirmation, and full app upgrade flow.
When This Skill Activates
Use this skill when the user:
- Asks to "add an app clip" or "create an app clip target"
- Mentions "instant app" or "lightweight app experience"
- Wants to set up "App Clip Card" metadata
- Mentions "NFC tag" invocation or "QR code" launching an app
- Asks about "app clip invocation" or "invocation URL handling"
- Wants a "lightweight app experience" for a physical location
Pre-Generation Checks
1. Project Context Detection
- Check deployment target (iOS 14+ required for App Clips, iOS 16+ recommended)
- Check Swift version (requires Swift 5.9+)
- Check for @Observable support (iOS 17+ / macOS 14+)
- Identify Xcode project structure (.xcodeproj or .xcworkspace)
2. Conflict Detection
Search for existing App Clip targets:
Glob: **/*AppClip*/*.swift, **/*Clip*/*.swift
Grep: "NSUserActivityTypeBrowsingWeb" or "AppClipExperience" or "SKOverlay"If existing App Clip target found:
- Ask if user wants to replace or extend it
- If extending, identify which components are missing
3. Project Structure
Identify where the main app target lives and where to place the App Clip target alongside it.
Configuration Questions
Ask user via AskUserQuestion:
- Invocation method?
- NFC tag only
- QR code only
- Safari banner (Smart App Banner)
- Messages
- All of the above — recommended
- Primary experience?
- Order food (restaurant/cafe)
- Reserve (booking/reservation)
- Check in (event/location)
- Preview content (article/product)
- Include location confirmation?
- Yes — verifies user is physically at the expected location (recommended for physical-world invocations)
- No — skip location verification
- Include full app upgrade prompt?
- Yes — show SKOverlay banner to download full app (recommended)
- No — App Clip only, no upgrade path
Generation Process
Step 1: Read Templates
Read templates.md for production Swift code.
Read patterns.md for constraints, testing, and best practices.
Step 2: Create Core Files
Generate these files:
AppClipApp.swift— @main App struct handling invocation via.onContinueUserActivityInvocationHandler.swift— Parses invocation URL, extracts parameters, validates against registered experiencesAppClipExperience.swift— Protocol and concrete experience implementations
Step 3: Create Location Files (if selected)
LocationConfirmationView.swift— CLLocationManager-based location verification for physical invocations
Step 4: Create Upgrade Files (if selected)
FullAppUpgradeView.swift— SKOverlay-based banner prompting full app downloadSharedDataManager.swift— App Group data sharing between App Clip and full app
Step 5: Determine File Location
Check project structure:
- If
Sources/exists ->Sources/AppClip/ - If main app target folder exists ->
AppClip/at the same level - Otherwise ->
AppClip/
Output Format
After generation, provide:
Files Created
AppClip/
├── AppClipApp.swift # @main entry point with invocation handling
├── InvocationHandler.swift # URL parsing and parameter extraction
├── AppClipExperience.swift # Experience protocol and implementations
├── LocationConfirmationView.swift # Location verification (optional)
├── FullAppUpgradeView.swift # SKOverlay upgrade prompt (optional)
└── SharedDataManager.swift # App Group data sharing (optional)Xcode Target Setup Instructions
- Add App Clip Target:
- File > New > Target > App Clip
- Set bundle ID to
{main-app-bundle-id}.Clip - Set deployment target to iOS 16.0
- Configure Associated Domains:
- Add
appclips:{your-domain.com}to both main app and App Clip entitlements
- Add
- Set Up App Group:
- Add
group.{your-bundle-id}to both targets for shared data
- Add
- Apple-App-Site-Association (AASA) file:
- Host at
https://{your-domain.com}/.well-known/apple-app-site-association
- Host at
Integration
Handle invocation in the App Clip:
@main
struct MyAppClip: App {
@State private var handler = InvocationHandler()
var body: some Scene {
WindowGroup {
ContentView(experience: handler.currentExperience)
.onContinueUserActivity(
NSUserActivityTypeBrowsingWeb
) { activity in
handler.handle(activity)
}
}
}
}Route to the correct experience:
struct ContentView: View {
let experience: (any AppClipExperience)?
var body: some View {
if let experience {
AnyView(experience.makeView())
} else {
DefaultExperienceView()
}
}
}Share data with the full app:
// In App Clip — save order before user upgrades
SharedDataManager.shared.save(order, forKey: "pendingOrder")
// In Full App — restore after install
if let order: Order = SharedDataManager.shared.load(forKey: "pendingOrder") {
showOrder(order)
}Prompt full app download:
FullAppUpgradeView(
appStoreID: "123456789",
benefits: [
"Order history and favorites",
"Loyalty rewards program",
"Push notification for order updates"
]
)Testing
@Test
func invocationHandlerParsesProductURL() {
let handler = InvocationHandler()
let url = URL(string: "https://example.com/clip/product/abc123")!
let experience = handler.parseURL(url)
#expect(experience != nil)
#expect(experience?.experienceType == .previewContent)
#expect(experience?.parameters["productID"] == "abc123")
}
@Test
func invocationHandlerRejectsInvalidURL() {
let handler = InvocationHandler()
let url = URL(string: "https://other-domain.com/something")!
let experience = handler.parseURL(url)
#expect(experience == nil)
}
@Test
func sharedDataManagerRoundTrips() {
let manager = SharedDataManager(suiteName: "group.test")
let order = Order(id: "order-1", items: ["Latte", "Muffin"])
manager.save(order, forKey: "testOrder")
let loaded: Order? = manager.load(forKey: "testOrder")
#expect(loaded?.id == "order-1")
#expect(loaded?.items.count == 2)
}Common Patterns
Handle Invocation URL
Every App Clip starts from a URL. Parse it to determine what experience to show:
// URL: https://example.com/clip/order?location=store-42
// -> Route to OrderExperience with locationID = "store-42"Present Experience Immediately
Users expect instant value. Show the relevant experience within 1-2 seconds, no sign-in required.
Prompt Full App Install
After the user completes the primary task, show an SKOverlay banner with clear benefits of the full app.
Gotchas
- 10 MB size limit — App Clip binary must be under 10 MB. Use SF Symbols, avoid large assets, lazy-load images from network.
- 8-hour data retention — App Clip data is deleted after 8 hours of inactivity. Use App Group to persist data accessible to the full app.
- Limited frameworks — No CallKit, no HealthKit, no CareKit. Limited background processing. Check Apple's framework availability list.
- No background processing — App Clips cannot run background tasks, background fetch, or silent push notifications.
- Must work without sign-in — App Clips should provide value immediately. Defer sign-in until the full app upgrade.
- App Clip Card metadata — Configure in App Store Connect: card image (3000x2000 px), title, subtitle, call-to-action button text.
- Associated Domains required — Both the main app and App Clip must have the
appclips:associated domain configured, and the AASA file must be hosted on the domain. - Size budgeting — Regularly check App Clip size during development with
xcodebuild -exportArchiveor the App Thinning Size Report.
References
- templates.md — All production Swift templates for App Clip infrastructure
- patterns.md — Constraints, data lifecycle, testing, and best practices
- Related:
generators/deep-linking— Universal link and deep link handling - Related:
generators/onboarding-generator— Onboarding flow for full app upgrade
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

